|
@@ -14,12 +14,14 @@ import com.ruoyi.zzb.study.domain.req.QueryInfoVO;
|
|
|
import com.ruoyi.zzb.study.domain.req.UpdatePageViewNumVO;
|
|
|
import com.ruoyi.zzb.study.service.StudyService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.Arrays;
|
|
|
|
|
|
@Slf4j
|
|
|
@RestController
|
|
@@ -96,6 +98,24 @@ public class StudyController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据docIds 学习助手批量删除
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/deleteByIds")
|
|
|
+ public AjaxResult delete(@RequestBody JSONObject params){
|
|
|
+ try {
|
|
|
+ String docIds = params.getString("docIds");
|
|
|
+ if(StringUtils.isBlank(docIds) || Arrays.asList(docIds.split(",")).size() == 0){
|
|
|
+ return error("docIds参数为空");
|
|
|
+ }
|
|
|
+ return studyService.delDataByDocIds(Arrays.asList(docIds.split(",")))? success(true) : error("【学习助手】 - 删除失败的文章号:[" + docIds + "]");
|
|
|
+ } catch (Exception e){
|
|
|
+ log.error("============【学习助手】异常:deleteByIds======", e);
|
|
|
+ return error("【学习助手】删除失败 - " + e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("/updatePageViewNumById")
|
|
|
public AjaxResult updatePageViewNumById(HttpServletResponse response, HttpServletRequest request,@Validated @RequestBody UpdatePageViewNumVO updatePageViewNumVO) {
|
|
|
try {
|
|
@@ -107,7 +127,7 @@ public class StudyController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// @PostMapping("/saveViewLog") 关闭保存访问日志对外接口
|
|
|
+ // @PostMapping("/saveViewLog") 关闭保存访问日志对外接口
|
|
|
public AjaxResult saveViewLog(HttpServletResponse response, HttpServletRequest request, @Validated @RequestBody QueryInfoVO queryInfoVO) {
|
|
|
try {
|
|
|
|