|
@@ -3,9 +3,12 @@ package com.zhongzheng.controller.user;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
|
|
|
|
|
|
|
|
+import com.zhongzheng.common.utils.ServletUtils;
|
|
|
|
|
+import com.zhongzheng.framework.web.service.WxTokenService;
|
|
|
import com.zhongzheng.modules.user.bo.UserStudyRecordAddBo;
|
|
import com.zhongzheng.modules.user.bo.UserStudyRecordAddBo;
|
|
|
import com.zhongzheng.modules.user.bo.UserStudyRecordEditBo;
|
|
import com.zhongzheng.modules.user.bo.UserStudyRecordEditBo;
|
|
|
import com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo;
|
|
import com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo;
|
|
|
|
|
+import com.zhongzheng.modules.user.entity.ClientLoginUser;
|
|
|
import com.zhongzheng.modules.user.service.IUserStudyRecordService;
|
|
import com.zhongzheng.modules.user.service.IUserStudyRecordService;
|
|
|
import com.zhongzheng.modules.user.vo.UserStudyRecordVo;
|
|
import com.zhongzheng.modules.user.vo.UserStudyRecordVo;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
@@ -42,14 +45,18 @@ public class UserStudyRecordController extends BaseController {
|
|
|
|
|
|
|
|
private final IUserStudyRecordService iUserStudyRecordService;
|
|
private final IUserStudyRecordService iUserStudyRecordService;
|
|
|
|
|
|
|
|
|
|
+ private final WxTokenService wxTokenService;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询用户学习记录列表
|
|
* 查询用户学习记录列表
|
|
|
*/
|
|
*/
|
|
|
@ApiOperation("查询用户学习记录列表")
|
|
@ApiOperation("查询用户学习记录列表")
|
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
|
public TableDataInfo<UserStudyRecordVo> list(UserStudyRecordQueryBo bo) {
|
|
public TableDataInfo<UserStudyRecordVo> list(UserStudyRecordQueryBo bo) {
|
|
|
|
|
+ ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
|
|
+ bo.setUserId(loginUser.getUser().getUserId());
|
|
|
startPage();
|
|
startPage();
|
|
|
- List<UserStudyRecordVo> list = iUserStudyRecordService.queryList(bo);
|
|
|
|
|
|
|
+ List<UserStudyRecordVo> list = iUserStudyRecordService.selectList(bo);
|
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -71,6 +78,8 @@ public class UserStudyRecordController extends BaseController {
|
|
|
@Log(title = "用户学习记录", businessType = BusinessType.INSERT)
|
|
@Log(title = "用户学习记录", businessType = BusinessType.INSERT)
|
|
|
@PostMapping()
|
|
@PostMapping()
|
|
|
public AjaxResult<Void> add(@RequestBody UserStudyRecordAddBo bo) {
|
|
public AjaxResult<Void> add(@RequestBody UserStudyRecordAddBo bo) {
|
|
|
|
|
+ ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
|
|
+ bo.setUserId(loginUser.getUser().getUserId());
|
|
|
return toAjax(iUserStudyRecordService.insertByAddBo(bo) ? 1 : 0);
|
|
return toAjax(iUserStudyRecordService.insertByAddBo(bo) ? 1 : 0);
|
|
|
}
|
|
}
|
|
|
|
|
|