| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- package cn.com.goldenwater.dcproj.controller.fjpjlgl;
- import cn.com.goldenwater.dcproj.model.AttFjpjlglBase;
- import cn.com.goldenwater.dcproj.model.AttSafetyBase;
- import cn.com.goldenwater.dcproj.param.AttFjpjlglBaseParam;
- import cn.com.goldenwater.dcproj.service.AttFjpjlglBaseService;
- 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 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.RequestParam;
- import org.springframework.web.bind.annotation.RestController;
- import java.util.List;
- /**
- * @author lhc
- * @date 2023-11-7
- */
- @Api(value = "项目法人基本信息表管理",tags="项目法人基本信息表管理")
- @RestController
- @RequestMapping("/att/fjpjlgl/base")
- public class AttFjpjlglBaseController extends BaseController {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private AttFjpjlglBaseService attFjpjlglBaseService;
- @ApiOperation(value = "添加项目法人基本信息表")
- @RequestMapping(value = "", method = RequestMethod.POST)
- public BaseResponse<AttFjpjlglBase> insert(@ApiParam(name = "attFjpjlglBase", value = "AttFjpjlglBase", required = true) @RequestBody AttFjpjlglBase attFjpjlglBase) {
- if(StringUtils.isBlank(attFjpjlglBase.getId())) {
- attFjpjlglBaseService.insert(attFjpjlglBase);
- }
- else{
- attFjpjlglBaseService.update(attFjpjlglBase);
- }
- return buildSuccessResponse(attFjpjlglBase);
- }
- @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 = attFjpjlglBaseService.delete(id);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "更新项目法人基本信息表信息")
- @RequestMapping(value = "/update", method = RequestMethod.POST)
- public BaseResponse<AttFjpjlglBase> update(@ApiParam(name = "attFjpjlglBase", value = "AttFjpjlglBase", required = true) @RequestBody AttFjpjlglBase attFjpjlglBase) {
- Assert.notNull(attFjpjlglBase.getId(), "主键id为必填参数");
- int ret = attFjpjlglBaseService.update(attFjpjlglBase);
- return buildSuccessResponse(attFjpjlglBase);
- }
- @ApiOperation(value = "根据ID获取项目法人基本信息表(单表)")
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public BaseResponse<AttFjpjlglBase> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- AttFjpjlglBase attFjpjlglBase = attFjpjlglBaseService.get(id);
- return buildSuccessResponse(attFjpjlglBase);
- }
- @ApiOperation(value = "根据 objId 获取基本信息(单表)")
- @RequestMapping(value = "/getObjId/{objId}", method = {RequestMethod.GET, RequestMethod.POST})
- public BaseResponse<AttFjpjlglBase> getObjId(@ApiParam(name = "objId", value = "objId", required = true)
- @PathVariable String objId) {
- return buildSuccessResponse(attFjpjlglBaseService.getObjId(objId));
- }
- }
|