刘俊驰 7 kuukautta sitten
vanhempi
commit
a7d99aea76

+ 0 - 59
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/HomeController.java

@@ -1,59 +0,0 @@
-package com.yonge.cooleshow.teacher.controller;
-
-import com.yonge.cooleshow.auth.api.entity.SysUser;
-import com.yonge.cooleshow.biz.dal.dto.SubjectHomeSearch;
-import com.yonge.cooleshow.biz.dal.dto.req.TotalReq;
-import com.yonge.cooleshow.biz.dal.service.HomeService;
-import com.yonge.cooleshow.biz.dal.service.MusicSheetService;
-import com.yonge.cooleshow.biz.dal.service.SysUserService;
-import com.yonge.cooleshow.biz.dal.vo.CourseHomeVo;
-import com.yonge.cooleshow.biz.dal.vo.HomeMusicSheetVo;
-import com.yonge.cooleshow.biz.dal.vo.SubjectHomeVo;
-import com.yonge.cooleshow.biz.dal.vo.res.HomeTotalStudent;
-import com.yonge.cooleshow.biz.dal.vo.res.HomeTotalTeacher;
-import com.yonge.cooleshow.biz.dal.vo.res.HomeUserToDoNum;
-import com.yonge.cooleshow.biz.dal.wrapper.teacher.TeacherHomeWrapper;
-import com.yonge.cooleshow.common.controller.BaseController;
-import com.yonge.cooleshow.common.entity.HttpResponseResult;
-import com.yonge.toolset.base.page.PageInfo;
-import com.yonge.toolset.mybatis.support.PageUtil;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.validation.Valid;
-import java.util.List;
-import java.util.Map;
-
-@RestController
-@RequestMapping("${app-config.url.teacher:}/home")
-@Api(value = "首页", tags = "首页")
-public class HomeController extends BaseController {
-
-
-    @Autowired
-    private HomeService homeService;
-
-    @Autowired
-    private SysUserService sysUserService;
-
-    @ApiOperation(value = "课程统计")
-    @PostMapping("/totalCourse")
-    public HttpResponseResult<List<TeacherHomeWrapper.TeacherTotalCourse>> totalCourse(@RequestBody TeacherHomeWrapper.TeacherTotalCourseQuery query) {
-        SysUser sysUser = sysUserService.getUser();
-        if (sysUser == null  || sysUser.getId() == null) {
-
-            return failed("用户信息获取失败");
-        }
-        query.setTeacherId(sysUser.getId());
-
-        return succeed(homeService.teacherTotalCourse(query));
-    }
-}

+ 16 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherHomeController.java

@@ -1,9 +1,11 @@
 package com.yonge.cooleshow.teacher.controller;
 
+import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.service.*;
 import com.yonge.cooleshow.biz.dal.vo.PianoRoomTimeVo;
 import com.yonge.cooleshow.biz.dal.vo.TeacherHomeStatisticalVo;
 import com.yonge.cooleshow.biz.dal.wrapper.TeacherIndexWrapper;
+import com.yonge.cooleshow.biz.dal.wrapper.teacher.TeacherHomeWrapper;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
@@ -13,6 +15,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
+import java.util.List;
 
 /**
  * Description 老师课后作业相关接口
@@ -40,6 +43,9 @@ public class TeacherHomeController extends BaseController {
     @Resource
     private SysMusicCompareRecordService sysMusicCompareRecordService;
 
+    @Autowired
+    private HomeService homeService;
+
     @ApiOperation(value = "首页统计数据")
     @GetMapping(value="/count")
     public HttpResponseResult<TeacherHomeStatisticalVo> countTeacherHome() {
@@ -85,7 +91,17 @@ public class TeacherHomeController extends BaseController {
         return succeed(sysMusicCompareRecordService.getTeacherPracticeHome(summarySearch));
     }
 
+    @ApiOperation(value = "课程统计")
+    @PostMapping("/totalCourse")
+    public HttpResponseResult<List<TeacherHomeWrapper.TeacherTotalCourse>> totalCourse(@RequestBody TeacherHomeWrapper.TeacherTotalCourseQuery query) {
+        SysUser sysUser = sysUserService.getUser();
+        if (sysUser == null  || sysUser.getId() == null) {
 
+            return failed("用户信息获取失败");
+        }
+        query.setTeacherId(sysUser.getId());
 
+        return succeed(homeService.teacherTotalCourse(query));
+    }
 
 }