Эх сурвалжийг харах

feat(app): 添加获取所有课程类目功能

- 新增 getAllCourseCategory 方法,用于获取指定门店的课程类目
- 在 AppDetailController 中添加相应的 API 接口
- 在 DetailServiceImpl 中实现具体逻辑
- 在 IDetailService 中声明新方法
SheepHy 1 долоо хоног өмнө
parent
commit
d9bd86ef55

+ 12 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/controller/AppDetailController.java

@@ -89,6 +89,18 @@ public class AppDetailController {
     public Result<List<AppCategory>> getAllCategory(@RequestParam @Schema(description="门店ID")String id){
         return Result.ok(detailService.getAllCategory(id));
     }
+
+    /**
+     * @Author SheepHy
+     * @Description 获取所有课程类目
+     * @Date 10:14 2025/7/9
+     **/
+    @GetMapping("/getAllCourseCategory")
+    @Operation(summary = "获取所有类目")
+    public Result<List<AppCategory>> getAllCourseCategory(@RequestParam @Schema(description="门店ID")String id){
+        return Result.ok(detailService.getAllCourseCategory(id));
+    }
+
     /**
      * @Author zx
      * @Description 查询课时列表封装

+ 9 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/IDetailService.java

@@ -57,6 +57,15 @@ public interface IDetailService {
      **/
     List<AppCategory> getAllCategory(String id);
 
+    /**
+     * @description 获取所有课程类目
+     * params
+     * @author SheepHy
+     * @date 2025/9/15
+     * return   {@link }
+     **/
+    List<AppCategory> getAllCourseCategory(String id);
+
     IPage<CourseResponseVo> findByCourseList(CourseRequestVo courseRequestVo);
 
 }

+ 14 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/DetailServiceImpl.java

@@ -385,6 +385,20 @@ public class DetailServiceImpl implements IDetailService {
         return appCategories;
     }
 
+    @Override
+    public List<AppCategory> getAllCourseCategory(String id) {
+        List<AppCategory> appCategories = new ArrayList<>();
+        AppSite appSite = appSiteMapper.selectById(id);
+        List<String> objects = new ArrayList<>();
+        if(null != appSite){
+            objects = Arrays.asList(appSite.getCategoryId().split(","));
+        }
+        if(objects.isEmpty()) return appCategories;
+        appCategories = appCategoryMapper.selectList(Wrappers.<AppCategory>lambdaQuery()
+                .eq(AppCategory::getStatus, 0).in(AppCategory::getId,objects)
+                .eq(AppCategory::getDelFlag, 0));
+        return appCategories;
+    }
 
 
     /**