视频列表接口优化
This commit is contained in:
parent
f0ebfc9992
commit
5bb89cbcc8
@ -1,10 +1,12 @@
|
|||||||
package com.stdiet.custom.dto.response;
|
package com.stdiet.custom.dto.response;
|
||||||
|
|
||||||
|
import com.stdiet.common.utils.AliyunVideoUtils;
|
||||||
|
import com.stdiet.common.utils.StringUtils;
|
||||||
|
import com.stdiet.common.utils.oss.AliyunOSSUtils;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
|
||||||
public class VideoResponse implements Serializable {
|
public class VideoResponse implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@ -14,4 +16,46 @@ public class VideoResponse implements Serializable {
|
|||||||
|
|
||||||
//视频标题
|
//视频标题
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
|
//视频封面
|
||||||
|
private String coverUrl;
|
||||||
|
|
||||||
|
//播放次数
|
||||||
|
private Integer playNum;
|
||||||
|
|
||||||
|
public String getVideoId() {
|
||||||
|
return videoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVideoId(String videoId) {
|
||||||
|
this.videoId = videoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCoverUrl() {
|
||||||
|
if (StringUtils.isNotEmpty(this.coverUrl)) {
|
||||||
|
return AliyunOSSUtils.generatePresignedUrl(this.coverUrl);
|
||||||
|
} else {
|
||||||
|
return AliyunVideoUtils.getVideoCoverUrl(this.videoId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCoverUrl(String coverUrl) {
|
||||||
|
this.coverUrl = coverUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPlayNum() {
|
||||||
|
return playNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPlayNum(Integer playNum) {
|
||||||
|
this.playNum = playNum;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getAllVideoByClassify" resultType="com.stdiet.custom.dto.response.VideoResponse">
|
<select id="getAllVideoByClassify" resultType="com.stdiet.custom.dto.response.VideoResponse">
|
||||||
select snv.video_id as videoId, snv.title
|
select snv.video_id as videoId, snv.title, snv.cover_url as coverUrl,snv.play_num as playNum
|
||||||
from sys_nutritional_video snv where cate_id = #{id} and del_flag = 0 and show_flag = 1
|
from sys_nutritional_video snv where cate_id = #{id} and del_flag = 0 and show_flag = 1
|
||||||
<if test="userType != null">
|
<if test="userType != null">
|
||||||
<if test="userType == 0">
|
<if test="userType == 0">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user