|  | @@ -1,5 +1,9 @@
 | 
	
		
			
				|  |  |  package com.yonge.cooleshow.admin.controller;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +import com.yonge.cooleshow.admin.io.request.teacher.TeacherVO;
 | 
	
		
			
				|  |  | +import com.yonge.cooleshow.biz.dal.vo.MyFens;
 | 
	
		
			
				|  |  | +import com.yonge.cooleshow.biz.dal.wrapper.teacher.TeacherWrapper;
 | 
	
		
			
				|  |  | +import com.yonge.toolset.base.page.QueryInfo;
 | 
	
		
			
				|  |  |  import io.swagger.annotations.Api;
 | 
	
		
			
				|  |  |  import io.swagger.annotations.ApiImplicitParam;
 | 
	
		
			
				|  |  |  import io.swagger.annotations.ApiImplicitParams;
 | 
	
	
		
			
				|  | @@ -9,6 +13,8 @@ import java.io.IOException;
 | 
	
		
			
				|  |  |  import java.io.OutputStream;
 | 
	
		
			
				|  |  |  import java.util.Date;
 | 
	
		
			
				|  |  |  import java.util.List;
 | 
	
		
			
				|  |  | +import java.util.Objects;
 | 
	
		
			
				|  |  | +import java.util.Optional;
 | 
	
		
			
				|  |  |  import java.util.stream.Collectors;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import javax.servlet.http.HttpServletResponse;
 | 
	
	
		
			
				|  | @@ -17,6 +23,7 @@ import javax.validation.Valid;
 | 
	
		
			
				|  |  |  import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  |  import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | +import org.springframework.http.HttpStatus;
 | 
	
		
			
				|  |  |  import org.springframework.security.access.prepost.PreAuthorize;
 | 
	
		
			
				|  |  |  import org.springframework.util.CollectionUtils;
 | 
	
		
			
				|  |  |  import org.springframework.web.bind.annotation.GetMapping;
 | 
	
	
		
			
				|  | @@ -246,4 +253,39 @@ public class TeacherController extends BaseController {
 | 
	
		
			
				|  |  |          teacherService.updateStyleVideo(teacherDto.getUserId(), teacherDto.getStyleVideo(), teacherDto.getMessage());
 | 
	
		
			
				|  |  |          return succeed();
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 查询老师统计指标
 | 
	
		
			
				|  |  | +     * @param userId 老师ID
 | 
	
		
			
				|  |  | +     * @return HttpResponseResult<TeacherVO.TeacherStat>
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    @ApiOperation(value = "详情", notes = "传入id")
 | 
	
		
			
				|  |  | +    @ApiImplicitParams({
 | 
	
		
			
				|  |  | +            @ApiImplicitParam(name = "id", value = "id", paramType = "path", dataType = "long", required = true),
 | 
	
		
			
				|  |  | +    })
 | 
	
		
			
				|  |  | +    @GetMapping("/stat/{id}")
 | 
	
		
			
				|  |  | +    public HttpResponseResult<TeacherVO.TeacherStat> teacherStatInfo(@PathVariable("id") Long userId) {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        // 老师统计指标
 | 
	
		
			
				|  |  | +        TeacherWrapper.TeacherStatInfo statInfo = teacherService.findTeacherStatInfoById(userId);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        return succeed(TeacherVO.TeacherStat.from(statInfo.jsonString()));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 老师粉丝信息查询
 | 
	
		
			
				|  |  | +     * @param query TeacherVO.TeacherFansQuery
 | 
	
		
			
				|  |  | +     * @return HttpResponseResult<PageInfo<MyFens>>
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    @ApiOperation(value = "我的粉丝")
 | 
	
		
			
				|  |  | +    @PostMapping(value = "/myFans")
 | 
	
		
			
				|  |  | +    public HttpResponseResult<PageInfo<MyFens>> queryMyFans(@RequestBody TeacherVO.TeacherFansQuery query) {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        if (Optional.ofNullable(query.getTeacherId()).orElse(0L) <= 0) {
 | 
	
		
			
				|  |  | +            return failed("无效的请求参数");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        IPage<MyFens> pages = teacherService.queryMyFans(PageUtil.getPage(query), query.getTeacherId());
 | 
	
		
			
				|  |  | +        return succeed(PageUtil.pageInfo(pages));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |  }
 |