| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- package cn.com.goldenwater.dcproj.controller.meeting;
- import cn.com.goldenwater.dcproj.model.MeetQuesConfig;
- import cn.com.goldenwater.dcproj.param.MeetQuesConfigParam;
- import cn.com.goldenwater.dcproj.service.MeetQuesConfigService;
- 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 2019-7-23
- */
- @Api(value = "MEET 会议问卷配置表管理", tags = "MEET 会议问卷配置表管理")
- @RestController
- @RequestMapping("/meet/ques/config")
- public class MeetQuesConfigController extends BaseController {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private MeetQuesConfigService meetQuesConfigService;
- @ApiOperation(value = "添加/修改会议问卷配置表")
- @RequestMapping(value = "", method = RequestMethod.POST)
- public BaseResponse<MeetQuesConfig> insert(@ApiParam(name = "meetQuesConfig", value = "MeetQuesConfig", required = true) @RequestBody MeetQuesConfig meetQuesConfig) {
- if (StringUtils.isBlank(meetQuesConfig.getId())) {
- String uuid = UuidUtil.uuid(); // 生成uuid
- meetQuesConfig.setId(uuid);
- meetQuesConfigService.insert(meetQuesConfig);
- } else {
- meetQuesConfigService.update(meetQuesConfig);
- }
- return buildSuccessResponse(meetQuesConfig);
- }
- @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 = meetQuesConfigService.delete(id);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "根据ID获取会议问卷配置表(单表)")
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public BaseResponse<MeetQuesConfig> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- MeetQuesConfig meetQuesConfig = meetQuesConfigService.get(id);
- return buildSuccessResponse(meetQuesConfig);
- }
- @ApiOperation(value = "获取会议问卷配置表(列表所有)")
- @RequestMapping(value = "/list", method = RequestMethod.POST)
- public BaseResponse<List<MeetQuesConfig>> list(@ApiParam(name = "meetQuesConfigParam", value = "meetQuesConfigParam", required = true) @RequestBody MeetQuesConfigParam meetQuesConfigParam) {
- List<MeetQuesConfig> meetQuesConfigList = meetQuesConfigService.findList(meetQuesConfigParam);
- return buildSuccessResponse(meetQuesConfigList);
- }
- @ApiOperation(value = "获取会议问卷配置表(列表--分页)")
- @RequestMapping(value = "/page", method = RequestMethod.POST)
- public BaseResponse<PageInfo<MeetQuesConfig>> page(@ApiParam(name = "meetQuesConfigParam", value = "meetQuesConfigParam", required = true) @RequestBody MeetQuesConfigParam meetQuesConfigParam) {
- PageInfo<MeetQuesConfig> meetQuesConfigList = meetQuesConfigService.findPageInfo(meetQuesConfigParam);
- return buildSuccessResponse(meetQuesConfigList);
- }
- }
|