package com.xunhong.erp.turbo.biz.app.service;

import com.xunhong.erp.turbo.api.biz.api.ExpenseRecordServiceI;
import com.xunhong.erp.turbo.api.biz.dto.cmd.ExpenseRecordCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.ExpenseRecordUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.qry.ExpenseRecordListQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.ExpenseRecordShowQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.ExpenseRecordVO;
import com.xunhong.erp.turbo.biz.app.executor.cmd.ExpenseRecordCreateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.ExpenseRecordUpdateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.query.ExpenseRecordListQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.ExpenseRecordShowQryExe;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author shenyifei
 */
@Slf4j
@Service
@DubboService(interfaceClass = ExpenseRecordServiceI.class, version = "1.0.0")
@RequiredArgsConstructor
public class ExpenseRecordServiceImpl implements ExpenseRecordServiceI {

    private final ExpenseRecordCreateCmdExe expenseRecordCreateCmdExe;
    private final ExpenseRecordUpdateCmdExe expenseRecordUpdateCmdExe;
    private final ExpenseRecordListQryExe expenseRecordListQryExe;
    private final ExpenseRecordShowQryExe expenseRecordShowQryExe;

    @Override
    public ExpenseRecordVO create(ExpenseRecordCreateCmd expenseRecordCreateCmd) {
        return expenseRecordCreateCmdExe.execute(expenseRecordCreateCmd);
    }

    @Override
    public List<ExpenseRecordVO> list(ExpenseRecordListQry expenseRecordListQry) {
        return expenseRecordListQryExe.execute(expenseRecordListQry);
    }

    @Override
    public ExpenseRecordVO update(ExpenseRecordUpdateCmd expenseRecordUpdateCmd) {
        return expenseRecordUpdateCmdExe.execute(expenseRecordUpdateCmd);
    }

    @Override
    public ExpenseRecordVO show(ExpenseRecordShowQry expenseRecordShowQry) {
        return expenseRecordShowQryExe.execute(expenseRecordShowQry);
    }
}

