Commit c428f3e8 authored by liuyang's avatar liuyang

fixed bug

parent 441ec6bf
......@@ -2,6 +2,7 @@ package com.qkdata.biz.management.controller;
import com.qkdata.biz.common.BizConstants;
import com.qkdata.biz.management.entity.TeacherPO;
import com.qkdata.biz.management.service.TeacherService;
import com.qkdata.biz.management.vo.QueryTeacherModel;
import com.qkdata.biz.management.vo.TeacherModel;
......@@ -14,10 +15,7 @@ import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
......@@ -37,6 +35,15 @@ public class TeacherController {
@Autowired
private TeacherService teacherService;
@ApiOperation("获取讲师信息")
@SysLog("获取讲师信息")
@GetMapping("/{id}")
@RequiresRoles(value = {BizConstants.ROLE_ADMIN,BizConstants.ROLE_OPERATOR},logical = Logical.OR)
public Result<TeacherPO> info(@PathVariable Long id){
TeacherPO po = teacherService.getById(id);
return Result.succeed(po);
}
@ApiOperation("添加讲师信息")
@PostMapping("/save")
@SysLog(value = "添加讲师信息")
......
package com.qkdata.biz.management.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.qkdata.biz.enums.QuestionStatusEnum;
import com.qkdata.common.base.entity.BasePO;
......
......@@ -101,6 +101,7 @@ public class TeacherService extends ServiceImpl<TeacherMapper, TeacherPO> {
po.setMobile(model.getMobile());
po.setIntroduce(model.getIntroduce());
po.setOrgId(model.getOrgId());
po.setAccount(model.getAccount());
updateById(po);
//添加讲师帐号
if (StrUtil.isBlank(po.getAccount()) && StrUtil.isNotBlank(model.getAccount())){
......@@ -111,7 +112,6 @@ public class TeacherService extends ServiceImpl<TeacherMapper, TeacherPO> {
public PageResult<TeacherModel> queryPage(QueryTeacherModel param) {
Page page = new Page(param.getPageIndex(),param.getPageSize());
List<TeacherModel> list = baseMapper.queryPage(page,param);
//TODO add courseCount
for (TeacherModel model : list){
int count = courseService.countByTeacher(model.getId());
model.setCourseCount(count);
......
package com.qkdata.biz.management.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.qkdata.biz.enums.QuestionStatusEnum;
import lombok.Data;
......
......@@ -16,7 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@Api(tags = "问答模块接口-端")
@Api(tags = "问答模块接口-手机端")
@RestController
@RequestMapping("/api/question")
public class FrontendQAController {
......
ALTER TABLE `question`
MODIFY COLUMN `status` tinyint(1) NULL DEFAULT NULL COMMENT '状态:待回复、已回复、已完成' AFTER `update_time`;
\ No newline at end of file
MODIFY COLUMN `status` int(1) NULL DEFAULT NULL COMMENT '状态:待回复、已回复、已完成' AFTER `update_time`;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment