“mitao”
2026-04-02 3207399bcdc24d13874e8bd9f27070a928ccc77b
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
package com.xiaopeng.operation.controller;
 
 
import com.xiaopeng.api.model.operation.XpUserFeedback;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.web.page.PageInfo;
import com.xiaopeng.operation.dto.XpUserFeedbackDto;
import com.xiaopeng.operation.query.UserFeedBackQuery;
import com.xiaopeng.operation.service.IXpUserFeedbackService;
import com.xiaopeng.operation.vo.XpUserFeedbackVO;
import com.xiaopeng.unifiedverification.interceptor.XpClientCheck;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
 
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;
 
import javax.servlet.http.HttpServletRequest;
 
/**
 * <p>
 * 用户意见反馈表 前端控制器
 * </p>
 *
 * @author mitao
 * @since 2026-02-03
 */
 
@Api(tags = "用户意见反馈")
@RestController
@RequestMapping("")
public class XpUserFeedbackController {
 
    private final IXpUserFeedbackService xpUserFeedbackService;
 
    public XpUserFeedbackController(IXpUserFeedbackService xpUserFeedbackService) {
        this.xpUserFeedbackService = xpUserFeedbackService;
    }
 
 
    /**
     * 添加用户意见反馈
     */
    @ApiOperation(value = "用户意见反馈",tags = {"小程序-用户意见反馈"},response = XpUserFeedback.class)
    @PostMapping(value = "/base/v1/mini-program/complaint/submit")
    @XpClientCheck(checkToken = false, checkOtpToken = true)
    public R<?> addXpUserFeedback(@RequestBody XpUserFeedbackDto dto, HttpServletRequest request) {
        String uid = request.getHeader("Xp-Uid");
        XpUserFeedback xpUserFeedback = new XpUserFeedback();
        xpUserFeedback.setFeedbackUserId(Long.valueOf(uid));
        xpUserFeedback.setFeedbackTypeId(dto.getFeedbackTypeId());
        xpUserFeedback.setFeedbackContent(dto.getFeedbackContent());
        xpUserFeedback.setFeedbackPictures(dto.getFeedbackPictures());
        xpUserFeedbackService.save(xpUserFeedback);
        return R.ok();
    }
 
    @ApiOperation(value = "获取意见反馈分页列表", tags = {"管理后台-服务中心"})
    @PostMapping(value = "/api/v1/userFeedBack/pageList")
    public R<PageInfo<XpUserFeedbackVO>> getPageList(@RequestBody UserFeedBackQuery query) {
        return R.ok(xpUserFeedbackService.getPageList(query));
    }
}