“mitao”
2026-04-07 4ba9020b7c67cc318448a8aeac741492b23b4189
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/system/controller/UserFeedbackController.java
@@ -1,20 +1,14 @@
package com.tcm.training.admin.system.controller;
import cn.dev33.satoken.stp.StpUtil;
import com.tcm.training.admin.common.ApiResponse;
import com.tcm.training.admin.common.PageResponse;
import com.tcm.training.admin.system.dto.UserFeedbackSubmitRequest;
import com.tcm.training.admin.system.service.UserFeedbackAppService;
import com.tcm.training.admin.system.vo.UserFeedbackListItemVO;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
@Validated
@RestController
@@ -23,21 +17,21 @@
    private final UserFeedbackAppService userFeedbackAppService;
    /**
     * 注入用户反馈后台查询服务。
     */
    public UserFeedbackController(UserFeedbackAppService userFeedbackAppService) {
        this.userFeedbackAppService = userFeedbackAppService;
    }
    /**
     * 分页查询用户反馈列表,供后台管理端使用。
     */
    @GetMapping("/user-feedbacks")
    public ApiResponse<PageResponse<UserFeedbackListItemVO>> page(
            @RequestParam(required = false, defaultValue = "1") int page,
            @RequestParam(required = false, defaultValue = "10") int pageSize,
            @RequestParam(required = false) String content) {
        return ApiResponse.ok(userFeedbackAppService.page(page, pageSize, content));
    }
    @PostMapping("/user-feedbacks")
    public ApiResponse<Void> submit(@Valid @RequestBody UserFeedbackSubmitRequest request) {
        userFeedbackAppService.submit(StpUtil.getLoginIdAsLong(), request);
        return ApiResponse.ok(null);
    }
}