From b8e649c13c020b4a28e272e11cff4b9181ecdf9d Mon Sep 17 00:00:00 2001 From: GoCo Date: Sat, 20 Sep 2025 10:21:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AiolDiscussionController.java | 23 ++----- .../modules/aiol/entity/AiolDiscussion.java | 6 +- .../src/views/aiol/AiolDiscussion.data.ts | 67 +++++++++++++++++++ 3 files changed, 78 insertions(+), 18 deletions(-) create mode 100644 jeecgboot-vue3/src/views/aiol/AiolDiscussion.data.ts diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolDiscussionController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolDiscussionController.java index b9c0be1b..4c7ba046 100644 --- a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolDiscussionController.java +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolDiscussionController.java @@ -210,30 +210,19 @@ public class AiolDiscussionController extends JeecgController> queryTeacherDiscussions(HttpServletRequest request) { - try { - // 1. 获取当前登录用户信息 - String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN); - String username = JwtUtil.getUsername(token); - LoginUser sysUser = sysBaseApi.getUserByName(username); - - if (sysUser == null) { - return Result.error("用户未登录或登录已过期"); - } - - // 2. 查询当前用户创建的讨论列表 + public Result> queryCourseDiscussions(HttpServletRequest request, @RequestParam(value = "courseId") String courseId) { + try { + // 2. 查询课程下的讨论列表 QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("create_by", sysUser.getUsername()) + queryWrapper.eq("course_id", courseId) .orderByDesc("create_time"); List discussionList = aiolDiscussionService.list(queryWrapper); - log.info("查询用户讨论列表成功: userId={}, 讨论数量={}", sysUser.getId(), discussionList.size()); return Result.OK(discussionList); - } catch (Exception e) { log.error("查询用户讨论列表失败: error={}", e.getMessage(), e); return Result.error("查询用户讨论列表失败: " + e.getMessage()); diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/entity/AiolDiscussion.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/entity/AiolDiscussion.java index 80cec3aa..b3ce9f05 100644 --- a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/entity/AiolDiscussion.java +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/entity/AiolDiscussion.java @@ -22,7 +22,7 @@ import lombok.experimental.Accessors; /** * @Description: 讨论 * @Author: jeecg-boot - * @Date: 2025-09-19 + * @Date: 2025-09-20 * @Version: V1.0 */ @Data @@ -45,6 +45,10 @@ public class AiolDiscussion implements Serializable { @Excel(name = "讨论描述", width = 15) @Schema(description = "讨论描述") private java.lang.String description; + /**课程id*/ + @Excel(name = "课程id", width = 15) + @Schema(description = "课程id") + private java.lang.String courseId; /**创建人*/ @Schema(description = "创建人") private java.lang.String createBy; diff --git a/jeecgboot-vue3/src/views/aiol/AiolDiscussion.data.ts b/jeecgboot-vue3/src/views/aiol/AiolDiscussion.data.ts new file mode 100644 index 00000000..96ea0ec4 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/AiolDiscussion.data.ts @@ -0,0 +1,67 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +import { getWeekMonthQuarterYear } from '/@/utils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '讨论标题', + align:"center", + dataIndex: 'title' + }, + { + title: '讨论描述', + align:"center", + dataIndex: 'description' + }, + { + title: '课程id', + align:"center", + dataIndex: 'courseId' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '讨论标题', + field: 'title', + component: 'Input', + }, + { + label: '讨论描述', + field: 'description', + component: 'Input', + }, + { + label: '课程id', + field: 'courseId', + component: 'Input', + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + title: {title: '讨论标题',order: 0,view: 'text', type: 'string',}, + description: {title: '讨论描述',order: 1,view: 'text', type: 'string',}, + courseId: {title: '课程id',order: 2,view: 'text', type: 'string',}, +}; + +/** +* 流程表单调用这个方法获取formSchema +* @param param +*/ +export function getBpmFormSchema(_formData): FormSchema[]{ + // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema + return formSchema; +} \ No newline at end of file