44323
2024-05-16 e358cca3bd49eaadb07f6bafdc1b325d01f08f0c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package com.ruoyi.management.controller;
 
 
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.management.domain.TFeedback;
import com.ruoyi.management.dto.FeedbackQuery;
import com.ruoyi.management.service.ITFeedbackService;
import com.ruoyi.management.vo.FeedbackVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
 
import java.util.List;
 
/**
 * <p>
 * 用户反馈 前端控制器
 * </p>
 *
 * @author 无关风月
 * @since 2024-04-26
 */
@Controller
@RequestMapping("/tFeedback")
public class TFeedbackController {
    @Autowired
    private ITFeedbackService feedbackService;
 
 
    @ResponseBody
    @PostMapping("/listAll")
    @ApiOperation(value = "列表查询", tags = {"反馈管理"})
    public AjaxResult<PageInfo<FeedbackVO>> listAll(FeedbackQuery query){
//        if (query.getEndTime()!=null){
//            query.getEndTime().setHours(23);
//            query.getEndTime().setMinutes(59);
//            query.getEndTime().setSeconds(59);
//        }
        List<FeedbackVO> list = feedbackService.listAll(query);
        PageInfo<FeedbackVO> res = new PageInfo<>(query.getPageNumber(), query.getPageSize());
        res.setRecords(list);
        return AjaxResult.success(res);
    }
 
    @ResponseBody
    @GetMapping("/detail")
    @ApiOperation(value = "查看详情", tags = {"反馈管理"})
    public AjaxResult<TFeedback> detail(Integer id){
        TFeedback feedback = feedbackService.getById(id);
        return AjaxResult.success(feedback);
    }
 
    @ResponseBody
    @GetMapping("/handle")
    @ApiOperation(value = "处理", tags = {"反馈管理"})
    public AjaxResult handle(Integer id){
        TFeedback feedback = feedbackService.getById(id);
        feedback.setState(2);
        feedbackService.updateById(feedback);
        return AjaxResult.success();
    }
}