feat: 🎸 讨论列表接口修改
This commit is contained in:
parent
5da9d2135a
commit
b8e649c13c
@ -210,30 +210,19 @@ public class AiolDiscussionController extends JeecgController<AiolDiscussion, IA
|
||||
return super.importExcel(request, response, AiolDiscussion.class);
|
||||
}
|
||||
|
||||
@AutoLog(value = "讨论-查询用户讨论列表")
|
||||
@Operation(summary = "查询用户讨论列表", description = "查询当前登录用户创建的讨论列表")
|
||||
@AutoLog(value = "讨论-查询课程下的讨论列表")
|
||||
@Operation(summary = "查询课程讨论列表", description = "查询课程讨论列表")
|
||||
@GetMapping(value = "/teacher_list")
|
||||
public Result<List<AiolDiscussion>> queryTeacherDiscussions(HttpServletRequest request) {
|
||||
public Result<List<AiolDiscussion>> queryCourseDiscussions(HttpServletRequest request, @RequestParam(value = "courseId") String courseId) {
|
||||
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. 查询当前用户创建的讨论列表
|
||||
// 2. 查询课程下的讨论列表
|
||||
QueryWrapper<AiolDiscussion> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("create_by", sysUser.getUsername())
|
||||
queryWrapper.eq("course_id", courseId)
|
||||
.orderByDesc("create_time");
|
||||
|
||||
List<AiolDiscussion> 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());
|
||||
|
@ -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;
|
||||
|
67
jeecgboot-vue3/src/views/aiol/AiolDiscussion.data.ts
Normal file
67
jeecgboot-vue3/src/views/aiol/AiolDiscussion.data.ts
Normal file
@ -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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user