package cn.com.goldenwater.dcproj.controller.waga; import cn.com.goldenwater.core.web.BaseController; import cn.com.goldenwater.core.web.BaseResponse; import cn.com.goldenwater.dcproj.model.AttWagaCrrct; import cn.com.goldenwater.dcproj.service.AttWagaCrrctService; 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.springframework.beans.factory.annotation.Autowired; import org.springframework.util.Assert; import org.springframework.web.bind.annotation.*; /** * @author lune * @date 2019-4-22 */ @Api(value = "WAGA 水闸基础信息纠错管理", tags = "WAGA 水闸基础信息纠错管理") @RestController @RequestMapping("/att/waga/crrct") public class AttWagaCrrctController extends BaseController { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private AttWagaCrrctService attWagaCrrctService; @ApiOperation(value = "添加水闸基础信息纠错管理") @RequestMapping(value = "", method = RequestMethod.POST) public BaseResponse insert(@ApiParam(name = "attWagaCrrct", value = "AttWagaCrrct", required = true) @RequestBody AttWagaCrrct attWagaCrrct) { String uuid = UuidUtil.uuid(); // 生成uuid attWagaCrrct.setId(uuid); attWagaCrrctService.insert(attWagaCrrct); return buildSuccessResponse(uuid); } @ApiOperation(value = "根据ID删除水闸基础信息纠错管理") @RequestMapping(value = "/del/{id}", method = RequestMethod.GET) public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) { attWagaCrrctService.delete(id); return buildSuccessResponse(); } @ApiOperation(value = "更新水闸基础信息纠错管理信息") @RequestMapping(value = "/update", method = RequestMethod.POST) public BaseResponse update(@ApiParam(name = "attWagaCrrct", value = "AttWagaCrrct", required = true) @RequestBody AttWagaCrrct attWagaCrrct) { Assert.notNull(attWagaCrrct.getId(), "主键id为必填参数"); attWagaCrrctService.update(attWagaCrrct); return buildSuccessResponse(); } @ApiOperation(value = "根据ID获取水闸基础信息纠错管理信息") @RequestMapping(value = "/{id}", method = RequestMethod.GET) public BaseResponse get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) { AttWagaCrrct attWagaCrrct = attWagaCrrctService.get(id); return buildSuccessResponse(attWagaCrrct); } }