|
|
|
@ -3,12 +3,16 @@ package com.ibeetl.jlw.web;
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import cn.jlw.Interceptor.SCoreUser;
|
|
|
|
|
import cn.jlw.Interceptor.TStudent;
|
|
|
|
|
import cn.jlw.Interceptor.TTeacher;
|
|
|
|
|
import cn.jlw.validate.ValidateConfig;
|
|
|
|
|
import com.ibeetl.admin.core.annotation.Function;
|
|
|
|
|
import com.ibeetl.admin.core.entity.CoreUser;
|
|
|
|
|
import com.ibeetl.admin.core.file.FileService;
|
|
|
|
|
import com.ibeetl.admin.core.service.CoreUserService;
|
|
|
|
|
import com.ibeetl.admin.core.web.JsonResult;
|
|
|
|
|
import com.ibeetl.jlw.entity.Student;
|
|
|
|
|
import com.ibeetl.jlw.entity.Teacher;
|
|
|
|
|
import com.ibeetl.jlw.entity.TeacherOpenCourseChatLog;
|
|
|
|
|
import com.ibeetl.jlw.service.TeacherOpenCourseChatLogService;
|
|
|
|
|
import com.ibeetl.jlw.web.query.TeacherOpenCourseChatLogQuery;
|
|
|
|
@ -111,7 +115,7 @@ public class TeacherOpenCourseChatLogController{
|
|
|
|
|
public JsonResult addDo(
|
|
|
|
|
@Validated(ValidateConfig.ADD.class)
|
|
|
|
|
@RequestBody TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery,
|
|
|
|
|
BindingResult result,@SCoreUser CoreUser coreUser){
|
|
|
|
|
BindingResult result, @SCoreUser CoreUser coreUser, @TTeacher Teacher teacher, @TStudent Student student){
|
|
|
|
|
if(result.hasErrors()){
|
|
|
|
|
return JsonResult.failMessage(result);
|
|
|
|
|
}else{
|
|
|
|
@ -120,6 +124,12 @@ public class TeacherOpenCourseChatLogController{
|
|
|
|
|
if(null == teacherOpenCourseChatLogQuery.getTeacherOpenCourseChatLogStatus()){
|
|
|
|
|
teacherOpenCourseChatLogQuery.setTeacherOpenCourseChatLogStatus(1);
|
|
|
|
|
}
|
|
|
|
|
if (ObjectUtil.isNotEmpty(teacher)) {
|
|
|
|
|
teacherOpenCourseChatLogQuery.setTeacherId(teacher.getTeacherId());
|
|
|
|
|
}
|
|
|
|
|
if (ObjectUtil.isNotEmpty(student)) {
|
|
|
|
|
teacherOpenCourseChatLogQuery.setStudentId(student.getStudentId());
|
|
|
|
|
}
|
|
|
|
|
return teacherOpenCourseChatLogService.add(teacherOpenCourseChatLogQuery);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -264,7 +274,7 @@ public class TeacherOpenCourseChatLogController{
|
|
|
|
|
public JsonResult addByType(
|
|
|
|
|
@RequestBody TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery,
|
|
|
|
|
Integer type,
|
|
|
|
|
BindingResult result, @SCoreUser CoreUser coreUser){
|
|
|
|
|
BindingResult result, @SCoreUser CoreUser coreUser, @TTeacher Teacher teacher, @TStudent Student student){
|
|
|
|
|
|
|
|
|
|
if(result.hasErrors()){
|
|
|
|
|
return JsonResult.failMessage(result);
|
|
|
|
@ -274,6 +284,12 @@ public class TeacherOpenCourseChatLogController{
|
|
|
|
|
if(null == teacherOpenCourseChatLogQuery.getTeacherOpenCourseChatLogStatus()){
|
|
|
|
|
teacherOpenCourseChatLogQuery.setTeacherOpenCourseChatLogStatus(1);
|
|
|
|
|
}
|
|
|
|
|
if (ObjectUtil.isNotEmpty(teacher)) {
|
|
|
|
|
teacherOpenCourseChatLogQuery.setTeacherId(teacher.getTeacherId());
|
|
|
|
|
}
|
|
|
|
|
if (ObjectUtil.isNotEmpty(student)) {
|
|
|
|
|
teacherOpenCourseChatLogQuery.setStudentId(student.getStudentId());
|
|
|
|
|
}
|
|
|
|
|
return teacherOpenCourseChatLogService.addByType(teacherOpenCourseChatLogQuery, type);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|