讨论,增加教师回复,学生回复

beetlsql3-dev
Mlxa0324 2 years ago
parent 6bf67b151f
commit 47956d6554

@ -0,0 +1,46 @@
package com.ibeetl.jlw.entity.dto;
import com.ibeetl.jlw.enums.ChatLogSendTypeEnum;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
/**
*
*/
@Data
@Builder
@Accessors(chain = true)
public class TeacherOpenCourseChatLogStudentDTO {
/**
* ID
*/
private Long teacherOpenCourseChatLogParentId;
/**
* ID
*/
@NotNull(message = "开课ID不能为空")
private Long teacherOpenCourseId;
/**
*
*/
@NotNull(message = "开课ID不能为空")
private String chatContent;
/**
*
*/
private String keywords;
/**
*
*/
@NotNull(message = "提问方式不能为空!")
private ChatLogSendTypeEnum chatLogSendType;
/**
*
*/
private String chatFiles;
}

@ -0,0 +1,50 @@
package com.ibeetl.jlw.entity.dto;
import com.ibeetl.jlw.enums.ChatLogSendTypeEnum;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
/**
*
*/
@Data
@Builder
@Accessors(chain = true)
public class TeacherOpenCourseChatLogTeacherDTO {
/**
* ID
*/
private Long teacherOpenCourseChatLogParentId;
/**
* ID
*/
@NotNull(message = "开课ID不能为空")
private Long teacherOpenCourseId;
/**
* ID
*/
private String schoolClassIds;
/**
*
*/
@NotNull(message = "讨论内容不能为空!")
private String chatContent;
/**
*
*/
private String keywords;
/**
*
*/
@NotNull(message = "提问方式不能为空!")
private ChatLogSendTypeEnum chatLogSendType;
/**
*
*/
private String chatFiles;
}

@ -97,7 +97,6 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
public JsonResult add(TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery){
String msg = "";
TeacherOpenCourseChatLog teacherOpenCourseChatLog = teacherOpenCourseChatLogQuery.pojo();
teacherOpenCourseChatLog.setTeacherOpenCourseChatLogAddTime(new Date());
teacherOpenCourseChatLogDao.insert(teacherOpenCourseChatLog);
teacherOpenCourseChatLogQuery.setTeacherOpenCourseChatLogId(teacherOpenCourseChatLog.getTeacherOpenCourseChatLogId());
JsonResult jsonResult = new JsonResult();

@ -1,5 +1,6 @@
package com.ibeetl.jlw.web;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil;
import cn.jlw.Interceptor.SCoreUser;
@ -14,6 +15,8 @@ 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.entity.dto.TeacherOpenCourseChatLogStudentDTO;
import com.ibeetl.jlw.entity.dto.TeacherOpenCourseChatLogTeacherDTO;
import com.ibeetl.jlw.service.TeacherOpenCourseChatLogService;
import com.ibeetl.jlw.web.query.TeacherOpenCourseChatLogQuery;
import org.apache.commons.lang3.StringUtils;
@ -132,6 +135,68 @@ public class TeacherOpenCourseChatLogController{
}
}
/**
*
* @param studentDTO
* @param result
* @param coreUser
* @param student
* @return
*/
@PostMapping(API + "/studentSend.do")
public JsonResult studentSend(
@Validated
@RequestBody TeacherOpenCourseChatLogStudentDTO studentDTO,
BindingResult result, @SCoreUser CoreUser coreUser, @TStudent Student student){
if(result.hasErrors()){
return JsonResult.failMessage(result);
}else{
Assert.notNull(coreUser, "请登录后再操作");
Assert.notNull(student, "该接口仅限学生使用");
TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery = new TeacherOpenCourseChatLogQuery();
teacherOpenCourseChatLogQuery.setUserId(student.getUserId());
teacherOpenCourseChatLogQuery.setOrgId(student.getOrgId());
if (ObjectUtil.isNotEmpty(student)) {
teacherOpenCourseChatLogQuery.setStudentId(student.getStudentId());
}
BeanUtil.copyProperties(studentDTO, teacherOpenCourseChatLogQuery);
teacherOpenCourseChatLogQuery.setDefault();
return teacherOpenCourseChatLogService.add(teacherOpenCourseChatLogQuery);
}
}
/**
*
* @param teacherDTO
* @param result
* @param coreUser
* @param teacher
* @return
*/
@PostMapping(API + "/teacherSend.do")
public JsonResult teacherSend(
@Validated
@RequestBody TeacherOpenCourseChatLogTeacherDTO teacherDTO,
BindingResult result, @SCoreUser CoreUser coreUser, @TTeacher Teacher teacher){
if(result.hasErrors()){
return JsonResult.failMessage(result);
}else{
Assert.notNull(coreUser, "请登录后再操作");
Assert.notNull(teacher, "该接口仅限教师使用");
TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery = new TeacherOpenCourseChatLogQuery();
teacherOpenCourseChatLogQuery.setUserId(teacher.getUserId());
teacherOpenCourseChatLogQuery.setOrgId(teacher.getOrgId());
if (ObjectUtil.isNotEmpty(teacher)) {
teacherOpenCourseChatLogQuery.setTeacherId(teacher.getTeacherId());
}
BeanUtil.copyProperties(teacherDTO, teacherOpenCourseChatLogQuery);
teacherOpenCourseChatLogQuery.setDefault();
return teacherOpenCourseChatLogService.add(teacherOpenCourseChatLogQuery);
}
}
/**
* -
* @param teacherOpenCourseChatLogId

@ -189,6 +189,13 @@ public class TeacherOpenCourseChatLogQuery extends PageParam {
return pojo;
}
public TeacherOpenCourseChatLogQuery setDefault() {
setReplyStatus(1);
setTeacherOpenCourseChatLogAddTime(new Date());
setTeacherOpenCourseChatLogStatus(1);
return this;
}
public String getTeacherOpenCourseChatLogIdPlural(){
return teacherOpenCourseChatLogIdPlural;
}

Loading…
Cancel
Save