Browse Source

命名修改

master
wxz 5 years ago
parent
commit
5d5f163648
  1. 5
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/ApiService.java
  2. 5
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/LuzhouGridPlatformApiService.java
  3. 2
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/ProjectController.java
  4. 6
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ProjectService.java
  5. 4
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

5
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/ApiService.java

@ -22,8 +22,9 @@ import java.util.HashMap;
import java.util.Map;
/**
* ApiService对接第三方平台的抽象类
* 每一个具体平台的ApiService都是该抽象类的子类选择性实现抽象类中的某些方法提供具体业务逻辑
* ApiService对接第三方平台的抽象类每一个子类都对应一个第三方平台每个第三方平台都实现唯一一个子类
* 每一个具体平台的ApiService都是该抽象类的子类选择性实现抽象类中的某些需要实现方法提供具体业务逻辑
* 此抽象类中定义方法的具体返回类型所有子类都要统一使用在具体实现中做转换若是不需要返回返回null即可
*/
public abstract class ApiService {

5
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/LuzhouGridPlatformApiService.java

@ -20,7 +20,10 @@ public class LuzhouGridPlatformApiService extends ApiService {
String result = sendPostRequest(platformId, ThirdPlatformActions.PROJECT_ASSIST, "{}", null);
ProjectAssistResult projectAssistResult = null;
if (!StringUtils.isBlank(result)) {
projectAssistResult = JSON.parseObject(result, ProjectAssistResult.class);
// 此处要经过一系列业务处理,将第三方平台返回的数据进行解析,等处理最后转换成ProjectAssistResult类型,返回。ProjectAssistResult这个类型是
// 所有apiService的projectAssist方法返回值的统一类型,是我们的epmet-cloud所需要的数据的实体,
// 所有apiService都要想办法转化成这个类型。
//projectAssistResult = JSON.parseObject(result, ProjectAssistResult.class);
}
System.out.println("泸州网格化平台项目协助发送成功");
return projectAssistResult;

2
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/ProjectController.java

@ -45,7 +45,7 @@ public class ProjectController {
@PostMapping("apply-assist")
public Result applyAssist(@RequestBody ProjectApplyAssistFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
projectService.projectAssist(formDTO);
projectService.applyAssist(formDTO);
return new Result();
}

6
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ProjectService.java

@ -10,5 +10,9 @@ public interface ProjectService {
String demoAction(TPFDemoFormDTO formDTO);
void projectAssist(ProjectApplyAssistFormDTO formDTO);
/**
*
* @param formDTO
*/
void applyAssist(ProjectApplyAssistFormDTO formDTO);
}

4
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -24,7 +24,7 @@ public class ProjectServiceImpl implements ProjectService, ApiServiceSelector {
}
@Override
public void projectAssist(ProjectApplyAssistFormDTO formDTO) {
public void applyAssist(ProjectApplyAssistFormDTO formDTO) {
String customerId = formDTO.getCustomerId();
String platformId = formDTO.getPlatformId();
@ -33,8 +33,6 @@ public class ProjectServiceImpl implements ProjectService, ApiServiceSelector {
// 判断该客户是否注册了该平台,如果没有的话,抛出异常
apiService.judgeRegistered(customerId, platformId);
System.out.println(apiService);
ProjectAssistResult projectAssistResult = apiService.projectAssist(formDTO);
}
}

Loading…
Cancel
Save