|
@@ -5,11 +5,13 @@ import com.fs.app.config.ImageStorageConfig;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.domain.ResponseResult;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
|
+import com.fs.course.domain.FsUserCoursePeriod;
|
|
|
import com.fs.course.param.FsCourseLinkCreateParam;
|
|
|
import com.fs.course.param.newfs.FsCourseSortLinkParam;
|
|
|
import com.fs.course.param.newfs.FsUserCourseListParam;
|
|
|
import com.fs.course.param.newfs.UserCourseVideoPageParam;
|
|
|
import com.fs.course.service.IFsCourseLinkService;
|
|
|
+import com.fs.course.service.IFsUserCoursePeriodService;
|
|
|
import com.fs.course.service.IFsUserCourseService;
|
|
|
import com.fs.course.service.IFsUserCourseVideoService;
|
|
|
import com.fs.course.vo.FsUserCourseParticipationRecordVO;
|
|
@@ -25,8 +27,6 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
-
|
|
|
-import java.io.File;
|
|
|
import java.io.InputStream;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -51,6 +51,9 @@ public class FsUserCourseVideoController extends AppBaseController {
|
|
|
@Autowired
|
|
|
private ImageStorageConfig imageConfig;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IFsUserCoursePeriodService fsUserCoursePeriodService;
|
|
|
+
|
|
|
@Login
|
|
|
@GetMapping("/pageList")
|
|
|
@ApiOperation("课程分页列表")
|
|
@@ -141,10 +144,19 @@ public class FsUserCourseVideoController extends AppBaseController {
|
|
|
log.info("获取的logo图片路径,fileUrl:{}", path);
|
|
|
InputStream inputStream = fsUserCourseService.handleImage("", path);
|
|
|
|
|
|
- if (StringUtils.isEmpty(param.getImgUrl())) {
|
|
|
- return R.error(400, "课程封面不能为空!");
|
|
|
+ // 获取营期的课程风格url
|
|
|
+ String imgUrl;
|
|
|
+ FsUserCoursePeriod fsUserCoursePeriod = fsUserCoursePeriodService.selectFsUserCoursePeriodById(param.getPeriodId());
|
|
|
+ if (fsUserCoursePeriod != null) {
|
|
|
+ imgUrl = fsUserCoursePeriod.getCourseStyle();
|
|
|
+ } else {
|
|
|
+ imgUrl = param.getImgUrl();
|
|
|
}
|
|
|
- String base64Image = fsUserCourseService.createCourseImageQR(realLink, param.getImgUrl(), inputStream, "png", param.getTitle(), param.getDuration());
|
|
|
+ if(StringUtils.isEmpty(imgUrl)){
|
|
|
+ return R.error(400, "营期风格图片或课程封面不能为空!");
|
|
|
+ }
|
|
|
+
|
|
|
+ String base64Image = fsUserCourseService.createCourseImageQR(realLink, imgUrl, inputStream, "png", param.getTitle(), param.getDuration());
|
|
|
// 返回Base64编码的图片字符串
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("url", base64Image);
|