评论接口更改返回状态44
This commit is contained in:
parent
5ba59aecf9
commit
d8f1eb8d16
@ -147,23 +147,17 @@ public class CaseClinicalArticleService {
|
|||||||
// 获取文章数据
|
// 获取文章数据
|
||||||
CaseClinicalArticleModel article = caseClinicalArticleDao.selectById(articleId);
|
CaseClinicalArticleModel article = caseClinicalArticleDao.selectById(articleId);
|
||||||
if (article == null) {
|
if (article == null) {
|
||||||
resultData.put("status", 0);
|
throw new BusinessException("非法文章");
|
||||||
resultData.put("message", "非法文章");
|
|
||||||
return resultData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (article.getArticleStatus() != 1){
|
if (article.getArticleStatus() != 1){
|
||||||
resultData.put("status", 0);
|
throw new BusinessException("非法文章");
|
||||||
resultData.put("message", "非法文章");
|
|
||||||
return resultData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理评论内容
|
// 处理评论内容
|
||||||
BasicSensitiveWordService.FilterResult result = basicSensitiveWordService.filter(request.getContent());
|
BasicSensitiveWordService.FilterResult result = basicSensitiveWordService.filter(request.getContent());
|
||||||
if (result.hasSensitive == 1){
|
if (result.hasSensitive == 1){
|
||||||
resultData.put("status", 0);
|
throw new BusinessException("存在敏感词,请修改后提交");
|
||||||
resultData.put("message", "存在敏感词,请修改后提交");
|
|
||||||
return resultData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增评论
|
// 新增评论
|
||||||
@ -187,18 +181,14 @@ public class CaseClinicalArticleService {
|
|||||||
|
|
||||||
int res = userCommentClinicalArticleDao.insert(userCommentClinicalArticleData);
|
int res = userCommentClinicalArticleDao.insert(userCommentClinicalArticleData);
|
||||||
if (res <= 0){
|
if (res <= 0){
|
||||||
resultData.put("status", 0);
|
throw new BusinessException("操作失败");
|
||||||
resultData.put("message", "操作失败");
|
|
||||||
return resultData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增文章的统计字段
|
// 新增文章的统计字段
|
||||||
boolean r = IncClinicalArticleStats(articleId,3,1);
|
boolean r = IncClinicalArticleStats(articleId,3,1);
|
||||||
if (!r){
|
if (!r){
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
resultData.put("status", 0);
|
throw new BusinessException("操作失败");
|
||||||
resultData.put("message", "操作失败");
|
|
||||||
return resultData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取发放积分次数
|
// 获取发放积分次数
|
||||||
|
|||||||
@ -183,23 +183,17 @@ public class CaseClinicalVideoService {
|
|||||||
// 获取视频数据
|
// 获取视频数据
|
||||||
CaseClinicalVideoModel video = caseClinicalVideoDao.selectById(videoId);
|
CaseClinicalVideoModel video = caseClinicalVideoDao.selectById(videoId);
|
||||||
if (video == null) {
|
if (video == null) {
|
||||||
resultData.put("status", 0);
|
throw new BusinessException("非法视频");
|
||||||
resultData.put("message", "非法视频");
|
|
||||||
return resultData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video.getVideoStatus() != 1){
|
if (video.getVideoStatus() != 1){
|
||||||
resultData.put("status", 0);
|
throw new BusinessException("非法视频");
|
||||||
resultData.put("message", "非法视频");
|
|
||||||
return resultData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理评论内容
|
// 处理评论内容
|
||||||
BasicSensitiveWordService.FilterResult result = basicSensitiveWordService.filter(request.getContent());
|
BasicSensitiveWordService.FilterResult result = basicSensitiveWordService.filter(request.getContent());
|
||||||
if (result.hasSensitive == 1){
|
if (result.hasSensitive == 1){
|
||||||
resultData.put("status", 0);
|
throw new BusinessException("存在敏感词,请修改后提交");
|
||||||
resultData.put("message", "存在敏感词,请修改后提交");
|
|
||||||
return resultData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增评论
|
// 新增评论
|
||||||
@ -223,18 +217,14 @@ public class CaseClinicalVideoService {
|
|||||||
|
|
||||||
int res = userCommentClinicalVideoDao.insert(userCommentClinicalVideoData);
|
int res = userCommentClinicalVideoDao.insert(userCommentClinicalVideoData);
|
||||||
if (res <= 0){
|
if (res <= 0){
|
||||||
resultData.put("status", 0);
|
throw new BusinessException("操作失败");
|
||||||
resultData.put("message", "操作失败");
|
|
||||||
return resultData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增文章的统计字段
|
// 新增文章的统计字段
|
||||||
boolean r = IncClinicalVideoStats(videoId,3,1);
|
boolean r = IncClinicalVideoStats(videoId,3,1);
|
||||||
if (!r){
|
if (!r){
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
resultData.put("status", 0);
|
throw new BusinessException("操作失败");
|
||||||
resultData.put("message", "操作失败");
|
|
||||||
return resultData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取发放积分次数
|
// 获取发放积分次数
|
||||||
|
|||||||
@ -444,23 +444,17 @@ public class CaseExchangeService {
|
|||||||
// 获取病例交流数据
|
// 获取病例交流数据
|
||||||
CaseExchangeModel article = caseExchangeDao.selectById(exchangeId);
|
CaseExchangeModel article = caseExchangeDao.selectById(exchangeId);
|
||||||
if (article == null) {
|
if (article == null) {
|
||||||
resultData.put("status", 0);
|
throw new BusinessException("非法病例交流");
|
||||||
resultData.put("message", "非法病例交流");
|
|
||||||
return resultData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (article.getExchangeStatus() != 1){
|
if (article.getExchangeStatus() != 1){
|
||||||
resultData.put("status", 0);
|
throw new BusinessException("非法病例交流");
|
||||||
resultData.put("message", "非法病例交流");
|
|
||||||
return resultData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理评论内容
|
// 处理评论内容
|
||||||
BasicSensitiveWordService.FilterResult result = basicSensitiveWordService.filter(request.getContent());
|
BasicSensitiveWordService.FilterResult result = basicSensitiveWordService.filter(request.getContent());
|
||||||
if (result.hasSensitive == 1){
|
if (result.hasSensitive == 1){
|
||||||
resultData.put("status", 0);
|
throw new BusinessException("存在敏感词,请修改后提交");
|
||||||
resultData.put("message", "存在敏感词,请修改后提交");
|
|
||||||
return resultData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增评论
|
// 新增评论
|
||||||
@ -484,18 +478,14 @@ public class CaseExchangeService {
|
|||||||
|
|
||||||
int res = userCommentExchangeDao.insert(userCommentExchangeData);
|
int res = userCommentExchangeDao.insert(userCommentExchangeData);
|
||||||
if (res <= 0){
|
if (res <= 0){
|
||||||
resultData.put("status", 0);
|
throw new BusinessException("操作失败");
|
||||||
resultData.put("message", "");
|
|
||||||
return resultData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增统计字段
|
// 新增统计字段
|
||||||
boolean r = IncCaseExchangeStats(exchangeId,3);
|
boolean r = IncCaseExchangeStats(exchangeId,3);
|
||||||
if (!r){
|
if (!r){
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
resultData.put("status", 0);
|
throw new BusinessException("操作失败");
|
||||||
resultData.put("message", "");
|
|
||||||
return resultData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取发放积分次数
|
// 获取发放积分次数
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user