|
@@ -6,7 +6,10 @@ import com.fs.common.core.domain.AjaxResult;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.page.TableDataInfo;
|
|
|
import com.fs.common.enums.BusinessType;
|
|
|
+import com.fs.common.utils.ServletUtils;
|
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
|
+import com.fs.core.security.LoginUser;
|
|
|
+import com.fs.core.web.service.TokenService;
|
|
|
import com.fs.course.domain.FsUserCourse;
|
|
|
import com.fs.course.service.IFsUserCourseService;
|
|
|
import com.fs.course.vo.FsUserCourseListPVO;
|
|
@@ -30,6 +33,9 @@ public class FsUserCourseController extends BaseController
|
|
|
@Autowired
|
|
|
private IFsUserCourseService fsUserCourseService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TokenService tokenService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询课程列表
|
|
|
*/
|
|
@@ -38,6 +44,9 @@ public class FsUserCourseController extends BaseController
|
|
|
public TableDataInfo list(FsUserCourse fsUserCourse)
|
|
|
{
|
|
|
startPage();
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ Long userId = loginUser.getUser().getUserId();
|
|
|
+ fsUserCourse.setUserId(userId);
|
|
|
List<FsUserCourseListPVO> list = fsUserCourseService.selectFsUserCourseListPVO(fsUserCourse);
|
|
|
return getDataTable(list);
|
|
|
}
|
|
@@ -50,6 +59,9 @@ public class FsUserCourseController extends BaseController
|
|
|
public TableDataInfo publicList(FsUserCourse fsUserCourse)
|
|
|
{
|
|
|
startPage();
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ Long userId = loginUser.getUser().getUserId();
|
|
|
+ fsUserCourse.setUserId(userId);
|
|
|
List<FsUserCourseListPVO> list = fsUserCourseService.selectFsUserCourseListPVO(fsUserCourse);
|
|
|
return getDataTable(list);
|
|
|
}
|
|
@@ -62,6 +74,9 @@ public class FsUserCourseController extends BaseController
|
|
|
@GetMapping("/export")
|
|
|
public AjaxResult export(FsUserCourse fsUserCourse)
|
|
|
{
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ Long userId = loginUser.getUser().getUserId();
|
|
|
+ fsUserCourse.setUserId(userId);
|
|
|
List<FsUserCourse> list = fsUserCourseService.selectFsUserCourseList(fsUserCourse);
|
|
|
ExcelUtil<FsUserCourse> util = new ExcelUtil<FsUserCourse>(FsUserCourse.class);
|
|
|
return util.exportExcel(list, "课程数据");
|
|
@@ -75,6 +90,9 @@ public class FsUserCourseController extends BaseController
|
|
|
@GetMapping("/publicExport")
|
|
|
public AjaxResult publicExport(FsUserCourse fsUserCourse)
|
|
|
{
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ Long userId = loginUser.getUser().getUserId();
|
|
|
+ fsUserCourse.setUserId(userId);
|
|
|
List<FsUserCourse> list = fsUserCourseService.selectFsUserCourseList(fsUserCourse);
|
|
|
ExcelUtil<FsUserCourse> util = new ExcelUtil<FsUserCourse>(FsUserCourse.class);
|
|
|
return util.exportExcel(list, "课程数据");
|
|
@@ -108,6 +126,9 @@ public class FsUserCourseController extends BaseController
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@RequestBody FsUserCourse fsUserCourse)
|
|
|
{
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ Long userId = loginUser.getUser().getUserId();
|
|
|
+ fsUserCourse.setUserId(userId);
|
|
|
return toAjax(fsUserCourseService.insertFsUserCourse(fsUserCourse));
|
|
|
}
|
|
|
|
|
@@ -119,6 +140,9 @@ public class FsUserCourseController extends BaseController
|
|
|
@PostMapping("/public")
|
|
|
public AjaxResult publicAdd(@RequestBody FsUserCourse fsUserCourse)
|
|
|
{
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ Long userId = loginUser.getUser().getUserId();
|
|
|
+ fsUserCourse.setUserId(userId);
|
|
|
return toAjax(fsUserCourseService.insertFsUserCourse(fsUserCourse));
|
|
|
}
|
|
|
|