1111
This commit is contained in:
parent
59de0d8ea1
commit
7b09f59b51
@ -14,6 +14,7 @@ import com.example.caseData.dto.userCommentClinicalVideo.UserCommentClinicalVide
|
|||||||
import com.example.caseData.exception.BusinessException;
|
import com.example.caseData.exception.BusinessException;
|
||||||
import com.example.caseData.model.*;
|
import com.example.caseData.model.*;
|
||||||
import com.example.caseData.request.CaseClinicalArticleRequest.getUserClinicalArticleCommentPage;
|
import com.example.caseData.request.CaseClinicalArticleRequest.getUserClinicalArticleCommentPage;
|
||||||
|
import com.example.caseData.request.CaseClinicalVideoRequest.addClinicalVideoApp;
|
||||||
import com.example.caseData.request.CaseClinicalVideoRequest.addClinicalVideoComment;
|
import com.example.caseData.request.CaseClinicalVideoRequest.addClinicalVideoComment;
|
||||||
import com.example.caseData.request.CaseClinicalVideoRequest.getClinicalVideoCommentPage;
|
import com.example.caseData.request.CaseClinicalVideoRequest.getClinicalVideoCommentPage;
|
||||||
import com.example.caseData.service.CaseClinicalVideoService;
|
import com.example.caseData.service.CaseClinicalVideoService;
|
||||||
@ -403,14 +404,12 @@ public class CaseClinicalVideoController {
|
|||||||
* 临床病例库-视频-同步app视频
|
* 临床病例库-视频-同步app视频
|
||||||
*/
|
*/
|
||||||
@PostMapping("/app/clinical/video")
|
@PostMapping("/app/clinical/video")
|
||||||
public Response<T> AddClinicalVideoComment(
|
public Response<T> AddClinicalVideoApp(
|
||||||
@Validated()
|
@Validated()
|
||||||
@RequestBody addClinicalVideoComment request
|
@RequestBody addClinicalVideoApp request
|
||||||
) {
|
) {
|
||||||
|
|
||||||
//
|
|
||||||
// try {
|
// try {
|
||||||
// boolean res = caseClinicalVideoService.AddClinicalVideoComment(userId,request);
|
// boolean res = caseClinicalVideoService.AddClinicalVideoApp(request);
|
||||||
// if (!res){
|
// if (!res){
|
||||||
// return Response.error("操作失败");
|
// return Response.error("操作失败");
|
||||||
// }
|
// }
|
||||||
|
|||||||
@ -75,6 +75,7 @@ public class CaseClinicalVideoAuthorDto {
|
|||||||
if (model.getCaseClinicalDoctor() != null) {
|
if (model.getCaseClinicalDoctor() != null) {
|
||||||
CaseClinicalDoctorDto caseClinicalDoctorDto = CaseClinicalDoctorDto.GetDto(model.getCaseClinicalDoctor());
|
CaseClinicalDoctorDto caseClinicalDoctorDto = CaseClinicalDoctorDto.GetDto(model.getCaseClinicalDoctor());
|
||||||
dto.setDoctorName(caseClinicalDoctorDto.getDoctorName());
|
dto.setDoctorName(caseClinicalDoctorDto.getDoctorName());
|
||||||
|
dto.setHospitalName(caseClinicalDoctorDto.getHospitalName());
|
||||||
}
|
}
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
|
|||||||
@ -0,0 +1,25 @@
|
|||||||
|
package com.example.caseData.request.CaseClinicalVideoRequest;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class addClinicalVideoApp {
|
||||||
|
// 父级 次级评论此字段必须存在
|
||||||
|
@JsonProperty("parent_id")
|
||||||
|
private String parentId;
|
||||||
|
|
||||||
|
// 根评论标识 次级评论此字段必须存在
|
||||||
|
@JsonProperty("root_id")
|
||||||
|
private String rootId;
|
||||||
|
|
||||||
|
// 评论内容
|
||||||
|
@JsonProperty("content")
|
||||||
|
@NotEmpty(message = "请输入评论内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
// 评论图片
|
||||||
|
@JsonProperty("comment_image")
|
||||||
|
private String commentImage;
|
||||||
|
}
|
||||||
@ -504,4 +504,62 @@ public class CaseClinicalVideoService {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 临床病例库-视频-同步app视频
|
||||||
|
* @param videoId 视频id
|
||||||
|
* @param userId 用户id
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
public boolean AddClinicalVideoApp(String videoId, String userId, addClinicalVideoComment request){
|
||||||
|
// 获取视频数据
|
||||||
|
CaseClinicalVideoModel video = caseClinicalVideoDao.selectById(videoId);
|
||||||
|
if (video == null) {
|
||||||
|
throw new BusinessException("非法视频");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (video.getVideoStatus() != 1){
|
||||||
|
throw new BusinessException("非法视频");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理评论内容
|
||||||
|
BasicSensitiveWordService.FilterResult result = basicSensitiveWordService.filter(request.getContent());
|
||||||
|
if (result.hasSensitive == 1){
|
||||||
|
throw new BusinessException("存在敏感词,请修改后提交");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增评论
|
||||||
|
UserCommentClinicalVideoModel userCommentClinicalVideoData = new UserCommentClinicalVideoModel();
|
||||||
|
userCommentClinicalVideoData.setUserId(Long.valueOf(userId));
|
||||||
|
userCommentClinicalVideoData.setVideoId(Long.valueOf(videoId));
|
||||||
|
userCommentClinicalVideoData.setStatus(1);
|
||||||
|
userCommentClinicalVideoData.setIsSensitive(0);
|
||||||
|
userCommentClinicalVideoData.setContent(request.getContent());
|
||||||
|
userCommentClinicalVideoData.setCommentImage(Replace.removeOssDomain(request.getCommentImage()));
|
||||||
|
|
||||||
|
// 评论根id
|
||||||
|
if (request.getRootId() != null) {
|
||||||
|
userCommentClinicalVideoData.setRootId(Long.valueOf(request.getRootId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 评论父级id
|
||||||
|
if (request.getParentId() != null) {
|
||||||
|
userCommentClinicalVideoData.setParentId(Long.valueOf(request.getParentId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
int res = userCommentClinicalVideoDao.insert(userCommentClinicalVideoData);
|
||||||
|
if (res <= 0){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增文章的统计字段
|
||||||
|
boolean r = IncClinicalVideoStats(videoId,3);
|
||||||
|
if (!r){
|
||||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user