|  | @@ -1,23 +1,13 @@
 | 
											
												
													
														|  |  package com.yonge.cooleshow.teacher.controller;
 |  |  package com.yonge.cooleshow.teacher.controller;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  import com.baomidou.mybatisplus.core.metadata.IPage;
 |  |  import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
											
												
													
														|  | -import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 |  | 
 | 
											
												
													
														|  |  import com.yonge.cooleshow.auth.api.dto.RealnameAuthReq;
 |  |  import com.yonge.cooleshow.auth.api.dto.RealnameAuthReq;
 | 
											
												
													
														|  |  import com.yonge.cooleshow.auth.api.entity.SysUser;
 |  |  import com.yonge.cooleshow.auth.api.entity.SysUser;
 | 
											
												
													
														|  |  import com.yonge.cooleshow.biz.dal.dto.TeacherDto;
 |  |  import com.yonge.cooleshow.biz.dal.dto.TeacherDto;
 | 
											
												
													
														|  | -import com.yonge.cooleshow.biz.dal.entity.Subject;
 |  | 
 | 
											
												
													
														|  | -import com.yonge.cooleshow.biz.dal.entity.Teacher;
 |  | 
 | 
											
												
													
														|  | -import com.yonge.cooleshow.biz.dal.entity.TeacherStyleVideo;
 |  | 
 | 
											
												
													
														|  | -import com.yonge.cooleshow.biz.dal.entity.TenantInfo;
 |  | 
 | 
											
												
													
														|  | -import com.yonge.cooleshow.biz.dal.entity.TenantUnbindRecord;
 |  | 
 | 
											
												
													
														|  | 
 |  | +import com.yonge.cooleshow.biz.dal.entity.*;
 | 
											
												
													
														|  |  import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
 |  |  import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
 | 
											
												
													
														|  |  import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
 |  |  import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
 | 
											
												
													
														|  | -import com.yonge.cooleshow.biz.dal.service.SmsCodeService;
 |  | 
 | 
											
												
													
														|  | -import com.yonge.cooleshow.biz.dal.service.SubjectService;
 |  | 
 | 
											
												
													
														|  | -import com.yonge.cooleshow.biz.dal.service.SysUserService;
 |  | 
 | 
											
												
													
														|  | -import com.yonge.cooleshow.biz.dal.service.TeacherService;
 |  | 
 | 
											
												
													
														|  | -import com.yonge.cooleshow.biz.dal.service.TenantInfoService;
 |  | 
 | 
											
												
													
														|  | -import com.yonge.cooleshow.biz.dal.service.TenantUnbindRecordService;
 |  | 
 | 
											
												
													
														|  | 
 |  | +import com.yonge.cooleshow.biz.dal.service.*;
 | 
											
												
													
														|  |  import com.yonge.cooleshow.biz.dal.vo.MyFens;
 |  |  import com.yonge.cooleshow.biz.dal.vo.MyFens;
 | 
											
												
													
														|  |  import com.yonge.cooleshow.biz.dal.vo.TeacherHomeVo;
 |  |  import com.yonge.cooleshow.biz.dal.vo.TeacherHomeVo;
 | 
											
												
													
														|  |  import com.yonge.cooleshow.biz.dal.vo.TeacherVo;
 |  |  import com.yonge.cooleshow.biz.dal.vo.TeacherVo;
 | 
											
										
											
												
													
														|  | @@ -35,19 +25,11 @@ import io.swagger.annotations.Api;
 | 
											
												
													
														|  |  import io.swagger.annotations.ApiOperation;
 |  |  import io.swagger.annotations.ApiOperation;
 | 
											
												
													
														|  |  import io.swagger.annotations.ApiParam;
 |  |  import io.swagger.annotations.ApiParam;
 | 
											
												
													
														|  |  import org.apache.commons.lang3.StringUtils;
 |  |  import org.apache.commons.lang3.StringUtils;
 | 
											
												
													
														|  | -import org.springframework.beans.factory.annotation.Autowired;
 |  | 
 | 
											
												
													
														|  | -import org.springframework.http.HttpStatus;
 |  | 
 | 
											
												
													
														|  |  import org.springframework.util.CollectionUtils;
 |  |  import org.springframework.util.CollectionUtils;
 | 
											
												
													
														|  |  import org.springframework.validation.annotation.Validated;
 |  |  import org.springframework.validation.annotation.Validated;
 | 
											
												
													
														|  | -import org.springframework.web.bind.annotation.GetMapping;
 |  | 
 | 
											
												
													
														|  | -import org.springframework.web.bind.annotation.PathVariable;
 |  | 
 | 
											
												
													
														|  | -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.RequestParam;
 |  | 
 | 
											
												
													
														|  | -import org.springframework.web.bind.annotation.ResponseBody;
 |  | 
 | 
											
												
													
														|  | -import org.springframework.web.bind.annotation.RestController;
 |  | 
 | 
											
												
													
														|  | 
 |  | +import org.springframework.web.bind.annotation.*;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +import javax.annotation.Resource;
 | 
											
												
													
														|  |  import javax.validation.Valid;
 |  |  import javax.validation.Valid;
 | 
											
												
													
														|  |  import java.util.Arrays;
 |  |  import java.util.Arrays;
 | 
											
												
													
														|  |  import java.util.List;
 |  |  import java.util.List;
 | 
											
										
											
												
													
														|  | @@ -57,46 +39,29 @@ import java.util.stream.Collectors;
 | 
											
												
													
														|  |  @RequestMapping("${app-config.url.teacher:}/teacher")
 |  |  @RequestMapping("${app-config.url.teacher:}/teacher")
 | 
											
												
													
														|  |  @Api(value = "教师表", tags = "教师表")
 |  |  @Api(value = "教师表", tags = "教师表")
 | 
											
												
													
														|  |  public class TeacherController extends BaseController {
 |  |  public class TeacherController extends BaseController {
 | 
											
												
													
														|  | -    @Autowired
 |  | 
 | 
											
												
													
														|  | 
 |  | +    @Resource
 | 
											
												
													
														|  |      private TeacherService teacherService;
 |  |      private TeacherService teacherService;
 | 
											
												
													
														|  | -    @Autowired
 |  | 
 | 
											
												
													
														|  | -    private SysUserFeignService sysUserFeignService;
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -    @Autowired
 |  | 
 | 
											
												
													
														|  | 
 |  | +    @Resource
 | 
											
												
													
														|  |      private SysUserService sysUserService;
 |  |      private SysUserService sysUserService;
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -    @Autowired
 |  | 
 | 
											
												
													
														|  | 
 |  | +    @Resource
 | 
											
												
													
														|  |      private SmsCodeService smsCodeService;
 |  |      private SmsCodeService smsCodeService;
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -    @Autowired
 |  | 
 | 
											
												
													
														|  | 
 |  | +    @Resource
 | 
											
												
													
														|  |      private TenantUnbindRecordService tenantUnbindRecordService;
 |  |      private TenantUnbindRecordService tenantUnbindRecordService;
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -    @Autowired
 |  | 
 | 
											
												
													
														|  | 
 |  | +    @Resource
 | 
											
												
													
														|  |      private TenantInfoService tenantInfoService;
 |  |      private TenantInfoService tenantInfoService;
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -    @Autowired
 |  | 
 | 
											
												
													
														|  | 
 |  | +    @Resource
 | 
											
												
													
														|  |      private SubjectService subjectService;
 |  |      private SubjectService subjectService;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @ApiOperation(value = "我的-查询教师基本信息")
 |  |      @ApiOperation(value = "我的-查询教师基本信息")
 | 
											
												
													
														|  |      @GetMapping("/queryUserInfo")
 |  |      @GetMapping("/queryUserInfo")
 | 
											
												
													
														|  |      public HttpResponseResult<TeacherHomeVo> queryUserInfo() {
 |  |      public HttpResponseResult<TeacherHomeVo> queryUserInfo() {
 | 
											
												
													
														|  | -        SysUser user = sysUserFeignService.queryUserInfo();
 |  | 
 | 
											
												
													
														|  | -        if (user == null || null == user.getId()) {
 |  | 
 | 
											
												
													
														|  | -            return failed(HttpStatus.FORBIDDEN, "请登录");
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        return teacherService.queryUserInfo(user.getId());
 |  | 
 | 
											
												
													
														|  | 
 |  | +        return teacherService.queryUserInfo(sysUserService.getUserId());
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @ApiOperation(value = "设置系统默认客服")
 |  |      @ApiOperation(value = "设置系统默认客服")
 | 
											
												
													
														|  |      @GetMapping("/updateUserCustomerService")
 |  |      @GetMapping("/updateUserCustomerService")
 | 
											
												
													
														|  |      public HttpResponseResult<String> updateUserCustomerService() {
 |  |      public HttpResponseResult<String> updateUserCustomerService() {
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        SysUser user = sysUserFeignService.queryUserInfo();
 |  | 
 | 
											
												
													
														|  | -        if (user == null || null == user.getId()) {
 |  | 
 | 
											
												
													
														|  | -            return failed(HttpStatus.FORBIDDEN, "请登录");
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        return succeed(teacherService.updateUserCustomerService(user.getId()));
 |  | 
 | 
											
												
													
														|  | 
 |  | +        return succeed(teacherService.updateUserCustomerService(sysUserService.getUserId()));
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -105,8 +70,7 @@ public class TeacherController extends BaseController {
 | 
											
												
													
														|  |       */
 |  |       */
 | 
											
												
													
														|  |      @GetMapping("/detail/{id}")
 |  |      @GetMapping("/detail/{id}")
 | 
											
												
													
														|  |      public HttpResponseResult<TeacherVo> detail(@PathVariable("id") Long userId) {
 |  |      public HttpResponseResult<TeacherVo> detail(@PathVariable("id") Long userId) {
 | 
											
												
													
														|  | -        SysUser user = sysUserFeignService.queryUserInfo();
 |  | 
 | 
											
												
													
														|  | -        Teacher teacher = teacherService.getById(user.getId());
 |  | 
 | 
											
												
													
														|  | 
 |  | +        Teacher teacher = teacherService.getById(sysUserService.getUserId());
 | 
											
												
													
														|  |          if (Boolean.FALSE.equals(teacher.getCustomerService())) {
 |  |          if (Boolean.FALSE.equals(teacher.getCustomerService())) {
 | 
											
												
													
														|  |              throw new BizException("权限不足");
 |  |              throw new BizException("权限不足");
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
										
											
												
													
														|  | @@ -123,28 +87,20 @@ public class TeacherController extends BaseController {
 | 
											
												
													
														|  |      @ApiOperation(value = "开通直播")
 |  |      @ApiOperation(value = "开通直播")
 | 
											
												
													
														|  |      @GetMapping("/openLive")
 |  |      @GetMapping("/openLive")
 | 
											
												
													
														|  |      public HttpResponseResult<Boolean> openLive() {
 |  |      public HttpResponseResult<Boolean> openLive() {
 | 
											
												
													
														|  | -        SysUser user = sysUserFeignService.queryUserInfo();
 |  | 
 | 
											
												
													
														|  | -        if (user == null || null == user.getId()) {
 |  | 
 | 
											
												
													
														|  | -            return failed(HttpStatus.FORBIDDEN, "请登录");
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        return teacherService.openLive(user.getId());
 |  | 
 | 
											
												
													
														|  | 
 |  | +        return teacherService.openLive(sysUserService.getUserId());
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @ApiOperation(value = "获取老师可授课声部列表")
 |  |      @ApiOperation(value = "获取老师可授课声部列表")
 | 
											
												
													
														|  |      @PostMapping("/querySubject")
 |  |      @PostMapping("/querySubject")
 | 
											
												
													
														|  |      public HttpResponseResult<List<Subject>> querySubject() {
 |  |      public HttpResponseResult<List<Subject>> querySubject() {
 | 
											
												
													
														|  | -        SysUser user = sysUserFeignService.queryUserInfo();
 |  | 
 | 
											
												
													
														|  | -        if (user == null || null == user.getId()) {
 |  | 
 | 
											
												
													
														|  | -            return failed(HttpStatus.FORBIDDEN, "请登录");
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        List<Subject> subjects = teacherService.querySubject(user.getId());
 |  | 
 | 
											
												
													
														|  | 
 |  | +        List<Subject> subjects = teacherService.querySubject(sysUserService.getUserId());
 | 
											
												
													
														|  |          subjectService.convertSubject(subjects);
 |  |          subjectService.convertSubject(subjects);
 | 
											
												
													
														|  |          return succeed(subjects);
 |  |          return succeed(subjects);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @ApiOperation(value = "设置声部")
 |  |      @ApiOperation(value = "设置声部")
 | 
											
												
													
														|  |      @GetMapping("/setSubject")
 |  |      @GetMapping("/setSubject")
 | 
											
												
													
														|  | -    public HttpResponseResult setSubject(@ApiParam(value = "声部主键集合", required = true) @RequestParam("subjectIds") String subjectIds) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +    public HttpResponseResult<Object> setSubject(@ApiParam(value = "声部主键集合", required = true) @RequestParam("subjectIds") String subjectIds) {
 | 
											
												
													
														|  |          if (StringUtil.isEmpty(subjectIds)) {
 |  |          if (StringUtil.isEmpty(subjectIds)) {
 | 
											
												
													
														|  |              return failed("参数不能为空");
 |  |              return failed("参数不能为空");
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
										
											
												
													
														|  | @@ -152,23 +108,14 @@ public class TeacherController extends BaseController {
 | 
											
												
													
														|  |          if (subjectIds.split(",").length > 5) {
 |  |          if (subjectIds.split(",").length > 5) {
 | 
											
												
													
														|  |              return failed("最多选择5个乐器");
 |  |              return failed("最多选择5个乐器");
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        SysUser user = sysUserFeignService.queryUserInfo();
 |  | 
 | 
											
												
													
														|  | -        if (user == null || null == user.getId()) {
 |  | 
 | 
											
												
													
														|  | -            return failed(HttpStatus.FORBIDDEN, "请登录");
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        return status(teacherService.setSubject(user.getId(), subjectIds) > 0);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        return status(teacherService.setSubject(sysUserService.getUserId(), subjectIds) > 0);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @ApiOperation(value = "获取声部搜索下拉框")
 |  |      @ApiOperation(value = "获取声部搜索下拉框")
 | 
											
												
													
														|  |      @PostMapping("/querySubjectItem")
 |  |      @PostMapping("/querySubjectItem")
 | 
											
												
													
														|  |      public HttpResponseResult<List<Subject>> querySubjectItem(
 |  |      public HttpResponseResult<List<Subject>> querySubjectItem(
 | 
											
												
													
														|  |              @ApiParam(value = "类型 PRACTICE 陪练课 LIVE 直播课 VIDEO 视频课 PIANO_ROOM 琴房 MUSIC 曲目 ") String type) {
 |  |              @ApiParam(value = "类型 PRACTICE 陪练课 LIVE 直播课 VIDEO 视频课 PIANO_ROOM 琴房 MUSIC 曲目 ") String type) {
 | 
											
												
													
														|  | -        SysUser user = sysUserFeignService.queryUserInfo();
 |  | 
 | 
											
												
													
														|  | -        if (user == null || null == user.getId()) {
 |  | 
 | 
											
												
													
														|  | -            return failed(HttpStatus.FORBIDDEN, "请登录");
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        List<Subject> subjects = teacherService.querySubjectItem(user.getId(), type);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        List<Subject> subjects = teacherService.querySubjectItem(sysUserService.getUserId(), type);
 | 
											
												
													
														|  |          subjectService.convertSubject(subjects);
 |  |          subjectService.convertSubject(subjects);
 | 
											
												
													
														|  |          return succeed(subjects);
 |  |          return succeed(subjects);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
										
											
												
													
														|  | @@ -176,36 +123,23 @@ public class TeacherController extends BaseController {
 | 
											
												
													
														|  |      @ApiOperation(value = "我的-个人风采")
 |  |      @ApiOperation(value = "我的-个人风采")
 | 
											
												
													
														|  |      @GetMapping("/queryTeacherStyle")
 |  |      @GetMapping("/queryTeacherStyle")
 | 
											
												
													
														|  |      public HttpResponseResult<TeacherVo> queryTeacherStyle() {
 |  |      public HttpResponseResult<TeacherVo> queryTeacherStyle() {
 | 
											
												
													
														|  | -        SysUser user = sysUserFeignService.queryUserInfo();
 |  | 
 | 
											
												
													
														|  | -        if (user == null || null == user.getId()) {
 |  | 
 | 
											
												
													
														|  | -            return failed(HttpStatus.FORBIDDEN, "请登录");
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        return HttpResponseResult.succeed(teacherService.detail(user.getId()));
 |  | 
 | 
											
												
													
														|  | 
 |  | +        return HttpResponseResult.succeed(teacherService.detail(sysUserService.getUserId()));
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @ApiOperation(value = "我的-个人风采保存")
 |  |      @ApiOperation(value = "我的-个人风采保存")
 | 
											
												
													
														|  |      @PostMapping("/saveTeacherStyle")
 |  |      @PostMapping("/saveTeacherStyle")
 | 
											
												
													
														|  |      public HttpResponseResult<TeacherVo> saveTeacherStyle(@RequestBody TeacherDto teacherDto) {
 |  |      public HttpResponseResult<TeacherVo> saveTeacherStyle(@RequestBody TeacherDto teacherDto) {
 | 
											
												
													
														|  | -        SysUser user = sysUserFeignService.queryUserInfo();
 |  | 
 | 
											
												
													
														|  | -        if (user == null || null == user.getId()) {
 |  | 
 | 
											
												
													
														|  | -            return failed(HttpStatus.FORBIDDEN, "请登录");
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  |          if (StringUtil.isEmpty(teacherDto.getSubjectId())) {
 |  |          if (StringUtil.isEmpty(teacherDto.getSubjectId())) {
 | 
											
												
													
														|  |              return failed("请选择乐器");
 |  |              return failed("请选择乐器");
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  | -        teacherDto.setUserId(user.getId());
 |  | 
 | 
											
												
													
														|  | 
 |  | +        teacherDto.setUserId(sysUserService.getUserId());
 | 
											
												
													
														|  |          return teacherService.saveTeacherStyle(teacherDto);
 |  |          return teacherService.saveTeacherStyle(teacherDto);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @ApiOperation(value = "我的粉丝")
 |  |      @ApiOperation(value = "我的粉丝")
 | 
											
												
													
														|  |      @PostMapping(value = "/queryMyFans")
 |  |      @PostMapping(value = "/queryMyFans")
 | 
											
												
													
														|  |      public HttpResponseResult<PageInfo<MyFens>> queryMyFans(@RequestBody QueryInfo query) {
 |  |      public HttpResponseResult<PageInfo<MyFens>> queryMyFans(@RequestBody QueryInfo query) {
 | 
											
												
													
														|  | -        SysUser sysUser = sysUserFeignService.queryUserInfo();
 |  | 
 | 
											
												
													
														|  | -        if (sysUser == null || sysUser.getId() == null) {
 |  | 
 | 
											
												
													
														|  | -            return failed(HttpStatus.FORBIDDEN, "请登录");
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        IPage<MyFens> pages = teacherService.queryMyFans(PageUtil.getPage(query), sysUser.getId());
 |  | 
 | 
											
												
													
														|  | 
 |  | +        IPage<MyFens> pages = teacherService.queryMyFans(PageUtil.getPage(query), sysUserService.getUserId());
 | 
											
												
													
														|  |          return succeed(PageUtil.pageInfo(pages));
 |  |          return succeed(PageUtil.pageInfo(pages));
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -213,11 +147,7 @@ public class TeacherController extends BaseController {
 | 
											
												
													
														|  |      @ApiOperation(value = "移除粉丝")
 |  |      @ApiOperation(value = "移除粉丝")
 | 
											
												
													
														|  |      @PostMapping(value = "/delFans/{userId}")
 |  |      @PostMapping(value = "/delFans/{userId}")
 | 
											
												
													
														|  |      public HttpResponseResult<Void> delFans(@PathVariable("userId") Long userId) {
 |  |      public HttpResponseResult<Void> delFans(@PathVariable("userId") Long userId) {
 | 
											
												
													
														|  | -        SysUser sysUser = sysUserFeignService.queryUserInfo();
 |  | 
 | 
											
												
													
														|  | -        if (sysUser == null || sysUser.getId() == null) {
 |  | 
 | 
											
												
													
														|  | -            return failed(HttpStatus.FORBIDDEN, "请登录");
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        teacherService.delFans(userId, sysUser.getId());
 |  | 
 | 
											
												
													
														|  | 
 |  | +        teacherService.delFans(userId, sysUserService.getUserId());
 | 
											
												
													
														|  |          return succeed();
 |  |          return succeed();
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -228,15 +158,11 @@ public class TeacherController extends BaseController {
 | 
											
												
													
														|  |      @PostMapping("/defaultSubject")
 |  |      @PostMapping("/defaultSubject")
 | 
											
												
													
														|  |      @ApiOperation(value = "设置老师默认查询声部")
 |  |      @ApiOperation(value = "设置老师默认查询声部")
 | 
											
												
													
														|  |      public HttpResponseResult defaultSubject(@RequestParam(required = false) Long subjectId) {
 |  |      public HttpResponseResult defaultSubject(@RequestParam(required = false) Long subjectId) {
 | 
											
												
													
														|  | -        SysUser sysUser = sysUserFeignService.queryUserInfo();
 |  | 
 | 
											
												
													
														|  | -        if (sysUser == null || sysUser.getId() == null) {
 |  | 
 | 
											
												
													
														|  | -            return failed("用户信息获取失败");
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  |          if (subjectId == null) {
 |  |          if (subjectId == null) {
 | 
											
												
													
														|  |              return succeed();
 |  |              return succeed();
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          Teacher teacher = new Teacher();
 |  |          Teacher teacher = new Teacher();
 | 
											
												
													
														|  | -        teacher.setUserId(sysUser.getId());
 |  | 
 | 
											
												
													
														|  | 
 |  | +        teacher.setUserId(sysUserService.getUserId());
 | 
											
												
													
														|  |          teacher.setDefaultSubject(subjectId);
 |  |          teacher.setDefaultSubject(subjectId);
 | 
											
												
													
														|  |          return succeed(teacherService.updateById(teacher));
 |  |          return succeed(teacherService.updateById(teacher));
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
										
											
												
													
														|  | @@ -245,11 +171,7 @@ public class TeacherController extends BaseController {
 | 
											
												
													
														|  |      @ApiOperation(value = "实名认证", notes = "传入realNameAuthDto")
 |  |      @ApiOperation(value = "实名认证", notes = "传入realNameAuthDto")
 | 
											
												
													
														|  |      @ResponseBody
 |  |      @ResponseBody
 | 
											
												
													
														|  |      public HttpResponseResult<IdcardInfoExtractor> realNameAuth(@Valid @RequestBody RealnameAuthReq realNameAuthDto) {
 |  |      public HttpResponseResult<IdcardInfoExtractor> realNameAuth(@Valid @RequestBody RealnameAuthReq realNameAuthDto) {
 | 
											
												
													
														|  | -        SysUser user = sysUserFeignService.queryUserInfo();
 |  | 
 | 
											
												
													
														|  | -        if (user == null || null == user.getId()) {
 |  | 
 | 
											
												
													
														|  | -            return failed(HttpStatus.FORBIDDEN, "请登录");
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        IdcardInfoExtractor idcardInfoExtractor = sysUserService.updateUserCard(realNameAuthDto, user,
 |  | 
 | 
											
												
													
														|  | 
 |  | +        IdcardInfoExtractor idcardInfoExtractor = sysUserService.updateUserCard(realNameAuthDto, sysUserService.getUser(),
 | 
											
												
													
														|  |                  ClientEnum.TEACHER);
 |  |                  ClientEnum.TEACHER);
 | 
											
												
													
														|  |          return succeed(idcardInfoExtractor);
 |  |          return succeed(idcardInfoExtractor);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
										
											
												
													
														|  | @@ -257,10 +179,7 @@ public class TeacherController extends BaseController {
 | 
											
												
													
														|  |      @PostMapping("/unbindTenant")
 |  |      @PostMapping("/unbindTenant")
 | 
											
												
													
														|  |      @ApiOperation(value = "解绑机构申请")
 |  |      @ApiOperation(value = "解绑机构申请")
 | 
											
												
													
														|  |      public HttpResponseResult<Boolean> unbindTenant(@Validated @RequestBody TeacherWrapper.UnbindTenant unbindTenant) {
 |  |      public HttpResponseResult<Boolean> unbindTenant(@Validated @RequestBody TeacherWrapper.UnbindTenant unbindTenant) {
 | 
											
												
													
														|  | -        SysUser user = sysUserFeignService.queryUserInfo();
 |  | 
 | 
											
												
													
														|  | -        if (user == null || null == user.getId()) {
 |  | 
 | 
											
												
													
														|  | -            return failed(HttpStatus.FORBIDDEN, "请登录");
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | 
 |  | +        SysUser user = sysUserService.getUser();
 | 
											
												
													
														|  |          boolean validCode = smsCodeService.verifyValidCode(user.getPhone(), unbindTenant.getCode(), "");
 |  |          boolean validCode = smsCodeService.verifyValidCode(user.getPhone(), unbindTenant.getCode(), "");
 | 
											
												
													
														|  |          if (!validCode) {
 |  |          if (!validCode) {
 | 
											
												
													
														|  |              return failed("验证码错误");
 |  |              return failed("验证码错误");
 | 
											
										
											
												
													
														|  | @@ -323,10 +242,7 @@ public class TeacherController extends BaseController {
 | 
											
												
													
														|  |      @PostMapping("/unbindTenantCancel")
 |  |      @PostMapping("/unbindTenantCancel")
 | 
											
												
													
														|  |      @ApiOperation(value = "解绑机构申请撤销")
 |  |      @ApiOperation(value = "解绑机构申请撤销")
 | 
											
												
													
														|  |      public HttpResponseResult<Boolean> unbindTenantCancel() {
 |  |      public HttpResponseResult<Boolean> unbindTenantCancel() {
 | 
											
												
													
														|  | -        SysUser user = sysUserFeignService.queryUserInfo();
 |  | 
 | 
											
												
													
														|  | -        if (user == null || null == user.getId()) {
 |  | 
 | 
											
												
													
														|  | -            return failed(HttpStatus.FORBIDDEN, "请登录");
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | 
 |  | +        SysUser user = sysUserService.getUser();
 | 
											
												
													
														|  |          boolean update = tenantUnbindRecordService.lambdaUpdate()
 |  |          boolean update = tenantUnbindRecordService.lambdaUpdate()
 | 
											
												
													
														|  |                  .eq(TenantUnbindRecord::getUserId, user.getId())
 |  |                  .eq(TenantUnbindRecord::getUserId, user.getId())
 | 
											
												
													
														|  |                  .eq(TenantUnbindRecord::getTenantId, user.getTenantId())
 |  |                  .eq(TenantUnbindRecord::getTenantId, user.getTenantId())
 | 
											
										
											
												
													
														|  | @@ -343,11 +259,7 @@ public class TeacherController extends BaseController {
 | 
											
												
													
														|  |      @GetMapping("/unbindTenantDetail")
 |  |      @GetMapping("/unbindTenantDetail")
 | 
											
												
													
														|  |      @ApiOperation(value = "解绑机构申请记录")
 |  |      @ApiOperation(value = "解绑机构申请记录")
 | 
											
												
													
														|  |      public HttpResponseResult<TenantUnbindRecord> unbindTenantDetail() {
 |  |      public HttpResponseResult<TenantUnbindRecord> unbindTenantDetail() {
 | 
											
												
													
														|  | -        SysUser user = sysUserFeignService.queryUserInfo();
 |  | 
 | 
											
												
													
														|  | -        if (user == null || null == user.getId()) {
 |  | 
 | 
											
												
													
														|  | -            return failed(HttpStatus.FORBIDDEN, "请登录");
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | 
 |  | +        SysUser user = sysUserService.getUser();
 | 
											
												
													
														|  |          TenantUnbindRecord one = tenantUnbindRecordService.lambdaQuery()
 |  |          TenantUnbindRecord one = tenantUnbindRecordService.lambdaQuery()
 | 
											
												
													
														|  |                  .eq(TenantUnbindRecord::getUserId, user.getId())
 |  |                  .eq(TenantUnbindRecord::getUserId, user.getId())
 | 
											
												
													
														|  |                  .eq(TenantUnbindRecord::getTenantId, user.getTenantId())
 |  |                  .eq(TenantUnbindRecord::getTenantId, user.getTenantId())
 |