package com.zhujizheng.IHome.feedback.controller; import com.zhujizheng.IHome.feedback.dto.PYPushFeedBackDTO; import com.zhujizheng.IHome.feedback.service.PYFeedBackService; import com.zhujizheng.IHome.feedback.vo.PYFeedBackUpdateVO; import com.zhujizheng.IHome.feedback.vo.PYFeedBackVO; import com.zhujizheng.IHome.generator.dao.PYFeedBack; import com.zhujizheng.IHome.util.response.ResponseResult; import com.zhujizheng.IHome.util.response.RestResultGenerator; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.util.List; /** * Created with IntelliJ IDEA *
* Author: yons
* Date: 2019/04/17
* Time: 01:43
* Description:
* Copyright © 2019年 com.zhujizheng. All rights reserved.
*/
@Api("反馈意见")
@RestController
@RequestMapping("/feedback")
public class PYFeedBackController {
@Autowired
private PYFeedBackService feedBackService;
@ApiOperation("上传反馈意见")
@ApiImplicitParam(name = "feedbackDTO", value = "反馈意见的数据", required = true, dataType = "PYFeedBackDTO")
@PostMapping("/push")
public ResponseResult pushFeedback(@Validated @RequestBody PYPushFeedBackDTO feedBackDTO) {
System.out.println("dto = " + feedBackDTO);
int result = feedBackService.pushFeedBack(feedBackDTO);
if (result == 0) {
return RestResultGenerator.genErrorResult("反馈失败");
} else {
return RestResultGenerator.genResult("反馈成功");
}
}
@ApiOperation("获取反馈意见")
@ApiImplicitParams({
@ApiImplicitParam(name = "feedbackTime", value = "反馈时间", paramType = "path", required = true, dataType = "long"),
@ApiImplicitParam(name = "statusUpdateTime", value = "反状态更新时间", paramType = "path", required = true, dataType = "long"),
@ApiImplicitParam(name = "status", value = "状态", paramType = "path", required = true, dataType = "int")
})
@GetMapping("/pull/{feedbackTime}/{statusUpdateTime}/{status}")
public ResponseResult getFeedbacks(@PathVariable long feedbackTime, @PathVariable long statusUpdateTime, @PathVariable int status) {
List