123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- package com.zhongzheng.controller.user;
- import com.zhongzheng.common.annotation.Log;
- import com.zhongzheng.common.core.controller.BaseController;
- import com.zhongzheng.common.core.domain.AjaxResult;
- import com.zhongzheng.common.core.page.TableDataInfo;
- import com.zhongzheng.common.enums.BusinessType;
- import com.zhongzheng.common.utils.ServletUtils;
- import com.zhongzheng.framework.web.service.WxTokenService;
- import com.zhongzheng.modules.user.bo.UserCourseAnswerAddBo;
- import com.zhongzheng.modules.user.bo.UserCourseAnswerEditBo;
- import com.zhongzheng.modules.user.bo.UserCourseAnswerQueryBo;
- import com.zhongzheng.modules.user.entity.ClientLoginUser;
- import com.zhongzheng.modules.user.service.IUserCourseAnswerService;
- import com.zhongzheng.modules.user.vo.UserCourseAnswerVo;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import lombok.RequiredArgsConstructor;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.util.List;
- /**
- * 答疑Controller
- *
- * @author ruoyi
- * @date 2021-12-15
- */
- @Api(value = "答疑控制器", tags = {"答疑管理"})
- @RequiredArgsConstructor(onConstructor_ = @Autowired)
- @RestController
- @RequestMapping("/course/answer")
- public class UserCourseAnswerController extends BaseController {
- private final IUserCourseAnswerService iUserCourseAnswerService;
- private final WxTokenService wxTokenService;
- /**
- * 查询答疑列表
- */
- @ApiOperation("查询答疑列表")
- @GetMapping("/list")
- public TableDataInfo<UserCourseAnswerVo> list(UserCourseAnswerQueryBo bo) {
- startPage();
- List<UserCourseAnswerVo> list = iUserCourseAnswerService.queryList(bo);
- return getDataTable(list);
- }
- /**
- * 新增答疑
- */
- @ApiOperation("新增答疑")
- @Log(title = "答疑", businessType = BusinessType.INSERT)
- @PostMapping()
- public AjaxResult<Void> add(@RequestBody UserCourseAnswerAddBo bo) {
- return toAjax(iUserCourseAnswerService.insertByAddBo(bo) ? 1 : 0);
- }
- /**
- * 新增答疑
- */
- /*@ApiOperation("新增答疑")
- @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);
- }*/
- /**
- * 修改答疑
- */
- @ApiOperation("修改答疑")
- @Log(title = "答疑", businessType = BusinessType.UPDATE)
- @PostMapping("edit")
- public AjaxResult<Void> edit(@RequestBody UserCourseAnswerEditBo bo) {
- return toAjax(iUserCourseAnswerService.updateByEditBo(bo) ? 1 : 0);
- }
- }
|