| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- package cn.com.goldenwater.dcproj.controller.xjvill;
- import cn.com.goldenwater.dcproj.model.AttXjcwsBase;
- import cn.com.goldenwater.dcproj.param.AttXjcwsBaseParam;
- import cn.com.goldenwater.dcproj.service.AttXjcwsBaseService;
- import cn.com.goldenwater.core.web.BaseController;
- import cn.com.goldenwater.core.web.BaseResponse;
- import cn.com.goldenwater.id.util.UuidUtil;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import io.swagger.annotations.ApiParam;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.apache.commons.lang3.StringUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.util.Assert;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.RestController;
- import java.util.List;
- /**
- * @author lhc
- * @date 2021-9-9
- */
- @Api(value = "新疆农村供水工程管理",tags="新疆农村供水工程管理")
- @RestController
- @RequestMapping("/att/xjcws/base")
- public class AttXjcwsBaseController extends BaseController {
- @Autowired
- private AttXjcwsBaseService attXjcwsBaseService;
- @ApiOperation(value = "修改新疆农村供水工程")
- @RequestMapping(value = "", method = RequestMethod.POST)
- public BaseResponse<AttXjcwsBase> insert(@ApiParam(name = "attXjcwsBase", value = "AttXjcwsBase", required = true) @RequestBody AttXjcwsBase attXjcwsBase) {
- int ret = 0;
- if(StringUtils.isBlank(attXjcwsBase.getId())){
- ret = attXjcwsBaseService.insert(attXjcwsBase);
- } else {
- ret = attXjcwsBaseService.update(attXjcwsBase);
- }
- return buildSuccessResponse(attXjcwsBase);
- }
- @ApiOperation(value = "根据ID删除新疆农村供水工程")
- @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
- public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- int ret = attXjcwsBaseService.delete(id);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "根据ID获取新疆农村供水工程(单表)")
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public BaseResponse<AttXjcwsBase> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- AttXjcwsBase attXjcwsBase = attXjcwsBaseService.get(id);
- return buildSuccessResponse(attXjcwsBase);
- }
- }
|