Commit 25971837 by 陶光胜

加日志

parent 6aabb1fb
......@@ -2,6 +2,10 @@ package com.gic.haoban.manage.web.controller;
import java.util.List;
import com.gic.haoban.common.utils.GlobalVar;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
......@@ -14,16 +18,33 @@ import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
@RestController
public class ApplicationController extends WebBaseController{
private static final Logger log = LogManager.getLogger(ApplicationController.class);
@Autowired
private ApplicationApiService applicationApiService;
@Autowired
private QywxSuiteApiService qywxSuiteApiService;
@RequestMapping("application-list")
public HaobanResponse applicationList() {
List<ApplicationDTO> list = applicationApiService.listApplication();
return resultResponse(HaoBanErrCode.ERR_1,list);
}
@RequestMapping("get-auth-url")
public HaobanResponse getAuthUrl(){
String suiteId = GlobalVar.ctxPropertiesMap.get("suiteId");
log.info("应用ID:{}", suiteId);
String redictUrl = "http://gicdev.demogic.com/haoban-manage3-web/callback";
String authorizationUrl = this.qywxSuiteApiService.getGrantAuthorizationUrl(suiteId, redictUrl);
return resultResponse(HaoBanErrCode.ERR_1, authorizationUrl);
}
@RequestMapping("callback")
public HaobanResponse callback(String code){
String suiteId = GlobalVar.ctxPropertiesMap.get("suiteId");
String result = this.qywxSuiteApiService.corpAuth(suiteId, code);
return resultResponse(HaoBanErrCode.ERR_1, result);
}
}
......@@ -37,7 +37,8 @@
<dubbo:reference interface="com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService" id="staffDepartmentRelatedApiService"/>
<dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxCorpApiService" id="qywxCorpApiService"/>
<dubbo:reference interface="com.gic.dict.api.service.ManagerDictService" id="managerDictService"/>
<dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxSuiteApiService" id="qywxSuiteApiService"/>
</beans>
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