package cn.com.goldenwater.dcproj.controller.meeting; import cn.com.goldenwater.dcproj.model.AttMeetingEval; import cn.com.goldenwater.dcproj.param.AttMeetingEvalParam; import cn.com.goldenwater.dcproj.service.AttMeetingEvalService; 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.beans.factory.annotation.Value; 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-9 */ @Api(value = "ATT 培训会议评价管理表管理", tags = "ATT 培训会议评价管理表管理") @RestController @RequestMapping("/att/meeting/eval") public class AttMeetingEvalController extends BaseController { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private AttMeetingEvalService attMeetingEvalService; @Value("${web.upload-path}") public String fileDir; @ApiOperation(value = "添加/修改培训会议评价管理表") @RequestMapping(value = "", method = RequestMethod.POST) public BaseResponse insert(@ApiParam(name = "attMeetingEval", value = "AttMeetingEval", required = true) @RequestBody AttMeetingEval attMeetingEval) { if (StringUtils.isBlank(attMeetingEval.getId())) { String uuid = UuidUtil.uuid(); // 生成uuid attMeetingEval.setId(uuid); attMeetingEvalService.insert(attMeetingEval); } else { attMeetingEvalService.update(attMeetingEval); } return buildSuccessResponse(attMeetingEval); } @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 = attMeetingEvalService.delete(id); return buildSuccessResponse(); } @ApiOperation(value = "根据ID获取培训会议评价管理表(单表)") @RequestMapping(value = "/{id}", method = RequestMethod.GET) public BaseResponse get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) { AttMeetingEval attMeetingEval = attMeetingEvalService.get(id); return buildSuccessResponse(attMeetingEval); } @ApiOperation(value = "获取培训会议评价管理表(列表所有)") @RequestMapping(value = "/list", method = RequestMethod.POST) public BaseResponse> list(@ApiParam(name = "attMeetingEvalParam", value = "attMeetingEvalParam", required = true) @RequestBody AttMeetingEvalParam attMeetingEvalParam) { List attMeetingEvalList = attMeetingEvalService.findList(attMeetingEvalParam); return buildSuccessResponse(attMeetingEvalList); } @ApiOperation(value = "获取培训会议评价管理表(列表--分页)") @RequestMapping(value = "/page", method = RequestMethod.POST) public BaseResponse> page(@ApiParam(name = "attMeetingEvalParam", value = "attMeetingEvalParam", required = true) @RequestBody AttMeetingEvalParam attMeetingEvalParam) { PageInfo attMeetingEvalList = attMeetingEvalService.findPageInfo(attMeetingEvalParam); return buildSuccessResponse(attMeetingEvalList); } }