Compare commits
5 Commits
337ba0f42a
...
3f199d375b
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3f199d375b | ||
![]() |
3429e6ac7b | ||
![]() |
ac7864f34b | ||
![]() |
1596e6fc33 | ||
![]() |
67068a03b6 |
36
jeecg-boot/jeecg-boot-module/jeecg-module-aiol/pom.xml
Normal file
36
jeecg-boot/jeecg-boot-module/jeecg-module-aiol/pom.xml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-boot-module</artifactId>
|
||||||
|
<version>3.8.2</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>jeecg-module-aiol</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>jeecg-module-aiol</name>
|
||||||
|
<url>http://maven.apache.org</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-boot-base-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-system-local-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-system-biz</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
@ -0,0 +1,51 @@
|
|||||||
|
package org.jeecg.modules.aiol.constant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* entity_link 表类型常量定义
|
||||||
|
* source_type:主体类型
|
||||||
|
* target_type:内容类型
|
||||||
|
*/
|
||||||
|
public final class EntityLinkConst {
|
||||||
|
|
||||||
|
private EntityLinkConst() {}
|
||||||
|
|
||||||
|
/** 主体类型 */
|
||||||
|
public static final class SourceType {
|
||||||
|
private SourceType() {}
|
||||||
|
// 课程
|
||||||
|
public static final String COURSE = "course";
|
||||||
|
// 课程分类
|
||||||
|
public static final String COURSE_CATEGORY = "course_category";
|
||||||
|
// 课程章节
|
||||||
|
public static final String COURSE_SECTION = "course_section";
|
||||||
|
// 专题(字典/专题)
|
||||||
|
public static final String SUBJECT = "subject";
|
||||||
|
// 活动
|
||||||
|
public static final String ACTIVITY = "activity";
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 内容类型 */
|
||||||
|
public static final class TargetType {
|
||||||
|
private TargetType() {}
|
||||||
|
// 资源(对应资源表)
|
||||||
|
public static final String RESOURCE = "resource";
|
||||||
|
// 作业(对应作业表)
|
||||||
|
public static final String HOMEWORK = "homework";
|
||||||
|
// 考试(对应考试表)
|
||||||
|
public static final String EXAM = "exam";
|
||||||
|
// 课程
|
||||||
|
public static final String COURSE = "course";
|
||||||
|
// 题库
|
||||||
|
public static final String REPO = "repo";
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 资源类型 0:视频,1:图片,2:文档 */
|
||||||
|
public static final class ResourceType {
|
||||||
|
private ResourceType() {}
|
||||||
|
public static final int VIDEO = 0;
|
||||||
|
public static final int IMAGE = 1;
|
||||||
|
public static final int DOCUMENT = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,221 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.config.shiro.IgnoreAuth;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolActivity;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolTag;
|
||||||
|
import org.jeecg.modules.aiol.mapper.AiolTagMapper;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolActivityService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 活动
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name = "活动")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolActivity")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolActivityController extends JeecgController<AiolActivity, IAiolActivityService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolActivityService aiolActivityService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolActivity
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "活动-分页列表查询")
|
||||||
|
@Operation(summary = "活动-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<IPage<AiolActivity>> queryPageList(AiolActivity aiolActivity,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolActivity> queryWrapper = QueryGenerator.initQueryWrapper(aiolActivity, req.getParameterMap());
|
||||||
|
Page<AiolActivity> page = new Page<AiolActivity>(pageNo, pageSize);
|
||||||
|
IPage<AiolActivity> pageList = aiolActivityService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolActivity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "活动-添加")
|
||||||
|
@Operation(summary = "活动-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_activity:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolActivity aiolActivity) {
|
||||||
|
aiolActivityService.save(aiolActivity);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolActivity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "活动-编辑")
|
||||||
|
@Operation(summary = "活动-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_activity:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolActivity aiolActivity) {
|
||||||
|
aiolActivityService.updateById(aiolActivity);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "活动-通过id删除")
|
||||||
|
@Operation(summary = "活动-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_activity:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
aiolActivityService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "活动-批量删除")
|
||||||
|
@Operation(summary = "活动-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_activity:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.aiolActivityService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "活动-通过id查询")
|
||||||
|
@Operation(summary = "活动-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolActivity> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
AiolActivity aiolActivity = aiolActivityService.getById(id);
|
||||||
|
if (aiolActivity == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolActivity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolActivity
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_activity:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolActivity aiolActivity) {
|
||||||
|
return super.exportXls(request, aiolActivity, AiolActivity.class, "活动");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_activity:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolActivity.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AiolTagMapper aiolTagMapper;
|
||||||
|
|
||||||
|
@GetMapping("/selected")
|
||||||
|
@Operation(summary = "查询精选活动")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<List<AiolActivity>> getSelectedActivities() {
|
||||||
|
// 1. 从 aiol_tag 表查询 target_type='activity' 的 target_id 列表
|
||||||
|
QueryWrapper<AiolTag> tagWrapper = new QueryWrapper<>();
|
||||||
|
tagWrapper.eq("target_type", "activity");
|
||||||
|
List<AiolTag> tags = aiolTagMapper.selectList(tagWrapper);
|
||||||
|
|
||||||
|
if (tags == null || tags.isEmpty()) {
|
||||||
|
return Result.OK(List.of());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 提取 target_id 列表
|
||||||
|
List<String> activityIds = tags.stream()
|
||||||
|
.map(AiolTag::getTargetId)
|
||||||
|
.filter(id -> id != null && !id.trim().isEmpty())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
if (activityIds.isEmpty()) {
|
||||||
|
return Result.OK(List.of());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 根据 target_id 列表查询活动数据
|
||||||
|
QueryWrapper<AiolActivity> activityWrapper = new QueryWrapper<>();
|
||||||
|
activityWrapper.in("id", activityIds);
|
||||||
|
List<AiolActivity> activities = aiolActivityService.list(activityWrapper);
|
||||||
|
|
||||||
|
return Result.OK(activities);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,182 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolActivitySignup;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolActivitySignupService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 活动报名
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="活动报名")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolActivitySignup")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolActivitySignupController extends JeecgController<AiolActivitySignup, IAiolActivitySignupService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolActivitySignupService aiolActivitySignupService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolActivitySignup
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "活动报名-分页列表查询")
|
||||||
|
@Operation(summary="活动报名-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolActivitySignup>> queryPageList(AiolActivitySignup aiolActivitySignup,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolActivitySignup> queryWrapper = QueryGenerator.initQueryWrapper(aiolActivitySignup, req.getParameterMap());
|
||||||
|
Page<AiolActivitySignup> page = new Page<AiolActivitySignup>(pageNo, pageSize);
|
||||||
|
IPage<AiolActivitySignup> pageList = aiolActivitySignupService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolActivitySignup
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "活动报名-添加")
|
||||||
|
@Operation(summary="活动报名-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_activity_signup:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolActivitySignup aiolActivitySignup) {
|
||||||
|
aiolActivitySignupService.save(aiolActivitySignup);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolActivitySignup
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "活动报名-编辑")
|
||||||
|
@Operation(summary="活动报名-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_activity_signup:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolActivitySignup aiolActivitySignup) {
|
||||||
|
aiolActivitySignupService.updateById(aiolActivitySignup);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "活动报名-通过id删除")
|
||||||
|
@Operation(summary="活动报名-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_activity_signup:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolActivitySignupService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "活动报名-批量删除")
|
||||||
|
@Operation(summary="活动报名-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_activity_signup:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolActivitySignupService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "活动报名-通过id查询")
|
||||||
|
@Operation(summary="活动报名-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolActivitySignup> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolActivitySignup aiolActivitySignup = aiolActivitySignupService.getById(id);
|
||||||
|
if(aiolActivitySignup==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolActivitySignup);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolActivitySignup
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_activity_signup:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolActivitySignup aiolActivitySignup) {
|
||||||
|
return super.exportXls(request, aiolActivitySignup, AiolActivitySignup.class, "活动报名");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_activity_signup:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolActivitySignup.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,207 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.config.shiro.IgnoreAuth;
|
||||||
|
import org.jeecg.modules.aiol.dto.CommentWithUserInfo;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolComment;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolCommentService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 评论
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="评论")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolComment")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolCommentController extends JeecgController<AiolComment, IAiolCommentService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolCommentService aiolCommentService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolComment
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "评论-分页列表查询")
|
||||||
|
@Operation(summary="评论-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolComment>> queryPageList(AiolComment aiolComment,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolComment> queryWrapper = QueryGenerator.initQueryWrapper(aiolComment, req.getParameterMap());
|
||||||
|
Page<AiolComment> page = new Page<AiolComment>(pageNo, pageSize);
|
||||||
|
IPage<AiolComment> pageList = aiolCommentService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolComment
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "评论-添加")
|
||||||
|
@Operation(summary="评论-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_comment:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolComment aiolComment) {
|
||||||
|
aiolCommentService.save(aiolComment);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolComment
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "评论-编辑")
|
||||||
|
@Operation(summary="评论-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_comment:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolComment aiolComment) {
|
||||||
|
aiolCommentService.updateById(aiolComment);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "评论-通过id删除")
|
||||||
|
@Operation(summary="评论-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_comment:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolCommentService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "评论-批量删除")
|
||||||
|
@Operation(summary="评论-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_comment:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolCommentService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "评论-通过id查询")
|
||||||
|
@Operation(summary="评论-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolComment> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolComment aiolComment = aiolCommentService.getById(id);
|
||||||
|
if(aiolComment==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolComment);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolComment
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_comment:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolComment aiolComment) {
|
||||||
|
return super.exportXls(request, aiolComment, AiolComment.class, "评论");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_comment:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolComment.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/course/{courseId}/list")
|
||||||
|
@Operation(summary = "查询课程评论列表", description = "根据课程ID查询课程评论列表,包含用户信息")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<List<CommentWithUserInfo>> queryCourseCommentList(@PathVariable("courseId") String courseId) {
|
||||||
|
List<CommentWithUserInfo> list = aiolCommentService.getCommentList("course", courseId);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @GetMapping("/activity/{activityId}/list")
|
||||||
|
// @Operation(summary = "查询活动评论列表", description = "根据活动ID查询活动评论列表,包含用户信息")
|
||||||
|
// public Result<List<CommentWithUserInfo>> queryActivityCommentList(@PathVariable("activityId") String activityId) {
|
||||||
|
// List<CommentWithUserInfo> list = commentBizService.getCommentList("activity", activityId);
|
||||||
|
// return Result.OK(list);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// @GetMapping("/{targetType}/{targetId}/list")
|
||||||
|
// @Operation(summary = "查询通用评论列表", description = "根据目标类型和目标ID查询评论列表,包含用户信息")
|
||||||
|
// public Result<List<CommentWithUserInfo>> queryCommentList(
|
||||||
|
// @PathVariable("targetType") String targetType,
|
||||||
|
// @PathVariable("targetId") String targetId) {
|
||||||
|
// List<CommentWithUserInfo> list = commentBizService.getCommentList(targetType, targetId);
|
||||||
|
// return Result.OK(list);
|
||||||
|
// }
|
||||||
|
}
|
@ -0,0 +1,182 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolContentConfig;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolContentConfigService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 内容配置
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="内容配置")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolContentConfig")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolContentConfigController extends JeecgController<AiolContentConfig, IAiolContentConfigService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolContentConfigService aiolContentConfigService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolContentConfig
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "内容配置-分页列表查询")
|
||||||
|
@Operation(summary="内容配置-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolContentConfig>> queryPageList(AiolContentConfig aiolContentConfig,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolContentConfig> queryWrapper = QueryGenerator.initQueryWrapper(aiolContentConfig, req.getParameterMap());
|
||||||
|
Page<AiolContentConfig> page = new Page<AiolContentConfig>(pageNo, pageSize);
|
||||||
|
IPage<AiolContentConfig> pageList = aiolContentConfigService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolContentConfig
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "内容配置-添加")
|
||||||
|
@Operation(summary="内容配置-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_content_config:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolContentConfig aiolContentConfig) {
|
||||||
|
aiolContentConfigService.save(aiolContentConfig);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolContentConfig
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "内容配置-编辑")
|
||||||
|
@Operation(summary="内容配置-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_content_config:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolContentConfig aiolContentConfig) {
|
||||||
|
aiolContentConfigService.updateById(aiolContentConfig);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "内容配置-通过id删除")
|
||||||
|
@Operation(summary="内容配置-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_content_config:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolContentConfigService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "内容配置-批量删除")
|
||||||
|
@Operation(summary="内容配置-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_content_config:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolContentConfigService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "内容配置-通过id查询")
|
||||||
|
@Operation(summary="内容配置-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolContentConfig> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolContentConfig aiolContentConfig = aiolContentConfigService.getById(id);
|
||||||
|
if(aiolContentConfig==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolContentConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolContentConfig
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_content_config:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolContentConfig aiolContentConfig) {
|
||||||
|
return super.exportXls(request, aiolContentConfig, AiolContentConfig.class, "内容配置");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_content_config:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolContentConfig.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,182 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolCourseCategory;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolCourseCategoryService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 课程分类
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="课程分类")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolCourseCategory")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolCourseCategoryController extends JeecgController<AiolCourseCategory, IAiolCourseCategoryService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolCourseCategoryService aiolCourseCategoryService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolCourseCategory
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "课程分类-分页列表查询")
|
||||||
|
@Operation(summary="课程分类-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolCourseCategory>> queryPageList(AiolCourseCategory aiolCourseCategory,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolCourseCategory> queryWrapper = QueryGenerator.initQueryWrapper(aiolCourseCategory, req.getParameterMap());
|
||||||
|
Page<AiolCourseCategory> page = new Page<AiolCourseCategory>(pageNo, pageSize);
|
||||||
|
IPage<AiolCourseCategory> pageList = aiolCourseCategoryService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolCourseCategory
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "课程分类-添加")
|
||||||
|
@Operation(summary="课程分类-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_course_category:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolCourseCategory aiolCourseCategory) {
|
||||||
|
aiolCourseCategoryService.save(aiolCourseCategory);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolCourseCategory
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "课程分类-编辑")
|
||||||
|
@Operation(summary="课程分类-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_course_category:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolCourseCategory aiolCourseCategory) {
|
||||||
|
aiolCourseCategoryService.updateById(aiolCourseCategory);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "课程分类-通过id删除")
|
||||||
|
@Operation(summary="课程分类-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_course_category:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolCourseCategoryService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "课程分类-批量删除")
|
||||||
|
@Operation(summary="课程分类-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_course_category:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolCourseCategoryService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "课程分类-通过id查询")
|
||||||
|
@Operation(summary="课程分类-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolCourseCategory> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolCourseCategory aiolCourseCategory = aiolCourseCategoryService.getById(id);
|
||||||
|
if(aiolCourseCategory==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolCourseCategory);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolCourseCategory
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_course_category:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolCourseCategory aiolCourseCategory) {
|
||||||
|
return super.exportXls(request, aiolCourseCategory, AiolCourseCategory.class, "课程分类");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_course_category:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolCourseCategory.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,412 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.constant.CommonConstant;
|
||||||
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.system.util.JwtUtil;
|
||||||
|
import org.jeecg.common.system.vo.DictModel;
|
||||||
|
import org.jeecg.common.system.vo.LoginUser;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.config.shiro.IgnoreAuth;
|
||||||
|
import org.jeecg.modules.aiol.dto.CourseWithTeacherInfo;
|
||||||
|
import org.jeecg.modules.aiol.dto.TeacherInfo;
|
||||||
|
import org.jeecg.modules.aiol.entity.*;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolCourseService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 课程
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name = "课程")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolCourse")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolCourseController extends JeecgController<AiolCourse, IAiolCourseService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolCourseService aiolCourseService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolCourse
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "课程-分页列表查询")
|
||||||
|
@Operation(summary = "课程-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolCourse>> queryPageList(AiolCourse aiolCourse,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolCourse> queryWrapper = QueryGenerator.initQueryWrapper(aiolCourse, req.getParameterMap());
|
||||||
|
Page<AiolCourse> page = new Page<AiolCourse>(pageNo, pageSize);
|
||||||
|
IPage<AiolCourse> pageList = aiolCourseService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolCourse
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "课程-添加")
|
||||||
|
@Operation(summary = "课程-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_course:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolCourse aiolCourse) {
|
||||||
|
aiolCourseService.save(aiolCourse);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolCourse
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "课程-编辑")
|
||||||
|
@Operation(summary = "课程-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_course:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolCourse aiolCourse) {
|
||||||
|
aiolCourseService.updateById(aiolCourse);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "课程-通过id删除")
|
||||||
|
@Operation(summary = "课程-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_course:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
aiolCourseService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "课程-批量删除")
|
||||||
|
@Operation(summary = "课程-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_course:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.aiolCourseService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "课程-通过id查询")
|
||||||
|
@Operation(summary = "课程-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolCourse> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
AiolCourse aiolCourse = aiolCourseService.getById(id);
|
||||||
|
if (aiolCourse == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolCourse);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolCourse
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_course:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolCourse aiolCourse) {
|
||||||
|
return super.exportXls(request, aiolCourse, AiolCourse.class, "课程");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_course:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolCourse.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysBaseAPI sysBaseApi;
|
||||||
|
|
||||||
|
@GetMapping("/query_list")
|
||||||
|
@Operation(summary = "学员端-查询课程列表", description = "可根据分类、难度、专题进行检索,三个参数可任意传递其中之一、之二或全部,每个参数可传递多个值,用英文逗号分割,不传参或传递all则查询所有课程,携带讲师信息")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<List<CourseWithTeacherInfo>> queryCourseList(
|
||||||
|
@RequestParam(value = "categoryId", required = false) String categoryId,
|
||||||
|
@RequestParam(value = "difficulty", required = false) String difficulty,
|
||||||
|
@RequestParam(value = "subject", required = false) String topic,
|
||||||
|
@RequestParam(value = "sort", required = false) String sort) {
|
||||||
|
List<CourseWithTeacherInfo> list = aiolCourseService.getCourseList(categoryId, difficulty, topic);
|
||||||
|
if (sort != null) {
|
||||||
|
switch (sort) {
|
||||||
|
case "hottest":
|
||||||
|
list = list.stream()
|
||||||
|
.sorted(Comparator.comparing(AiolCourse::getEnrollCount, Comparator.nullsLast(Integer::compareTo)).reversed())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
break;
|
||||||
|
case "latest":
|
||||||
|
list = list.stream()
|
||||||
|
.sorted(Comparator.comparing(AiolCourse::getCreateTime, Comparator.nullsLast(java.util.Date::compareTo)).reversed())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
break;
|
||||||
|
case "recommend":
|
||||||
|
default:
|
||||||
|
// 不处理,直接返回
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@Operation(summary = "查询课程详情", description = "根据课程ID查询课程详情")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<AiolCourse> queryCourseDetail(@RequestParam(value = "id") String id) {
|
||||||
|
AiolCourse course = aiolCourseService.getById(id);
|
||||||
|
return Result.OK(course);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/subject/list")
|
||||||
|
@Operation(summary = "查询课程专题列表", description = "返回字典值")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<List<LabelValue>> querySubjectList() {
|
||||||
|
List<DictModel> list = sysBaseApi.getDictItems("course_subject");
|
||||||
|
List<LabelValue> simple = list.stream()
|
||||||
|
.map(d -> new LabelValue(d.getValue(), d.getLabel() != null ? d.getLabel() : d.getText()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
return Result.OK(simple);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仅返回 value、label 的简单对象
|
||||||
|
*/
|
||||||
|
private static record LabelValue(String value, String label) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/difficulty/list")
|
||||||
|
@Operation(summary = "查询课程难度列表", description = "返回字典值")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<List<LabelValue>> queryDifficultyList() {
|
||||||
|
List<DictModel> list = sysBaseApi.getDictItems("course_difficulty");
|
||||||
|
List<LabelValue> simple = list.stream()
|
||||||
|
.map(d -> new LabelValue(d.getValue(), d.getLabel() != null ? d.getLabel() : d.getText()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
return Result.OK(simple);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/category/list")
|
||||||
|
@Operation(summary = "查询课程分类列表", description = "根据sortOrder降序排序")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<List<AiolCourseCategory>> queryCategoryList() {
|
||||||
|
List<AiolCourseCategory> list = aiolCourseService.getCourseCategoryList();
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/{courseId}/section")
|
||||||
|
@Operation(summary = "查询课程章节列表", description = "根据课程id查询章节列表,type表示章节类型:0=视频、1=资料、2=考试、3=作业;level表示章节层级,0=一级章节、1=二级章节,通过parentId记录父子关系,前端需自行组织树形结构;当前层级的顺序通过sortOrder排序")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<List<AiolCourseSection>> querySectionList(@PathVariable(value = "courseId") String courseId) {
|
||||||
|
List<AiolCourseSection> list = aiolCourseService.getCourseSectionList(courseId);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/{courseId}/section_video/{sectionId}")
|
||||||
|
@Operation(summary = "查询视频章节详情", description = "该接口需要携带用户登录token。根据章节id查询章节详情,不同类型的章节,返回的内容不同")
|
||||||
|
public Result<List<AiolResource>> querySectionDetail(@PathVariable(value = "courseId") String courseId, @PathVariable(value = "sectionId") String sectionId) {
|
||||||
|
// TODO GC 获取用户id,根据courseId判断当前用户是否报名课程,只有已报名的课程才能查看章节详情
|
||||||
|
|
||||||
|
List<AiolResource> list = aiolCourseService.getCourseSectionDetail(0, sectionId, AiolResource.class);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/{courseId}/section_document/{sectionId}")
|
||||||
|
@Operation(summary = "查询文档章节详情", description = "该接口需要携带用户登录token。根据章节id查询章节详情,不同类型的章节,返回的内容不同")
|
||||||
|
public Result<List<AiolResource>> querySectionDocumentDetail(@PathVariable(value = "courseId") String courseId, @PathVariable(value = "sectionId") String sectionId) {
|
||||||
|
// TODO GC 获取用户id,根据courseId判断当前用户是否报名课程,只有已报名的课程才能查看章节详情
|
||||||
|
|
||||||
|
List<AiolResource> list = aiolCourseService.getCourseSectionDetail(1, sectionId, AiolResource.class);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/{courseId}/section_homework/{sectionId}")
|
||||||
|
@Operation(summary = "查询作业章节详情", description = "该接口需要携带用户登录token。根据章节id查询章节详情,不同类型的章节,返回的内容不同")
|
||||||
|
public Result<List<AiolHomework>> querySectionHomeworkDetail(@PathVariable(value = "courseId") String courseId, @PathVariable(value = "sectionId") String sectionId) {
|
||||||
|
// TODO GC 获取用户id,根据courseId判断当前用户是否报名课程,只有已报名的课程才能查看章节详情
|
||||||
|
|
||||||
|
List<AiolHomework> list = aiolCourseService.getCourseSectionDetail(3, sectionId, AiolHomework.class);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/{courseId}/teachers")
|
||||||
|
@Operation(summary = "查询课程的授课教师")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<List<TeacherInfo>> queryTeacherList(@PathVariable(value = "courseId") String courseId) {
|
||||||
|
List<TeacherInfo> list = aiolCourseService.getCourseTeacherList(courseId);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/{courseId}/enroll")
|
||||||
|
@Operation(summary = "报名课程", description = "该接口需要携带用户登录token。根据课程id报名课程。返回值为报名结果,报名成功返回success")
|
||||||
|
public Result<String> enrollCourse(@PathVariable(value = "courseId") String courseId, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN);
|
||||||
|
String username = JwtUtil.getUsername(token);
|
||||||
|
LoginUser sysUser = sysBaseApi.getUserByName(username);
|
||||||
|
String result = aiolCourseService.enrollCourse(courseId, sysUser.getId());
|
||||||
|
return Result.OK(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/{courseId}/is_enrolled")
|
||||||
|
@Operation(summary = "查询课程是否已报名", description = "该接口需要携带用户登录token。根据课程id查询课程是否已报名。判断返回值的result是否为true")
|
||||||
|
public Result<Boolean> isEnrolled(@PathVariable(value = "courseId") String courseId, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN);
|
||||||
|
String username = JwtUtil.getUsername(token);
|
||||||
|
LoginUser sysUser = sysBaseApi.getUserByName(username);
|
||||||
|
|
||||||
|
boolean isEnrolled = aiolCourseService.isEnrolled(courseId, sysUser.getId());
|
||||||
|
return Result.OK(isEnrolled);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/teacher_list")
|
||||||
|
@Operation(summary = "查询当前教师创建的课程")
|
||||||
|
public Result<List<AiolCourse>> queryTeacherCourseList(
|
||||||
|
@RequestParam(value = "keyword", required = false) String keyword,
|
||||||
|
@RequestParam(value = "status", required = false) Integer status,
|
||||||
|
HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN);
|
||||||
|
String username = JwtUtil.getUsername(token);
|
||||||
|
LoginUser sysUser = sysBaseApi.getUserByName(username);
|
||||||
|
|
||||||
|
QueryWrapper<AiolCourse> wrapper = new QueryWrapper<AiolCourse>().eq("create_by", sysUser.getUsername());
|
||||||
|
|
||||||
|
// 课程名关键词检索
|
||||||
|
if (keyword != null && !keyword.trim().isEmpty()) {
|
||||||
|
wrapper.like("name", keyword.trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 状态检索:0 未开始;1进行中;2已结束
|
||||||
|
if (status != null) {
|
||||||
|
wrapper.eq("status", status);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<AiolCourse> list = aiolCourseService.list(wrapper);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/{courseId}/add_students")
|
||||||
|
@Operation(summary = "批量导入学生", description = "请求体为JSON格式,包含ids字段,ids为逗号分隔的学生ID字符串")
|
||||||
|
public Result<Map<String, Object>> addStudents(@PathVariable(value = "courseId") String courseId, @RequestBody Map<String, Object> requestBody, HttpServletRequest request) {
|
||||||
|
String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN);
|
||||||
|
String username = JwtUtil.getUsername(token);
|
||||||
|
LoginUser sysUser = sysBaseApi.getUserByName(username);
|
||||||
|
|
||||||
|
// 从Map中获取ids字段
|
||||||
|
String ids = (String) requestBody.get("ids");
|
||||||
|
if (ids == null || ids.trim().isEmpty()) {
|
||||||
|
return Result.error("ids字段不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.OK(aiolCourseService.addStudents(courseId, ids, sysUser));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/{courseId}/progress")
|
||||||
|
@Operation(summary = "查询课程学习进度")
|
||||||
|
public Result<Map<String, Object>> queryCourseProgress(@PathVariable(value = "courseId") String courseId, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN);
|
||||||
|
String username = JwtUtil.getUsername(token);
|
||||||
|
LoginUser sysUser = sysBaseApi.getUserByName(username);
|
||||||
|
|
||||||
|
Map<String, Object> progress = aiolCourseService.getCourseProgress(courseId, sysUser.getId());
|
||||||
|
return Result.OK(progress);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/count")
|
||||||
|
@Operation(summary = "查询课程总数", description = "返回系统中所有课程的总数量")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<Long> queryCourseCount() {
|
||||||
|
long count = aiolCourseService.count();
|
||||||
|
return Result.OK(count);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/test")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<String> test() {
|
||||||
|
return Result.OK("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/test2")
|
||||||
|
public Result<String> test2(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN);
|
||||||
|
String username = JwtUtil.getUsername(token);
|
||||||
|
LoginUser sysUser = sysBaseApi.getUserByName(username);
|
||||||
|
return Result.OK(sysUser.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/test3")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<Long> test3() {
|
||||||
|
long count = aiolCourseService.count();
|
||||||
|
return Result.OK(count);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,182 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolCourseSection;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolCourseSectionService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 课程章节
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="课程章节")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolCourseSection")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolCourseSectionController extends JeecgController<AiolCourseSection, IAiolCourseSectionService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolCourseSectionService aiolCourseSectionService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolCourseSection
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "课程章节-分页列表查询")
|
||||||
|
@Operation(summary="课程章节-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolCourseSection>> queryPageList(AiolCourseSection aiolCourseSection,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolCourseSection> queryWrapper = QueryGenerator.initQueryWrapper(aiolCourseSection, req.getParameterMap());
|
||||||
|
Page<AiolCourseSection> page = new Page<AiolCourseSection>(pageNo, pageSize);
|
||||||
|
IPage<AiolCourseSection> pageList = aiolCourseSectionService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolCourseSection
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "课程章节-添加")
|
||||||
|
@Operation(summary="课程章节-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_course_section:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolCourseSection aiolCourseSection) {
|
||||||
|
aiolCourseSectionService.save(aiolCourseSection);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolCourseSection
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "课程章节-编辑")
|
||||||
|
@Operation(summary="课程章节-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_course_section:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolCourseSection aiolCourseSection) {
|
||||||
|
aiolCourseSectionService.updateById(aiolCourseSection);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "课程章节-通过id删除")
|
||||||
|
@Operation(summary="课程章节-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_course_section:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolCourseSectionService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "课程章节-批量删除")
|
||||||
|
@Operation(summary="课程章节-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_course_section:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolCourseSectionService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "课程章节-通过id查询")
|
||||||
|
@Operation(summary="课程章节-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolCourseSection> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolCourseSection aiolCourseSection = aiolCourseSectionService.getById(id);
|
||||||
|
if(aiolCourseSection==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolCourseSection);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolCourseSection
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_course_section:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolCourseSection aiolCourseSection) {
|
||||||
|
return super.exportXls(request, aiolCourseSection, AiolCourseSection.class, "课程章节");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_course_section:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolCourseSection.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,182 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolCourseSignup;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolCourseSignupService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 课程报名
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="课程报名")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolCourseSignup")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolCourseSignupController extends JeecgController<AiolCourseSignup, IAiolCourseSignupService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolCourseSignupService aiolCourseSignupService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolCourseSignup
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "课程报名-分页列表查询")
|
||||||
|
@Operation(summary="课程报名-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolCourseSignup>> queryPageList(AiolCourseSignup aiolCourseSignup,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolCourseSignup> queryWrapper = QueryGenerator.initQueryWrapper(aiolCourseSignup, req.getParameterMap());
|
||||||
|
Page<AiolCourseSignup> page = new Page<AiolCourseSignup>(pageNo, pageSize);
|
||||||
|
IPage<AiolCourseSignup> pageList = aiolCourseSignupService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolCourseSignup
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "课程报名-添加")
|
||||||
|
@Operation(summary="课程报名-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_course_signup:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolCourseSignup aiolCourseSignup) {
|
||||||
|
aiolCourseSignupService.save(aiolCourseSignup);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolCourseSignup
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "课程报名-编辑")
|
||||||
|
@Operation(summary="课程报名-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_course_signup:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolCourseSignup aiolCourseSignup) {
|
||||||
|
aiolCourseSignupService.updateById(aiolCourseSignup);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "课程报名-通过id删除")
|
||||||
|
@Operation(summary="课程报名-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_course_signup:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolCourseSignupService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "课程报名-批量删除")
|
||||||
|
@Operation(summary="课程报名-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_course_signup:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolCourseSignupService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "课程报名-通过id查询")
|
||||||
|
@Operation(summary="课程报名-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolCourseSignup> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolCourseSignup aiolCourseSignup = aiolCourseSignupService.getById(id);
|
||||||
|
if(aiolCourseSignup==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolCourseSignup);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolCourseSignup
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_course_signup:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolCourseSignup aiolCourseSignup) {
|
||||||
|
return super.exportXls(request, aiolCourseSignup, AiolCourseSignup.class, "课程报名");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_course_signup:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolCourseSignup.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,182 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolCourseTeacher;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolCourseTeacherService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 授课教师
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="授课教师")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolCourseTeacher")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolCourseTeacherController extends JeecgController<AiolCourseTeacher, IAiolCourseTeacherService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolCourseTeacherService aiolCourseTeacherService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolCourseTeacher
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "授课教师-分页列表查询")
|
||||||
|
@Operation(summary="授课教师-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolCourseTeacher>> queryPageList(AiolCourseTeacher aiolCourseTeacher,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolCourseTeacher> queryWrapper = QueryGenerator.initQueryWrapper(aiolCourseTeacher, req.getParameterMap());
|
||||||
|
Page<AiolCourseTeacher> page = new Page<AiolCourseTeacher>(pageNo, pageSize);
|
||||||
|
IPage<AiolCourseTeacher> pageList = aiolCourseTeacherService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolCourseTeacher
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "授课教师-添加")
|
||||||
|
@Operation(summary="授课教师-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_course_teacher:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolCourseTeacher aiolCourseTeacher) {
|
||||||
|
aiolCourseTeacherService.save(aiolCourseTeacher);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolCourseTeacher
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "授课教师-编辑")
|
||||||
|
@Operation(summary="授课教师-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_course_teacher:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolCourseTeacher aiolCourseTeacher) {
|
||||||
|
aiolCourseTeacherService.updateById(aiolCourseTeacher);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "授课教师-通过id删除")
|
||||||
|
@Operation(summary="授课教师-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_course_teacher:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolCourseTeacherService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "授课教师-批量删除")
|
||||||
|
@Operation(summary="授课教师-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_course_teacher:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolCourseTeacherService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "授课教师-通过id查询")
|
||||||
|
@Operation(summary="授课教师-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolCourseTeacher> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolCourseTeacher aiolCourseTeacher = aiolCourseTeacherService.getById(id);
|
||||||
|
if(aiolCourseTeacher==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolCourseTeacher);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolCourseTeacher
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_course_teacher:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolCourseTeacher aiolCourseTeacher) {
|
||||||
|
return super.exportXls(request, aiolCourseTeacher, AiolCourseTeacher.class, "授课教师");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_course_teacher:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolCourseTeacher.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,182 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolEntityLink;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolEntityLinkService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 主体绑定
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="主体绑定")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolEntityLink")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolEntityLinkController extends JeecgController<AiolEntityLink, IAiolEntityLinkService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolEntityLinkService aiolEntityLinkService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolEntityLink
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "主体绑定-分页列表查询")
|
||||||
|
@Operation(summary="主体绑定-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolEntityLink>> queryPageList(AiolEntityLink aiolEntityLink,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolEntityLink> queryWrapper = QueryGenerator.initQueryWrapper(aiolEntityLink, req.getParameterMap());
|
||||||
|
Page<AiolEntityLink> page = new Page<AiolEntityLink>(pageNo, pageSize);
|
||||||
|
IPage<AiolEntityLink> pageList = aiolEntityLinkService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolEntityLink
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "主体绑定-添加")
|
||||||
|
@Operation(summary="主体绑定-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_entity_link:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolEntityLink aiolEntityLink) {
|
||||||
|
aiolEntityLinkService.save(aiolEntityLink);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolEntityLink
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "主体绑定-编辑")
|
||||||
|
@Operation(summary="主体绑定-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_entity_link:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolEntityLink aiolEntityLink) {
|
||||||
|
aiolEntityLinkService.updateById(aiolEntityLink);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "主体绑定-通过id删除")
|
||||||
|
@Operation(summary="主体绑定-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_entity_link:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolEntityLinkService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "主体绑定-批量删除")
|
||||||
|
@Operation(summary="主体绑定-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_entity_link:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolEntityLinkService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "主体绑定-通过id查询")
|
||||||
|
@Operation(summary="主体绑定-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolEntityLink> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolEntityLink aiolEntityLink = aiolEntityLinkService.getById(id);
|
||||||
|
if(aiolEntityLink==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolEntityLink);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolEntityLink
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_entity_link:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolEntityLink aiolEntityLink) {
|
||||||
|
return super.exportXls(request, aiolEntityLink, AiolEntityLink.class, "主体绑定");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_entity_link:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolEntityLink.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,182 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolExamAnswer;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolExamAnswerService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 考试答题
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="考试答题")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolExamAnswer")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolExamAnswerController extends JeecgController<AiolExamAnswer, IAiolExamAnswerService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolExamAnswerService aiolExamAnswerService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolExamAnswer
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "考试答题-分页列表查询")
|
||||||
|
@Operation(summary="考试答题-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolExamAnswer>> queryPageList(AiolExamAnswer aiolExamAnswer,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolExamAnswer> queryWrapper = QueryGenerator.initQueryWrapper(aiolExamAnswer, req.getParameterMap());
|
||||||
|
Page<AiolExamAnswer> page = new Page<AiolExamAnswer>(pageNo, pageSize);
|
||||||
|
IPage<AiolExamAnswer> pageList = aiolExamAnswerService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolExamAnswer
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "考试答题-添加")
|
||||||
|
@Operation(summary="考试答题-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_exam_answer:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolExamAnswer aiolExamAnswer) {
|
||||||
|
aiolExamAnswerService.save(aiolExamAnswer);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolExamAnswer
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "考试答题-编辑")
|
||||||
|
@Operation(summary="考试答题-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_exam_answer:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolExamAnswer aiolExamAnswer) {
|
||||||
|
aiolExamAnswerService.updateById(aiolExamAnswer);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "考试答题-通过id删除")
|
||||||
|
@Operation(summary="考试答题-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_exam_answer:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolExamAnswerService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "考试答题-批量删除")
|
||||||
|
@Operation(summary="考试答题-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_exam_answer:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolExamAnswerService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "考试答题-通过id查询")
|
||||||
|
@Operation(summary="考试答题-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolExamAnswer> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolExamAnswer aiolExamAnswer = aiolExamAnswerService.getById(id);
|
||||||
|
if(aiolExamAnswer==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolExamAnswer);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolExamAnswer
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_exam_answer:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolExamAnswer aiolExamAnswer) {
|
||||||
|
return super.exportXls(request, aiolExamAnswer, AiolExamAnswer.class, "考试答题");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_exam_answer:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolExamAnswer.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,572 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.entity.*;
|
||||||
|
import org.jeecg.modules.aiol.service.*;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 考试
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="考试")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolExam")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolExamController extends JeecgController<AiolExam, IAiolExamService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolExamService aiolExamService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolExam
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "考试-分页列表查询")
|
||||||
|
@Operation(summary="考试-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolExam>> queryPageList(AiolExam aiolExam,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolExam> queryWrapper = QueryGenerator.initQueryWrapper(aiolExam, req.getParameterMap());
|
||||||
|
Page<AiolExam> page = new Page<AiolExam>(pageNo, pageSize);
|
||||||
|
IPage<AiolExam> pageList = aiolExamService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolExam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "考试-添加")
|
||||||
|
@Operation(summary="考试-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_exam:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolExam aiolExam) {
|
||||||
|
aiolExamService.save(aiolExam);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolExam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "考试-编辑")
|
||||||
|
@Operation(summary="考试-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_exam:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolExam aiolExam) {
|
||||||
|
aiolExamService.updateById(aiolExam);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "考试-通过id删除")
|
||||||
|
@Operation(summary="考试-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_exam:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolExamService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "考试-批量删除")
|
||||||
|
@Operation(summary="考试-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_exam:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolExamService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "考试-通过id查询")
|
||||||
|
@Operation(summary="考试-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolExam> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolExam aiolExam = aiolExamService.getById(id);
|
||||||
|
if(aiolExam==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolExam);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolExam
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_exam:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolExam aiolExam) {
|
||||||
|
return super.exportXls(request, aiolExam, AiolExam.class, "考试");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_exam:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolExam.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IAiolPaperService paperService;
|
||||||
|
@Autowired
|
||||||
|
private IAiolExamService examService;
|
||||||
|
@Autowired
|
||||||
|
private IAiolPaperQuestionService paperQuestionService;
|
||||||
|
@Autowired
|
||||||
|
private IAiolExamAnswerService examAnswerService;
|
||||||
|
@Autowired
|
||||||
|
private IAiolExamRecordService examRecordService;
|
||||||
|
@Autowired
|
||||||
|
private IAiolQuestionService questionService;
|
||||||
|
@Autowired
|
||||||
|
private IAiolQuestionRepoService questionRepoService;
|
||||||
|
@Autowired
|
||||||
|
private IAiolQuestionOptionService questionOptionService;
|
||||||
|
|
||||||
|
//获取考试试题
|
||||||
|
@RequestMapping("/getExamQuestions/{examId}")
|
||||||
|
@Operation(summary = "获取考试试题")
|
||||||
|
@Transactional
|
||||||
|
public Result<?> getExamQuestions(@PathVariable String examId, @RequestParam String studentId) {
|
||||||
|
AiolExam exam = examService.getById(examId);
|
||||||
|
if(exam.getPaperId().isEmpty()){
|
||||||
|
return Result.error("考试未关联试卷");
|
||||||
|
}
|
||||||
|
AiolPaper paper = paperService.getById(exam.getPaperId());
|
||||||
|
//题目id集合
|
||||||
|
List<String> questionIds;
|
||||||
|
List<AiolPaperQuestion> paperQuestions = new ArrayList<>();
|
||||||
|
//随机组卷
|
||||||
|
if(paper.getGenerateMode()==1){
|
||||||
|
List<AiolQuestionRepo> list = questionRepoService.list(
|
||||||
|
new LambdaQueryWrapper<AiolQuestionRepo>().
|
||||||
|
eq(AiolQuestionRepo::getRepoId, paper.getRepoId())
|
||||||
|
);
|
||||||
|
//筛选试卷
|
||||||
|
questionIds = random(list, paper.getRules());
|
||||||
|
}else {
|
||||||
|
//固定组卷
|
||||||
|
// 获取试卷中的试题关联信息
|
||||||
|
paperQuestions = paperQuestionService.getQuestions(paper.getId());
|
||||||
|
|
||||||
|
// 如果没有试题关联信息,直接返回空列表
|
||||||
|
if (CollectionUtils.isEmpty(paperQuestions)) {
|
||||||
|
return Result.OK("试卷中没有试题");
|
||||||
|
}
|
||||||
|
// 提取所有试题ID
|
||||||
|
questionIds = paperQuestions.stream()
|
||||||
|
.map(AiolPaperQuestion::getQuestionId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isEmpty(questionIds)) {
|
||||||
|
return Result.OK("试卷中没有试题");
|
||||||
|
}
|
||||||
|
// 从题目表查询试题内容
|
||||||
|
List<AiolQuestion> questions = questionService.listByIds(questionIds);
|
||||||
|
|
||||||
|
List<AiolQuestion> sortedQuestions = questions;
|
||||||
|
// 将试题内容按试卷中的顺序排序
|
||||||
|
if(paper.getGenerateMode()==0){
|
||||||
|
Map<String, AiolQuestion> questionMap = questions.stream()
|
||||||
|
.collect(Collectors.toMap(AiolQuestion::getId, question -> question));
|
||||||
|
sortedQuestions = paperQuestions.stream()
|
||||||
|
.sorted(Comparator.comparing(AiolPaperQuestion::getOrderNo))
|
||||||
|
.map(paperQuestion -> questionMap.get(paperQuestion.getQuestionId()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
//获取复选题id
|
||||||
|
List<String> type5Ids = sortedQuestions.stream()
|
||||||
|
.filter(question -> question.getType() == 5)
|
||||||
|
.map(AiolQuestion::getId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
//获取复选题所包含的题目
|
||||||
|
List<AiolQuestion> type5Questions = new ArrayList<>();
|
||||||
|
if (!type5Ids.isEmpty()) {
|
||||||
|
type5Questions = questionService.list(
|
||||||
|
new LambdaQueryWrapper<AiolQuestion>()
|
||||||
|
.in(AiolQuestion::getParentId, type5Ids)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// 创建一个映射,用于快速查找父ID对应的子题目
|
||||||
|
Map<String, List<AiolQuestion>> parentToChildrenMap = type5Questions.stream()
|
||||||
|
.collect(Collectors.groupingBy(AiolQuestion::getParentId));
|
||||||
|
|
||||||
|
// 将子题目添加到原始列表中,保持原有顺序
|
||||||
|
List<AiolQuestion> resultQuestions = new ArrayList<>();
|
||||||
|
for (AiolQuestion question : questions) {
|
||||||
|
resultQuestions.add(question);
|
||||||
|
if (question.getType() == 5) {
|
||||||
|
List<AiolQuestion> children = parentToChildrenMap.getOrDefault(question.getId(), Collections.emptyList());
|
||||||
|
resultQuestions.addAll(children);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//创建考试答题初始化记录
|
||||||
|
List<AiolExamAnswer> examAnswerList = new ArrayList<>();
|
||||||
|
for (AiolQuestion resultQuestion : resultQuestions) {
|
||||||
|
AiolExamAnswer examAnswer = new AiolExamAnswer();
|
||||||
|
examAnswer.setExamId(examId);
|
||||||
|
examAnswer.setUserId(studentId);
|
||||||
|
if (resultQuestion != null && StringUtils.isNotEmpty(resultQuestion.getParentId())) {
|
||||||
|
examAnswer.setParentQuestionId(resultQuestion.getParentId());
|
||||||
|
}
|
||||||
|
examAnswer.setQuestionId(resultQuestion.getId());
|
||||||
|
examAnswerList.add(examAnswer);
|
||||||
|
}
|
||||||
|
examAnswerService.saveBatch(examAnswerList);
|
||||||
|
//创建考试记录
|
||||||
|
AiolExamRecord examRecord = new AiolExamRecord();
|
||||||
|
examRecord.setExamId(examId);
|
||||||
|
examRecord.setUserId(studentId);
|
||||||
|
examRecord.setStatus(0);
|
||||||
|
examRecordService.save(examRecord);
|
||||||
|
// 返回排序后的试题总列表
|
||||||
|
return Result.OK(resultQuestions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/submitAnswer")
|
||||||
|
@Operation(summary = "提交答案")
|
||||||
|
public Result<?> submitAnswer(@RequestBody AiolExamAnswer examAnswer) {
|
||||||
|
// 创建查询条件
|
||||||
|
LambdaUpdateWrapper<AiolExamAnswer> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.eq(AiolExamAnswer::getExamId, examAnswer.getExamId())
|
||||||
|
.eq(AiolExamAnswer::getUserId, examAnswer.getUserId())
|
||||||
|
.eq(AiolExamAnswer::getQuestionId, examAnswer.getQuestionId());
|
||||||
|
|
||||||
|
// 更新答案
|
||||||
|
if (examAnswer.getAnswer() != null) {
|
||||||
|
updateWrapper.set(AiolExamAnswer::getAnswer, examAnswer.getAnswer());
|
||||||
|
}
|
||||||
|
// 执行更新
|
||||||
|
return examAnswerService.update(updateWrapper) ? Result.OK() : Result.error("提交答案失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/submitExam")
|
||||||
|
@Operation(summary = "提交考试")
|
||||||
|
@Transactional
|
||||||
|
public Result<?> submitExam(@RequestBody AiolExamRecord examRecord,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
examRecord.setIpAddress(getClientIp(req));
|
||||||
|
examRecord.setDeviceInfo(getDeviceInfo(req));
|
||||||
|
//修改状态
|
||||||
|
examRecord.setStatus(1);
|
||||||
|
// 创建更新条件
|
||||||
|
LambdaUpdateWrapper<AiolExamRecord> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.eq(AiolExamRecord::getExamId, examRecord.getExamId())
|
||||||
|
.eq(AiolExamRecord::getUserId, examRecord.getUserId());
|
||||||
|
// 更新ip
|
||||||
|
if (examRecord.getIpAddress() != null) {
|
||||||
|
updateWrapper.set(AiolExamRecord::getIpAddress, examRecord.getIpAddress());
|
||||||
|
}
|
||||||
|
// 更新设备信息
|
||||||
|
if (examRecord.getDeviceInfo() != null) {
|
||||||
|
updateWrapper.set(AiolExamRecord::getDeviceInfo, examRecord.getDeviceInfo());
|
||||||
|
}
|
||||||
|
// 阅卷
|
||||||
|
List<AiolExamAnswer> gradedAnswers = gradeExam(examRecord.getExamId(), examRecord.getUserId());
|
||||||
|
examAnswerService.updateBatchById(gradedAnswers);
|
||||||
|
// 更新考试状态,提交时间
|
||||||
|
updateWrapper.
|
||||||
|
set(AiolExamRecord::getStatus,1).
|
||||||
|
set(AiolExamRecord::getSubmittedAt, new Date());
|
||||||
|
// 更新
|
||||||
|
return examRecordService.update(updateWrapper) ? Result.OK() : Result.error("提交考试失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/queryExamProgress")
|
||||||
|
@Operation(summary = "查询考试进度")
|
||||||
|
public Result<?> queryExamProgress(@RequestParam String examId, @RequestParam String userId) {
|
||||||
|
AiolExam byId = examService.getById(examId);
|
||||||
|
if(byId == null){
|
||||||
|
return Result.error("考试不存在");
|
||||||
|
}
|
||||||
|
//判断考试结束时间
|
||||||
|
if(byId.getEndTime().before(new Date())){
|
||||||
|
return Result.error("考试已结束");
|
||||||
|
}
|
||||||
|
AiolExamRecord one = examRecordService.getOne(
|
||||||
|
new LambdaQueryWrapper<AiolExamRecord>()
|
||||||
|
.eq(AiolExamRecord::getExamId, examId)
|
||||||
|
.eq(AiolExamRecord::getUserId, userId)
|
||||||
|
);
|
||||||
|
if(one == null){
|
||||||
|
return Result.error("用户暂未考试,可获取考试题目");
|
||||||
|
}
|
||||||
|
return Result.OK(examAnswerService.
|
||||||
|
list(new LambdaQueryWrapper<AiolExamAnswer>().
|
||||||
|
eq(AiolExamAnswer::getExamId, examId).
|
||||||
|
eq(AiolExamAnswer::getUserId, userId))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据考试规则随机组卷
|
||||||
|
public List<String> random(List<AiolQuestionRepo> list, String rules) {
|
||||||
|
JSONObject ruleJson = JSON.parseObject(rules);
|
||||||
|
|
||||||
|
// 根据规则筛选和随机抽取题目
|
||||||
|
Map<Integer, List<String>> typeQuestions = new HashMap<>();
|
||||||
|
|
||||||
|
// 先按题目类型分组
|
||||||
|
list.forEach(qr -> {
|
||||||
|
AiolQuestion question = questionService.getById(qr.getQuestionId());
|
||||||
|
if (!typeQuestions.containsKey(question.getType())) {
|
||||||
|
typeQuestions.put(question.getType(), new ArrayList<>());
|
||||||
|
}
|
||||||
|
typeQuestions.get(question.getType()).add(question.getId());
|
||||||
|
});
|
||||||
|
|
||||||
|
// 根据规则随机抽取题目
|
||||||
|
List<String> questionIds = new ArrayList<>();
|
||||||
|
for (Integer type : typeQuestions.keySet()) {
|
||||||
|
int count = ruleJson.getInteger("type"+type + "_count"); // 例如:single_choice_count
|
||||||
|
List<String> typeQuestionIds = typeQuestions.get(type);
|
||||||
|
|
||||||
|
// 随机抽取指定数量的题目
|
||||||
|
if (typeQuestionIds.size() <= count) {
|
||||||
|
questionIds.addAll(typeQuestionIds);
|
||||||
|
} else {
|
||||||
|
// 打乱顺序后取前count个
|
||||||
|
Collections.shuffle(typeQuestionIds);
|
||||||
|
questionIds.addAll(typeQuestionIds.subList(0, count));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return questionIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取ip信息
|
||||||
|
public String getClientIp(HttpServletRequest request) {
|
||||||
|
String ip = request.getHeader("X-Forwarded-For");
|
||||||
|
|
||||||
|
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||||
|
ip = request.getHeader("Proxy-Client-IP");
|
||||||
|
}
|
||||||
|
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||||
|
ip = request.getHeader("WL-Proxy-Client-IP");
|
||||||
|
}
|
||||||
|
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||||
|
ip = request.getHeader("HTTP_CLIENT_IP");
|
||||||
|
}
|
||||||
|
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||||
|
ip = request.getHeader("HTTP_X_FORWARDED_FOR");
|
||||||
|
}
|
||||||
|
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||||
|
ip = request.getRemoteAddr();
|
||||||
|
}
|
||||||
|
// 对于通过多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割
|
||||||
|
if (ip != null && ip.contains(",")) {
|
||||||
|
ip = ip.split(",")[0].trim();
|
||||||
|
}
|
||||||
|
return ip;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量阅卷
|
||||||
|
* @param examId 考试ID
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 阅卷后的答题列表
|
||||||
|
*/
|
||||||
|
private List<AiolExamAnswer> gradeExam(String examId, String userId) {
|
||||||
|
// 获取学生的答题列表
|
||||||
|
List<AiolExamAnswer> examAnswerList = examAnswerService.list(new LambdaQueryWrapper<AiolExamAnswer>()
|
||||||
|
.eq(AiolExamAnswer::getExamId, examId)
|
||||||
|
.eq(AiolExamAnswer::getUserId, userId)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 提取所有题目ID
|
||||||
|
List<String> questionIds = examAnswerList.stream()
|
||||||
|
.map(AiolExamAnswer::getQuestionId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 查询题目
|
||||||
|
List<AiolQuestion> questions = questionService.list(new LambdaQueryWrapper<AiolQuestion>()
|
||||||
|
.in(AiolQuestion::getId, questionIds)
|
||||||
|
.lt(AiolQuestion::getType, 3)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 创建题目ID到题目的映射
|
||||||
|
Map<String, AiolQuestion> questionMap = questions.stream()
|
||||||
|
.collect(Collectors.toMap(AiolQuestion::getId, question -> question));
|
||||||
|
|
||||||
|
// 获取 选择、多选、判断 题目ID列表
|
||||||
|
List<String> questionIdsFromQuestions = questions.stream()
|
||||||
|
.map(AiolQuestion::getId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 查询这些题目的正确选项
|
||||||
|
List<AiolQuestionOption> questionOptions = questionOptionService.list(new LambdaQueryWrapper<AiolQuestionOption>()
|
||||||
|
.in(AiolQuestionOption::getQuestionId, questionIdsFromQuestions)
|
||||||
|
.eq(AiolQuestionOption::getIzCorrent, 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 将选项转换为Map,结构为:题目ID -> 正确答案选项ID列表
|
||||||
|
Map<String, List<String>> correctAnswerMap = questionOptions.stream()
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
AiolQuestionOption::getQuestionId,
|
||||||
|
Collectors.mapping(AiolQuestionOption::getId, Collectors.toList())
|
||||||
|
));
|
||||||
|
|
||||||
|
// 遍历学生的答案,进行评分
|
||||||
|
for (AiolExamAnswer examAnswer : examAnswerList) {
|
||||||
|
String studentAnswer = examAnswer.getAnswer();
|
||||||
|
AiolQuestion question = questionMap.get(examAnswer.getQuestionId());
|
||||||
|
List<String> correctAnswers = correctAnswerMap.get(examAnswer.getQuestionId());
|
||||||
|
|
||||||
|
// 比较答案并设置分数
|
||||||
|
if (studentAnswer != null && question != null && correctAnswers != null) {
|
||||||
|
// 将学生答案按逗号分割成列表
|
||||||
|
List<String> studentAnswers = Arrays.asList(studentAnswer.split(","));
|
||||||
|
double score = 0.0;
|
||||||
|
|
||||||
|
// 根据题目类型进行评分
|
||||||
|
if (question.getType() == 1 || question.getType() == 2) { // 单选题或判断题
|
||||||
|
if (studentAnswers.get(0).equals(correctAnswers.get(0))) {
|
||||||
|
score = question.getScore(); // 使用题目设定的分值
|
||||||
|
}
|
||||||
|
} else if (question.getType() == 3) { // 多选题
|
||||||
|
// 检查学生答案数量是否正确
|
||||||
|
if (studentAnswers.size() == correctAnswers.size()) {
|
||||||
|
// 检查每个答案是否都正确
|
||||||
|
boolean allCorrect = studentAnswers.stream()
|
||||||
|
.allMatch(correctAnswers::contains);
|
||||||
|
|
||||||
|
if (allCorrect) {
|
||||||
|
score = question.getScore(); // 使用题目设定的分值
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
examAnswer.setIzCorrect(score> 0.0 ? 1 : 0);
|
||||||
|
examAnswer.setScore(score);
|
||||||
|
} else {
|
||||||
|
examAnswer.setScore(0.0); // 答案为空或题目不存在
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return examAnswerList;
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取设备信息
|
||||||
|
public String getDeviceInfo(HttpServletRequest request) {
|
||||||
|
// 获取User-Agent
|
||||||
|
String userAgent = request.getHeader("User-Agent");
|
||||||
|
// 解析设备信息
|
||||||
|
String deviceInfo = parseDeviceInfo(userAgent);
|
||||||
|
return deviceInfo;
|
||||||
|
}
|
||||||
|
private String parseDeviceInfo(String userAgent) {
|
||||||
|
if (userAgent == null) {
|
||||||
|
return "Unknown";
|
||||||
|
}
|
||||||
|
StringBuilder deviceInfo = new StringBuilder();
|
||||||
|
// 判断操作系统
|
||||||
|
if (userAgent.indexOf("Windows") > -1) {
|
||||||
|
deviceInfo.append("Windows");
|
||||||
|
} else if (userAgent.indexOf("Mac") > -1) {
|
||||||
|
deviceInfo.append("Mac");
|
||||||
|
} else if (userAgent.indexOf("X11") > -1) {
|
||||||
|
deviceInfo.append("Unix");
|
||||||
|
} else if (userAgent.indexOf("Android") > -1) {
|
||||||
|
deviceInfo.append("Android");
|
||||||
|
} else if (userAgent.indexOf("iPhone") > -1 || userAgent.indexOf("iPad") > -1) {
|
||||||
|
deviceInfo.append("iOS");
|
||||||
|
} else {
|
||||||
|
deviceInfo.append("Unknown OS");
|
||||||
|
}
|
||||||
|
deviceInfo.append(" | ");
|
||||||
|
// 判断浏览器
|
||||||
|
if (userAgent.indexOf("MSIE") > -1) {
|
||||||
|
deviceInfo.append("MSIE");
|
||||||
|
} else if (userAgent.indexOf("Firefox") > -1) {
|
||||||
|
deviceInfo.append("Firefox");
|
||||||
|
} else if (userAgent.indexOf("Chrome") > -1) {
|
||||||
|
deviceInfo.append("Chrome");
|
||||||
|
} else if (userAgent.indexOf("Safari") > -1) {
|
||||||
|
deviceInfo.append("Safari");
|
||||||
|
} else if (userAgent.indexOf("Opera") > -1) {
|
||||||
|
deviceInfo.append("Opera");
|
||||||
|
} else {
|
||||||
|
deviceInfo.append("Unknown Browser");
|
||||||
|
}
|
||||||
|
// 可以添加更多设备信息的判断,如:
|
||||||
|
// 判断是否是移动设备
|
||||||
|
boolean isMobile = userAgent.indexOf("Mobile") > -1 ||
|
||||||
|
userAgent.indexOf("Android") > -1 ||
|
||||||
|
userAgent.indexOf("iPhone") > -1;
|
||||||
|
deviceInfo.append(" | ").append(isMobile ? "Mobile" : "PC");
|
||||||
|
return deviceInfo.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,182 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolExamRecord;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolExamRecordService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 考试记录
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="考试记录")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolExamRecord")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolExamRecordController extends JeecgController<AiolExamRecord, IAiolExamRecordService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolExamRecordService aiolExamRecordService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolExamRecord
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "考试记录-分页列表查询")
|
||||||
|
@Operation(summary="考试记录-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolExamRecord>> queryPageList(AiolExamRecord aiolExamRecord,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolExamRecord> queryWrapper = QueryGenerator.initQueryWrapper(aiolExamRecord, req.getParameterMap());
|
||||||
|
Page<AiolExamRecord> page = new Page<AiolExamRecord>(pageNo, pageSize);
|
||||||
|
IPage<AiolExamRecord> pageList = aiolExamRecordService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolExamRecord
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "考试记录-添加")
|
||||||
|
@Operation(summary="考试记录-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_exam_record:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolExamRecord aiolExamRecord) {
|
||||||
|
aiolExamRecordService.save(aiolExamRecord);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolExamRecord
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "考试记录-编辑")
|
||||||
|
@Operation(summary="考试记录-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_exam_record:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolExamRecord aiolExamRecord) {
|
||||||
|
aiolExamRecordService.updateById(aiolExamRecord);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "考试记录-通过id删除")
|
||||||
|
@Operation(summary="考试记录-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_exam_record:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolExamRecordService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "考试记录-批量删除")
|
||||||
|
@Operation(summary="考试记录-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_exam_record:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolExamRecordService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "考试记录-通过id查询")
|
||||||
|
@Operation(summary="考试记录-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolExamRecord> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolExamRecord aiolExamRecord = aiolExamRecordService.getById(id);
|
||||||
|
if(aiolExamRecord==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolExamRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolExamRecord
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_exam_record:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolExamRecord aiolExamRecord) {
|
||||||
|
return super.exportXls(request, aiolExamRecord, AiolExamRecord.class, "考试记录");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_exam_record:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolExamRecord.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,214 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.dto.StudentSubmitHomework;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolHomework;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolHomeworkSubmit;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolHomeworkService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolHomeworkSubmitService;
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 作业
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name = "作业")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolHomework")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolHomeworkController extends JeecgController<AiolHomework, IAiolHomeworkService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolHomeworkService aiolHomeworkService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolHomework
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "作业-分页列表查询")
|
||||||
|
@Operation(summary = "作业-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolHomework>> queryPageList(AiolHomework aiolHomework,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolHomework> queryWrapper = QueryGenerator.initQueryWrapper(aiolHomework, req.getParameterMap());
|
||||||
|
Page<AiolHomework> page = new Page<AiolHomework>(pageNo, pageSize);
|
||||||
|
IPage<AiolHomework> pageList = aiolHomeworkService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolHomework
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "作业-添加")
|
||||||
|
@Operation(summary = "作业-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_homework:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolHomework aiolHomework) {
|
||||||
|
aiolHomeworkService.save(aiolHomework);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolHomework
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "作业-编辑")
|
||||||
|
@Operation(summary = "作业-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_homework:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolHomework aiolHomework) {
|
||||||
|
aiolHomeworkService.updateById(aiolHomework);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "作业-通过id删除")
|
||||||
|
@Operation(summary = "作业-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_homework:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
aiolHomeworkService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "作业-批量删除")
|
||||||
|
@Operation(summary = "作业-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_homework:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.aiolHomeworkService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "作业-通过id查询")
|
||||||
|
@Operation(summary = "作业-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolHomework> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
AiolHomework aiolHomework = aiolHomeworkService.getById(id);
|
||||||
|
if (aiolHomework == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolHomework);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolHomework
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_homework:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolHomework aiolHomework) {
|
||||||
|
return super.exportXls(request, aiolHomework, AiolHomework.class, "作业");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_homework:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolHomework.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IAiolHomeworkSubmitService homeworkSubmitService;
|
||||||
|
|
||||||
|
@GetMapping("/course/{courseId}")
|
||||||
|
@Operation(summary = "查询课程作业")
|
||||||
|
public Result<List<AiolHomework>> list(@PathVariable String courseId) {
|
||||||
|
return Result.OK(aiolHomeworkService.listByCourseId(courseId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("submit")
|
||||||
|
@Operation(summary = "提交作业")
|
||||||
|
public Result<String> submit(@RequestBody StudentSubmitHomework studentSubmitHomework) {
|
||||||
|
return Result.OK(homeworkSubmitService.submit(studentSubmitHomework) ? "提交成功" : "提交失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("submitted/{studentId}")
|
||||||
|
@Operation(summary = "查询我已提交的作业")
|
||||||
|
public Result<List<AiolHomeworkSubmit>> submitted(@PathVariable String studentId) {
|
||||||
|
return Result.OK(homeworkSubmitService.submitted(studentId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("correct/{homeworkSubmitId}")
|
||||||
|
@Operation(summary = "教师批改作业")
|
||||||
|
public Result<Integer> correct(@PathVariable String homeworkSubmitId, @RequestParam Integer score,
|
||||||
|
@RequestParam String comment, @RequestParam String teacherId) {
|
||||||
|
return Result.OK(homeworkSubmitService.correct(homeworkSubmitId, score, comment, teacherId));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,182 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolHomeworkSubmit;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolHomeworkSubmitService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 作业提交
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="作业提交")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolHomeworkSubmit")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolHomeworkSubmitController extends JeecgController<AiolHomeworkSubmit, IAiolHomeworkSubmitService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolHomeworkSubmitService aiolHomeworkSubmitService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolHomeworkSubmit
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "作业提交-分页列表查询")
|
||||||
|
@Operation(summary="作业提交-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolHomeworkSubmit>> queryPageList(AiolHomeworkSubmit aiolHomeworkSubmit,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolHomeworkSubmit> queryWrapper = QueryGenerator.initQueryWrapper(aiolHomeworkSubmit, req.getParameterMap());
|
||||||
|
Page<AiolHomeworkSubmit> page = new Page<AiolHomeworkSubmit>(pageNo, pageSize);
|
||||||
|
IPage<AiolHomeworkSubmit> pageList = aiolHomeworkSubmitService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolHomeworkSubmit
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "作业提交-添加")
|
||||||
|
@Operation(summary="作业提交-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_homework_submit:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolHomeworkSubmit aiolHomeworkSubmit) {
|
||||||
|
aiolHomeworkSubmitService.save(aiolHomeworkSubmit);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolHomeworkSubmit
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "作业提交-编辑")
|
||||||
|
@Operation(summary="作业提交-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_homework_submit:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolHomeworkSubmit aiolHomeworkSubmit) {
|
||||||
|
aiolHomeworkSubmitService.updateById(aiolHomeworkSubmit);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "作业提交-通过id删除")
|
||||||
|
@Operation(summary="作业提交-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_homework_submit:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolHomeworkSubmitService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "作业提交-批量删除")
|
||||||
|
@Operation(summary="作业提交-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_homework_submit:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolHomeworkSubmitService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "作业提交-通过id查询")
|
||||||
|
@Operation(summary="作业提交-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolHomeworkSubmit> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolHomeworkSubmit aiolHomeworkSubmit = aiolHomeworkSubmitService.getById(id);
|
||||||
|
if(aiolHomeworkSubmit==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolHomeworkSubmit);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolHomeworkSubmit
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_homework_submit:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolHomeworkSubmit aiolHomeworkSubmit) {
|
||||||
|
return super.exportXls(request, aiolHomeworkSubmit, AiolHomeworkSubmit.class, "作业提交");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_homework_submit:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolHomeworkSubmit.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,166 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.config.shiro.IgnoreAuth;
|
||||||
|
import org.jeecg.modules.aiol.dto.CommentWithUserInfo;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolContentConfig;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolCourse;
|
||||||
|
import org.jeecg.modules.aiol.mapper.AiolContentConfigMapper;
|
||||||
|
import org.jeecg.modules.aiol.mapper.AiolCourseMapper;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolCommentService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
|
import org.springframework.data.redis.core.ZSetOperations;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Tag(name = "首页")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/index")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolIndexController {
|
||||||
|
@Autowired
|
||||||
|
private AiolContentConfigMapper contentConfigMapper;
|
||||||
|
@Autowired
|
||||||
|
private IAiolCommentService commentBizService;
|
||||||
|
@Autowired(required = false)
|
||||||
|
private StringRedisTemplate stringRedisTemplate;
|
||||||
|
@Autowired
|
||||||
|
private AiolCourseMapper courseMapper;
|
||||||
|
|
||||||
|
private static final String HOT_SEARCH_ZSET_KEY = "hot:search";
|
||||||
|
|
||||||
|
@GetMapping("/content")
|
||||||
|
@Operation(summary = "查询首页内容")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<String> queryContent(@RequestParam String contentKey) {
|
||||||
|
AiolContentConfig contentConfig = contentConfigMapper.selectOne(new QueryWrapper<AiolContentConfig>().eq("content_key", contentKey));
|
||||||
|
if (contentConfig == null) {
|
||||||
|
return Result.error("内容配置不存在");
|
||||||
|
}
|
||||||
|
return Result.OK(contentConfig.getContentValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/statistics")
|
||||||
|
@Operation(summary = "查询首页数据统计")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<Map<String, Object>> queryStatistics() {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
|
||||||
|
// 定义统计项的配置键
|
||||||
|
String[] statisticsKeys = {"xxsp", "mszj", "pxjc", "zysc", "zxsy"};
|
||||||
|
|
||||||
|
// 从配置表查询每个统计项的值
|
||||||
|
for (String key : statisticsKeys) {
|
||||||
|
AiolContentConfig contentConfig = contentConfigMapper.selectOne(
|
||||||
|
new QueryWrapper<AiolContentConfig>().eq("content_key", key)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (contentConfig != null && contentConfig.getContentValue() != null) {
|
||||||
|
try {
|
||||||
|
// 尝试解析为数字,如果失败则使用默认值0
|
||||||
|
Integer value = Integer.parseInt(contentConfig.getContentValue());
|
||||||
|
map.put(key, value);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
log.warn("配置项 {} 的值 {} 不是有效数字,使用默认值0", key, contentConfig.getContentValue());
|
||||||
|
map.put(key, 0);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.warn("配置项 {} 不存在,使用默认值0", key);
|
||||||
|
map.put(key, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.OK(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/selected_comments")
|
||||||
|
@Operation(summary = "查询精选评论")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<List<CommentWithUserInfo>> querySelectedComments() {
|
||||||
|
// 查询精选评论(包含用户信息)
|
||||||
|
List<CommentWithUserInfo> comments = commentBizService.getAllSelectedComments();
|
||||||
|
return Result.OK(comments);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/hot_search")
|
||||||
|
@Operation(summary = "查询热门搜索记录(关键词+搜索次数,Redis ZSet 排名)")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<List<Map<String, Object>>> queryHotSearch(@RequestParam(defaultValue = "10") Integer limit) {
|
||||||
|
if (limit == null || limit <= 0) {
|
||||||
|
limit = 10;
|
||||||
|
}
|
||||||
|
if (stringRedisTemplate == null) {
|
||||||
|
return Result.error("Redis 未配置,无法查询热门搜索");
|
||||||
|
}
|
||||||
|
|
||||||
|
Set<ZSetOperations.TypedTuple<String>> tuples = stringRedisTemplate.opsForZSet()
|
||||||
|
.reverseRangeWithScores(HOT_SEARCH_ZSET_KEY, 0, limit - 1);
|
||||||
|
|
||||||
|
List<Map<String, Object>> result = new ArrayList<>();
|
||||||
|
if (tuples != null) {
|
||||||
|
for (ZSetOperations.TypedTuple<String> tuple : tuples) {
|
||||||
|
if (tuple == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Map<String, Object> item = new HashMap<>();
|
||||||
|
item.put("keyword", tuple.getValue());
|
||||||
|
item.put("count", tuple.getScore() == null ? 0 : tuple.getScore().longValue());
|
||||||
|
result.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Result.OK(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/search")
|
||||||
|
@Operation(summary = "全局搜索(课程:name/description/school)")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<List<AiolCourse>> globalSearch(
|
||||||
|
@RequestParam String keyword,
|
||||||
|
@RequestParam(required = false, defaultValue = "20") Integer limit
|
||||||
|
) {
|
||||||
|
if (limit == null || limit <= 0) {
|
||||||
|
limit = 20;
|
||||||
|
}
|
||||||
|
if (limit > 100) {
|
||||||
|
limit = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (keyword == null || keyword.trim().isEmpty()) {
|
||||||
|
return Result.OK(new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (keyword.trim().length() < 2) {
|
||||||
|
return Result.error("关键词长度至少为2个字符");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 记录关键词到 Redis 热搜
|
||||||
|
if (stringRedisTemplate != null) {
|
||||||
|
try {
|
||||||
|
stringRedisTemplate.opsForZSet().incrementScore(HOT_SEARCH_ZSET_KEY, keyword.trim(), 1D);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("记录热搜关键词到 Redis 失败: {}", keyword, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String kw = keyword.trim();
|
||||||
|
QueryWrapper<AiolCourse> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.lambda()
|
||||||
|
.like(AiolCourse::getName, kw)
|
||||||
|
.or()
|
||||||
|
.like(AiolCourse::getDescription, kw)
|
||||||
|
.or()
|
||||||
|
.like(AiolCourse::getSchool, kw);
|
||||||
|
|
||||||
|
List<AiolCourse> list = courseMapper.selectList(wrapper.last("limit " + limit));
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,182 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolLearnProgress;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolLearnProgressService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 学习进度
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="学习进度")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolLearnProgress")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolLearnProgressController extends JeecgController<AiolLearnProgress, IAiolLearnProgressService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolLearnProgressService aiolLearnProgressService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolLearnProgress
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "学习进度-分页列表查询")
|
||||||
|
@Operation(summary="学习进度-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolLearnProgress>> queryPageList(AiolLearnProgress aiolLearnProgress,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolLearnProgress> queryWrapper = QueryGenerator.initQueryWrapper(aiolLearnProgress, req.getParameterMap());
|
||||||
|
Page<AiolLearnProgress> page = new Page<AiolLearnProgress>(pageNo, pageSize);
|
||||||
|
IPage<AiolLearnProgress> pageList = aiolLearnProgressService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolLearnProgress
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "学习进度-添加")
|
||||||
|
@Operation(summary="学习进度-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_learn_progress:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolLearnProgress aiolLearnProgress) {
|
||||||
|
aiolLearnProgressService.save(aiolLearnProgress);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolLearnProgress
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "学习进度-编辑")
|
||||||
|
@Operation(summary="学习进度-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_learn_progress:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolLearnProgress aiolLearnProgress) {
|
||||||
|
aiolLearnProgressService.updateById(aiolLearnProgress);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "学习进度-通过id删除")
|
||||||
|
@Operation(summary="学习进度-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_learn_progress:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolLearnProgressService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "学习进度-批量删除")
|
||||||
|
@Operation(summary="学习进度-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_learn_progress:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolLearnProgressService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "学习进度-通过id查询")
|
||||||
|
@Operation(summary="学习进度-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolLearnProgress> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolLearnProgress aiolLearnProgress = aiolLearnProgressService.getById(id);
|
||||||
|
if(aiolLearnProgress==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolLearnProgress);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolLearnProgress
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_learn_progress:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolLearnProgress aiolLearnProgress) {
|
||||||
|
return super.exportXls(request, aiolLearnProgress, AiolLearnProgress.class, "学习进度");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_learn_progress:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolLearnProgress.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,182 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolPaper;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolPaperService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 试卷
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="试卷")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolPaper")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolPaperController extends JeecgController<AiolPaper, IAiolPaperService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolPaperService aiolPaperService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolPaper
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "试卷-分页列表查询")
|
||||||
|
@Operation(summary="试卷-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolPaper>> queryPageList(AiolPaper aiolPaper,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolPaper> queryWrapper = QueryGenerator.initQueryWrapper(aiolPaper, req.getParameterMap());
|
||||||
|
Page<AiolPaper> page = new Page<AiolPaper>(pageNo, pageSize);
|
||||||
|
IPage<AiolPaper> pageList = aiolPaperService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolPaper
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "试卷-添加")
|
||||||
|
@Operation(summary="试卷-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_paper:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolPaper aiolPaper) {
|
||||||
|
aiolPaperService.save(aiolPaper);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolPaper
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "试卷-编辑")
|
||||||
|
@Operation(summary="试卷-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_paper:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolPaper aiolPaper) {
|
||||||
|
aiolPaperService.updateById(aiolPaper);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "试卷-通过id删除")
|
||||||
|
@Operation(summary="试卷-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_paper:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolPaperService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "试卷-批量删除")
|
||||||
|
@Operation(summary="试卷-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_paper:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolPaperService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "试卷-通过id查询")
|
||||||
|
@Operation(summary="试卷-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolPaper> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolPaper aiolPaper = aiolPaperService.getById(id);
|
||||||
|
if(aiolPaper==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolPaper);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolPaper
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_paper:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolPaper aiolPaper) {
|
||||||
|
return super.exportXls(request, aiolPaper, AiolPaper.class, "试卷");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_paper:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolPaper.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,182 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolPaperQuestion;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolPaperQuestionService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 试卷试题
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="试卷试题")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolPaperQuestion")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolPaperQuestionController extends JeecgController<AiolPaperQuestion, IAiolPaperQuestionService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolPaperQuestionService aiolPaperQuestionService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolPaperQuestion
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "试卷试题-分页列表查询")
|
||||||
|
@Operation(summary="试卷试题-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolPaperQuestion>> queryPageList(AiolPaperQuestion aiolPaperQuestion,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolPaperQuestion> queryWrapper = QueryGenerator.initQueryWrapper(aiolPaperQuestion, req.getParameterMap());
|
||||||
|
Page<AiolPaperQuestion> page = new Page<AiolPaperQuestion>(pageNo, pageSize);
|
||||||
|
IPage<AiolPaperQuestion> pageList = aiolPaperQuestionService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolPaperQuestion
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "试卷试题-添加")
|
||||||
|
@Operation(summary="试卷试题-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_paper_question:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolPaperQuestion aiolPaperQuestion) {
|
||||||
|
aiolPaperQuestionService.save(aiolPaperQuestion);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolPaperQuestion
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "试卷试题-编辑")
|
||||||
|
@Operation(summary="试卷试题-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_paper_question:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolPaperQuestion aiolPaperQuestion) {
|
||||||
|
aiolPaperQuestionService.updateById(aiolPaperQuestion);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "试卷试题-通过id删除")
|
||||||
|
@Operation(summary="试卷试题-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_paper_question:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolPaperQuestionService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "试卷试题-批量删除")
|
||||||
|
@Operation(summary="试卷试题-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_paper_question:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolPaperQuestionService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "试卷试题-通过id查询")
|
||||||
|
@Operation(summary="试卷试题-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolPaperQuestion> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolPaperQuestion aiolPaperQuestion = aiolPaperQuestionService.getById(id);
|
||||||
|
if(aiolPaperQuestion==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolPaperQuestion);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolPaperQuestion
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_paper_question:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolPaperQuestion aiolPaperQuestion) {
|
||||||
|
return super.exportXls(request, aiolPaperQuestion, AiolPaperQuestion.class, "试卷试题");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_paper_question:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolPaperQuestion.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,182 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolQuestionAnswer;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolQuestionAnswerService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 题目答案
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="题目答案")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolQuestionAnswer")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolQuestionAnswerController extends JeecgController<AiolQuestionAnswer, IAiolQuestionAnswerService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolQuestionAnswerService aiolQuestionAnswerService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolQuestionAnswer
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "题目答案-分页列表查询")
|
||||||
|
@Operation(summary="题目答案-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolQuestionAnswer>> queryPageList(AiolQuestionAnswer aiolQuestionAnswer,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolQuestionAnswer> queryWrapper = QueryGenerator.initQueryWrapper(aiolQuestionAnswer, req.getParameterMap());
|
||||||
|
Page<AiolQuestionAnswer> page = new Page<AiolQuestionAnswer>(pageNo, pageSize);
|
||||||
|
IPage<AiolQuestionAnswer> pageList = aiolQuestionAnswerService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolQuestionAnswer
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题目答案-添加")
|
||||||
|
@Operation(summary="题目答案-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_question_answer:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolQuestionAnswer aiolQuestionAnswer) {
|
||||||
|
aiolQuestionAnswerService.save(aiolQuestionAnswer);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolQuestionAnswer
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题目答案-编辑")
|
||||||
|
@Operation(summary="题目答案-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_question_answer:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolQuestionAnswer aiolQuestionAnswer) {
|
||||||
|
aiolQuestionAnswerService.updateById(aiolQuestionAnswer);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题目答案-通过id删除")
|
||||||
|
@Operation(summary="题目答案-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_question_answer:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolQuestionAnswerService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题目答案-批量删除")
|
||||||
|
@Operation(summary="题目答案-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_question_answer:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolQuestionAnswerService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "题目答案-通过id查询")
|
||||||
|
@Operation(summary="题目答案-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolQuestionAnswer> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolQuestionAnswer aiolQuestionAnswer = aiolQuestionAnswerService.getById(id);
|
||||||
|
if(aiolQuestionAnswer==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolQuestionAnswer);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolQuestionAnswer
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_question_answer:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolQuestionAnswer aiolQuestionAnswer) {
|
||||||
|
return super.exportXls(request, aiolQuestionAnswer, AiolQuestionAnswer.class, "题目答案");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_question_answer:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolQuestionAnswer.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,182 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolQuestion;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolQuestionService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 题目
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="题目")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolQuestion")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolQuestionController extends JeecgController<AiolQuestion, IAiolQuestionService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolQuestionService aiolQuestionService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolQuestion
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "题目-分页列表查询")
|
||||||
|
@Operation(summary="题目-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolQuestion>> queryPageList(AiolQuestion aiolQuestion,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolQuestion> queryWrapper = QueryGenerator.initQueryWrapper(aiolQuestion, req.getParameterMap());
|
||||||
|
Page<AiolQuestion> page = new Page<AiolQuestion>(pageNo, pageSize);
|
||||||
|
IPage<AiolQuestion> pageList = aiolQuestionService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolQuestion
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题目-添加")
|
||||||
|
@Operation(summary="题目-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_question:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolQuestion aiolQuestion) {
|
||||||
|
aiolQuestionService.save(aiolQuestion);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolQuestion
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题目-编辑")
|
||||||
|
@Operation(summary="题目-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_question:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolQuestion aiolQuestion) {
|
||||||
|
aiolQuestionService.updateById(aiolQuestion);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题目-通过id删除")
|
||||||
|
@Operation(summary="题目-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_question:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolQuestionService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题目-批量删除")
|
||||||
|
@Operation(summary="题目-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_question:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolQuestionService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "题目-通过id查询")
|
||||||
|
@Operation(summary="题目-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolQuestion> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolQuestion aiolQuestion = aiolQuestionService.getById(id);
|
||||||
|
if(aiolQuestion==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolQuestion);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolQuestion
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_question:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolQuestion aiolQuestion) {
|
||||||
|
return super.exportXls(request, aiolQuestion, AiolQuestion.class, "题目");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_question:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolQuestion.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,182 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolQuestionOption;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolQuestionOptionService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 题目选项
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="题目选项")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolQuestionOption")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolQuestionOptionController extends JeecgController<AiolQuestionOption, IAiolQuestionOptionService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolQuestionOptionService aiolQuestionOptionService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolQuestionOption
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "题目选项-分页列表查询")
|
||||||
|
@Operation(summary="题目选项-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolQuestionOption>> queryPageList(AiolQuestionOption aiolQuestionOption,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolQuestionOption> queryWrapper = QueryGenerator.initQueryWrapper(aiolQuestionOption, req.getParameterMap());
|
||||||
|
Page<AiolQuestionOption> page = new Page<AiolQuestionOption>(pageNo, pageSize);
|
||||||
|
IPage<AiolQuestionOption> pageList = aiolQuestionOptionService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolQuestionOption
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题目选项-添加")
|
||||||
|
@Operation(summary="题目选项-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_question_option:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolQuestionOption aiolQuestionOption) {
|
||||||
|
aiolQuestionOptionService.save(aiolQuestionOption);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolQuestionOption
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题目选项-编辑")
|
||||||
|
@Operation(summary="题目选项-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_question_option:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolQuestionOption aiolQuestionOption) {
|
||||||
|
aiolQuestionOptionService.updateById(aiolQuestionOption);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题目选项-通过id删除")
|
||||||
|
@Operation(summary="题目选项-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_question_option:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolQuestionOptionService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题目选项-批量删除")
|
||||||
|
@Operation(summary="题目选项-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_question_option:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolQuestionOptionService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "题目选项-通过id查询")
|
||||||
|
@Operation(summary="题目选项-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolQuestionOption> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolQuestionOption aiolQuestionOption = aiolQuestionOptionService.getById(id);
|
||||||
|
if(aiolQuestionOption==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolQuestionOption);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolQuestionOption
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_question_option:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolQuestionOption aiolQuestionOption) {
|
||||||
|
return super.exportXls(request, aiolQuestionOption, AiolQuestionOption.class, "题目选项");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_question_option:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolQuestionOption.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,182 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolQuestionRepo;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolQuestionRepoService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 题库题目
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="题库题目")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolQuestionRepo")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolQuestionRepoController extends JeecgController<AiolQuestionRepo, IAiolQuestionRepoService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolQuestionRepoService aiolQuestionRepoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolQuestionRepo
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "题库题目-分页列表查询")
|
||||||
|
@Operation(summary="题库题目-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolQuestionRepo>> queryPageList(AiolQuestionRepo aiolQuestionRepo,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolQuestionRepo> queryWrapper = QueryGenerator.initQueryWrapper(aiolQuestionRepo, req.getParameterMap());
|
||||||
|
Page<AiolQuestionRepo> page = new Page<AiolQuestionRepo>(pageNo, pageSize);
|
||||||
|
IPage<AiolQuestionRepo> pageList = aiolQuestionRepoService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolQuestionRepo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题库题目-添加")
|
||||||
|
@Operation(summary="题库题目-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_question_repo:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolQuestionRepo aiolQuestionRepo) {
|
||||||
|
aiolQuestionRepoService.save(aiolQuestionRepo);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolQuestionRepo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题库题目-编辑")
|
||||||
|
@Operation(summary="题库题目-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_question_repo:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolQuestionRepo aiolQuestionRepo) {
|
||||||
|
aiolQuestionRepoService.updateById(aiolQuestionRepo);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题库题目-通过id删除")
|
||||||
|
@Operation(summary="题库题目-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_question_repo:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolQuestionRepoService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题库题目-批量删除")
|
||||||
|
@Operation(summary="题库题目-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_question_repo:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolQuestionRepoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "题库题目-通过id查询")
|
||||||
|
@Operation(summary="题库题目-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolQuestionRepo> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolQuestionRepo aiolQuestionRepo = aiolQuestionRepoService.getById(id);
|
||||||
|
if(aiolQuestionRepo==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolQuestionRepo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolQuestionRepo
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_question_repo:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolQuestionRepo aiolQuestionRepo) {
|
||||||
|
return super.exportXls(request, aiolQuestionRepo, AiolQuestionRepo.class, "题库题目");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_question_repo:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolQuestionRepo.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,356 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.constant.EntityLinkConst;
|
||||||
|
import org.jeecg.modules.aiol.dto.QuestionAnswerDTO;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolQuestion;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolQuestionAnswer;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolQuestionOption;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolRepo;
|
||||||
|
import org.jeecg.modules.aiol.mapper.AiolRepoMapper;
|
||||||
|
import org.jeecg.modules.aiol.service.*;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 题库
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name = "题库")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolRepo")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolRepoController extends JeecgController<AiolRepo, IAiolRepoService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolRepoService aiolRepoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolRepo
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "题库-分页列表查询")
|
||||||
|
@Operation(summary = "题库-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolRepo>> queryPageList(AiolRepo aiolRepo,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolRepo> queryWrapper = QueryGenerator.initQueryWrapper(aiolRepo, req.getParameterMap());
|
||||||
|
Page<AiolRepo> page = new Page<AiolRepo>(pageNo, pageSize);
|
||||||
|
IPage<AiolRepo> pageList = aiolRepoService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolRepo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题库-添加")
|
||||||
|
@Operation(summary = "题库-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_repo:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolRepo aiolRepo) {
|
||||||
|
aiolRepoService.save(aiolRepo);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolRepo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题库-编辑")
|
||||||
|
@Operation(summary = "题库-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_repo:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolRepo aiolRepo) {
|
||||||
|
aiolRepoService.updateById(aiolRepo);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题库-通过id删除")
|
||||||
|
@Operation(summary = "题库-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_repo:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
aiolRepoService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "题库-批量删除")
|
||||||
|
@Operation(summary = "题库-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_repo:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.aiolRepoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "题库-通过id查询")
|
||||||
|
@Operation(summary = "题库-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolRepo> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
AiolRepo aiolRepo = aiolRepoService.getById(id);
|
||||||
|
if (aiolRepo == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolRepo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolRepo
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_repo:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolRepo aiolRepo) {
|
||||||
|
return super.exportXls(request, aiolRepo, AiolRepo.class, "题库");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_repo:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolRepo.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AiolRepoMapper repoMapper;
|
||||||
|
@Autowired
|
||||||
|
private IAiolQuestionRepoService questionRepoService;
|
||||||
|
@Autowired
|
||||||
|
private IAiolEntityLinkService entityLinkBizService;
|
||||||
|
@Autowired
|
||||||
|
private IAiolQuestionService questionService;
|
||||||
|
@Autowired
|
||||||
|
private IAiolQuestionOptionService questionOptionService;
|
||||||
|
@Autowired
|
||||||
|
private IAiolQuestionAnswerService questionAnswerService;
|
||||||
|
|
||||||
|
@PostMapping("course_add")
|
||||||
|
@Operation(summary = "课程下新建题库")
|
||||||
|
@Transactional
|
||||||
|
public Result<Integer> correct(@RequestBody Map<String, Object> data) {
|
||||||
|
String title = (String) data.get("title");
|
||||||
|
String remark = (String) data.get("remark");
|
||||||
|
String courseId = (String) data.get("courseId");
|
||||||
|
|
||||||
|
AiolRepo repo = new AiolRepo();
|
||||||
|
repo.setTitle(title);
|
||||||
|
repo.setRemark(remark);
|
||||||
|
|
||||||
|
repoMapper.insert(repo);
|
||||||
|
entityLinkBizService.save(EntityLinkConst.SourceType.COURSE, courseId, EntityLinkConst.TargetType.REPO, repo.getId());
|
||||||
|
return Result.OK(repo.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("repoList")
|
||||||
|
@Operation(summary = "获取所有题库")
|
||||||
|
public Result<List<AiolRepo>> repoList() {
|
||||||
|
return Result.ok(aiolRepoService.list());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping(value = "/courseAdd")
|
||||||
|
@Operation(summary = "课程新建题库")
|
||||||
|
public Result<String> courseAdd(@RequestBody AiolRepo repo) {
|
||||||
|
return aiolRepoService.save(repo) ? Result.OK("添加成功!") : Result.error("添加失败!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/questionList/{repoId}")
|
||||||
|
@Operation(summary = "查询题库下题目")
|
||||||
|
public Result<List<AiolQuestion>> questionList(@PathVariable String repoId) {
|
||||||
|
// 获取题库中的题目ID列表
|
||||||
|
List<String> repoQuestionIds = questionRepoService.questionList(repoId);
|
||||||
|
if (repoQuestionIds.isEmpty()) {
|
||||||
|
return Result.error("该题库下没有题目或该题库不存在");
|
||||||
|
}
|
||||||
|
// 根据ID列表查询题目
|
||||||
|
List<AiolQuestion> questions = questionService.listByIds(repoQuestionIds);
|
||||||
|
if (questions.isEmpty()) {
|
||||||
|
return Result.error("题目不存在");
|
||||||
|
}
|
||||||
|
//获取复选题id
|
||||||
|
List<String> type5Ids = questions.stream()
|
||||||
|
.filter(question -> question.getType() == 5)
|
||||||
|
.map(AiolQuestion::getId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
//获取复选题所包含的题目
|
||||||
|
List<AiolQuestion> type5Questions = new ArrayList<>();
|
||||||
|
if (!type5Ids.isEmpty()) {
|
||||||
|
type5Questions = questionService.list(
|
||||||
|
new LambdaQueryWrapper<AiolQuestion>()
|
||||||
|
.in(AiolQuestion::getParentId, type5Ids)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// 创建一个映射,用于快速查找父ID对应的子题目
|
||||||
|
Map<String, List<AiolQuestion>> parentToChildrenMap = type5Questions.stream()
|
||||||
|
.collect(Collectors.groupingBy(AiolQuestion::getParentId));
|
||||||
|
|
||||||
|
// 将子题目添加到原始列表中,保持原有顺序
|
||||||
|
List<AiolQuestion> resultQuestions = new ArrayList<>();
|
||||||
|
for (AiolQuestion question : questions) {
|
||||||
|
resultQuestions.add(question);
|
||||||
|
if (question.getType() == 5) {
|
||||||
|
List<AiolQuestion> children = parentToChildrenMap.getOrDefault(question.getId(), Collections.emptyList());
|
||||||
|
resultQuestions.addAll(children);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Result.ok(resultQuestions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("course_list")
|
||||||
|
@Operation(summary = "获取课程下的题库")
|
||||||
|
public Result<List<AiolRepo>> courseList(@RequestParam String courseId) {
|
||||||
|
List<String> targetIds = entityLinkBizService.listTargetIds(EntityLinkConst.SourceType.COURSE, courseId, EntityLinkConst.TargetType.REPO);
|
||||||
|
|
||||||
|
if (targetIds.size() > 0) {
|
||||||
|
List<AiolRepo> list = repoMapper.selectByIds(targetIds);
|
||||||
|
return Result.OK(list);
|
||||||
|
} else {
|
||||||
|
return Result.OK(new ArrayList<>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/repoList/{questionId}")
|
||||||
|
@Operation(summary = "查询题目详情")
|
||||||
|
public Result<?> questionDetail(@PathVariable String questionId) {
|
||||||
|
AiolQuestion rootQuestion = questionService.getById(questionId);
|
||||||
|
if (rootQuestion == null) {
|
||||||
|
return Result.error("题目不存在");
|
||||||
|
}
|
||||||
|
QuestionAnswerDTO questionAnswerDTO = new QuestionAnswerDTO();
|
||||||
|
questionAnswerDTO.setQuestion(rootQuestion);
|
||||||
|
if (rootQuestion.getType() >= 0 && rootQuestion.getType() <= 2) {
|
||||||
|
questionAnswerDTO.setAnswer(choiceDetail(questionId));
|
||||||
|
return Result.ok(questionAnswerDTO);
|
||||||
|
} else if (rootQuestion.getType() == 3 || rootQuestion.getType() == 4) {
|
||||||
|
questionAnswerDTO.setAnswer(answerDetail(questionId));
|
||||||
|
return Result.ok(questionAnswerDTO);
|
||||||
|
} else {
|
||||||
|
//查询复合题所包含的题目
|
||||||
|
List<AiolQuestion> list = questionService.list(
|
||||||
|
new LambdaQueryWrapper<AiolQuestion>().
|
||||||
|
eq(AiolQuestion::getParentId, questionId)
|
||||||
|
);
|
||||||
|
//根据题目类型进行分组(false:选择多选判断题,true:填空简答题)
|
||||||
|
Map<Boolean, List<AiolQuestion>> groupedQuestions = list.stream()
|
||||||
|
.collect(Collectors.partitioningBy(
|
||||||
|
q -> q.getType() > 2
|
||||||
|
));
|
||||||
|
//获取选择题,多选题,判断题答案
|
||||||
|
List<AiolQuestion> question = groupedQuestions.get(false);
|
||||||
|
if (!question.isEmpty()) {
|
||||||
|
question.forEach(q -> {
|
||||||
|
QuestionAnswerDTO qad = new QuestionAnswerDTO();
|
||||||
|
qad.setQuestion(q);
|
||||||
|
qad.setAnswer(choiceDetail(q.getId()));
|
||||||
|
questionAnswerDTO.getChildren().add(qad);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//获取填空题,简答题答案
|
||||||
|
List<AiolQuestion> question1 = groupedQuestions.get(true);
|
||||||
|
if (!question1.isEmpty()) {
|
||||||
|
question1.forEach(q -> {
|
||||||
|
QuestionAnswerDTO qad = new QuestionAnswerDTO();
|
||||||
|
qad.setQuestion(q);
|
||||||
|
qad.setAnswer(answerDetail(q.getId()));
|
||||||
|
questionAnswerDTO.getChildren().add(qad);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return Result.ok(questionAnswerDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询选择题,多选题,判断题答案
|
||||||
|
public List<AiolQuestionOption> choiceDetail(String questionId) {
|
||||||
|
return questionOptionService.list(
|
||||||
|
new LambdaQueryWrapper<AiolQuestionOption>().
|
||||||
|
eq(AiolQuestionOption::getQuestionId, questionId).
|
||||||
|
orderByAsc(AiolQuestionOption::getOrderNo)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询填空题,简答题答案
|
||||||
|
public List<AiolQuestionAnswer> answerDetail(String questionId) {
|
||||||
|
return questionAnswerService.list(
|
||||||
|
new LambdaQueryWrapper<AiolQuestionAnswer>().
|
||||||
|
eq(AiolQuestionAnswer::getQuestionId, questionId).
|
||||||
|
orderByAsc(AiolQuestionAnswer::getOrderNo)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,232 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.config.shiro.IgnoreAuth;
|
||||||
|
import org.jeecg.modules.aiol.constant.EntityLinkConst;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolResource;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolEntityLinkService;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolResourceService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 资源
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name = "资源")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolResource")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolResourceController extends JeecgController<AiolResource, IAiolResourceService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolResourceService aiolResourceService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolResource
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "资源-分页列表查询")
|
||||||
|
@Operation(summary = "资源-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolResource>> queryPageList(AiolResource aiolResource,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolResource> queryWrapper = QueryGenerator.initQueryWrapper(aiolResource, req.getParameterMap());
|
||||||
|
Page<AiolResource> page = new Page<AiolResource>(pageNo, pageSize);
|
||||||
|
IPage<AiolResource> pageList = aiolResourceService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolResource
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "资源-添加")
|
||||||
|
@Operation(summary = "资源-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_resource:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolResource aiolResource) {
|
||||||
|
aiolResourceService.save(aiolResource);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolResource
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "资源-编辑")
|
||||||
|
@Operation(summary = "资源-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_resource:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolResource aiolResource) {
|
||||||
|
aiolResourceService.updateById(aiolResource);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "资源-通过id删除")
|
||||||
|
@Operation(summary = "资源-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_resource:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
aiolResourceService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "资源-批量删除")
|
||||||
|
@Operation(summary = "资源-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_resource:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.aiolResourceService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "资源-通过id查询")
|
||||||
|
@Operation(summary = "资源-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolResource> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
AiolResource aiolResource = aiolResourceService.getById(id);
|
||||||
|
if (aiolResource == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolResource);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolResource
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_resource:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolResource aiolResource) {
|
||||||
|
return super.exportXls(request, aiolResource, AiolResource.class, "资源");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_resource:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolResource.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IAiolEntityLinkService entityLinkBizService;
|
||||||
|
|
||||||
|
@GetMapping("/feature")
|
||||||
|
@Operation(summary = "查询精品资源")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<List<AiolResource>> queryFeatureResource() {
|
||||||
|
List<AiolResource> list = aiolResourceService.list(new QueryWrapper<AiolResource>().eq("iz_featured", 1));
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/video")
|
||||||
|
@Operation(summary = "按课程分类查询视频资源")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<List<AiolResource>> queryVideoResource(@RequestParam("categoryId") String courseCategoryId) {
|
||||||
|
List<String> targetIds = entityLinkBizService.listTargetIds(EntityLinkConst.SourceType.COURSE_CATEGORY, courseCategoryId, EntityLinkConst.TargetType.RESOURCE);
|
||||||
|
List<AiolResource> list = new ArrayList<>();
|
||||||
|
for (String targetId : targetIds) {
|
||||||
|
AiolResource resource = aiolResourceService.getById(targetId);
|
||||||
|
if (resource.getType() == EntityLinkConst.ResourceType.VIDEO) {
|
||||||
|
list.add(resource);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/image")
|
||||||
|
@Operation(summary = "按课程分类查询图片资源")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<List<AiolResource>> queryImageResource(@RequestParam("categoryId") String courseCategoryId) {
|
||||||
|
List<String> targetIds = entityLinkBizService.listTargetIds(EntityLinkConst.SourceType.COURSE_CATEGORY, courseCategoryId, EntityLinkConst.TargetType.RESOURCE);
|
||||||
|
List<AiolResource> list = new ArrayList<>();
|
||||||
|
for (String targetId : targetIds) {
|
||||||
|
AiolResource resource = aiolResourceService.getById(targetId);
|
||||||
|
if (resource.getType() == EntityLinkConst.ResourceType.IMAGE) {
|
||||||
|
list.add(resource);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/upload")
|
||||||
|
@Operation(summary = "课程视频文件上传", description = "课程视频文件上传,返回各清晰度的m3u8文件地址")
|
||||||
|
public Result<Map<String, String>> upload(@RequestParam("file") MultipartFile file, HttpServletRequest request) throws Exception {
|
||||||
|
if (file == null || file.isEmpty()) return Result.error("没有找到上传的文件");
|
||||||
|
Map<String, String> qualityUrls = aiolResourceService.uploadHls(file, request);
|
||||||
|
return Result.OK(qualityUrls);
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package org.jeecg.modules.gen.aioltag.controller;
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -14,8 +14,8 @@ import org.jeecg.common.api.vo.Result;
|
|||||||
import org.jeecg.common.system.query.QueryGenerator;
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
import org.jeecg.modules.gen.aioltag.entity.AiolTag;
|
import org.jeecg.modules.aiol.entity.AiolTag;
|
||||||
import org.jeecg.modules.gen.aioltag.service.IAiolTagService;
|
import org.jeecg.modules.aiol.service.IAiolTagService;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@ -41,12 +41,12 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|||||||
/**
|
/**
|
||||||
* @Description: 标签
|
* @Description: 标签
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2025-08-28
|
* @Date: 2025-08-31
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Tag(name="标签")
|
@Tag(name="标签")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/gen/aioltag/aiolTag")
|
@RequestMapping("/aiol/aiolTag")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class AiolTagController extends JeecgController<AiolTag, IAiolTagService> {
|
public class AiolTagController extends JeecgController<AiolTag, IAiolTagService> {
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -84,7 +84,7 @@ public class AiolTagController extends JeecgController<AiolTag, IAiolTagService>
|
|||||||
*/
|
*/
|
||||||
@AutoLog(value = "标签-添加")
|
@AutoLog(value = "标签-添加")
|
||||||
@Operation(summary="标签-添加")
|
@Operation(summary="标签-添加")
|
||||||
@RequiresPermissions("gen.aioltag:aiol_tag:add")
|
@RequiresPermissions("aiol:aiol_tag:add")
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
public Result<String> add(@RequestBody AiolTag aiolTag) {
|
public Result<String> add(@RequestBody AiolTag aiolTag) {
|
||||||
aiolTagService.save(aiolTag);
|
aiolTagService.save(aiolTag);
|
||||||
@ -100,7 +100,7 @@ public class AiolTagController extends JeecgController<AiolTag, IAiolTagService>
|
|||||||
*/
|
*/
|
||||||
@AutoLog(value = "标签-编辑")
|
@AutoLog(value = "标签-编辑")
|
||||||
@Operation(summary="标签-编辑")
|
@Operation(summary="标签-编辑")
|
||||||
@RequiresPermissions("gen.aioltag:aiol_tag:edit")
|
@RequiresPermissions("aiol:aiol_tag:edit")
|
||||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
public Result<String> edit(@RequestBody AiolTag aiolTag) {
|
public Result<String> edit(@RequestBody AiolTag aiolTag) {
|
||||||
aiolTagService.updateById(aiolTag);
|
aiolTagService.updateById(aiolTag);
|
||||||
@ -115,7 +115,7 @@ public class AiolTagController extends JeecgController<AiolTag, IAiolTagService>
|
|||||||
*/
|
*/
|
||||||
@AutoLog(value = "标签-通过id删除")
|
@AutoLog(value = "标签-通过id删除")
|
||||||
@Operation(summary="标签-通过id删除")
|
@Operation(summary="标签-通过id删除")
|
||||||
@RequiresPermissions("gen.aioltag:aiol_tag:delete")
|
@RequiresPermissions("aiol:aiol_tag:delete")
|
||||||
@DeleteMapping(value = "/delete")
|
@DeleteMapping(value = "/delete")
|
||||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
aiolTagService.removeById(id);
|
aiolTagService.removeById(id);
|
||||||
@ -130,7 +130,7 @@ public class AiolTagController extends JeecgController<AiolTag, IAiolTagService>
|
|||||||
*/
|
*/
|
||||||
@AutoLog(value = "标签-批量删除")
|
@AutoLog(value = "标签-批量删除")
|
||||||
@Operation(summary="标签-批量删除")
|
@Operation(summary="标签-批量删除")
|
||||||
@RequiresPermissions("gen.aioltag:aiol_tag:deleteBatch")
|
@RequiresPermissions("aiol:aiol_tag:deleteBatch")
|
||||||
@DeleteMapping(value = "/deleteBatch")
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
this.aiolTagService.removeByIds(Arrays.asList(ids.split(",")));
|
this.aiolTagService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
@ -160,7 +160,7 @@ public class AiolTagController extends JeecgController<AiolTag, IAiolTagService>
|
|||||||
* @param request
|
* @param request
|
||||||
* @param aiolTag
|
* @param aiolTag
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("gen.aioltag:aiol_tag:exportXls")
|
@RequiresPermissions("aiol:aiol_tag:exportXls")
|
||||||
@RequestMapping(value = "/exportXls")
|
@RequestMapping(value = "/exportXls")
|
||||||
public ModelAndView exportXls(HttpServletRequest request, AiolTag aiolTag) {
|
public ModelAndView exportXls(HttpServletRequest request, AiolTag aiolTag) {
|
||||||
return super.exportXls(request, aiolTag, AiolTag.class, "标签");
|
return super.exportXls(request, aiolTag, AiolTag.class, "标签");
|
||||||
@ -173,7 +173,7 @@ public class AiolTagController extends JeecgController<AiolTag, IAiolTagService>
|
|||||||
* @param response
|
* @param response
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("gen.aioltag:aiol_tag:importExcel")
|
@RequiresPermissions("aiol:aiol_tag:importExcel")
|
||||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
return super.importExcel(request, response, AiolTag.class);
|
return super.importExcel(request, response, AiolTag.class);
|
@ -0,0 +1,194 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.constant.CommonConstant;
|
||||||
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||||
|
import org.jeecg.common.system.util.JwtUtil;
|
||||||
|
import org.jeecg.common.system.vo.DictModel;
|
||||||
|
import org.jeecg.common.util.PasswordUtil;
|
||||||
|
import org.jeecg.common.util.RedisUtil;
|
||||||
|
import org.jeecg.config.shiro.IgnoreAuth;
|
||||||
|
import org.jeecg.modules.aiol.dto.TeacherInfo;
|
||||||
|
import org.jeecg.modules.aiol.dto.UserInfoResponse;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolUserInfo;
|
||||||
|
import org.jeecg.modules.aiol.mapper.AiolUserInfoMapper;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolUserInfoService;
|
||||||
|
import org.jeecg.modules.system.entity.SysUser;
|
||||||
|
import org.jeecg.modules.system.service.ISysUserService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Tag(name = "前台用户")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolUser")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolUserController {
|
||||||
|
@Autowired
|
||||||
|
private ISysUserService sysUserService;
|
||||||
|
@Autowired
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
@Autowired
|
||||||
|
private IAiolUserInfoService userBizService;
|
||||||
|
@Autowired
|
||||||
|
private AiolUserInfoMapper userInfoMapper;
|
||||||
|
@Autowired
|
||||||
|
private ISysBaseAPI sysBaseApi;
|
||||||
|
|
||||||
|
@PostMapping("/login")
|
||||||
|
@Operation(summary = "用户登录")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<JSONObject> login(@RequestBody Map<String, String> user, HttpServletRequest request) {
|
||||||
|
Result<JSONObject> result = new Result<JSONObject>();
|
||||||
|
String username = user.get("username");
|
||||||
|
String password = user.get("password");
|
||||||
|
if (isLoginFailOvertimes(username)) {
|
||||||
|
return result.error500("该用户登录失败次数过多,请于10分钟后再次登录!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// step.2 校验用户是否存在且有效
|
||||||
|
LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(SysUser::getUsername, username);
|
||||||
|
SysUser sysUser = sysUserService.getOne(queryWrapper);
|
||||||
|
Result<?> checkResult = sysUserService.checkUserIsEffective(sysUser);
|
||||||
|
if (!checkResult.isSuccess()) {
|
||||||
|
return result.error500(checkResult.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
// step.3 校验用户名或密码是否正确
|
||||||
|
String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt());
|
||||||
|
String syspassword = sysUser.getPassword();
|
||||||
|
if (!syspassword.equals(userpassword)) {
|
||||||
|
addLoginFailOvertimes(username);
|
||||||
|
result.error500("用户名或密码错误");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// step.4 登录成功获取用户信息
|
||||||
|
JSONObject obj = new JSONObject(new LinkedHashMap<>());
|
||||||
|
// 1.生成token
|
||||||
|
String token = JwtUtil.sign(username, syspassword);
|
||||||
|
// 设置token缓存有效时间
|
||||||
|
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
|
||||||
|
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME * 2 / 1000);
|
||||||
|
obj.put("token", token);
|
||||||
|
|
||||||
|
// TODO 查询用户信息
|
||||||
|
|
||||||
|
result.setResult(obj);
|
||||||
|
result.success("登录成功");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录失败超出次数5 返回true
|
||||||
|
*
|
||||||
|
* @param username
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private boolean isLoginFailOvertimes(String username) {
|
||||||
|
String key = CommonConstant.LOGIN_FAIL + username;
|
||||||
|
Object failTime = redisUtil.get(key);
|
||||||
|
if (failTime != null) {
|
||||||
|
Integer val = Integer.parseInt(failTime.toString());
|
||||||
|
if (val > 5) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录登录失败次数
|
||||||
|
*
|
||||||
|
* @param username
|
||||||
|
*/
|
||||||
|
private void addLoginFailOvertimes(String username) {
|
||||||
|
String key = CommonConstant.LOGIN_FAIL + username;
|
||||||
|
Object failTime = redisUtil.get(key);
|
||||||
|
Integer val = 0;
|
||||||
|
if (failTime != null) {
|
||||||
|
val = Integer.parseInt(failTime.toString());
|
||||||
|
}
|
||||||
|
// 10分钟,一分钟为60s
|
||||||
|
redisUtil.set(key, ++val, 600);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all_teachers")
|
||||||
|
@Operation(summary = "查询师资力量", description = "categoryId为all则查询全部")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<List<TeacherInfo>> queryAllTeachers(@RequestParam("categoryId") String categoryId) {
|
||||||
|
List<TeacherInfo> list = userBizService.queryAllTeachers(categoryId);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/info")
|
||||||
|
@Operation(summary = "查询用户信息", description = "通过JWT token获取当前用户的详细信息,包括基本信息、角色和扩展信息")
|
||||||
|
public Result<UserInfoResponse> queryUserInfo(HttpServletRequest request) {
|
||||||
|
try {
|
||||||
|
// 1. 从JWT中获取用户名
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
if (username == null || username.trim().isEmpty()) {
|
||||||
|
return Result.error(401, "用户未登录或token无效");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 根据用户名查询系统用户信息
|
||||||
|
SysUser sysUser = sysUserService.getUserByName(username);
|
||||||
|
if (sysUser == null) {
|
||||||
|
return Result.error(404, "用户不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 查询用户角色
|
||||||
|
List<String> roles = sysUserService.getUserRolesSet(username).stream()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 4. 根据用户ID查询user_info表信息
|
||||||
|
AiolUserInfo userInfo = userInfoMapper.selectOne(
|
||||||
|
new QueryWrapper<AiolUserInfo>().eq("user_id", sysUser.getId()));
|
||||||
|
|
||||||
|
// 5. 构建返回结果
|
||||||
|
UserInfoResponse response = new UserInfoResponse();
|
||||||
|
|
||||||
|
// 基本用户信息
|
||||||
|
UserInfoResponse.BaseInfo baseInfo = new UserInfoResponse.BaseInfo();
|
||||||
|
BeanUtils.copyProperties(sysUser, baseInfo);
|
||||||
|
response.setBaseInfo(baseInfo);
|
||||||
|
response.setRoles(roles);
|
||||||
|
|
||||||
|
// 扩展用户信息
|
||||||
|
if (userInfo != null) {
|
||||||
|
UserInfoResponse.ExtendedInfo extendedInfo = new UserInfoResponse.ExtendedInfo();
|
||||||
|
BeanUtils.copyProperties(userInfo, extendedInfo);
|
||||||
|
response.setExtendedInfo(extendedInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.OK(response);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("查询用户信息失败:" + e.getMessage(), e);
|
||||||
|
return Result.error(500, "查询用户信息失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/schools")
|
||||||
|
@Operation(summary = "查询学校列表")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<List<String>> querySchools() {
|
||||||
|
List<DictModel> list = sysBaseApi.getDictItems("school_list");
|
||||||
|
List<String> schools = list.stream()
|
||||||
|
.map(d -> d.getLabel())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
return Result.OK(schools);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,182 @@
|
|||||||
|
package org.jeecg.modules.aiol.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolUserInfo;
|
||||||
|
import org.jeecg.modules.aiol.service.IAiolUserInfoService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 用户信息
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="用户信息")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/aiol/aiolUserInfo")
|
||||||
|
@Slf4j
|
||||||
|
public class AiolUserInfoController extends JeecgController<AiolUserInfo, IAiolUserInfoService> {
|
||||||
|
@Autowired
|
||||||
|
private IAiolUserInfoService aiolUserInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param aiolUserInfo
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "用户信息-分页列表查询")
|
||||||
|
@Operation(summary="用户信息-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<AiolUserInfo>> queryPageList(AiolUserInfo aiolUserInfo,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<AiolUserInfo> queryWrapper = QueryGenerator.initQueryWrapper(aiolUserInfo, req.getParameterMap());
|
||||||
|
Page<AiolUserInfo> page = new Page<AiolUserInfo>(pageNo, pageSize);
|
||||||
|
IPage<AiolUserInfo> pageList = aiolUserInfoService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param aiolUserInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "用户信息-添加")
|
||||||
|
@Operation(summary="用户信息-添加")
|
||||||
|
@RequiresPermissions("aiol:aiol_user_info:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody AiolUserInfo aiolUserInfo) {
|
||||||
|
aiolUserInfoService.save(aiolUserInfo);
|
||||||
|
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param aiolUserInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "用户信息-编辑")
|
||||||
|
@Operation(summary="用户信息-编辑")
|
||||||
|
@RequiresPermissions("aiol:aiol_user_info:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody AiolUserInfo aiolUserInfo) {
|
||||||
|
aiolUserInfoService.updateById(aiolUserInfo);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "用户信息-通过id删除")
|
||||||
|
@Operation(summary="用户信息-通过id删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_user_info:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
aiolUserInfoService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "用户信息-批量删除")
|
||||||
|
@Operation(summary="用户信息-批量删除")
|
||||||
|
@RequiresPermissions("aiol:aiol_user_info:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.aiolUserInfoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "用户信息-通过id查询")
|
||||||
|
@Operation(summary="用户信息-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<AiolUserInfo> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
AiolUserInfo aiolUserInfo = aiolUserInfoService.getById(id);
|
||||||
|
if(aiolUserInfo==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(aiolUserInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param aiolUserInfo
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_user_info:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, AiolUserInfo aiolUserInfo) {
|
||||||
|
return super.exportXls(request, aiolUserInfo, AiolUserInfo.class, "用户信息");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("aiol:aiol_user_info:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, AiolUserInfo.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package org.jeecg.modules.aiol.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolComment;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description = "评论信息(包含用户信息)")
|
||||||
|
public class CommentWithUserInfo extends AiolComment {
|
||||||
|
@Schema(description = "用户姓名")
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
@Schema(description = "用户头像")
|
||||||
|
private String userAvatar;
|
||||||
|
|
||||||
|
@Schema(description = "用户标签")
|
||||||
|
private String userTag;
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package org.jeecg.modules.aiol.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolCourse;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description = "课程信息(包含讲师信息)")
|
||||||
|
public class CourseWithTeacherInfo extends AiolCourse {
|
||||||
|
@Schema(description = "授课讲师列表")
|
||||||
|
private List<TeacherInfo> teacherList;
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolQuestion;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class QuestionAnswerDTO {
|
||||||
|
//题目内容
|
||||||
|
private AiolQuestion question;
|
||||||
|
//答案
|
||||||
|
private List<?> answer;
|
||||||
|
//子题目列表
|
||||||
|
private List<QuestionAnswerDTO> children = new ArrayList<>();
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package org.jeecg.modules.aiol.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "学生提交作业")
|
||||||
|
public class StudentSubmitHomework {
|
||||||
|
/**作业id*/
|
||||||
|
@Schema(description = "作业id")
|
||||||
|
private String homeworkId;
|
||||||
|
/**学生id*/
|
||||||
|
@Schema(description = "学生id")
|
||||||
|
private String studentId;
|
||||||
|
/**作业内容*/
|
||||||
|
@Schema(description = "作业内容")
|
||||||
|
private String content;
|
||||||
|
/**附件*/
|
||||||
|
@Schema(description = "附件")
|
||||||
|
private String attachment;
|
||||||
|
/**状态*/
|
||||||
|
@Schema(description = "状态")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package org.jeecg.modules.aiol.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "讲师信息")
|
||||||
|
public class TeacherInfo {
|
||||||
|
@Schema(description = "讲师ID")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "讲师姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "讲师头像")
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
@Schema(description = "职称")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Schema(description = "标签")
|
||||||
|
private String tag;
|
||||||
|
|
||||||
|
@Schema(description = "显示顺序")
|
||||||
|
private Integer sortOrder;
|
||||||
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
package org.jeecg.modules.aiol.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "用户信息响应对象")
|
||||||
|
public class UserInfoResponse {
|
||||||
|
|
||||||
|
@Schema(description = "用户基本信息")
|
||||||
|
private BaseInfo baseInfo;
|
||||||
|
|
||||||
|
@Schema(description = "用户角色列表")
|
||||||
|
private List<String> roles;
|
||||||
|
|
||||||
|
@Schema(description = "扩展用户信息")
|
||||||
|
private ExtendedInfo extendedInfo;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "用户基本信息")
|
||||||
|
public static class BaseInfo {
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "用户名")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
@Schema(description = "真实姓名")
|
||||||
|
private String realname;
|
||||||
|
|
||||||
|
@Schema(description = "头像")
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
@Schema(description = "手机号")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@Schema(description = "邮箱")
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
@Schema(description = "性别(1-男,2-女)")
|
||||||
|
private Integer sex;
|
||||||
|
|
||||||
|
@Schema(description = "生日")
|
||||||
|
private Date birthday;
|
||||||
|
|
||||||
|
@Schema(description = "状态(1-正常,2-冻结)")
|
||||||
|
private Integer status;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "扩展用户信息")
|
||||||
|
public static class ExtendedInfo {
|
||||||
|
@Schema(description = "专业")
|
||||||
|
private String major;
|
||||||
|
|
||||||
|
@Schema(description = "学院")
|
||||||
|
private String college;
|
||||||
|
|
||||||
|
@Schema(description = "学历")
|
||||||
|
private String education;
|
||||||
|
|
||||||
|
@Schema(description = "职称")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Schema(description = "标签")
|
||||||
|
private String tag;
|
||||||
|
|
||||||
|
@Schema(description = "显示顺序")
|
||||||
|
private Integer sortOrder;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,105 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 活动
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_activity")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="活动")
|
||||||
|
public class AiolActivity implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**标题*/
|
||||||
|
@Excel(name = "标题", width = 15)
|
||||||
|
@Schema(description = "标题")
|
||||||
|
private java.lang.String title;
|
||||||
|
/**介绍*/
|
||||||
|
@Excel(name = "介绍", width = 15)
|
||||||
|
@Schema(description = "介绍")
|
||||||
|
private java.lang.String introduction;
|
||||||
|
/**说明图片*/
|
||||||
|
@Excel(name = "说明图片", width = 15)
|
||||||
|
@Schema(description = "说明图片")
|
||||||
|
private java.lang.String imgs;
|
||||||
|
/**头图*/
|
||||||
|
@Excel(name = "头图", width = 15)
|
||||||
|
@Schema(description = "头图")
|
||||||
|
private java.lang.String banner;
|
||||||
|
/**介绍视频*/
|
||||||
|
@Excel(name = "介绍视频", width = 15)
|
||||||
|
@Schema(description = "介绍视频")
|
||||||
|
private java.lang.String video;
|
||||||
|
/**报名人数上限*/
|
||||||
|
@Excel(name = "报名人数上限", width = 15)
|
||||||
|
@Schema(description = "报名人数上限")
|
||||||
|
private java.lang.Integer maxNum;
|
||||||
|
/**开始时间*/
|
||||||
|
@Excel(name = "开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "开始时间")
|
||||||
|
private java.util.Date startTime;
|
||||||
|
/**结束时间*/
|
||||||
|
@Excel(name = "结束时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "结束时间")
|
||||||
|
private java.util.Date endTime;
|
||||||
|
/**扩展字段*/
|
||||||
|
@Excel(name = "扩展字段", width = 15)
|
||||||
|
@Schema(description = "扩展字段")
|
||||||
|
private java.lang.String extra;
|
||||||
|
/**附件*/
|
||||||
|
@Excel(name = "附件", width = 15)
|
||||||
|
@Schema(description = "附件")
|
||||||
|
private java.lang.String attachment;
|
||||||
|
/**状态*/
|
||||||
|
@Excel(name = "状态", width = 15, dicCode = "course_status")
|
||||||
|
@Dict(dicCode = "course_status")
|
||||||
|
@Schema(description = "状态")
|
||||||
|
private java.lang.String status;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,80 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 活动报名
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_activity_signup")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="活动报名")
|
||||||
|
public class AiolActivitySignup implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**姓名*/
|
||||||
|
@Excel(name = "姓名", width = 15)
|
||||||
|
@Schema(description = "姓名")
|
||||||
|
private java.lang.String name;
|
||||||
|
/**年龄*/
|
||||||
|
@Excel(name = "年龄", width = 15)
|
||||||
|
@Schema(description = "年龄")
|
||||||
|
private java.lang.String age;
|
||||||
|
/**手机号*/
|
||||||
|
@Excel(name = "手机号", width = 15)
|
||||||
|
@Schema(description = "手机号")
|
||||||
|
private java.lang.String phone;
|
||||||
|
/**邮箱*/
|
||||||
|
@Excel(name = "邮箱", width = 15)
|
||||||
|
@Schema(description = "邮箱")
|
||||||
|
private java.lang.String email;
|
||||||
|
/**扩展字段*/
|
||||||
|
@Excel(name = "扩展字段", width = 15)
|
||||||
|
@Schema(description = "扩展字段")
|
||||||
|
private java.lang.String extra;
|
||||||
|
/**附件*/
|
||||||
|
@Excel(name = "附件", width = 15)
|
||||||
|
@Schema(description = "附件")
|
||||||
|
private java.lang.String attachment;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,84 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 评论
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_comment")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="评论")
|
||||||
|
public class AiolComment implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**用户id*/
|
||||||
|
@Excel(name = "用户id", width = 15)
|
||||||
|
@Schema(description = "用户id")
|
||||||
|
private java.lang.String userId;
|
||||||
|
/**目标类型*/
|
||||||
|
@Excel(name = "目标类型", width = 15)
|
||||||
|
@Schema(description = "目标类型")
|
||||||
|
private java.lang.String targetType;
|
||||||
|
/**目标id*/
|
||||||
|
@Excel(name = "目标id", width = 15)
|
||||||
|
@Schema(description = "目标id")
|
||||||
|
private java.lang.String targetId;
|
||||||
|
/**内容*/
|
||||||
|
@Excel(name = "内容", width = 15)
|
||||||
|
@Schema(description = "内容")
|
||||||
|
private java.lang.String content;
|
||||||
|
/**图片*/
|
||||||
|
@Excel(name = "图片", width = 15)
|
||||||
|
@Schema(description = "图片")
|
||||||
|
private java.lang.String imgs;
|
||||||
|
/**是否置顶*/
|
||||||
|
@Excel(name = "是否置顶", width = 15)
|
||||||
|
@Schema(description = "是否置顶")
|
||||||
|
private java.lang.Integer izTop;
|
||||||
|
/**点赞数*/
|
||||||
|
@Excel(name = "点赞数", width = 15)
|
||||||
|
@Schema(description = "点赞数")
|
||||||
|
private java.lang.Integer likeCount;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 内容配置
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_content_config")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="内容配置")
|
||||||
|
public class AiolContentConfig implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**配置标识*/
|
||||||
|
@Excel(name = "配置标识", width = 15)
|
||||||
|
@Schema(description = "配置标识")
|
||||||
|
private java.lang.String contentKey;
|
||||||
|
/**配置值*/
|
||||||
|
@Excel(name = "配置值", width = 15)
|
||||||
|
@Schema(description = "配置值")
|
||||||
|
private java.lang.String contentValue;
|
||||||
|
/**值类型*/
|
||||||
|
@Excel(name = "值类型", width = 15)
|
||||||
|
@Schema(description = "值类型")
|
||||||
|
private java.lang.String valueType;
|
||||||
|
/**描述*/
|
||||||
|
@Excel(name = "描述", width = 15)
|
||||||
|
@Schema(description = "描述")
|
||||||
|
private java.lang.String description;
|
||||||
|
}
|
@ -0,0 +1,140 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 课程
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_course")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="课程")
|
||||||
|
public class AiolCourse implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private String id;
|
||||||
|
/**课程名*/
|
||||||
|
@Excel(name = "课程名", width = 15)
|
||||||
|
@Schema(description = "课程名")
|
||||||
|
private String name;
|
||||||
|
/**封面图*/
|
||||||
|
@Excel(name = "封面图", width = 15)
|
||||||
|
@Schema(description = "封面图")
|
||||||
|
private String cover;
|
||||||
|
/**介绍视频*/
|
||||||
|
@Excel(name = "介绍视频", width = 15)
|
||||||
|
@Schema(description = "介绍视频")
|
||||||
|
private String video;
|
||||||
|
/**学校*/
|
||||||
|
@Excel(name = "学校", width = 15)
|
||||||
|
@Schema(description = "学校")
|
||||||
|
private String school;
|
||||||
|
/**课程概述*/
|
||||||
|
@Excel(name = "课程概述", width = 15)
|
||||||
|
@Schema(description = "课程概述")
|
||||||
|
private String description;
|
||||||
|
/**课程类型*/
|
||||||
|
@Excel(name = "课程类型", width = 15, dicCode = "course_type")
|
||||||
|
@Dict(dicCode = "course_type")
|
||||||
|
@Schema(description = "课程类型")
|
||||||
|
private Integer type;
|
||||||
|
/**授课目标*/
|
||||||
|
@Excel(name = "授课目标", width = 15)
|
||||||
|
@Schema(description = "授课目标")
|
||||||
|
private String target;
|
||||||
|
/**课程难度*/
|
||||||
|
@Excel(name = "课程难度", width = 15, dicCode = "course_difficulty")
|
||||||
|
@Dict(dicCode = "course_difficulty")
|
||||||
|
@Schema(description = "课程难度")
|
||||||
|
private Integer difficulty;
|
||||||
|
/**所属专题*/
|
||||||
|
@Excel(name = "所属专题", width = 15, dicCode = "course_subject")
|
||||||
|
@Dict(dicCode = "course_subject")
|
||||||
|
@Schema(description = "所属专题")
|
||||||
|
private String subject;
|
||||||
|
/**课程大纲*/
|
||||||
|
@Excel(name = "课程大纲", width = 15)
|
||||||
|
@Schema(description = "课程大纲")
|
||||||
|
private String outline;
|
||||||
|
/**预备知识*/
|
||||||
|
@Excel(name = "预备知识", width = 15)
|
||||||
|
@Schema(description = "预备知识")
|
||||||
|
private String prerequisite;
|
||||||
|
/**参考资料*/
|
||||||
|
@Excel(name = "参考资料", width = 15)
|
||||||
|
@Schema(description = "参考资料")
|
||||||
|
private String reference;
|
||||||
|
/**学时安排*/
|
||||||
|
@Excel(name = "学时安排", width = 15)
|
||||||
|
@Schema(description = "学时安排")
|
||||||
|
private String arrangement;
|
||||||
|
/**开课时间*/
|
||||||
|
@Excel(name = "开课时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "开课时间")
|
||||||
|
private Date startTime;
|
||||||
|
/**结课时间*/
|
||||||
|
@Excel(name = "结课时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "结课时间")
|
||||||
|
private Date endTime;
|
||||||
|
/**已报名人数*/
|
||||||
|
@Excel(name = "已报名人数", width = 15)
|
||||||
|
@Schema(description = "已报名人数")
|
||||||
|
private Integer enrollCount;
|
||||||
|
/**最大报名人数*/
|
||||||
|
@Excel(name = "最大报名人数", width = 15)
|
||||||
|
@Schema(description = "最大报名人数")
|
||||||
|
private Integer maxEnroll;
|
||||||
|
/**状态*/
|
||||||
|
@Excel(name = "状态", width = 15, dicCode = "course_status")
|
||||||
|
@Dict(dicCode = "course_status")
|
||||||
|
@Schema(description = "状态")
|
||||||
|
private Integer status;
|
||||||
|
/**常见问题*/
|
||||||
|
@Excel(name = "常见问题", width = 15)
|
||||||
|
@Schema(description = "常见问题")
|
||||||
|
private String question;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
/**创建时间*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
/**更新时间*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 课程分类
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_course_category")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="课程分类")
|
||||||
|
public class AiolCourseCategory implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**分类名*/
|
||||||
|
@Excel(name = "分类名", width = 15)
|
||||||
|
@Schema(description = "分类名")
|
||||||
|
private java.lang.String name;
|
||||||
|
/**排序*/
|
||||||
|
@Excel(name = "排序", width = 15)
|
||||||
|
@Schema(description = "排序")
|
||||||
|
private java.lang.Integer sortOrder;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建时间*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新时间*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,82 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 课程章节
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_course_section")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="课程章节")
|
||||||
|
public class AiolCourseSection implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**课程id*/
|
||||||
|
@Excel(name = "课程id", width = 15)
|
||||||
|
@Schema(description = "课程id")
|
||||||
|
private java.lang.String courseId;
|
||||||
|
/**章节名*/
|
||||||
|
@Excel(name = "章节名", width = 15)
|
||||||
|
@Schema(description = "章节名")
|
||||||
|
private java.lang.String name;
|
||||||
|
/**章节类型*/
|
||||||
|
@Excel(name = "章节类型", width = 15, dicCode = "course_section_type")
|
||||||
|
@Dict(dicCode = "course_section_type")
|
||||||
|
@Schema(description = "章节类型")
|
||||||
|
private java.lang.Integer type;
|
||||||
|
/**排序号*/
|
||||||
|
@Excel(name = "排序号", width = 15)
|
||||||
|
@Schema(description = "排序号")
|
||||||
|
private java.lang.Integer sortOrder;
|
||||||
|
/**父章节id*/
|
||||||
|
@Excel(name = "父章节id", width = 15)
|
||||||
|
@Schema(description = "父章节id")
|
||||||
|
private java.lang.String parentId;
|
||||||
|
/**章节层级*/
|
||||||
|
@Excel(name = "章节层级", width = 15, dicCode = "course_section_level")
|
||||||
|
@Dict(dicCode = "course_section_level")
|
||||||
|
@Schema(description = "章节层级")
|
||||||
|
private java.lang.Integer level;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 课程报名
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_course_signup")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="课程报名")
|
||||||
|
public class AiolCourseSignup implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**用户id*/
|
||||||
|
@Excel(name = "用户id", width = 15)
|
||||||
|
@Schema(description = "用户id")
|
||||||
|
private java.lang.String userId;
|
||||||
|
/**课程id*/
|
||||||
|
@Excel(name = "课程id", width = 15)
|
||||||
|
@Schema(description = "课程id")
|
||||||
|
private java.lang.String courseId;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,73 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 授课教师
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_course_teacher")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="授课教师")
|
||||||
|
public class AiolCourseTeacher implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**课程id*/
|
||||||
|
@Excel(name = "课程id", width = 15)
|
||||||
|
@Schema(description = "课程id")
|
||||||
|
private java.lang.String courseId;
|
||||||
|
/**教师id*/
|
||||||
|
@Excel(name = "教师id", width = 15)
|
||||||
|
@Schema(description = "教师id")
|
||||||
|
private java.lang.String teacherId;
|
||||||
|
/**授课角色*/
|
||||||
|
@Excel(name = "授课角色", width = 15, dicCode = "course_role")
|
||||||
|
@Dict(dicCode = "course_role")
|
||||||
|
@Schema(description = "授课角色")
|
||||||
|
private java.lang.String role;
|
||||||
|
/**显示顺序*/
|
||||||
|
@Excel(name = "显示顺序", width = 15)
|
||||||
|
@Schema(description = "显示顺序")
|
||||||
|
private java.lang.Integer sortOrder;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 主体绑定
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_entity_link")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="主体绑定")
|
||||||
|
public class AiolEntityLink implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**主体类型*/
|
||||||
|
@Excel(name = "主体类型", width = 15)
|
||||||
|
@Schema(description = "主体类型")
|
||||||
|
private java.lang.String sourceType;
|
||||||
|
/**主体id*/
|
||||||
|
@Excel(name = "主体id", width = 15)
|
||||||
|
@Schema(description = "主体id")
|
||||||
|
private java.lang.String sourceId;
|
||||||
|
/**内容类型*/
|
||||||
|
@Excel(name = "内容类型", width = 15)
|
||||||
|
@Schema(description = "内容类型")
|
||||||
|
private java.lang.String targetType;
|
||||||
|
/**内容id*/
|
||||||
|
@Excel(name = "内容id", width = 15)
|
||||||
|
@Schema(description = "内容id")
|
||||||
|
private java.lang.String targetId;
|
||||||
|
/**排序*/
|
||||||
|
@Excel(name = "排序", width = 15)
|
||||||
|
@Schema(description = "排序")
|
||||||
|
private java.lang.Integer sortOrder;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
}
|
@ -0,0 +1,88 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 考试
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_exam")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="考试")
|
||||||
|
public class AiolExam implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**考试名称*/
|
||||||
|
@Excel(name = "考试名称", width = 15)
|
||||||
|
@Schema(description = "考试名称")
|
||||||
|
private java.lang.String name;
|
||||||
|
/**试卷id*/
|
||||||
|
@Excel(name = "试卷id", width = 15)
|
||||||
|
@Schema(description = "试卷id")
|
||||||
|
private java.lang.String paperId;
|
||||||
|
/**开始时间*/
|
||||||
|
@Excel(name = "开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "开始时间")
|
||||||
|
private java.util.Date startTime;
|
||||||
|
/**结束时间*/
|
||||||
|
@Excel(name = "结束时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "结束时间")
|
||||||
|
private java.util.Date endTime;
|
||||||
|
/**考试时长*/
|
||||||
|
@Excel(name = "考试时长", width = 15)
|
||||||
|
@Schema(description = "考试时长")
|
||||||
|
private java.lang.Integer totalTime;
|
||||||
|
/**考试类型*/
|
||||||
|
@Excel(name = "考试类型", width = 15)
|
||||||
|
@Schema(description = "考试类型")
|
||||||
|
private java.lang.Integer type;
|
||||||
|
/**状态*/
|
||||||
|
@Excel(name = "状态", width = 15)
|
||||||
|
@Schema(description = "状态")
|
||||||
|
private java.lang.Integer status;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,84 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 考试答题
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_exam_answer")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="考试答题")
|
||||||
|
public class AiolExamAnswer implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**考试id*/
|
||||||
|
@Excel(name = "考试id", width = 15)
|
||||||
|
@Schema(description = "考试id")
|
||||||
|
private java.lang.String examId;
|
||||||
|
/**用户id*/
|
||||||
|
@Excel(name = "用户id", width = 15)
|
||||||
|
@Schema(description = "用户id")
|
||||||
|
private java.lang.String userId;
|
||||||
|
/**复合题id*/
|
||||||
|
@Excel(name = "复合题id", width = 15)
|
||||||
|
@Schema(description = "复合题id")
|
||||||
|
private java.lang.String parentQuestionId;
|
||||||
|
/**题目id*/
|
||||||
|
@Excel(name = "题目id", width = 15)
|
||||||
|
@Schema(description = "题目id")
|
||||||
|
private java.lang.String questionId;
|
||||||
|
/**答案*/
|
||||||
|
@Excel(name = "答案", width = 15)
|
||||||
|
@Schema(description = "答案")
|
||||||
|
private java.lang.String answer;
|
||||||
|
/**是否正确*/
|
||||||
|
@Excel(name = "是否正确", width = 15)
|
||||||
|
@Schema(description = "是否正确")
|
||||||
|
private java.lang.Integer izCorrect;
|
||||||
|
/**题目得分*/
|
||||||
|
@Excel(name = "题目得分", width = 15)
|
||||||
|
@Schema(description = "题目得分")
|
||||||
|
private java.lang.Double score;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,86 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 考试记录
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_exam_record")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="考试记录")
|
||||||
|
public class AiolExamRecord implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**考试id*/
|
||||||
|
@Excel(name = "考试id", width = 15)
|
||||||
|
@Schema(description = "考试id")
|
||||||
|
private java.lang.String examId;
|
||||||
|
/**用户id*/
|
||||||
|
@Excel(name = "用户id", width = 15)
|
||||||
|
@Schema(description = "用户id")
|
||||||
|
private java.lang.String userId;
|
||||||
|
/**总分*/
|
||||||
|
@Excel(name = "总分", width = 15)
|
||||||
|
@Schema(description = "总分")
|
||||||
|
private java.lang.Double totalScore;
|
||||||
|
/**状态*/
|
||||||
|
@Excel(name = "状态", width = 15)
|
||||||
|
@Schema(description = "状态")
|
||||||
|
private java.lang.Integer status;
|
||||||
|
/**提交时间*/
|
||||||
|
@Excel(name = "提交时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "提交时间")
|
||||||
|
private java.util.Date submittedAt;
|
||||||
|
/**ip地址*/
|
||||||
|
@Excel(name = "ip地址", width = 15)
|
||||||
|
@Schema(description = "ip地址")
|
||||||
|
private java.lang.String ipAddress;
|
||||||
|
/**设备信息*/
|
||||||
|
@Excel(name = "设备信息", width = 15)
|
||||||
|
@Schema(description = "设备信息")
|
||||||
|
private java.lang.String deviceInfo;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 作业
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_homework")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="作业")
|
||||||
|
public class AiolHomework implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**标题*/
|
||||||
|
@Excel(name = "标题", width = 15)
|
||||||
|
@Schema(description = "标题")
|
||||||
|
private java.lang.String title;
|
||||||
|
/**说明*/
|
||||||
|
@Excel(name = "说明", width = 15)
|
||||||
|
@Schema(description = "说明")
|
||||||
|
private java.lang.String description;
|
||||||
|
/**附件*/
|
||||||
|
@Excel(name = "附件", width = 15)
|
||||||
|
@Schema(description = "附件")
|
||||||
|
private java.lang.String attachment;
|
||||||
|
/**满分*/
|
||||||
|
@Excel(name = "满分", width = 15)
|
||||||
|
@Schema(description = "满分")
|
||||||
|
private java.lang.Integer maxScore;
|
||||||
|
/**及格分数*/
|
||||||
|
@Excel(name = "及格分数", width = 15)
|
||||||
|
@Schema(description = "及格分数")
|
||||||
|
private java.lang.Integer passScore;
|
||||||
|
/**开始时间*/
|
||||||
|
@Excel(name = "开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "开始时间")
|
||||||
|
private java.util.Date startTime;
|
||||||
|
/**结束时间*/
|
||||||
|
@Excel(name = "结束时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "结束时间")
|
||||||
|
private java.util.Date endTime;
|
||||||
|
/**状态*/
|
||||||
|
@Excel(name = "状态", width = 15, dicCode = "course_status")
|
||||||
|
@Dict(dicCode = "course_status")
|
||||||
|
@Schema(description = "状态")
|
||||||
|
private java.lang.Integer status;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,90 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 作业提交
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_homework_submit")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="作业提交")
|
||||||
|
public class AiolHomeworkSubmit implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**作业id*/
|
||||||
|
@Excel(name = "作业id", width = 15)
|
||||||
|
@Schema(description = "作业id")
|
||||||
|
private java.lang.String homeworkId;
|
||||||
|
/**学生id*/
|
||||||
|
@Excel(name = "学生id", width = 15)
|
||||||
|
@Schema(description = "学生id")
|
||||||
|
private java.lang.String studentId;
|
||||||
|
/**作业内容*/
|
||||||
|
@Excel(name = "作业内容", width = 15)
|
||||||
|
@Schema(description = "作业内容")
|
||||||
|
private java.lang.String content;
|
||||||
|
/**附件*/
|
||||||
|
@Excel(name = "附件", width = 15)
|
||||||
|
@Schema(description = "附件")
|
||||||
|
private java.lang.String attachment;
|
||||||
|
/**得分*/
|
||||||
|
@Excel(name = "得分", width = 15)
|
||||||
|
@Schema(description = "得分")
|
||||||
|
private java.lang.Integer score;
|
||||||
|
/**批改意见*/
|
||||||
|
@Excel(name = "批改意见", width = 15)
|
||||||
|
@Schema(description = "批改意见")
|
||||||
|
private java.lang.String comment;
|
||||||
|
/**批改时间*/
|
||||||
|
@Excel(name = "批改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "批改时间")
|
||||||
|
private java.util.Date gradedTime;
|
||||||
|
/**状态*/
|
||||||
|
@Excel(name = "状态", width = 15)
|
||||||
|
@Schema(description = "状态")
|
||||||
|
private java.lang.Integer status;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,80 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 学习进度
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_learn_progress")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="学习进度")
|
||||||
|
public class AiolLearnProgress implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**用户id*/
|
||||||
|
@Excel(name = "用户id", width = 15)
|
||||||
|
@Schema(description = "用户id")
|
||||||
|
private java.lang.String userId;
|
||||||
|
/**课程id*/
|
||||||
|
@Excel(name = "课程id", width = 15)
|
||||||
|
@Schema(description = "课程id")
|
||||||
|
private java.lang.String courseId;
|
||||||
|
/**章节id*/
|
||||||
|
@Excel(name = "章节id", width = 15)
|
||||||
|
@Schema(description = "章节id")
|
||||||
|
private java.lang.String sectionId;
|
||||||
|
/**进度*/
|
||||||
|
@Excel(name = "进度", width = 15)
|
||||||
|
@Schema(description = "进度")
|
||||||
|
private java.lang.Integer progress;
|
||||||
|
/**时长*/
|
||||||
|
@Excel(name = "时长", width = 15)
|
||||||
|
@Schema(description = "时长")
|
||||||
|
private java.lang.Integer duration;
|
||||||
|
/**状态*/
|
||||||
|
@Excel(name = "状态", width = 15)
|
||||||
|
@Schema(description = "状态")
|
||||||
|
private java.lang.Integer status;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,84 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 试卷
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_paper")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="试卷")
|
||||||
|
public class AiolPaper implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**试卷标题*/
|
||||||
|
@Excel(name = "试卷标题", width = 15)
|
||||||
|
@Schema(description = "试卷标题")
|
||||||
|
private java.lang.String title;
|
||||||
|
/**组卷模式*/
|
||||||
|
@Excel(name = "组卷模式", width = 15)
|
||||||
|
@Schema(description = "组卷模式")
|
||||||
|
private java.lang.Integer generateMode;
|
||||||
|
/**组卷规则*/
|
||||||
|
@Excel(name = "组卷规则", width = 15)
|
||||||
|
@Schema(description = "组卷规则")
|
||||||
|
private java.lang.String rules;
|
||||||
|
/**题库id*/
|
||||||
|
@Excel(name = "题库id", width = 15)
|
||||||
|
@Schema(description = "题库id")
|
||||||
|
private java.lang.String repoId;
|
||||||
|
/**总分*/
|
||||||
|
@Excel(name = "总分", width = 15)
|
||||||
|
@Schema(description = "总分")
|
||||||
|
private java.lang.Double totalScore;
|
||||||
|
/**及格分*/
|
||||||
|
@Excel(name = "及格分", width = 15)
|
||||||
|
@Schema(description = "及格分")
|
||||||
|
private java.lang.Double passScore;
|
||||||
|
/**是否需要批阅*/
|
||||||
|
@Excel(name = "是否需要批阅", width = 15)
|
||||||
|
@Schema(description = "是否需要批阅")
|
||||||
|
private java.lang.Integer requireReview;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 试卷试题
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_paper_question")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="试卷试题")
|
||||||
|
public class AiolPaperQuestion implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**试卷id*/
|
||||||
|
@Excel(name = "试卷id", width = 15)
|
||||||
|
@Schema(description = "试卷id")
|
||||||
|
private java.lang.String paperId;
|
||||||
|
/**题目id*/
|
||||||
|
@Excel(name = "题目id", width = 15)
|
||||||
|
@Schema(description = "题目id")
|
||||||
|
private java.lang.String questionId;
|
||||||
|
/**排序*/
|
||||||
|
@Excel(name = "排序", width = 15)
|
||||||
|
@Schema(description = "排序")
|
||||||
|
private java.lang.Integer orderNo;
|
||||||
|
/**分值*/
|
||||||
|
@Excel(name = "分值", width = 15)
|
||||||
|
@Schema(description = "分值")
|
||||||
|
private java.lang.Double score;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,82 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 题目
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_question")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="题目")
|
||||||
|
public class AiolQuestion implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**父题目id*/
|
||||||
|
@Excel(name = "父题目id", width = 15)
|
||||||
|
@Schema(description = "父题目id")
|
||||||
|
private java.lang.String parentId;
|
||||||
|
/**题目类型*/
|
||||||
|
@Excel(name = "题目类型", width = 15, dicCode = "question_type")
|
||||||
|
@Dict(dicCode = "question_type")
|
||||||
|
@Schema(description = "题目类型")
|
||||||
|
private java.lang.Integer type;
|
||||||
|
/**题干*/
|
||||||
|
@Excel(name = "题干", width = 15)
|
||||||
|
@Schema(description = "题干")
|
||||||
|
private java.lang.String content;
|
||||||
|
/**题目解析*/
|
||||||
|
@Excel(name = "题目解析", width = 15)
|
||||||
|
@Schema(description = "题目解析")
|
||||||
|
private java.lang.String analysis;
|
||||||
|
/**难度*/
|
||||||
|
@Excel(name = "难度", width = 15, dicCode = "question_difficulty")
|
||||||
|
@Dict(dicCode = "question_difficulty")
|
||||||
|
@Schema(description = "难度")
|
||||||
|
private java.lang.Integer difficulty;
|
||||||
|
/**分值*/
|
||||||
|
@Excel(name = "分值", width = 15)
|
||||||
|
@Schema(description = "分值")
|
||||||
|
private java.lang.Integer score;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 题目答案
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_question_answer")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="题目答案")
|
||||||
|
public class AiolQuestionAnswer implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**题目id*/
|
||||||
|
@Excel(name = "题目id", width = 15)
|
||||||
|
@Schema(description = "题目id")
|
||||||
|
private java.lang.String questionId;
|
||||||
|
/**答案内容*/
|
||||||
|
@Excel(name = "答案内容", width = 15)
|
||||||
|
@Schema(description = "答案内容")
|
||||||
|
private java.lang.String answerText;
|
||||||
|
/**序号*/
|
||||||
|
@Excel(name = "序号", width = 15)
|
||||||
|
@Schema(description = "序号")
|
||||||
|
private java.lang.Integer orderNo;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 题目选项
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_question_option")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="题目选项")
|
||||||
|
public class AiolQuestionOption implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**题目id*/
|
||||||
|
@Excel(name = "题目id", width = 15)
|
||||||
|
@Schema(description = "题目id")
|
||||||
|
private java.lang.String questionId;
|
||||||
|
/**选项内容*/
|
||||||
|
@Excel(name = "选项内容", width = 15)
|
||||||
|
@Schema(description = "选项内容")
|
||||||
|
private java.lang.String content;
|
||||||
|
/**是否正确答案*/
|
||||||
|
@Excel(name = "是否正确答案", width = 15)
|
||||||
|
@Schema(description = "是否正确答案")
|
||||||
|
private java.lang.Integer izCorrent;
|
||||||
|
/**序号*/
|
||||||
|
@Excel(name = "序号", width = 15)
|
||||||
|
@Schema(description = "序号")
|
||||||
|
private java.lang.Integer orderNo;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 题库题目
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_question_repo")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="题库题目")
|
||||||
|
public class AiolQuestionRepo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**题库id*/
|
||||||
|
@Excel(name = "题库id", width = 15)
|
||||||
|
@Schema(description = "题库id")
|
||||||
|
private java.lang.String repoId;
|
||||||
|
/**题目id*/
|
||||||
|
@Excel(name = "题目id", width = 15)
|
||||||
|
@Schema(description = "题目id")
|
||||||
|
private java.lang.String questionId;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 题库
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_repo")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="题库")
|
||||||
|
public class AiolRepo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**题库名称*/
|
||||||
|
@Excel(name = "题库名称", width = 15)
|
||||||
|
@Schema(description = "题库名称")
|
||||||
|
private java.lang.String title;
|
||||||
|
/**题库备注*/
|
||||||
|
@Excel(name = "题库备注", width = 15)
|
||||||
|
@Schema(description = "题库备注")
|
||||||
|
private java.lang.String remark;
|
||||||
|
/**题目数量*/
|
||||||
|
@Excel(name = "题目数量", width = 15)
|
||||||
|
@Schema(description = "题目数量")
|
||||||
|
private java.lang.Integer questionCount;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 资源
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_resource")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="资源")
|
||||||
|
public class AiolResource implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**资源名*/
|
||||||
|
@Excel(name = "资源名", width = 15)
|
||||||
|
@Schema(description = "资源名")
|
||||||
|
private java.lang.String name;
|
||||||
|
/**描述*/
|
||||||
|
@Excel(name = "描述", width = 15)
|
||||||
|
@Schema(description = "描述")
|
||||||
|
private java.lang.String description;
|
||||||
|
/**资源类型*/
|
||||||
|
@Excel(name = "资源类型", width = 15, dicCode = "resource_type")
|
||||||
|
@Dict(dicCode = "resource_type")
|
||||||
|
@Schema(description = "资源类型")
|
||||||
|
private java.lang.Integer type;
|
||||||
|
/**文件url*/
|
||||||
|
@Excel(name = "文件url", width = 15)
|
||||||
|
@Schema(description = "文件url")
|
||||||
|
private java.lang.String fileUrl;
|
||||||
|
/**缩略图url*/
|
||||||
|
@Excel(name = "缩略图url", width = 15)
|
||||||
|
@Schema(description = "缩略图url")
|
||||||
|
private java.lang.String thumbnailUrl;
|
||||||
|
/**时长*/
|
||||||
|
@Excel(name = "时长", width = 15)
|
||||||
|
@Schema(description = "时长")
|
||||||
|
private java.lang.Integer duration;
|
||||||
|
/**文件大小*/
|
||||||
|
@Excel(name = "文件大小", width = 15)
|
||||||
|
@Schema(description = "文件大小")
|
||||||
|
private java.lang.Integer fileSize;
|
||||||
|
/**文件元数据*/
|
||||||
|
@Excel(name = "文件元数据", width = 15)
|
||||||
|
@Schema(description = "文件元数据")
|
||||||
|
private java.lang.String metadata;
|
||||||
|
/**是否精选*/
|
||||||
|
@Excel(name = "是否精选", width = 15, dicCode = "resource_iz_featured")
|
||||||
|
@Dict(dicCode = "resource_iz_featured")
|
||||||
|
@Schema(description = "是否精选")
|
||||||
|
private java.lang.Integer izFeatured;
|
||||||
|
/**状态*/
|
||||||
|
@Excel(name = "状态", width = 15, dicCode = "resource_status")
|
||||||
|
@Dict(dicCode = "resource_status")
|
||||||
|
@Schema(description = "状态")
|
||||||
|
private java.lang.Integer status;
|
||||||
|
/**创建人*/
|
||||||
|
@Excel(name = "创建人", width = 15)
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createdBy;
|
||||||
|
/**创建时间*/
|
||||||
|
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
private java.util.Date createdTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Excel(name = "更新人", width = 15)
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updatedBy;
|
||||||
|
/**更新时间*/
|
||||||
|
@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
private java.util.Date updatedTime;
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 标签
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_tag")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="标签")
|
||||||
|
public class AiolTag implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**标签名*/
|
||||||
|
@Excel(name = "标签名", width = 15)
|
||||||
|
@Schema(description = "标签名")
|
||||||
|
private java.lang.String name;
|
||||||
|
/**目标类型*/
|
||||||
|
@Excel(name = "目标类型", width = 15)
|
||||||
|
@Schema(description = "目标类型")
|
||||||
|
private java.lang.String targetType;
|
||||||
|
/**目标id*/
|
||||||
|
@Excel(name = "目标id", width = 15)
|
||||||
|
@Schema(description = "目标id")
|
||||||
|
private java.lang.String targetId;
|
||||||
|
/**描述*/
|
||||||
|
@Excel(name = "描述", width = 15)
|
||||||
|
@Schema(description = "描述")
|
||||||
|
private java.lang.String description;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,84 @@
|
|||||||
|
package org.jeecg.modules.aiol.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 用户信息
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("aiol_user_info")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description="用户信息")
|
||||||
|
public class AiolUserInfo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**用户id*/
|
||||||
|
@Excel(name = "用户id", width = 15)
|
||||||
|
@Schema(description = "用户id")
|
||||||
|
private java.lang.String userId;
|
||||||
|
/**专业*/
|
||||||
|
@Excel(name = "专业", width = 15)
|
||||||
|
@Schema(description = "专业")
|
||||||
|
private java.lang.String major;
|
||||||
|
/**学院*/
|
||||||
|
@Excel(name = "学院", width = 15)
|
||||||
|
@Schema(description = "学院")
|
||||||
|
private java.lang.String college;
|
||||||
|
/**学历*/
|
||||||
|
@Excel(name = "学历", width = 15)
|
||||||
|
@Schema(description = "学历")
|
||||||
|
private java.lang.String education;
|
||||||
|
/**职称*/
|
||||||
|
@Excel(name = "职称", width = 15)
|
||||||
|
@Schema(description = "职称")
|
||||||
|
private java.lang.String title;
|
||||||
|
/**标签*/
|
||||||
|
@Excel(name = "标签", width = 15)
|
||||||
|
@Schema(description = "标签")
|
||||||
|
private java.lang.String tag;
|
||||||
|
/**显示顺序*/
|
||||||
|
@Excel(name = "显示顺序", width = 15)
|
||||||
|
@Schema(description = "显示顺序")
|
||||||
|
private java.lang.Integer sortOrder;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolActivity;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 活动
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolActivityMapper extends BaseMapper<AiolActivity> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolActivitySignup;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 活动报名
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolActivitySignupMapper extends BaseMapper<AiolActivitySignup> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolComment;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 评论
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolCommentMapper extends BaseMapper<AiolComment> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolContentConfig;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 内容配置
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolContentConfigMapper extends BaseMapper<AiolContentConfig> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolCourseCategory;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 课程分类
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolCourseCategoryMapper extends BaseMapper<AiolCourseCategory> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolCourse;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 课程
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolCourseMapper extends BaseMapper<AiolCourse> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolCourseSection;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 课程章节
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolCourseSectionMapper extends BaseMapper<AiolCourseSection> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolCourseSignup;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 课程报名
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolCourseSignupMapper extends BaseMapper<AiolCourseSignup> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolCourseTeacher;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 授课教师
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolCourseTeacherMapper extends BaseMapper<AiolCourseTeacher> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolEntityLink;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 主体绑定
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolEntityLinkMapper extends BaseMapper<AiolEntityLink> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolExamAnswer;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 考试答题
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolExamAnswerMapper extends BaseMapper<AiolExamAnswer> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolExam;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 考试
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolExamMapper extends BaseMapper<AiolExam> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolExamRecord;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 考试记录
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolExamRecordMapper extends BaseMapper<AiolExamRecord> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolHomework;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 作业
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolHomeworkMapper extends BaseMapper<AiolHomework> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolHomeworkSubmit;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 作业提交
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolHomeworkSubmitMapper extends BaseMapper<AiolHomeworkSubmit> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolLearnProgress;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 学习进度
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolLearnProgressMapper extends BaseMapper<AiolLearnProgress> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolPaper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 试卷
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolPaperMapper extends BaseMapper<AiolPaper> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolPaperQuestion;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 试卷试题
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolPaperQuestionMapper extends BaseMapper<AiolPaperQuestion> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolQuestionAnswer;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 题目答案
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolQuestionAnswerMapper extends BaseMapper<AiolQuestionAnswer> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolQuestion;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 题目
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolQuestionMapper extends BaseMapper<AiolQuestion> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolQuestionOption;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 题目选项
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolQuestionOptionMapper extends BaseMapper<AiolQuestionOption> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolQuestionRepo;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 题库题目
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolQuestionRepoMapper extends BaseMapper<AiolQuestionRepo> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolRepo;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 题库
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolRepoMapper extends BaseMapper<AiolRepo> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolResource;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 资源
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolResourceMapper extends BaseMapper<AiolResource> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolTag;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 标签
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolTagMapper extends BaseMapper<AiolTag> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.aiol.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.aiol.entity.AiolUserInfo;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 用户信息
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-31
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface AiolUserInfoMapper extends BaseMapper<AiolUserInfo> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.aiol.mapper.AiolActivityMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.aiol.mapper.AiolActivitySignupMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.aiol.mapper.AiolCommentMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.aiol.mapper.AiolContentConfigMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.aiol.mapper.AiolCourseCategoryMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.aiol.mapper.AiolCourseMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.aiol.mapper.AiolCourseSectionMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.aiol.mapper.AiolCourseSignupMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.aiol.mapper.AiolCourseTeacherMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.aiol.mapper.AiolEntityLinkMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.aiol.mapper.AiolExamAnswerMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.aiol.mapper.AiolExamMapper">
|
||||||
|
|
||||||
|
</mapper>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user