package com.xiaopeng.operation.controller; import com.xiaopeng.api.model.operation.XpUserFeedback; import com.xiaopeng.common.core.domain.R; import com.xiaopeng.operation.dto.XpUserFeedbackDto; import com.xiaopeng.operation.service.IXpUserFeedbackService; 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; /** *
* 用户意见反馈表 前端控制器 *
* * @author mitao * @since 2026-02-03 */ @Api(tags = "用户意见反馈") @RestController @RequestMapping("/base/v1/mini-program") public class XpUserFeedbackController { private final IXpUserFeedbackService xpUserFeedbackService; public XpUserFeedbackController(IXpUserFeedbackService xpUserFeedbackService) { this.xpUserFeedbackService = xpUserFeedbackService; } /** * 添加用户意见反馈 */ @ApiOperation(value = "用户意见反馈",tags = {"小程序-用户意见反馈"},response = XpUserFeedback.class) @PostMapping(value = "/api/v1/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(); } }