package com.hzs.member.detail.provider;

import com.hzs.common.core.domain.R;
import com.hzs.common.domain.member.base.CuMemberRegister;
import com.hzs.common.domain.member.detail.CuMemberLevel;
import com.hzs.member.base.service.ICuMemberRegisterService;
import com.hzs.member.detail.ICuMemberDetailServiceApi;
import com.hzs.member.detail.service.ICuMemberLevelService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 会员升级记录dubbo服务
 */
@DubboService
public class CuMemberDetailProvider implements ICuMemberDetailServiceApi {

    @Autowired
    private ICuMemberLevelService iCuMemberLevelService;
    @Autowired
    private ICuMemberRegisterService iCuMemberRegisterService;

    @Override
    public R<CuMemberLevel> getLastUpgrade(Long pkMember, Long pkOrder) {
        return R.ok(iCuMemberLevelService.getLastUpgrade(pkMember, pkOrder));
    }

    @Override
    public R<List<CuMemberLevel>> getUpgradeList(Long pkMember) {
        return R.ok(iCuMemberLevelService.getUpgradeList(pkMember));
    }

    @Override
    public R<CuMemberRegister> getMemberRegister(Long pkMember) {
        return R.ok(iCuMemberRegisterService.queryCuMemberRegister(pkMember));
    }

}
