教授修改

This commit is contained in:
86182
2022-12-14 19:12:23 +08:00
parent e1644c1816
commit 5690ba67b4
4 changed files with 28 additions and 3 deletions

View File

@@ -11,6 +11,7 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.xboe.module.teacher.dto.TeacherFiledVo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@@ -280,7 +281,7 @@ public class TeacherApi extends ApiBaseController {
* @return * @return
*/ */
@PostMapping("/update-teacher") @PostMapping("/update-teacher")
public JsonResponse<Teacher> updateTeacher(@RequestBody Teacher teacher) { public JsonResponse<TeacherFiledVo> updateTeacher(@RequestBody TeacherFiledVo teacher) {
if (teacher == null) { if (teacher == null) {
return error("缺少必要参数"); return error("缺少必要参数");
} }

View File

@@ -0,0 +1,18 @@
package com.xboe.module.teacher.dto;
import lombok.Data;
@Data
public class TeacherFiledVo {
private String id;
private String photo;
private String workExperience;
private String courses;
private String expertise;
}

View File

@@ -4,6 +4,7 @@ import java.util.List;
import com.xboe.common.PageList; import com.xboe.common.PageList;
import com.xboe.core.exception.XaskException; import com.xboe.core.exception.XaskException;
import com.xboe.module.teacher.dto.TeacherFiledVo;
import com.xboe.module.teacher.dto.TeacherSyncUpdateDto; import com.xboe.module.teacher.dto.TeacherSyncUpdateDto;
import com.xboe.module.teacher.entity.Teacher; import com.xboe.module.teacher.entity.Teacher;
import com.xboe.module.teacher.vo.TeacherQuery; import com.xboe.module.teacher.vo.TeacherQuery;
@@ -67,7 +68,7 @@ public interface ITeacherService {
* @param entity * @param entity
* @throws XaskException * @throws XaskException
*/ */
void updateTeacher(Teacher entity); void updateTeacher(TeacherFiledVo entity);
/* /*
* 更新同步信息 * 更新同步信息

View File

@@ -9,6 +9,7 @@ import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
import com.xboe.module.teacher.dto.TeacherFiledVo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
@@ -206,8 +207,12 @@ public class TeacherServiceImpl implements ITeacherService {
@Override @Override
@Transactional @Transactional
public void updateTeacher(Teacher entity) { public void updateTeacher(TeacherFiledVo entity) {
Teacher teacher = dao.get(entity.getId()); Teacher teacher = dao.get(entity.getId());
teacher.setPhoto(entity.getPhoto());
teacher.setWorkExperience(entity.getWorkExperience());
teacher.setCourses(entity.getCourses());
teacher.setExpertise(entity.getExpertise());
dao.update(teacher); dao.update(teacher);
} }