|
@@ -5,11 +5,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
-import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.zzb.common.bean.RspResult;
|
|
|
import com.ruoyi.zzb.study.domain.StudyDocInfo;
|
|
|
import com.ruoyi.zzb.study.domain.UserSearchParam;
|
|
|
-import com.ruoyi.zzb.study.domain.req.SaveViewLogVO;
|
|
|
+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;
|
|
@@ -41,10 +40,19 @@ public class StudyController {
|
|
|
}
|
|
|
|
|
|
@PostMapping("/findDocInfoById")
|
|
|
- public JSONObject findDocInfoById(HttpServletResponse response, HttpServletRequest request,@RequestBody JSONObject params) {
|
|
|
+ public JSONObject findDocInfoById(HttpServletResponse response, HttpServletRequest request, @Validated @RequestBody QueryInfoVO queryInfoVO) {
|
|
|
|
|
|
try {
|
|
|
- StudyDocInfo result = studyService.findDocInfoById(params.getString("docId"));
|
|
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
+ SysUser sysUser = loginUser.getUser();
|
|
|
+
|
|
|
+ queryInfoVO.setUserId(sysUser.getUserId()+"");
|
|
|
+ StudyDocInfo result = studyService.findDocInfoById(queryInfoVO.getDocId());
|
|
|
+
|
|
|
+ if(result != null){ //有记录详情,保存浏览记录
|
|
|
+ studyService.saveViewLogInfo(queryInfoVO,sysUser);
|
|
|
+ }
|
|
|
+
|
|
|
return RspResult.success(result);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
@@ -96,15 +104,15 @@ public class StudyController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @PostMapping("/saveViewLog")
|
|
|
- public JSONObject saveViewLog(HttpServletResponse response, HttpServletRequest request, @Validated @RequestBody SaveViewLogVO saveViewLogVO) {
|
|
|
+// @PostMapping("/saveViewLog") 关闭保存访问日志对外接口
|
|
|
+ public JSONObject saveViewLog(HttpServletResponse response, HttpServletRequest request, @Validated @RequestBody QueryInfoVO queryInfoVO) {
|
|
|
try {
|
|
|
|
|
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
SysUser sysUser = loginUser.getUser();
|
|
|
|
|
|
- saveViewLogVO.setUserId(sysUser.getUserId()+"");
|
|
|
- boolean result = studyService.saveViewLogInfo(saveViewLogVO,sysUser);
|
|
|
+ queryInfoVO.setUserId(sysUser.getUserId()+"");
|
|
|
+ boolean result = studyService.saveViewLogInfo(queryInfoVO,sysUser);
|
|
|
return RspResult.success(result);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|