Commit 20af146c authored by root's avatar root

修改首页接口

parent 59afbbbe
......@@ -117,7 +117,8 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation(value="606 分页查询大家都在学", notes="分页查询大家都在学")
@GetMapping(value = "/queryPersonMoreByPagination")
public Result queryPersonMoreByPagination(CurUser curUser,@Valid FirstPageQueryDTO firstPageQueryDTO, BindingResult bindingResult) {
bLessonService.queryPersonMoreByPagination(getPaginationUtility());
String userId = curUser.getUserId();
bLessonService.queryPersonMoreByPagination(getPaginationUtility(),userId);
GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
......@@ -125,7 +126,7 @@ public class BLessonController extends PaginationController<BLesson> {
gridModel);
}
@ApiOperation(value="607 分页查询推荐", notes="分页查询推荐")
@ApiOperation(value="607 分页查询企业推荐", notes="分页查询企业推荐")
@GetMapping(value = "/queryRecommendByPagination")
public Result queryRecommendByPagination(CurUser curUser,@Valid FirstPageQueryDTO firstPageQueryDTO, BindingResult bindingResult) {
String userId = curUser.getUserId();
......@@ -140,7 +141,8 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation(value="608 分页查询最受关注", notes="分页查询最受关注")
@GetMapping(value = "/queryConcernByPagination")
public Result queryConcernByPagination(CurUser curUser) {
bLessonService.queryConcernByPagination(getPaginationUtility());
String userId = curUser.getUserId();
bLessonService.queryConcernByPagination(getPaginationUtility(),userId);
GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
......@@ -152,7 +154,8 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation(value="609 分页查询可能感兴趣", notes="分页查询可能感兴趣")
@GetMapping(value = "/queryInterestedByPagination")
public Result queryInterestedByPagination(CurUser curUser) {
bLessonService.queryInterestedByPagination(getPaginationUtility());
String userId = curUser.getUserId();
bLessonService.queryInterestedByPagination(getPaginationUtility(),userId);
GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
......@@ -199,13 +202,13 @@ public class BLessonController extends PaginationController<BLesson> {
}
@ApiOperation(value="613 我发布的课程总数", notes="我发布的课程总数")
@GetMapping(value = "/iPublishCount")
public Result iPublishCount(CurUser curUser) {
@GetMapping(value = "/iLessonCount")
public Result ILessonCountDTO(CurUser curUser) {
String userId = curUser.getUserId();
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
bLessonService.iPublishCount(userId));
bLessonService.iLessonCount(userId));
}
......
package org.rcisoft.business.blesson.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.rcisoft.business.blesson.entity.BLesson;
import org.rcisoft.business.blesson.dto.ILearnLessonDTO;
import org.rcisoft.business.blesson.service.BLessonPersonService;
import org.rcisoft.common.controller.PaginationController;
import org.rcisoft.common.model.GridModel;
import org.rcisoft.core.constant.MessageConstant;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.result.Result;
import org.rcisoft.sys.user.bean.CurUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
@Api(tags = "9 学生-课程")
@RestController
@RequestMapping("/BLessonPerson")
@Slf4j
public class BLessonPersonController extends PaginationController<BLesson> {
}
......@@ -40,9 +40,10 @@ public interface BLessonPersonRepository extends BaseMapper<BLabel> {
int quit(String id);
@Select({"<script>",
" select (select COUNT(1) from b_lesson_person where person_id = #{userId} ) learnAllCount, " +
" select " +
"(select COUNT(1) from b_lesson_person where person_id = #{userId} ) learnAllCount, " +
"(select COUNT(1) from b_lesson_person where person_id = #{userId} and is_finish = '1') finishCount, " +
"(select COUNT(1) from b_lesson_person where person_id = #{userId} and is_finish = '0') notFinishCount, " +
"(select COUNT(1) from b_lesson_person where person_id = #{userId} and is_finish = '0') notFinishCount " +
"</script>"})
ILearnCountDTO iLearnLessonCount(String userId);
......
......@@ -6,13 +6,5 @@ import lombok.Data;
@Data
public class ILearnCountDTO {
@ApiModelProperty(value = "我学习全部课程数量")
private String learnAllCount;
@ApiModelProperty(value = "我学完课程数量")
private String finishCount;
@ApiModelProperty(value = "我未学完课程数量")
private String notFinishCount;
}
......@@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class IPublishCountDTO {
public class ILessonCountDTO {
@ApiModelProperty(value = "我发布全部课程数量")
private String publishAllCount;
......@@ -17,4 +17,14 @@ public class IPublishCountDTO {
@ApiModelProperty(value = "我发布已关闭课程数量")
private String closedCount;
@ApiModelProperty(value = "我学习全部课程数量")
private String learnAllCount;
@ApiModelProperty(value = "我学完课程数量")
private String finishCount;
@ApiModelProperty(value = "我未学完课程数量")
private String notFinishCount;
}
......@@ -50,7 +50,7 @@ public interface BLessonService{
* @param
* @return
*/
List<BLesson> queryPersonMoreByPagination(PageUtil pageUtil);
List<BLesson> queryPersonMoreByPagination(PageUtil pageUtil,String userId);
/**
* 分页查找推荐
......@@ -66,7 +66,7 @@ public interface BLessonService{
* @param
* @return
*/
List<BLesson> queryConcernByPagination(PageUtil pageUtil);
List<BLesson> queryConcernByPagination(PageUtil pageUtil,String userId);
/**
* 分页查找可能感兴趣的
......@@ -74,7 +74,7 @@ public interface BLessonService{
* @param
* @return
*/
List<BLesson> queryInterestedByPagination(PageUtil pageUtil);
List<BLesson> queryInterestedByPagination(PageUtil pageUtil,String userId);
/**
* 插入
......@@ -116,6 +116,6 @@ public interface BLessonService{
* @param userId
* @return
*/
IPublishCountDTO iPublishCount(String userId);
ILessonCountDTO iLessonCount(String userId);
}
......@@ -73,21 +73,37 @@ public class BLessonServiceImpl implements BLessonService {
}
@Override
public List<BLesson> queryPersonMoreByPagination(PageUtil pageUtil) {
return bLessonRepository.queryPersonMore();
public List<BLesson> queryPersonMoreByPagination(PageUtil pageUtil, String userId) {
List<String> departs = new ArrayList<>();
departs.add("1");
departs.add("2");
departs.add("3");
return bLessonRepository.queryPersonMore(userId,departs);
}
@Override
public List<BLesson> queryRecommendByPagination(PageUtil pageUtil,String userId) {
return bLessonRepository.queryRecommend(userId);
List<String> departs = new ArrayList<>();
departs.add("1");
departs.add("2");
departs.add("3");
return bLessonRepository.queryRecommend(userId,departs);
}
@Override
public List<BLesson> queryConcernByPagination(PageUtil pageUtil) {
return bLessonRepository.queryConcern();
public List<BLesson> queryConcernByPagination(PageUtil pageUtil,String userId) {
List<String> departs = new ArrayList<>();
departs.add("1");
departs.add("2");
departs.add("3");
return bLessonRepository.queryConcern(userId,departs);
}
@Override
public List<BLesson> queryInterestedByPagination(PageUtil pageUtil) {
return bLessonRepository.queryInterested();
public List<BLesson> queryInterestedByPagination(PageUtil pageUtil,String userId) {
List<String> departs = new ArrayList<>();
departs.add("1");
departs.add("2");
departs.add("3");
return bLessonRepository.queryInterested(userId,departs);
}
......@@ -196,8 +212,8 @@ public class BLessonServiceImpl implements BLessonService {
}
@Override
public IPublishCountDTO iPublishCount(String userId) {
return bLessonRepository.iPublishCount(userId);
public ILessonCountDTO iLessonCount(String userId) {
return bLessonRepository.iLessonCount(userId);
}
}
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