package com.hzs.member.account.provider;

import com.hzs.common.core.domain.R;
import com.hzs.common.domain.member.account.CuMemberTrade;
import com.hzs.member.account.IMemberTradeServiceApi;
import com.hzs.member.account.dto.BusinessCommissionDTO;
import com.hzs.member.account.dto.MemberBalanceDTO;
import com.hzs.member.account.service.ICuMemberRechargeService;
import com.hzs.member.account.service.ICuMemberTradeService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Slf4j
@DubboService
public class IMemberTradeServiceProvider implements IMemberTradeServiceApi {

    @Autowired
    ICuMemberTradeService memberTradeService;

    @Autowired
    ICuMemberRechargeService memberRechargeService;

    @Override
    public List<MemberBalanceDTO> selectBalanceNotEnoughMember(BusinessCommissionDTO businessCommissionDTO) {
        return memberTradeService.selectBalanceNotEnoughMember(businessCommissionDTO);
    }

    @Override
    public R<Boolean> businessCommissionSubmit(BusinessCommissionDTO businessCommissionDTO) {
        return R.ok(memberTradeService.businessCommissionSubmit(businessCommissionDTO));
    }

    @Override
    public R<List<CuMemberTrade>> querySourceCodeLastTrade(Long pkMember, String sourceCode, Integer tradeClassify) {
        return R.ok(memberTradeService.querySourceCodeLastTrade(pkMember, sourceCode, tradeClassify));
    }

}
