d6cba1cb243116b98ae33d29801c95bc8c571062.svn-base 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package cn.com.goldenwater.dcproj.controller;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.model.BisInspVill2021Vill;
  5. import cn.com.goldenwater.dcproj.param.CountryParam;
  6. import cn.com.goldenwater.dcproj.service.BisInspVill2021VillService;
  7. import io.swagger.annotations.Api;
  8. import io.swagger.annotations.ApiOperation;
  9. import io.swagger.annotations.ApiParam;
  10. import org.apache.commons.lang3.StringUtils;
  11. import org.slf4j.Logger;
  12. import org.slf4j.LoggerFactory;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.web.bind.annotation.*;
  15. import java.util.List;
  16. /**
  17. * @author lhc
  18. * @date 2021-6-16
  19. */
  20. @Api(value = "097 2021农饮-行政村管理", tags = "097 2021农饮-行政村管理")
  21. @RestController
  22. @RequestMapping("/bis/insp/vill2021/vill")
  23. public class BisInspVill2021VillController extends BaseController {
  24. private Logger logger = LoggerFactory.getLogger(getClass());
  25. @Autowired
  26. private BisInspVill2021VillService bisInspVill2021VillService;
  27. @ApiOperation(value = "修改097 2021农饮-行政村")
  28. @RequestMapping(value = "", method = RequestMethod.POST)
  29. public BaseResponse<BisInspVill2021Vill> insert(@ApiParam(name = "bisInspVill2021Vill", value = "BisInspVill2021Vill", required = true)
  30. @RequestBody BisInspVill2021Vill bisInspVill2021Vill) {
  31. int ret = 0;
  32. if (StringUtils.isBlank(bisInspVill2021Vill.getId())) {
  33. ret = bisInspVill2021VillService.insert(bisInspVill2021Vill);
  34. } else {
  35. ret = bisInspVill2021VillService.update(bisInspVill2021Vill);
  36. }
  37. return buildSuccessResponse(bisInspVill2021Vill);
  38. }
  39. @ApiOperation(value = "根据ID删除097 2021农饮-行政村")
  40. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  41. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  42. int ret = bisInspVill2021VillService.delete(id);
  43. return buildSuccessResponse();
  44. }
  45. @ApiOperation(value = "根据ID获取097 2021农饮-行政村(单表)")
  46. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  47. public BaseResponse<BisInspVill2021Vill> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  48. BisInspVill2021Vill bisInspVill2021Vill = bisInspVill2021VillService.get(id);
  49. return buildSuccessResponse(bisInspVill2021Vill);
  50. }
  51. @ApiOperation(value = "批量添加行政村")
  52. @RequestMapping(value = "/addbatch", method = RequestMethod.POST)
  53. public BaseResponse addbatch(@ApiParam(name = "countryParam", value = "countryParam", required = true)
  54. @RequestBody List<CountryParam> countryParamList) {
  55. return buildSuccessResponse(bisInspVill2021VillService.addbatch(countryParamList, getCurrentPersId()));
  56. }
  57. }