|
@@ -3,6 +3,9 @@ package com.zhongzheng.controller.user;
|
|
|
import java.util.List;
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
+import com.zhongzheng.common.utils.ServletUtils;
|
|
|
+import com.zhongzheng.framework.web.service.WxTokenService;
|
|
|
+import com.zhongzheng.modules.user.entity.ClientLoginUser;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -42,6 +45,7 @@ public class UserCourseAnswerController extends BaseController {
|
|
|
|
|
|
private final IUserCourseAnswerService iUserCourseAnswerService;
|
|
|
|
|
|
+ private final WxTokenService wxTokenService;
|
|
|
/**
|
|
|
* 查询答疑列表
|
|
|
*/
|
|
@@ -61,6 +65,8 @@ public class UserCourseAnswerController extends BaseController {
|
|
|
@Log(title = "答疑", businessType = BusinessType.INSERT)
|
|
|
@PostMapping()
|
|
|
public AjaxResult<Void> add(@RequestBody UserCourseAnswerAddBo bo) {
|
|
|
+ ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ bo.setUserId(loginUser.getUser().getUserId());
|
|
|
return toAjax(iUserCourseAnswerService.insertByAddBo(bo) ? 1 : 0);
|
|
|
}
|
|
|
|