|
|
@@ -0,0 +1,66 @@
|
|
|
+package cn.iocoder.byzs.module.web.controller.admin.ai;
|
|
|
+
|
|
|
+import cn.iocoder.byzs.framework.common.pojo.CommonResult;
|
|
|
+import cn.iocoder.byzs.framework.common.util.object.BeanUtils;
|
|
|
+import cn.iocoder.byzs.module.bjdx.controller.admin.course.vo.CoursePageReqVO;
|
|
|
+import cn.iocoder.byzs.module.bjdx.controller.admin.coursetype.vo.CourseTypeListReqVO;
|
|
|
+import cn.iocoder.byzs.module.bjdx.controller.admin.coursetype.vo.CourseTypeRespVO;
|
|
|
+import cn.iocoder.byzs.module.bjdx.dal.dataobject.coursetype.CourseTypeDO;
|
|
|
+import cn.iocoder.byzs.module.bjdx.service.course.CourseService;
|
|
|
+import cn.iocoder.byzs.module.bjdx.service.coursetype.CourseTypeService;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.Parameter;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import jakarta.annotation.Resource;
|
|
|
+import jakarta.annotation.security.PermitAll;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+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.List;
|
|
|
+
|
|
|
+import static cn.iocoder.byzs.framework.common.pojo.CommonResult.success;
|
|
|
+
|
|
|
+@Tag(name = "Web-前端接口")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/bjdxWeb/ai")
|
|
|
+@Validated
|
|
|
+public class WebAiController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private CourseService courseService;
|
|
|
+ @Resource
|
|
|
+ private CourseTypeService courseTypeService;
|
|
|
+
|
|
|
+
|
|
|
+ @PermitAll
|
|
|
+ @GetMapping("/getCourseByTypeId")
|
|
|
+ @Operation(summary = "根据类型获得课程列表")
|
|
|
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
+ public CommonResult<List<CoursePageReqVO>> getCourseByTypeId(@RequestParam("typeId") String typeId) {
|
|
|
+ List<CoursePageReqVO> courseList = courseService.getCourseList(new CoursePageReqVO().setCourseType(typeId));
|
|
|
+ return success(courseList);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PermitAll
|
|
|
+ @GetMapping("/getTypeGrade")
|
|
|
+ @Operation(summary = "获得课程-年级")
|
|
|
+ public CommonResult<List<CourseTypeRespVO>> getTypeGrade() {
|
|
|
+ CourseTypeListReqVO listReqVO = new CourseTypeListReqVO().setCtTypeNode("0");
|
|
|
+ List<CourseTypeDO> list = courseTypeService.getCourseTypeList(listReqVO);
|
|
|
+ List<CourseTypeRespVO> listVo = BeanUtils.toBean(list, CourseTypeRespVO.class);
|
|
|
+ return success(listVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PermitAll
|
|
|
+ @GetMapping("/getTypeByGradeId")
|
|
|
+ @Operation(summary = "获得课程-年级大纲")
|
|
|
+ public CommonResult<List<CourseTypeRespVO>> getTypeByGradeId(@RequestParam("id") Integer id) {
|
|
|
+ CourseTypeListReqVO listReqVO = new CourseTypeListReqVO().setCtParentId(id).setCtTypeNode("1");
|
|
|
+ List<CourseTypeDO> list = courseTypeService.getCourseTypeList(listReqVO);
|
|
|
+ List<CourseTypeRespVO> listVo = BeanUtils.toBean(list, CourseTypeRespVO.class);
|
|
|
+ return success(listVo);
|
|
|
+ }
|
|
|
+}
|