package com.ruoyi.ss.apiBill.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ss.apiBill.domain.ApiBill;
import com.ruoyi.ss.apiBill.domain.ApiBillQuery;
import com.ruoyi.ss.apiBill.domain.ApiBillVO;
import com.ruoyi.ss.apiBill.mapper.ApiBillMapper;
import com.ruoyi.ss.apiBill.service.ApiBillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * API收费订单Service业务层处理
 *
 * @author ruoyi
 * @date 2024-08-09
 */
@Service
public class ApiBillServiceImpl implements ApiBillService
{
    @Autowired
    private ApiBillMapper apiBillMapper;

    /**
     * 查询API收费订单
     *
     * @param billId API收费订单主键
     * @return API收费订单
     */
    @Override
    public ApiBillVO selectApiBillByBillId(Long billId)
    {
        return apiBillMapper.selectApiBillByBillId(billId);
    }

    /**
     * 查询API收费订单列表
     *
     * @param apiBill API收费订单
     * @return API收费订单
     */
    @Override
    public List<ApiBillVO> selectApiBillList(ApiBillQuery apiBill)
    {
        return apiBillMapper.selectApiBillList(apiBill);
    }

    /**
     * 新增API收费订单
     *
     * @param apiBill API收费订单
     * @return 结果
     */
    @Override
    public int insertApiBill(ApiBill apiBill)
    {
        apiBill.setCreateTime(DateUtils.getNowDate());
        return apiBillMapper.insertApiBill(apiBill);
    }

    /**
     * 修改API收费订单
     *
     * @param apiBill API收费订单
     * @return 结果
     */
    @Override
    public int updateApiBill(ApiBill apiBill)
    {
        return apiBillMapper.updateApiBill(apiBill);
    }

    /**
     * 批量删除API收费订单
     *
     * @param billIds 需要删除的API收费订单主键
     * @return 结果
     */
    @Override
    public int deleteApiBillByBillIds(Long[] billIds)
    {
        return apiBillMapper.deleteApiBillByBillIds(billIds);
    }

    /**
     * 删除API收费订单信息
     *
     * @param billId API收费订单主键
     * @return 结果
     */
    @Override
    public int deleteApiBillByBillId(Long billId)
    {
        return apiBillMapper.deleteApiBillByBillId(billId);
    }
}
