Эх сурвалжийг харах

feat 适配器加上性能代码

3 долоо хоног өмнө
parent
commit
5c046c90be

+ 3 - 1
edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/commodity/remote/BaseCountryServeRemoteController.java

@@ -1,7 +1,9 @@
 package edu.travel.commodity.remote;
 
+import edu.travel.commodity.dto.BaseCountryDto;
 import edu.travel.commodity.dto.BaseCountryServeDTO;
 import edu.travel.commodity.vo.BaseCountryServeVo;
+import edu.travel.remote.base.RemoteBaseController;
 import edu.travel.resp.BaseResponse;
 import edu.travel.rpc.RPCBaseResponse;
 import org.springframework.cloud.openfeign.FeignClient;
@@ -12,7 +14,7 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
 @FeignClient(path = "/base_country_serve",name = "commodity")
-public interface BaseCountryServeRemoteController {
+public interface BaseCountryServeRemoteController extends RemoteBaseController<BaseCountryServeVo, BaseCountryDto> {
     @GetMapping("/getByControlId")
     RPCBaseResponse getByControlId( @RequestBody String id);
 

+ 52 - 5
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/web/BaseCountryServeController.java

@@ -1,22 +1,20 @@
 package edu.travel.commodity.web;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import edu.travel.commodity.dto.BaseCountryDto;
 import edu.travel.commodity.dto.BaseCountryServeDTO;
 import edu.travel.commodity.entity.BaseCountryServe;
 import edu.travel.commodity.remote.BaseCountryServeRemoteController;
 import edu.travel.commodity.service.BaseCountryServeService;
 import edu.travel.commodity.vo.BaseCountryServeVo;
-import edu.travel.interfaces.UpdateGroups;
-import edu.travel.resp.BaseResponse;
 import edu.travel.rpc.RPCBaseResponse;
-import edu.travel.utils.tree.CustomDeepCopy;
 import edu.travel.web.BaseController;
 import org.springframework.beans.BeanUtils;
-import org.springframework.validation.Errors;
-import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import org.springframework.beans.factory.annotation.Autowired;
 
+import java.util.List;
+
 /**
 * 服务国家表(base_country_serve)表控制层
 *
@@ -39,4 +37,53 @@ public class BaseCountryServeController  extends BaseController<BaseCountryServe
         RPCBaseResponse baseResponse = super.getById(id);
         return baseResponse;
     }
+
+    @Override
+    @GetMapping("/getFormId")
+    public RPCBaseResponse<BaseCountryServeVo> getFormId(String id) {
+        RPCBaseResponse<BaseCountryServe> byId = super.getById(id);
+        RPCBaseResponse<BaseCountryServeVo> baseCountryServeVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(byId, baseCountryServeVoRPCBaseResponse);
+        return baseCountryServeVoRPCBaseResponse;
+    }
+
+    @Override
+    @PostMapping("/updateFormId")
+    public RPCBaseResponse<BaseCountryServeVo> updateTargetFormId(BaseCountryDto entity) {
+        BaseCountryServe baseCountryServe = new BaseCountryServe();
+        BeanUtils.copyProperties(entity, baseCountryServe);
+        RPCBaseResponse<BaseCountryServe> baseCountryServeRPCBaseResponse = super.updateTargetById(baseCountryServe);
+        RPCBaseResponse<BaseCountryServeVo> baseCountryServeVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(baseCountryServeRPCBaseResponse, baseCountryServeVoRPCBaseResponse);
+        return baseCountryServeVoRPCBaseResponse;
+    }
+
+    @Override
+    @PostMapping("/saveForm")
+    public RPCBaseResponse<BaseCountryServeVo> saveFormTarget(BaseCountryDto entity) {
+        BaseCountryServe baseCountryServe = new BaseCountryServe();
+        BeanUtils.copyProperties(entity, baseCountryServe);
+        RPCBaseResponse<BaseCountryServe> baseCountryServeRPCBaseResponse = super.saveTarget(baseCountryServe);
+        RPCBaseResponse<BaseCountryServeVo> baseCountryServeVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(baseCountryServeRPCBaseResponse, baseCountryServeVoRPCBaseResponse);
+        return baseCountryServeVoRPCBaseResponse;
+    }
+
+    @Override
+    @PostMapping("/deleteFormId")
+    public RPCBaseResponse<BaseCountryServeVo> deleteTargetFormId(@RequestBody List<String> ids) {
+        RPCBaseResponse<BaseCountryServe> baseCountryServeRPCBaseResponse = super.deleteTargetById(ids);
+        RPCBaseResponse<BaseCountryServeVo> baseCountryServeVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(baseCountryServeRPCBaseResponse, baseCountryServeVoRPCBaseResponse);
+        return baseCountryServeVoRPCBaseResponse;
+    }
+
+    @Override
+    @GetMapping("/listForm")
+    public RPCBaseResponse<List<BaseCountryServeVo>> getAllForm() {
+        RPCBaseResponse<List<BaseCountryServe>> listRPCBaseResponse = super.listAll();
+        RPCBaseResponse<List<BaseCountryServeVo>> baseCountryServeVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(listRPCBaseResponse, baseCountryServeVoRPCBaseResponse);
+        return baseCountryServeVoRPCBaseResponse;
+    }
 }

+ 2 - 0
edu-travel-service/pom.xml

@@ -16,6 +16,8 @@
         <module>edu-travel-service-order</module>
         <module>edu-travel-service-upload</module>
         <module>edu-travel-service-debezium</module>
+        <module>edu-travel-service-country</module>
+        <module>edu-travel-service-pay</module>
     </modules>
 
     <name>edu-travel-service</name>