|
@@ -8,10 +8,9 @@ import edu.travel.commodity.service.BaseCountryService;
|
|
|
import edu.travel.commodity.vo.BaseCountryVo;
|
|
|
import edu.travel.rpc.RPCBaseResponse;
|
|
|
import edu.travel.web.BaseController;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
@@ -43,4 +42,52 @@ public class BaseCountryController extends BaseController<BaseCountry> implement
|
|
|
return baseCountryService.getCountryPage(baseCountryDTO);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @GetMapping("/getFormId")
|
|
|
+ public RPCBaseResponse<BaseCountryVo> getFormId(String id) {
|
|
|
+ RPCBaseResponse<BaseCountry> countryRPCBaseResponse = super.getById(id);
|
|
|
+ RPCBaseResponse<BaseCountryVo> baseCountryVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(countryRPCBaseResponse, baseCountryVoRPCBaseResponse);
|
|
|
+ return baseCountryVoRPCBaseResponse;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @PostMapping("/updateFormId")
|
|
|
+ public RPCBaseResponse<BaseCountryVo> updateTargetFormId(@RequestBody BaseCountryDto entity) {
|
|
|
+ BaseCountry baseCountry = new BaseCountry();
|
|
|
+ BeanUtils.copyProperties(entity, baseCountry);
|
|
|
+ RPCBaseResponse<BaseCountry> baseCountryRPCBaseResponse = super.updateTargetById(baseCountry);
|
|
|
+ RPCBaseResponse<BaseCountryVo> baseCountryVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(baseCountryRPCBaseResponse, baseCountryVoRPCBaseResponse);
|
|
|
+ return baseCountryVoRPCBaseResponse;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @PostMapping("/saveForm")
|
|
|
+ public RPCBaseResponse<BaseCountryVo> saveFormTarget(@RequestBody BaseCountryDto entity) {
|
|
|
+ BaseCountry baseCountry = new BaseCountry();
|
|
|
+ BeanUtils.copyProperties(entity, baseCountry);
|
|
|
+ RPCBaseResponse<BaseCountry> baseCountryRPCBaseResponse = super.saveTarget(baseCountry);
|
|
|
+ RPCBaseResponse<BaseCountryVo> baseCountryVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(baseCountryRPCBaseResponse, baseCountryVoRPCBaseResponse);
|
|
|
+ return baseCountryVoRPCBaseResponse;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @PostMapping("/deleteFormId")
|
|
|
+ public RPCBaseResponse<BaseCountryVo> deleteTargetFormId(@RequestBody List<String> ids) {
|
|
|
+ RPCBaseResponse<BaseCountry> baseCountryRPCBaseResponse = super.deleteTargetById(ids);
|
|
|
+ RPCBaseResponse<BaseCountryVo> baseCountryVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(baseCountryRPCBaseResponse, baseCountryVoRPCBaseResponse);
|
|
|
+ return baseCountryVoRPCBaseResponse;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @GetMapping("/listForm")
|
|
|
+ public RPCBaseResponse<List<BaseCountryVo>> getAllForm() {
|
|
|
+ RPCBaseResponse<List<BaseCountry>> listRPCBaseResponse = super.listAll();
|
|
|
+ RPCBaseResponse<List<BaseCountryVo>> baseCountryVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(listRPCBaseResponse, baseCountryVoRPCBaseResponse);
|
|
|
+ return baseCountryVoRPCBaseResponse;
|
|
|
+ }
|
|
|
}
|