Commit 2b1e25a7 by 徐高华

企微托管账号

parent 3023e34c
package com.gic.haoban.manage.web.controller.open;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil;
import com.gic.haoban.manage.api.dto.OpenStaffDTO;
import com.gic.haoban.manage.api.qdto.OpenStaffInitQDTO;
import com.gic.haoban.manage.api.service.OpenStaffApiService;
import com.gic.haoban.manage.web.qo.open.OpenStaffQO;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 企微托管
*/
@RestController
@RequestMapping("/qw-open")
public class QywxOpenController {
@Autowired
private OpenStaffApiService openStaffApiService ;
/**
* 托管列表
* @param qo
* @return
*/
@RequestMapping("open-staff-list")
public RestResponse<Object> page(@RequestBody OpenStaffQO qo) {
return null ;
}
/**
* 登录初始化
* @param staffId
* @return
*/
@RequestMapping("login-init")
public RestResponse<Long> init(String staffId , @RequestParam(defaultValue = "0") int loginAgainFlag) {
if(StringUtils.isBlank(staffId)) {
return RestResponse.failure("9999","请先选择成员") ;
}
WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId();
String enterpriseId = login.getEnterpriseId() ;
String checkMsg = this.check(wxEnterpriseId,enterpriseId) ;
if(null != this.check(wxEnterpriseId,enterpriseId)) {
return RestResponse.failure("9999",checkMsg) ;
}
OpenStaffInitQDTO initQDTO = new OpenStaffInitQDTO() ;
initQDTO.setWxEnterpriseId(wxEnterpriseId);
initQDTO.setEnterpriseId(enterpriseId);
initQDTO.setStaffId(staffId);
initQDTO.setLoginAgainFlag(loginAgainFlag);
ServiceResponse<Long> resp = this.openStaffApiService.init(initQDTO) ;
if(!resp.isSuccess()) {
return RestResponse.failure("9999",resp.getMessage()) ;
}
return RestResponse.successResult(resp.getResult());
}
/**
* 获取账号详情
* @param openStaffId
* @return
*/
@RequestMapping("get-open-staff")
public RestResponse<OpenStaffDTO> getOpenStaff(Long openStaffId) {
ServiceResponse<OpenStaffDTO> resp = this.openStaffApiService.getById(openStaffId) ;
if(!resp.isSuccess()) {
return RestResponse.failure("9999",resp.getMessage()) ;
}
return RestResponse.successResult(resp.getResult());
}
private String check(String wxEnterpriseId , String enterpriseId) {
return null ;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment