beetlsql3-dev
Mlxa0324 2 years ago
parent 19e47d9e63
commit 7d76dc9fa5

@ -0,0 +1,80 @@
package com.ibeetl.jlw.service.api.student;
import cn.hutool.core.lang.Assert;
import com.ibeetl.jlw.dao.TeacherMergeApplicationDao;
import com.ibeetl.jlw.entity.Teacher;
import com.ibeetl.jlw.entity.TeacherMergeApplication;
import com.ibeetl.jlw.entity.TeacherOpenCourseMergeTeacher;
import com.ibeetl.jlw.entity.TeacherOpenCourseNotice;
import com.ibeetl.jlw.entity.api.CurrentUserInfo;
import com.ibeetl.jlw.entity.api.teacher.TeacherIndexData;
import com.ibeetl.jlw.service.IndexBaseService;
import com.ibeetl.jlw.service.TeacherOpenCourseMergeTeacherService;
import com.ibeetl.jlw.service.TeacherOpenCourseNoticeService;
import com.ibeetl.jlw.web.query.TeacherMergeApplicationQuery;
import com.ibeetl.jlw.web.query.TeacherOpenCourseMergeTeacherQuery;
import com.ibeetl.jlw.web.query.TeacherOpenCourseNoticeQuery;
import org.assertj.core.util.Lists;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author mlx
* @date 2022/10/20
* @modified
*/
@Service
public class ApiStudentService {
@Resource private IndexBaseService indexBaseService;
@Resource private TeacherOpenCourseNoticeService teacherOpenCourseNoticeService;
@Resource private TeacherMergeApplicationDao teacherMergeApplicationDao;
@Resource private TeacherOpenCourseMergeTeacherService teacherOpenCourseMergeTeacherService;
/**
* -
* @return
*/
public TeacherIndexData index() {
// 自动根据登录的身份获取当前用户信息。
CurrentUserInfo currentUserInfo = indexBaseService.userInfo();
Object identityInfo = currentUserInfo.getIdentityInfo();
Assert.isTrue(identityInfo instanceof Teacher, "该接口只能老师访问!");
// 教师ID
final Long teacherId = ((Teacher) identityInfo).getTeacherId();
// TODO xuliangtong 实训评阅列表查询
List<Object> toDoList = Lists.emptyList();
// 我的通知
TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery = new TeacherOpenCourseNoticeQuery();
teacherOpenCourseNoticeQuery.setCreateByTeacherId(teacherId);
List<TeacherOpenCourseNotice> noticeList = teacherOpenCourseNoticeService.getValuesByQuery(teacherOpenCourseNoticeQuery);
// 教师应用信息
TeacherMergeApplicationQuery teacherMergeApplicationQuery = new TeacherMergeApplicationQuery();
teacherMergeApplicationQuery.setTeacherId(teacherId);
List<TeacherMergeApplication> applicationList = teacherMergeApplicationDao.getValuesByQueryOrderByIndex(teacherMergeApplicationQuery);
// 我的开课信息
TeacherOpenCourseMergeTeacherQuery teacherOpenCourseMergeTeacherQuery = new TeacherOpenCourseMergeTeacherQuery();
teacherOpenCourseMergeTeacherQuery.setTeacherId(teacherId);
List<TeacherOpenCourseMergeTeacher> openCourseList = teacherOpenCourseMergeTeacherService.getValuesByQuery(teacherOpenCourseMergeTeacherQuery);
return TeacherIndexData.builder()
.toDoList(toDoList)
.noticeList(noticeList)
.myApplicationList(applicationList)
.myOpenCourseList(openCourseList)
.build();
}
}

@ -2,7 +2,10 @@ package com.ibeetl.jlw.service.api.teacher;
import cn.hutool.core.lang.Assert;
import com.ibeetl.jlw.dao.TeacherMergeApplicationDao;
import com.ibeetl.jlw.entity.*;
import com.ibeetl.jlw.entity.Teacher;
import com.ibeetl.jlw.entity.TeacherMergeApplication;
import com.ibeetl.jlw.entity.TeacherOpenCourseMergeTeacher;
import com.ibeetl.jlw.entity.TeacherOpenCourseNotice;
import com.ibeetl.jlw.entity.api.CurrentUserInfo;
import com.ibeetl.jlw.entity.api.teacher.TeacherIndexData;
import com.ibeetl.jlw.service.IndexBaseService;
@ -27,7 +30,7 @@ import java.util.List;
* @modified
*/
@Service
public class TeacherIndexService {
public class ApiTeacherService {
@Resource private IndexBaseService indexBaseService;
@Resource private TeacherOpenCourseNoticeService teacherOpenCourseNoticeService;

@ -172,31 +172,6 @@ public class StudentController{
}
}
/**
* -
* @return
*/
@PostMapping(API + "/register.do")
@ResponseBody
public JsonResult register() {
return JsonResult.success();
}
/**
* -
*
* @date 2022/10/21
* @return
*/
@PostMapping(API + "/indexData.do")
@ResponseBody
public JsonResult indexData() {
return JsonResult.success();
}
//学生端首页所需数据
@GetMapping(API + "/indexInfo.do")
@ResponseBody

@ -0,0 +1,63 @@
package com.ibeetl.jlw.web.api.student;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.jlw.entity.api.teacher.TeacherIndexData;
import com.ibeetl.jlw.service.api.student.ApiStudentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* -
*
* @author lx
*/
@Slf4j
@Validated
@RestController
@RequestMapping("/api/student")
public class ApiStudentController {
@Resource private ApiStudentService apiStudentService;
/**
* -
* @return
*/
@PostMapping("index.do")
public JsonResult<TeacherIndexData> index() {
return JsonResult.success(apiStudentService.index());
}
/**
* -
*
* @date 2022/10/21
* @return
*/
@PostMapping("register.do")
@ResponseBody
public JsonResult register() {
return JsonResult.success();
}
/**
* -
*
* @date 2022/10/21
* @return
*/
@PostMapping("indexData.do")
@ResponseBody
public JsonResult indexData() {
return JsonResult.success();
}
}

@ -2,7 +2,7 @@ package com.ibeetl.jlw.web.api.teacher;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.jlw.entity.api.teacher.TeacherIndexData;
import com.ibeetl.jlw.service.api.teacher.TeacherIndexService;
import com.ibeetl.jlw.service.api.teacher.ApiTeacherService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
@ -19,10 +19,10 @@ import javax.annotation.Resource;
@Slf4j
@Validated
@RestController
@RequestMapping("/api/teacherIndex")
@RequestMapping("/api/teacher")
public class ApiTeacherController {
@Resource private TeacherIndexService teacherIndexService;
@Resource private ApiTeacherService apiTeacherService;
/**
* -
@ -30,7 +30,7 @@ public class ApiTeacherController {
*/
@PostMapping("index.do")
public JsonResult<TeacherIndexData> index() {
return JsonResult.success(teacherIndexService.index());
return JsonResult.success(apiTeacherService.index());
}
}

Loading…
Cancel
Save