Merge branch 'master' of https://gitee.com/wjl2008_admin/nuttyreading-java into zcc
This commit is contained in:
@@ -24,6 +24,8 @@ public class UserToCourseEntity {
|
|||||||
|
|
||||||
private Integer days;
|
private Integer days;
|
||||||
|
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
private Date startTime;
|
private Date startTime;
|
||||||
|
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
|
|||||||
@@ -2,9 +2,13 @@ package com.peanut.modules.sociology.controller;
|
|||||||
|
|
||||||
import com.peanut.common.utils.R;
|
import com.peanut.common.utils.R;
|
||||||
import com.peanut.modules.common.entity.CourseEntity;
|
import com.peanut.modules.common.entity.CourseEntity;
|
||||||
|
import com.peanut.modules.common.entity.CourseSociologyEntity;
|
||||||
|
import com.peanut.modules.common.to.ParamTo;
|
||||||
import com.peanut.modules.sociology.service.CourseService;
|
import com.peanut.modules.sociology.service.CourseService;
|
||||||
|
import com.peanut.modules.sociology.service.CourseSociologyService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -16,6 +20,10 @@ public class HomeController {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CourseService courseService;
|
private CourseService courseService;
|
||||||
|
@Autowired
|
||||||
|
private CourseSociologyService courseSociologyService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//首页-我的课程
|
//首页-我的课程
|
||||||
@RequestMapping("/getMyCourse")
|
@RequestMapping("/getMyCourse")
|
||||||
@@ -24,4 +32,13 @@ public class HomeController {
|
|||||||
return R.ok().put("myCourse",courseList);
|
return R.ok().put("myCourse",courseList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/getSociologyLabels")
|
||||||
|
public R getSociologyLabels(@RequestBody ParamTo param){
|
||||||
|
List<CourseSociologyEntity> sociologyLabels = courseSociologyService.getSociologyLabels(param.getId());
|
||||||
|
return R.ok().put("labels",sociologyLabels);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.peanut.modules.sociology.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.peanut.modules.common.entity.CourseSociologyEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface CourseSociologyService extends IService<CourseSociologyEntity> {
|
||||||
|
|
||||||
|
List<CourseSociologyEntity> getSociologyLabels(Integer id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.peanut.modules.sociology.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.peanut.modules.common.dao.CourseSociologyDao;
|
||||||
|
import com.peanut.modules.common.entity.CourseSociologyEntity;
|
||||||
|
import com.peanut.modules.sociology.service.CourseSociologyService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service("sociologyCourseSociologyService")
|
||||||
|
public class CourseSociologyServiceImpl extends ServiceImpl<CourseSociologyDao, CourseSociologyEntity> implements CourseSociologyService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CourseSociologyEntity> getSociologyLabels(Integer id) {
|
||||||
|
LambdaQueryWrapper<CourseSociologyEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(CourseSociologyEntity::getPid,id);
|
||||||
|
wrapper.orderByAsc(CourseSociologyEntity::getSort);
|
||||||
|
List<CourseSociologyEntity> list = this.list(wrapper);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user