package com.hzs.member.base.provider;

import com.hzs.common.core.domain.R;
import com.hzs.member.base.ICuMemberRetailRegionServiceApi;
import com.hzs.retail.member.service.ICuMemberRetailRegionService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @description: 会员收益区域dubbo服务
 * @author: zhang jing
 * @date: 2024/12/30 15:05
 * @param:
 * @return:
 **/
@Slf4j
@DubboService
public class CuMemberRetailRegionServiceProvider implements ICuMemberRetailRegionServiceApi {

    @Autowired
    private ICuMemberRetailRegionService iCuMemberRetailRegionService;

    /**
     * @description: 批量修改已到期的会员收益区域
     * @author: zhang jing
     * @date: 2024/12/30 15:20
     * @param: []
     * @return: com.hzs.common.core.domain.R<?>
     **/
    @Override
    public R<?> batchUpdateRetailRegion() {
        try {
            iCuMemberRetailRegionService.batchUpdateRetailRegion();
        } catch (Exception e) {
            log.error("batchUpdateRetailRegion error:", e);
            return R.fail();
        }
        return R.ok();
    }

    @Override
    public R<?> handleRepeatRegion() {
        try {
            iCuMemberRetailRegionService.handleRepeatRegion();
            return R.ok();
        } catch (Exception e) {
            log.error("handleRepeatRegion error:", e);
            return R.fail();
        }
    }

}
