|
|
@@ -7,7 +7,6 @@ import com.usoftchina.uas.office.entity.DataCenter;
|
|
|
import com.usoftchina.uas.office.jdbc.DataSourceHolder;
|
|
|
import com.usoftchina.uas.office.qywx.manage.entity.QywxAgent;
|
|
|
import com.usoftchina.uas.office.qywx.manage.service.QywxAgentService;
|
|
|
-import com.usoftchina.uas.office.service.DataCenterService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@@ -22,15 +21,12 @@ public class QywxAgentController {
|
|
|
@Autowired
|
|
|
private QywxAgentService qywxAgentService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private DataCenterService dataCenterService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private QywxProperties qywxProperties;
|
|
|
|
|
|
@GetMapping(path = "/agent")
|
|
|
public Result getQywxAgentList() {
|
|
|
- DataCenter dataCenter = dataCenterService.find();
|
|
|
+ DataCenter dataCenter = DataCenter.INSTANCE;
|
|
|
if (null == dataCenter) {
|
|
|
return Result.error("数据中心未设置");
|
|
|
}
|
|
|
@@ -44,7 +40,7 @@ public class QywxAgentController {
|
|
|
|
|
|
@PostMapping(path = "/agent")
|
|
|
public Result saveQywxAgent(QywxAgent agent) {
|
|
|
- DataCenter dataCenter = dataCenterService.find();
|
|
|
+ DataCenter dataCenter = DataCenter.INSTANCE;
|
|
|
if (null == dataCenter) {
|
|
|
return Result.error("数据中心未设置");
|
|
|
}
|
|
|
@@ -59,7 +55,7 @@ public class QywxAgentController {
|
|
|
|
|
|
@DeleteMapping(path = "/agent")
|
|
|
public Result deleteQywxAgent(String code) {
|
|
|
- DataCenter dataCenter = dataCenterService.find();
|
|
|
+ DataCenter dataCenter = DataCenter.INSTANCE;
|
|
|
if (null == dataCenter) {
|
|
|
return Result.error("数据中心未设置");
|
|
|
}
|
|
|
@@ -80,7 +76,7 @@ public class QywxAgentController {
|
|
|
*/
|
|
|
@GetMapping(path = "/agent/auth_url")
|
|
|
public Result getAgentAuthUrl(String code) throws Exception{
|
|
|
- DataCenter dataCenter = dataCenterService.find();
|
|
|
+ DataCenter dataCenter = DataCenter.INSTANCE;
|
|
|
if (null == dataCenter) {
|
|
|
return Result.error("数据中心未设置");
|
|
|
}
|