| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- package cn.com.goldenwater.dcproj.controller.efp;
- import cn.com.goldenwater.core.web.BaseController;
- import cn.com.goldenwater.core.web.BaseResponse;
- import cn.com.goldenwater.dcproj.model.AttEfpBase;
- import cn.com.goldenwater.dcproj.param.AttEfpBaseParam;
- import cn.com.goldenwater.dcproj.service.AttEfpBaseService;
- import cn.com.goldenwater.id.util.UuidUtil;
- import com.github.pagehelper.PageInfo;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import io.swagger.annotations.ApiParam;
- import org.apache.commons.lang3.StringUtils;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.util.List;
- /**
- * @author lune
- * @date 2020-5-27
- */
- @Api(value = "ATT 超标洪水防御督查对象基础表管理",tags="ATT 超标洪水防御督查对象基础表管理")
- @RestController
- @RequestMapping("/att/efp/base")
- public class AttEfpBaseController extends BaseController {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private AttEfpBaseService attEfpBaseService;
- @ApiOperation(value = "添加/修改超标洪水防御督查对象基础表")
- @RequestMapping(value = "", method = RequestMethod.POST)
- public BaseResponse<AttEfpBase> insert(@ApiParam(name = "attEfpBase", value = "AttEfpBase", required = true) @RequestBody AttEfpBase attEfpBase) {
- if(StringUtils.isBlank(attEfpBase.getId())) {
- String uuid = UuidUtil.uuid(); // 生成uuid
- attEfpBase.setId(uuid);
- attEfpBaseService.insert(attEfpBase);
- }else{
- attEfpBaseService.update(attEfpBase);
- }
- return buildSuccessResponse(attEfpBase);
- }
- @ApiOperation(value = "根据ID删除超标洪水防御督查对象基础表")
- @RequestMapping(value = "/del/{id}", method = RequestMethod.GET)
- public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- int ret = attEfpBaseService.delete(id);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "根据ID获取超标洪水防御督查对象基础表(单表)")
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public BaseResponse<AttEfpBase> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- AttEfpBase attEfpBase = attEfpBaseService.get(id);
- return buildSuccessResponse(attEfpBase);
- }
- @ApiOperation(value = "获取超标洪水防御督查对象基础表(列表所有)")
- @RequestMapping(value = "/list", method = RequestMethod.POST)
- public BaseResponse<List<AttEfpBase>> list(@ApiParam(name = "attEfpBaseParam", value = "attEfpBaseParam", required = true) @RequestBody AttEfpBaseParam attEfpBaseParam) {
- List<AttEfpBase> attEfpBaseList = attEfpBaseService.findList(attEfpBaseParam);
- return buildSuccessResponse(attEfpBaseList);
- }
- @ApiOperation(value = "获取超标洪水防御督查对象基础表(列表--分页)")
- @RequestMapping(value = "/page", method = RequestMethod.POST)
- public BaseResponse<PageInfo<AttEfpBase>> page(@ApiParam(name = "attEfpBaseParam", value = "attEfpBaseParam", required = true) @RequestBody AttEfpBaseParam attEfpBaseParam) {
- PageInfo<AttEfpBase> attEfpBaseList = attEfpBaseService.findPageInfo(attEfpBaseParam);
- return buildSuccessResponse(attEfpBaseList);
- }
- }
|