CloudControlLoginController.java 4.7 KB
package cn.com.glsx.entmicro.controller.wechatcloudcontrol;

import cn.com.glsx.entmicro.model.response.EntmicroStaffResponse;
import cn.com.glsx.entmicro.model.response.wechatcloudcontrol.customer.CustomerInfoResponse;
import cn.com.glsx.entmicro.model.response.wechatcloudcontrol.login.CloudControQccodeResponse;
import cn.com.glsx.entmicro.request.wechatcloudcontrol.login.CustomerListRopResquest;
import cn.com.glsx.entmicro.request.wechatcloudcontrol.login.QcCodeRequest;
import cn.com.glsx.entmicro.request.wechatcloudcontrol.login.WechatDepositRopRequest;
import cn.com.glsx.entmicro.service.EntimicroStaffService;
import cn.com.glsx.entmicro.service.wechatcloudcontrol.CloudControlLoginService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.AbstractRopRequest;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @BelongsProject: scrm_v2.11.0_20221010_1
 * @BelongsPackage: cn.com.glsx.entmicro.controller.wechatcloudcontrol
 * @Author: 11
 * @CreateTime: 2022-09-21  18:57
 * @Description: TODO
 * @Version: 1.0
 */
@Slf4j
@Api("企微托管管理")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class CloudControlLoginController {

    @Autowired
    private CloudControlLoginService cloudControlLoginService;

    @Autowired
    private EntimicroStaffService entimicroStaffService;

    @ServiceMethod(method = "entmicro.api.wechatcloudcontrol.cloudconlogin.getLoginQcCode")
    @ApiOperation("获取验证码")
    public RopResponse<CloudControQccodeResponse> getLoginQcCode(AbstractRopRequest abstractRopRequest) {
        try {
            return RopResponse.success(cloudControlLoginService.getLoginQcCode());
        } catch (RpcServiceException e) {
            log.info("=======CloudControlLoginController_getLoginQcCode_invoke__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "entmicro.api.wechatcloudcontrol.cloudconlogin.getQcCodeDetail")
    @ApiOperation("验证二维码是否失效")
    public RopResponse<Boolean> getQcCodeDetail(QcCodeRequest qcCodeRequest) {
        try {
            return RopResponse.success(cloudControlLoginService.getQcCodeDetail(qcCodeRequest));
        } catch (RpcServiceException e) {
            log.info("=======CloudControlLoginController_getQcCodeDetail_invoke__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "entmicro.api.wechatcloudcontrol.cloudconlogin.wechatDepositList")
    @ApiOperation("查询托管的员工")
    public RopResponse<Pagination<EntmicroStaffResponse>> wechatDepositList(WechatDepositRopRequest wechatDepositRopRequest) {
        try {
            return RopResponse.success(entimicroStaffService.wechatDepositList(wechatDepositRopRequest));
        } catch (RpcServiceException e) {
            log.info("=======CloudControlLoginController_wechatDepositList_invoke__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "entmicro.api.wechatcloudcontrol.cloudconlogin.wechatDepositNotAccessList")
    @ApiOperation("查询非SCRM托管的员工")
    public RopResponse<Pagination<EntmicroStaffResponse>> wechatDepositNotAccessList(WechatDepositRopRequest wechatDepositRopRequest) {
        try {
            return RopResponse.success(entimicroStaffService.wechatDepositNotAccessList(wechatDepositRopRequest));
        } catch (RpcServiceException e) {
            log.info("=======CloudControlLoginController_wechatDepositNotAccessList_invoke__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "entmicro.api.wechatcloudcontrol.cloudconlogin.getStaffFriends")
    @ApiOperation("查询非SCRM托管的员工客户列表")
    public RopResponse<Pagination<CustomerInfoResponse>> getStaffFriends(CustomerListRopResquest customerListRopResquest) {
        try {
            return RopResponse.success(cloudControlLoginService.getStaffFriends(customerListRopResquest));
        } catch (RpcServiceException e) {
            log.info("=======CloudControlLoginController_getStaffFriends_invoke__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }
}