فهرست منبع

店铺问答讨论优化

dujian 3 ماه پیش
والد
کامیت
a5719cd972

+ 7 - 7
alien-store-platform/src/main/java/shop/alien/storeplatform/controller/StorePlatformDiscussionController.java

@@ -28,14 +28,14 @@ import java.util.List;
 @RequiredArgsConstructor
 public class StorePlatformDiscussionController {
 
-    private final StorePlatformDiscussionService storeDiscussionService;
+    private final StorePlatformDiscussionService storePlatformDiscussionService;
 
     @ApiOperation("发布一级问答讨论 (主贴)")
     @PostMapping("/postTopic")
     public R<Boolean> postTopic(@RequestBody StorePlatformDiscussion discussion) {
         log.info("StorePlatformDiscussionController.postTopic?discussion={}", discussion);
         try {
-            boolean success = storeDiscussionService.postTopic(discussion);
+            boolean success = storePlatformDiscussionService.postTopic(discussion);
             return success ? R.success("发布成功") : R.fail("发布失败");
         } catch (Exception e) {
             log.error("发布讨论失败", e);
@@ -48,7 +48,7 @@ public class StorePlatformDiscussionController {
     public R<Boolean> postReply(@RequestBody StorePlatformDiscussion discussion) {
         log.info("StorePlatformDiscussionController.postReply?discussion={}", discussion);
         try {
-            boolean success = storeDiscussionService.postReply(discussion);
+            boolean success = storePlatformDiscussionService.postReply(discussion);
             return success ? R.success("回复成功") : R.fail("回复失败");
         } catch (Exception e) {
             log.error("回复讨论失败", e);
@@ -63,7 +63,7 @@ public class StorePlatformDiscussionController {
             @ApiParam(value = "页码", defaultValue = "1") @RequestParam(defaultValue = "1") Integer pageNum,
             @ApiParam(value = "每页数量", defaultValue = "10") @RequestParam(defaultValue = "10") Integer pageSize) {
         log.info("StorePlatformDiscussionController.pageRoot?storeId={}, pageNum={}, pageSize={}", storeId, pageNum, pageSize);
-        return R.data(storeDiscussionService.pageRootDiscussions(storeId, pageNum, pageSize));
+        return R.data(storePlatformDiscussionService.pageRootDiscussions(storeId, pageNum, pageSize));
     }
 
     @ApiOperation("分页获取某条一级问答讨论下的所有回复")
@@ -73,21 +73,21 @@ public class StorePlatformDiscussionController {
             @ApiParam(value = "页码", defaultValue = "1") @RequestParam(defaultValue = "1") Integer pageNum,
             @ApiParam(value = "每页数量", defaultValue = "10") @RequestParam(defaultValue = "10") Integer pageSize) {
         log.info("StorePlatformDiscussionController.pageReplies?rootId={}, pageNum={}, pageSize={}", rootId, pageNum, pageSize);
-        return R.data(storeDiscussionService.pageRepliesByRootId(rootId, pageNum, pageSize));
+        return R.data(storePlatformDiscussionService.pageRepliesByRootId(rootId, pageNum, pageSize));
     }
 
     @ApiOperation("获取店铺问答讨论列表")
     @GetMapping("/list")
     public R<List<StorePlatformDiscussionUserVo>> list(@ApiParam(value = "店铺ID", required = true) @RequestParam Integer storeId) {
         log.info("StorePlatformDiscussionController.list?storeId={}", storeId);
-        return R.data(storeDiscussionService.listByStoreId(storeId));
+        return R.data(storePlatformDiscussionService.listByStoreId(storeId));
     }
 
     @ApiOperation("删除问答讨论")
     @DeleteMapping("/delete/{id}")
     public R<Boolean> delete(@PathVariable Integer id) {
         log.info("StorePlatformDiscussionController.delete?id={}", id);
-        boolean success = storeDiscussionService.removeById(id);
+        boolean success = storePlatformDiscussionService.removeById(id);
         return success ? R.success("删除成功") : R.fail("删除失败");
     }
 }

+ 0 - 147
alien-store-platform/接口文档/36-店铺讨论模块接口.md

@@ -1,147 +0,0 @@
-# 商户平台-店铺讨论模块接口文档
-
-## 模块概述
-
-本模块提供店铺讨论功能,支持分页查询一级讨论(主贴)以及一级讨论下的所有回复(仿B站评论模式)。支持逻辑删除、层级归类以及用户信息显示。
-
----
-
-## 接口列表
-
-1. [发布一级讨论](#接口一发布一级讨论) - 用户在店铺下发起新讨论
-2. [回复讨论](#接口二回复讨论) - 用户回复已有讨论
-3. [分页获取一级讨论](#接口三分页获取一级讨论) - 分页查询店铺的主讨论列表 (带用户信息)
-4. [分页获取回复列表](#接口四分页获取回复列表) - 分页查询回复 (带主贴信息和用户信息)
-5. [获取所有讨论列表](#接口五获取所有讨论列表) - 查询店铺所有讨论 (不分页)
-6. [删除讨论](#接口六删除讨论) - 根据ID逻辑删除讨论记录
-
----
-
-## 接口一:发布一级讨论
-
-### 接口信息
-
-- **接口名称**: 发布一级问答讨论 (主贴)
-- **接口路径**: `POST /platformStoreDiscussion/postTopic`
-- **请求方式**: POST
-- **接口描述**: 在指定店铺下发起新的讨论。系统会自动将 `rootId` 设置为生成的主键 ID。
-
-### 请求参数
-
-| 参数名 | 类型 | 必填 | 说明 |
-|--------|------|------|------|
-| storeId | Integer | 是 | 店铺ID |
-| userId | Integer | 是 | 用户ID |
-| content | String | 是 | 讨论内容 |
-
-### 响应参数
-
-```json
-{
-    "code": 200,
-    "success": true,
-    "data": true,
-    "msg": "发布成功"
-}
-```
-
----
-
-## 接口二:回复讨论
-
-### 接口信息
-
-- **接口名称**: 回复问答讨论
-- **接口路径**: `POST /platformStoreDiscussion/postReply`
-- **请求方式**: POST
-- **接口描述**: 对已有讨论进行回复。系统会根据 `parentId` 自动查询并填充 `storeId` 和 `rootId`。
-
-### 请求参数
-
-| 参数名 | 类型 | 必填 | 说明 |
-|--------|------|------|------|
-| userId | Integer | 是 | 用户ID |
-| content | String | 是 | 讨论内容 |
-| parentId | Integer | 是 | 被回复的讨论 ID |
-
-### 响应参数
-
-```json
-{
-    "code": 200,
-    "success": true,
-    "data": true,
-    "msg": "回复成功"
-}
-```
-
----
-
-## 接口三:分页获取一级讨论
-
-### 接口信息
-
-- **接口名称**: 分页获取一级问答讨论列表
-- **接口路径**: `GET /platformStoreDiscussion/pageRoot`
-- **请求方式**: GET
-
-### 响应参数 (核心部分)
-
-```json
-{
-    "code": 200,
-    "data": {
-        "records": [
-            {
-                "id": 1,
-                "content": "主贴内容",
-                "userName": "用户昵称",
-                "userImage": "用户头像URL",
-                "createdTime": "2025-12-30 14:00:00"
-            }
-        ],
-        "total": 100,
-        "size": 10,
-        "current": 1
-    }
-}
-```
-
----
-
-## 接口四:分页获取回复列表
-
-### 接口信息
-
-- **接口名称**: 分页获取某条一级问答讨论下的所有回复
-- **接口路径**: `GET /platformStoreDiscussion/pageReplies`
-- **请求方式**: GET
-- **接口描述**: 返回结构包含原主贴信息 (`topic`) 和分页后的回复列表 (`replies`)。注意:`replies` 列表中不包含 `topic` 本身。
-
----
-
-## 接口五:获取所有讨论列表
-
-### 接口信息
-
-- **接口名称**: 获取店铺问答讨论列表
-- **接口路径**: `GET /platformStoreDiscussion/list`
-- **请求方式**: GET
-- **接口描述**: 不分页获取店铺下所有讨论记录。
-
----
-
-## 接口六:删除讨论
-
-### 接口信息
-
-- **接口名称**: 删除问答讨论
-- **接口路径**: `DELETE /platformStoreDiscussion/delete/{id}`
-- **请求方式**: DELETE
-- **接口描述**: 根据讨论ID逻辑删除。
-
----
-
-**文档版本**: v1.3  
-**最后更新**: 2025-12-30  
-**维护人员**: alien