评论问题

This commit is contained in:
wucongxing8150 2025-08-12 15:22:22 +08:00
parent 4bceffd6aa
commit 70b69c17a5
19 changed files with 210 additions and 14 deletions

View File

@ -3,6 +3,8 @@ package net.lab1024.sa.admin.module.business.caseClinicalArticle.controller;
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentClinicalArticleAddForm;
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentClinicalArticleQueryForm;
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentClinicalArticleUpdateForm;
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentStatusUpdateForm;
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentTopUpdateForm;
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.vo.UserCommentClinicalArticleVO;
import net.lab1024.sa.admin.module.business.caseClinicalArticle.service.UserCommentClinicalArticleService;
import net.lab1024.sa.base.common.domain.ResponseDTO;
@ -54,15 +56,15 @@ public class UserCommentClinicalArticleController {
@Operation(summary = "修改评论状态 @author xing")
@PostMapping("/userCommentClinicalArticle/updateStatus")
@SaCheckPermission("userCommentClinicalArticle:update")
public ResponseDTO<String> updateStatus(@RequestParam Long commentId, @RequestParam Integer status) {
return userCommentClinicalArticleService.updateStatus(commentId, status);
public ResponseDTO<String> updateStatus(@RequestBody @Valid UserCommentStatusUpdateForm updateForm) {
return userCommentClinicalArticleService.updateStatus(updateForm.getCommentId(), updateForm.getStatus());
}
@Operation(summary = "修改置顶状态 @author xing")
@PostMapping("/userCommentClinicalArticle/updateTopStatus")
@SaCheckPermission("userCommentClinicalArticle:update")
public ResponseDTO<String> updateTopStatus(@RequestParam Long commentId, @RequestParam Integer isTop) {
return userCommentClinicalArticleService.updateTopStatus(commentId, isTop);
public ResponseDTO<String> updateTopStatus(@RequestBody @Valid UserCommentTopUpdateForm updateForm) {
return userCommentClinicalArticleService.updateTopStatus(updateForm.getCommentId(), updateForm.getIsTop());
}
@Operation(summary = "批量删除 @author xing")

View File

@ -0,0 +1,25 @@
package net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
/**
* 用户评论状态更新表单
*
* @Author xing
* @Date 2025-08-12 09:11:31
* @Copyright gdxz
*/
@Data
public class UserCommentStatusUpdateForm {
@Schema(description = "评论ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "评论ID 不能为空")
private Long commentId;
@Schema(description = "状态值", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "状态值 不能为空")
private Integer status;
}

View File

@ -0,0 +1,25 @@
package net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
/**
* 用户评论置顶状态更新表单
*
* @Author xing
* @Date 2025-08-12 09:11:31
* @Copyright gdxz
*/
@Data
public class UserCommentTopUpdateForm {
@Schema(description = "评论ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "评论ID 不能为空")
private Long commentId;
@Schema(description = "置顶状态", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "置顶状态 不能为空")
private Integer isTop;
}

View File

@ -3,6 +3,7 @@ package net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import lombok.Data;
import net.lab1024.sa.admin.util.Replace;
/**
* 用户评论-临床病例-文章 列表VO
@ -42,6 +43,16 @@ public class UserCommentClinicalArticleVO {
@Schema(description = "评论内容(原版)")
private String contentWord;
@Schema(description = "评论图片")
private String commentImage;
public String getCommentImage() {
if (commentImage == null || commentImage.isEmpty()) {
return "";
}
return Replace.addOssDomain(commentImage);
}
@Schema(description = "文章标题")
private String articleTitle;

View File

@ -5,6 +5,8 @@ import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.entity.Us
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentClinicalArticleAddForm;
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentClinicalArticleQueryForm;
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentClinicalArticleUpdateForm;
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentStatusUpdateForm;
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentTopUpdateForm;
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.vo.UserCommentClinicalArticleVO;
import net.lab1024.sa.base.common.util.SmartBeanUtil;
import net.lab1024.sa.base.common.util.SmartPageUtil;

View File

@ -3,6 +3,8 @@ package net.lab1024.sa.admin.module.business.caseClinicalVideo.controller;
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentClinicalVideoAddForm;
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentClinicalVideoQueryForm;
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentClinicalVideoUpdateForm;
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentStatusUpdateForm;
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentTopUpdateForm;
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.vo.UserCommentClinicalVideoVO;
import net.lab1024.sa.admin.module.business.caseClinicalVideo.service.UserCommentClinicalVideoService;
import net.lab1024.sa.base.common.domain.ResponseDTO;
@ -54,15 +56,15 @@ public class UserCommentClinicalVideoController {
@Operation(summary = "修改评论状态 @author xing")
@PostMapping("/userCommentClinicalVideo/updateStatus")
@SaCheckPermission("userCommentClinicalVideo:update")
public ResponseDTO<String> updateStatus(@RequestParam Long commentId, @RequestParam Integer status) {
return userCommentClinicalVideoService.updateStatus(commentId, status);
public ResponseDTO<String> updateStatus(@RequestBody @Valid UserCommentStatusUpdateForm updateForm) {
return userCommentClinicalVideoService.updateStatus(updateForm.getCommentId(), updateForm.getStatus());
}
@Operation(summary = "修改置顶状态 @author xing")
@PostMapping("/userCommentClinicalVideo/updateTopStatus")
@SaCheckPermission("userCommentClinicalVideo:update")
public ResponseDTO<String> updateTopStatus(@RequestParam Long commentId, @RequestParam Integer isTop) {
return userCommentClinicalVideoService.updateTopStatus(commentId, isTop);
public ResponseDTO<String> updateTopStatus(@RequestBody @Valid UserCommentTopUpdateForm updateForm) {
return userCommentClinicalVideoService.updateTopStatus(updateForm.getCommentId(), updateForm.getIsTop());
}
@Operation(summary = "批量删除 @author xing")

View File

@ -0,0 +1,25 @@
package net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
/**
* 用户评论状态更新表单
*
* @Author xing
* @Date 2025-08-12 09:12:42
* @Copyright gdxz
*/
@Data
public class UserCommentStatusUpdateForm {
@Schema(description = "评论ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "评论ID 不能为空")
private Long commentId;
@Schema(description = "状态值", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "状态值 不能为空")
private Integer status;
}

View File

@ -0,0 +1,25 @@
package net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
/**
* 用户评论置顶状态更新表单
*
* @Author xing
* @Date 2025-08-12 09:12:42
* @Copyright gdxz
*/
@Data
public class UserCommentTopUpdateForm {
@Schema(description = "评论ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "评论ID 不能为空")
private Long commentId;
@Schema(description = "置顶状态", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "置顶状态 不能为空")
private Integer isTop;
}

View File

@ -3,6 +3,7 @@ package net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import lombok.Data;
import net.lab1024.sa.admin.util.Replace;
/**
* 用户评论-临床病例-视频 列表VO
@ -42,6 +43,16 @@ public class UserCommentClinicalVideoVO {
@Schema(description = "评论内容(原版)")
private String contentWord;
@Schema(description = "评论图片")
private String commentImage;
public String getCommentImage() {
if (commentImage == null || commentImage.isEmpty()) {
return "";
}
return Replace.addOssDomain(commentImage);
}
@Schema(description = "视频标题")
private String videoTitle;

View File

@ -5,6 +5,8 @@ import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.entity.User
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentClinicalVideoAddForm;
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentClinicalVideoQueryForm;
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentClinicalVideoUpdateForm;
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentStatusUpdateForm;
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentTopUpdateForm;
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.vo.UserCommentClinicalVideoVO;
import net.lab1024.sa.base.common.util.SmartBeanUtil;
import net.lab1024.sa.base.common.util.SmartPageUtil;

View File

@ -3,6 +3,8 @@ package net.lab1024.sa.admin.module.business.caseExchange.controller;
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentExchangeAddForm;
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentExchangeQueryForm;
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentExchangeUpdateForm;
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentStatusUpdateForm;
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentTopUpdateForm;
import net.lab1024.sa.admin.module.business.caseExchange.domain.vo.UserCommentExchangeVO;
import net.lab1024.sa.admin.module.business.caseExchange.service.UserCommentExchangeService;
import net.lab1024.sa.base.common.domain.ResponseDTO;
@ -54,15 +56,15 @@ public class UserCommentExchangeController {
@Operation(summary = "修改评论状态 @author xing")
@PostMapping("/userCommentExchange/updateStatus")
@SaCheckPermission("userCommentExchange:update")
public ResponseDTO<String> updateStatus(@RequestParam Long commentId, @RequestParam Integer status) {
return userCommentExchangeService.updateStatus(commentId, status);
public ResponseDTO<String> updateStatus(@RequestBody @Valid UserCommentStatusUpdateForm updateForm) {
return userCommentExchangeService.updateStatus(updateForm.getCommentId(), updateForm.getStatus());
}
@Operation(summary = "修改置顶状态 @author xing")
@PostMapping("/userCommentExchange/updateTopStatus")
@SaCheckPermission("userCommentExchange:update")
public ResponseDTO<String> updateTopStatus(@RequestParam Long commentId, @RequestParam Integer isTop) {
return userCommentExchangeService.updateTopStatus(commentId, isTop);
public ResponseDTO<String> updateTopStatus(@RequestBody @Valid UserCommentTopUpdateForm updateForm) {
return userCommentExchangeService.updateTopStatus(updateForm.getCommentId(), updateForm.getIsTop());
}
@Operation(summary = "批量删除 @author xing")

View File

@ -0,0 +1,25 @@
package net.lab1024.sa.admin.module.business.caseExchange.domain.form;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
/**
* 用户评论状态更新表单
*
* @Author xing
* @Date 2025-08-12 09:13:30
* @Copyright gdxz
*/
@Data
public class UserCommentStatusUpdateForm {
@Schema(description = "评论ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "评论ID 不能为空")
private Long commentId;
@Schema(description = "状态值", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "状态值 不能为空")
private Integer status;
}

View File

@ -0,0 +1,25 @@
package net.lab1024.sa.admin.module.business.caseExchange.domain.form;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
/**
* 用户评论置顶状态更新表单
*
* @Author xing
* @Date 2025-08-12 09:13:30
* @Copyright gdxz
*/
@Data
public class UserCommentTopUpdateForm {
@Schema(description = "评论ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "评论ID 不能为空")
private Long commentId;
@Schema(description = "置顶状态", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "置顶状态 不能为空")
private Integer isTop;
}

View File

@ -3,6 +3,7 @@ package net.lab1024.sa.admin.module.business.caseExchange.domain.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import lombok.Data;
import net.lab1024.sa.admin.util.Replace;
/**
* 用户评论-病例交流 列表VO
@ -42,6 +43,16 @@ public class UserCommentExchangeVO {
@Schema(description = "评论内容(原版)")
private String contentWord;
@Schema(description = "评论图片")
private String commentImage;
public String getCommentImage() {
if (commentImage == null || commentImage.isEmpty()) {
return "";
}
return Replace.addOssDomain(commentImage);
}
@Schema(description = "交流标题")
private String exchangeTitle;

View File

@ -5,6 +5,8 @@ import net.lab1024.sa.admin.module.business.caseExchange.domain.entity.UserComme
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentExchangeAddForm;
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentExchangeQueryForm;
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentExchangeUpdateForm;
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentStatusUpdateForm;
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentTopUpdateForm;
import net.lab1024.sa.admin.module.business.caseExchange.domain.vo.UserCommentExchangeVO;
import net.lab1024.sa.base.common.util.SmartBeanUtil;
import net.lab1024.sa.base.common.util.SmartPageUtil;

View File

@ -3,10 +3,8 @@ package net.lab1024.sa.admin.util;
import net.lab1024.sa.admin.config.OssConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
@Component
@RequestMapping("/config")
public class Replace {
private static OssConfig ossConfig;

View File

@ -13,6 +13,7 @@
user_comment_clinical_article.is_author,
user_comment_clinical_article.content,
user_comment_clinical_article.content_word,
user_comment_clinical_article.comment_image,
case_clinical_article.article_title,
user_comment_clinical_article.created_at
</sql>

View File

@ -13,6 +13,7 @@
user_comment_clinical_video.is_author,
user_comment_clinical_video.content,
user_comment_clinical_video.content_word,
user_comment_clinical_video.comment_image,
case_clinical_video.video_title,
user_comment_clinical_video.created_at
</sql>

View File

@ -13,6 +13,7 @@
user_comment_exchange.is_author,
user_comment_exchange.content,
user_comment_exchange.content_word,
user_comment_exchange.comment_image,
case_exchange.exchange_title,
user_comment_exchange.created_at
</sql>