| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- package cn.com.goldenwater.dcproj.controller.zhejiang;
- import cn.com.goldenwater.dcproj.model.AttZhejiangJgBase;
- import cn.com.goldenwater.dcproj.param.AttZhejiangJgBaseParam;
- import cn.com.goldenwater.dcproj.service.AttZhejiangJgBaseService;
- 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.apache.commons.lang3.StringUtils;
- import com.github.pagehelper.PageInfo;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- 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 java.util.List;
- /**
- * @author lune
- * @date 2020-5-12
- */
- @Api(value = "ATT 浙江监管基本信息管理",tags="ATT 浙江监管基本信息管理")
- @RestController
- @RequestMapping("/att/zhejiang/jg/base")
- public class AttZhejiangJgBaseController extends BaseController {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private AttZhejiangJgBaseService attZhejiangJgBaseService;
- @ApiOperation(value = "添加/修改")
- @RequestMapping(value = "", method = RequestMethod.POST)
- public BaseResponse<AttZhejiangJgBase> insert(@ApiParam(name = "attZhejiangJgBase", value = "AttZhejiangJgBase", required = true) @RequestBody AttZhejiangJgBase attZhejiangJgBase) {
- if(StringUtils.isBlank(attZhejiangJgBase.getId())) {
- String uuid = UuidUtil.uuid(); // 生成uuid
- attZhejiangJgBase.setId(uuid);
- attZhejiangJgBaseService.insert(attZhejiangJgBase);
- }else{
- attZhejiangJgBaseService.update(attZhejiangJgBase);
- }
- return buildSuccessResponse(attZhejiangJgBase);
- }
- @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 = attZhejiangJgBaseService.delete(id);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "根据ID获取(单表)")
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public BaseResponse<AttZhejiangJgBase> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- AttZhejiangJgBase attZhejiangJgBase = attZhejiangJgBaseService.get(id);
- return buildSuccessResponse(attZhejiangJgBase);
- }
- @ApiOperation(value = "获取(列表所有)")
- @RequestMapping(value = "/list", method = RequestMethod.POST)
- public BaseResponse<List<AttZhejiangJgBase>> list(@ApiParam(name = "attZhejiangJgBaseParam", value = "attZhejiangJgBaseParam", required = true) @RequestBody AttZhejiangJgBaseParam attZhejiangJgBaseParam) {
- List<AttZhejiangJgBase> attZhejiangJgBaseList = attZhejiangJgBaseService.findList(attZhejiangJgBaseParam);
- return buildSuccessResponse(attZhejiangJgBaseList);
- }
- @ApiOperation(value = "获取(列表--分页)")
- @RequestMapping(value = "/page", method = RequestMethod.POST)
- public BaseResponse<PageInfo<AttZhejiangJgBase>> page(@ApiParam(name = "attZhejiangJgBaseParam", value = "attZhejiangJgBaseParam", required = true) @RequestBody AttZhejiangJgBaseParam attZhejiangJgBaseParam) {
- PageInfo<AttZhejiangJgBase> attZhejiangJgBaseList = attZhejiangJgBaseService.findPageInfo(attZhejiangJgBaseParam);
- return buildSuccessResponse(attZhejiangJgBaseList);
- }
- }
|