| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- package cn.com.goldenwater.dcproj.controller.base;
- import cn.com.goldenwater.core.web.BaseController;
- import cn.com.goldenwater.core.web.BaseResponse;
- import cn.com.goldenwater.dcproj.model.StStbprpB;
- import cn.com.goldenwater.dcproj.param.PersObjParam;
- import cn.com.goldenwater.dcproj.service.StStbprpBService;
- import com.github.pagehelper.PageInfo;
- 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.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.RestController;
- import javax.servlet.http.HttpServletResponse;
- import java.util.List;
- /**
- * @author lune
- * @date 2019-6-4
- */
- @Api(value = "水文站基础信息管理", tags = "水文站基础信息管理")
- @RestController
- @RequestMapping("/st/stbprp/base")
- public class StStbprpBController extends BaseController {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private StStbprpBService stStbprpBService;
- @ApiOperation(value = "添加xxx")
- @RequestMapping(value = "", method = RequestMethod.POST)
- public BaseResponse<StStbprpB> insert(@ApiParam(name = "stStbprpB", value = "StStbprpB", required = true) @RequestBody StStbprpB stStbprpB) {
- int ret = stStbprpBService.insert(stStbprpB);
- return buildSuccessResponse(stStbprpB);
- }
- @ApiOperation(value = "根据ID删除xxx")
- @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
- public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- int ret = stStbprpBService.delete(id);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "更新xxx信息")
- @RequestMapping(value = "", method = RequestMethod.PUT)
- public BaseResponse update(@ApiParam(name = "stStbprpB", value = "StStbprpB", required = true) @RequestBody StStbprpB stStbprpB) {
- Assert.notNull(stStbprpB.getStcd(), "主键id为必填参数");
- int ret = stStbprpBService.update(stStbprpB);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "根据ID获取xxx(单表)")
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public BaseResponse<StStbprpB> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- StStbprpB stStbprpB = stStbprpBService.get(id);
- return buildSuccessResponse(stStbprpB);
- }
- @ApiOperation(value = "获取列表(地图展示)")
- @RequestMapping(value = "findList", method = RequestMethod.POST)
- public BaseResponse<List<StStbprpB>> findList(@ApiParam(name = "StStbprpBParam", value = "stStbprpBParam", required = true) @RequestBody PersObjParam persObjParam) {
- List<StStbprpB> stStbprpBList = stStbprpBService.findListBy(persObjParam);
- return buildSuccessResponse(stStbprpBList);
- }
- @ApiOperation(value = "获取列表(分页)")
- @RequestMapping(value = "findPageList", method = RequestMethod.POST)
- public BaseResponse<PageInfo<StStbprpB>> findPageList(@ApiParam(name = "StStbprpBParam", value = "stStbprpBParam", required = true) @RequestBody PersObjParam persObjParam, HttpServletResponse response) {
- PageInfo<StStbprpB> stStbprpBPageInfo = stStbprpBService.findPageInfoBy(persObjParam, response);
- return buildSuccessResponse(stStbprpBPageInfo);
- }
- }
|