beetlsql3-dev
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();
|
||||
}
|
||||
}
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue