111
This commit is contained in:
parent
f09faeef6b
commit
6c4d7a90f8
@ -21,6 +21,7 @@ import com.example.caseData.request.caseExchangeRequest.getUserCaseExchangeComme
|
|||||||
import com.example.caseData.request.clinicalRequest.getClinicalArticleSearchPage;
|
import com.example.caseData.request.clinicalRequest.getClinicalArticleSearchPage;
|
||||||
import com.example.caseData.service.CaseClinicalArticleService;
|
import com.example.caseData.service.CaseClinicalArticleService;
|
||||||
import com.example.caseData.utils.IntToString;
|
import com.example.caseData.utils.IntToString;
|
||||||
|
import com.example.caseData.utils.Replace;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -317,6 +318,9 @@ public class CaseClinicalArticleController {
|
|||||||
// 去除用户唯一标识
|
// 去除用户唯一标识
|
||||||
dto.setUserIden(null);
|
dto.setUserIden(null);
|
||||||
|
|
||||||
|
// 图片
|
||||||
|
dto.setCommentImage(Replace.addOssDomain(dto.getCommentImage()));
|
||||||
|
|
||||||
// 获取次级评论
|
// 获取次级评论
|
||||||
if (request.getIsHaveSubComment() == 1){
|
if (request.getIsHaveSubComment() == 1){
|
||||||
if (dto.getRootId() == null){
|
if (dto.getRootId() == null){
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import com.example.caseData.request.CaseClinicalVideoRequest.addClinicalVideoCom
|
|||||||
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;
|
||||||
import com.example.caseData.service.CaseClinicalVideoService;
|
import com.example.caseData.service.CaseClinicalVideoService;
|
||||||
|
import com.example.caseData.utils.Replace;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -313,6 +314,9 @@ public class CaseClinicalVideoController {
|
|||||||
// 去除用户唯一标识
|
// 去除用户唯一标识
|
||||||
dto.setUserIden(null);
|
dto.setUserIden(null);
|
||||||
|
|
||||||
|
// 图片
|
||||||
|
dto.setCommentImage(Replace.addOssDomain(dto.getCommentImage()));
|
||||||
|
|
||||||
// 获取次级评论
|
// 获取次级评论
|
||||||
if (request.getIsHaveSubComment() == 1){
|
if (request.getIsHaveSubComment() == 1){
|
||||||
if (dto.getRootId() == null){
|
if (dto.getRootId() == null){
|
||||||
|
|||||||
@ -582,6 +582,9 @@ public class CaseExchangeController {
|
|||||||
// 去除用户唯一标识
|
// 去除用户唯一标识
|
||||||
dto.setUserIden(null);
|
dto.setUserIden(null);
|
||||||
|
|
||||||
|
// 图片
|
||||||
|
dto.setCommentImage(Replace.addOssDomain(dto.getCommentImage()));
|
||||||
|
|
||||||
// 获取次级评论
|
// 获取次级评论
|
||||||
if (request.getIsHaveSubComment() == 1){
|
if (request.getIsHaveSubComment() == 1){
|
||||||
if (dto.getRootId() == null){
|
if (dto.getRootId() == null){
|
||||||
|
|||||||
@ -75,6 +75,12 @@ public class UserCommentClinicalArticleDto {
|
|||||||
@JsonProperty("content_word")
|
@JsonProperty("content_word")
|
||||||
private String contentWord;
|
private String contentWord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 评论图片
|
||||||
|
*/
|
||||||
|
@JsonProperty("comment_image")
|
||||||
|
private String commentImage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -76,6 +76,12 @@ public class UserCommentClinicalVideoDto {
|
|||||||
@JsonProperty("content_word")
|
@JsonProperty("content_word")
|
||||||
private String contentWord;
|
private String contentWord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 评论图片
|
||||||
|
*/
|
||||||
|
@JsonProperty("comment_image")
|
||||||
|
private String commentImage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -179,7 +179,7 @@ public class CaseClinicalArticleService {
|
|||||||
userCommentClinicalArticleData.setStatus(1);
|
userCommentClinicalArticleData.setStatus(1);
|
||||||
userCommentClinicalArticleData.setIsSensitive(0);
|
userCommentClinicalArticleData.setIsSensitive(0);
|
||||||
userCommentClinicalArticleData.setContent(request.getContent());
|
userCommentClinicalArticleData.setContent(request.getContent());
|
||||||
userCommentClinicalArticleData.setCommentImage(Replace.addOssDomain(request.getCommentImage()));
|
userCommentClinicalArticleData.setCommentImage(Replace.removeOssDomain(request.getCommentImage()));
|
||||||
|
|
||||||
// 评论根id
|
// 评论根id
|
||||||
if (request.getRootId() != null) {
|
if (request.getRootId() != null) {
|
||||||
|
|||||||
@ -173,7 +173,7 @@ public class CaseClinicalVideoService {
|
|||||||
userCommentClinicalVideoData.setStatus(1);
|
userCommentClinicalVideoData.setStatus(1);
|
||||||
userCommentClinicalVideoData.setIsSensitive(0);
|
userCommentClinicalVideoData.setIsSensitive(0);
|
||||||
userCommentClinicalVideoData.setContent(request.getContent());
|
userCommentClinicalVideoData.setContent(request.getContent());
|
||||||
userCommentClinicalVideoData.setCommentImage(Replace.addOssDomain(request.getCommentImage()));
|
userCommentClinicalVideoData.setCommentImage(Replace.removeOssDomain(request.getCommentImage()));
|
||||||
|
|
||||||
// 评论根id
|
// 评论根id
|
||||||
if (request.getRootId() != null) {
|
if (request.getRootId() != null) {
|
||||||
|
|||||||
@ -279,7 +279,7 @@ public class CaseExchangeService {
|
|||||||
userCommentExchangeData.setStatus(1);
|
userCommentExchangeData.setStatus(1);
|
||||||
userCommentExchangeData.setIsSensitive(0);
|
userCommentExchangeData.setIsSensitive(0);
|
||||||
userCommentExchangeData.setContent(request.getContent());
|
userCommentExchangeData.setContent(request.getContent());
|
||||||
userCommentExchangeData.setCommentImage(Replace.addOssDomain(request.getCommentImage()));
|
userCommentExchangeData.setCommentImage(Replace.removeOssDomain(request.getCommentImage()));
|
||||||
|
|
||||||
// 评论根id
|
// 评论根id
|
||||||
if (request.getRootId() != null) {
|
if (request.getRootId() != null) {
|
||||||
|
|||||||
@ -27,4 +27,22 @@ public class Replace {
|
|||||||
}
|
}
|
||||||
return ossConfig.getCustomDomainName() + url;
|
return ossConfig.getCustomDomainName() + url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 去除OSS地址中的域名前缀
|
||||||
|
* @param url 可能包含域名的完整URL
|
||||||
|
* @return 去除了域名后的相对路径,如果未匹配则返回原字符串
|
||||||
|
*/
|
||||||
|
public static String removeOssDomain(String url) {
|
||||||
|
if (url == null || url.isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
String customDomain = ossConfig.getCustomDomainName();
|
||||||
|
if (customDomain != null && url.startsWith(customDomain)) {
|
||||||
|
return url.substring(customDomain.length());
|
||||||
|
}
|
||||||
|
|
||||||
|
return url;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
LEFT JOIN basic_hospital b ON a.hospital_id = b.hospital_id
|
LEFT JOIN basic_hospital b ON a.hospital_id = b.hospital_id
|
||||||
WHERE b.source = 2
|
WHERE b.source = 2
|
||||||
<if test="hospital_name != null and hospital_name != ''">
|
<if test="hospital_name != null and hospital_name != ''">
|
||||||
AND b.hospital_name LIKE CONCAT('%', #{hospitalName}, '%')
|
AND b.hospital_name LIKE CONCAT('%', #{hospital_name}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="order != null and !order.isEmpty()">
|
<if test="order != null and !order.isEmpty()">
|
||||||
ORDER BY
|
ORDER BY
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user