| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- package cn.com.goldenwater.dcproj.controller;
- import cn.com.goldenwater.core.web.BaseController;
- import cn.com.goldenwater.core.web.BaseResponse;
- import cn.com.goldenwater.dcproj.model.AttDepBase;
- import cn.com.goldenwater.dcproj.service.AttDepBaseService;
- 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.*;
- /**
- * @author lhc
- * @date 2021-1-5
- */
- @Api(value = "水行政部门安全生产(湖南)-基础表管理", tags = "水行政部门安全生产(湖南)-基础表管理")
- @RestController
- @RequestMapping("/att/dep/base")
- public class AttDepBaseController extends BaseController {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private AttDepBaseService attDepBaseService;
- @ApiOperation(value = "修改水行政部门安全生产(湖南)-基础表")
- @RequestMapping(value = "", method = RequestMethod.POST)
- public BaseResponse insert(@ApiParam(name = "attDepBase", value = "AttDepBase", required = true)
- @RequestBody AttDepBase attDepBase) {
- int ret = 0;
- if (StringUtils.isBlank(attDepBase.getId())) {
- ret = attDepBaseService.insert(attDepBase);
- } else {
- ret = attDepBaseService.update(attDepBase);
- }
- return buildSuccessResponse(attDepBase);
- }
- @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 = attDepBaseService.delete(id);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "根据ID获取水行政部门安全生产(湖南)-基础表(单表)")
- @RequestMapping(value = "/{id}", method = {RequestMethod.GET, RequestMethod.POST})
- public BaseResponse<AttDepBase> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- AttDepBase attDepBase = attDepBaseService.get(id);
- return buildSuccessResponse(attDepBase);
- }
- @ApiOperation(value = "根据 objId 获取取水许可管理基本信息(单表)")
- @RequestMapping(value = "/getObjId/{objId}", method ={RequestMethod.GET, RequestMethod.POST})
- public BaseResponse<AttDepBase> getObjId(@ApiParam(name = "objId", value = "objId", required = true) @PathVariable String objId) {
- AttDepBase attDepBase = attDepBaseService.getObjId(objId);
- return buildSuccessResponse(attDepBase);
- }
- }
|