|
|
@@ -13,6 +13,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
/**
|
|
|
* 直播间敏感词过滤Controller
|
|
|
@@ -52,6 +53,24 @@ public class LiveSensitiveWordsController extends BaseController
|
|
|
return util.exportExcel(list, "直播间敏感词过滤数据");
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/importTemplate")
|
|
|
+ public AjaxResult importTemplate()
|
|
|
+ {
|
|
|
+ ExcelUtil<LiveSensitiveWords> util = new ExcelUtil<>(LiveSensitiveWords.class);
|
|
|
+ return util.importTemplateExcel("敏感词导入模板");
|
|
|
+ }
|
|
|
+
|
|
|
+ @PreAuthorize("@ss.hasPermi('live:words:add')")
|
|
|
+ @Log(title = "直播间敏感词过滤", businessType = BusinessType.IMPORT)
|
|
|
+ @PostMapping("/importData")
|
|
|
+ public AjaxResult importData(MultipartFile file) throws Exception
|
|
|
+ {
|
|
|
+ ExcelUtil<LiveSensitiveWords> util = new ExcelUtil<>(LiveSensitiveWords.class);
|
|
|
+ List<LiveSensitiveWords> list = util.importExcel(file.getInputStream());
|
|
|
+ String message = liveSensitiveWordsService.importData(list);
|
|
|
+ return AjaxResult.success(message);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取直播间敏感词过滤详细信息
|
|
|
*/
|