yh
This commit is contained in:
@@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
|
||||
/**
|
||||
* 启动程序
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||
@@ -16,7 +16,7 @@ public class RuoYiApplication
|
||||
{
|
||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||
SpringApplication.run(RuoYiApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
System.out.println("(♥◠‿◠)ノ゙ 启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
" .-------. ____ __ \n" +
|
||||
" | _ _ \\ \\ \\ / / \n" +
|
||||
" | ( ' ) | \\ _. / ' \n" +
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.config.TextModerationPlus;
|
||||
import com.ruoyi.system.service.IShareInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -15,10 +16,11 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Controller
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-19
|
||||
*/
|
||||
@@ -28,6 +30,8 @@ public class ShareInfoController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IShareInfoService shareInfoService;
|
||||
@Autowired
|
||||
private TextModerationPlus textModerationPlus;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
@@ -68,6 +72,10 @@ public class ShareInfoController extends BaseController
|
||||
public AjaxResult add(@RequestBody ShareInfo shareInfo)
|
||||
{
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
boolean result = textModerationPlus.textModeration(shareInfo.getShareDecs());
|
||||
if (!result){
|
||||
return warn("内容违规");
|
||||
}
|
||||
shareInfo.setUserId(userId);
|
||||
return toAjax(shareInfoService.insertShareInfo(shareInfo));
|
||||
}
|
||||
@@ -102,4 +110,15 @@ public class ShareInfoController extends BaseController
|
||||
{
|
||||
return toAjax(shareInfoService.increaseShareCount(id));
|
||||
}
|
||||
|
||||
// 分享内容检查
|
||||
@PostMapping("/textModeration")
|
||||
public AjaxResult textModeration(@RequestBody Map<String,String> params) {
|
||||
String content = params.get("content");
|
||||
if (content != null && !content.isEmpty()){
|
||||
boolean result = textModerationPlus.textModeration(content);
|
||||
return result ? success() : warn("内容违规");
|
||||
}
|
||||
return error("文本不能为空");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user