|
@@ -1,16 +1,14 @@
|
|
|
package edu.travel.country.web;
|
|
|
-import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import edu.travel.country.entity.BaseCountry;
|
|
|
import edu.travel.country.service.BaseCountryService;
|
|
|
import edu.travel.dto.BaseCountryDto;
|
|
|
import edu.travel.remote.BaseCountryRemoteController;
|
|
|
import edu.travel.rpc.RPCBaseResponse;
|
|
|
-import edu.travel.utils.tree.ModelMapperUtil;
|
|
|
import edu.travel.vo.BaseCountryVo;
|
|
|
import edu.travel.web.BaseController;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
-
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -31,21 +29,30 @@ public class BaseCountryController extends BaseController<BaseCountry> implement
|
|
|
@Autowired
|
|
|
private BaseCountryService baseCountryService;
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 生成国家树
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
//国家树
|
|
|
@GetMapping("/getCountryTree")
|
|
|
public RPCBaseResponse<List<BaseCountryVo>> getCountryTree() {
|
|
|
return baseCountryService.getCountryTree();
|
|
|
}
|
|
|
|
|
|
- //国家分页
|
|
|
+ /**
|
|
|
+ * 国家分页
|
|
|
+ */
|
|
|
@GetMapping("/getCountryPage")
|
|
|
public RPCBaseResponse<IPage<BaseCountryVo>> getCountryPage(BaseCountryDto baseCountryDTO) {
|
|
|
return baseCountryService.getCountryPage(baseCountryDTO);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 通过id查询国家
|
|
|
+ */
|
|
|
@Override
|
|
|
- @GetMapping("/getFormId")
|
|
|
+ @GetMapping("/getCountryFormId")
|
|
|
public RPCBaseResponse<BaseCountryVo> getFormId(String id) {
|
|
|
RPCBaseResponse<BaseCountry> countryRPCBaseResponse = super.getId(id);
|
|
|
RPCBaseResponse<BaseCountryVo> baseCountryVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
@@ -53,8 +60,11 @@ public class BaseCountryController extends BaseController<BaseCountry> implement
|
|
|
return baseCountryVoRPCBaseResponse;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 更新国家信息
|
|
|
+ */
|
|
|
@Override
|
|
|
- @PostMapping("/updateFormId")
|
|
|
+ @PostMapping("/updateCountryFormId")
|
|
|
public RPCBaseResponse<BaseCountryVo> updateTargetFormId(@RequestBody BaseCountryDto entity) {
|
|
|
BaseCountry baseCountry = new BaseCountry();
|
|
|
BeanUtils.copyProperties(entity, baseCountry);
|
|
@@ -64,8 +74,11 @@ public class BaseCountryController extends BaseController<BaseCountry> implement
|
|
|
return baseCountryVoRPCBaseResponse;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 新增国家信息
|
|
|
+ */
|
|
|
@Override
|
|
|
- @PostMapping("/saveForm")
|
|
|
+ @PostMapping("/saveCountryForm")
|
|
|
public RPCBaseResponse<BaseCountryVo> saveFormTarget(@RequestBody BaseCountryDto entity) {
|
|
|
BaseCountry baseCountry = new BaseCountry();
|
|
|
BeanUtils.copyProperties(entity, baseCountry);
|
|
@@ -75,8 +88,11 @@ public class BaseCountryController extends BaseController<BaseCountry> implement
|
|
|
return baseCountryVoRPCBaseResponse;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 删除国家
|
|
|
+ */
|
|
|
@Override
|
|
|
- @PostMapping("/deleteFormId")
|
|
|
+ @PostMapping("/deleteCountryFormId")
|
|
|
public RPCBaseResponse<BaseCountryVo> deleteTargetFormId(@RequestBody List<String> ids) {
|
|
|
RPCBaseResponse<BaseCountry> baseCountryRPCBaseResponse = super.deleteTargetById(ids);
|
|
|
RPCBaseResponse<BaseCountryVo> baseCountryVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
@@ -84,8 +100,11 @@ public class BaseCountryController extends BaseController<BaseCountry> implement
|
|
|
return baseCountryVoRPCBaseResponse;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取国家表
|
|
|
+ */
|
|
|
@Override
|
|
|
- @GetMapping("/listForm")
|
|
|
+ @GetMapping("/CountrylistForm")
|
|
|
public RPCBaseResponse<List<BaseCountryVo>> getAllForm() {
|
|
|
RPCBaseResponse<List<BaseCountry>> listRPCBaseResponse = super.listAll();
|
|
|
RPCBaseResponse<List<BaseCountryVo>> baseCountryVoRPCBaseResponse = new RPCBaseResponse<>();
|