|
@@ -5,7 +5,9 @@ import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
|
import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.Student;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.Subject;
|
|
|
+import com.yonge.cooleshow.biz.dal.enums.YesOrNoEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.service.StudentService;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.StudentStarService;
|
|
|
import com.yonge.cooleshow.biz.dal.support.PageUtil;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.MyFollow;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.StudentHomeVo;
|
|
@@ -30,6 +32,8 @@ public class StudentController extends BaseController {
|
|
|
@Autowired
|
|
|
private StudentService studentService;
|
|
|
@Autowired
|
|
|
+ private StudentStarService studentStarService;
|
|
|
+ @Autowired
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
@ApiOperation(value = "查询学员")
|
|
@@ -88,8 +92,21 @@ public class StudentController extends BaseController {
|
|
|
return succeed(PageUtil.pageInfo(pages));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ @ApiOperation(value = "关注/取消关注")
|
|
|
+ @GetMapping("/starOrUnStar")
|
|
|
+ public HttpResponseResult<Boolean> starOrUnStar(@ApiParam(value = "老师ID", required = true) @RequestParam("userId") Long userId,
|
|
|
+ @ApiParam(value = "状态 0 取消关注 1 关注", required = true) @RequestParam("starStatus") YesOrNoEnum starStatus) {
|
|
|
+ if (null == userId) {
|
|
|
+ return failed("缺少老师ID");
|
|
|
+ }
|
|
|
+ if (null == starStatus) {
|
|
|
+ return failed("缺少关注状态");
|
|
|
+ }
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
+ if (user == null || null == user.getId()) {
|
|
|
+ return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
+ }
|
|
|
+ return studentStarService.starOrUnStar(user.getId(), userId, starStatus);
|
|
|
+ }
|
|
|
|
|
|
}
|