15个文件已修改
2个文件已添加
1 文件已重命名
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import cn.lili.group.Update; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.modules.lmk.domain.form.VideoFootPrintForm; |
| | | import cn.lili.modules.lmk.domain.form.VideoHomePageInfoForm; |
| | | import cn.lili.modules.lmk.domain.form.WxVideoForm; |
| | | import cn.lili.modules.lmk.domain.query.AuthorVideoQuery; |
| | | import cn.lili.modules.member.entity.dos.FootPrint; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import lombok.RequiredArgsConstructor; |
| | | import java.util.List; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import cn.lili.modules.lmk.service.VideoService; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.VideoForm; |
| | | import cn.lili.modules.lmk.domain.query.VideoQuery; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * 视频内容 前端控制器 |
| | |
| | | |
| | | @PostMapping("/publish") |
| | | @ApiOperation(value = "发布视频", notes = "发布视频") |
| | | public Result publish(@RequestBody @Validated({Add.class}) VideoForm form) { |
| | | public Result publish(@RequestBody @Validated({Add.class}) WxVideoForm form) { |
| | | return videoService.publish(form); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public Result update(@RequestBody @Validated(Update.class) VideoForm form) { |
| | | public Result update(@RequestBody @Validated(Update.class) WxVideoForm form) { |
| | | return videoService.update(form); |
| | | } |
| | | |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.group.Update; |
| | | import cn.lili.modules.lmk.domain.form.VideoForm; |
| | | import cn.lili.modules.lmk.domain.query.VideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.WxVideoTagQuery; |
| | | import cn.lili.modules.lmk.service.VideoService; |
| | | import cn.lili.modules.lmk.service.VideoTagService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 视频标签 前端控制器 |
| | |
| | | @ApiModelProperty("region") |
| | | private String region; |
| | | |
| | | |
| | | @ApiModelProperty("端点,用于拼接filekey直接预览") |
| | | private String endpoint; |
| | | } |
| | |
| | | /** 视频标题 */ |
| | | private String title; |
| | | |
| | | @TableField("goods_id") |
| | | /** 商品id */ |
| | | private String goodsId; |
| | | @TableField("video_content_type") |
| | | /** 视频内容类型:视频、图片 */ |
| | | private String videoContentType; |
| | | |
| | | @TableField("video_type") |
| | | /** 视频类型:视频、大健康、神厨 */ |
| | | private String videoType; |
| | | |
| | | @TableField("video_imgs") |
| | | /** 图片地址(json数组),对应video_type = 图片 */ |
| | | private String videoImgs; |
| | | |
| | | @TableField("goods_view_num") |
| | | /** 商品查看次数 */ |
File was renamed from framework/src/main/java/cn/lili/modules/lmk/domain/form/VideoForm.java |
| | |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import org.springframework.lang.NonNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "Video表单", description = "视频内容表单") |
| | | public class VideoForm extends AbsForm { |
| | | public class WxVideoForm extends AbsForm { |
| | | |
| | | |
| | | @NotBlank(message = "视频不能为空", groups = {Add.class, Update.class}) |
| | | // @NotBlank(message = "视频不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("视频") |
| | | private String videoFileKey; |
| | | |
| | |
| | | private String title; |
| | | |
| | | @ApiModelProperty("视频封面") |
| | | @NotBlank(message = "视频封面不能为空", groups = {Add.class, Update.class}) |
| | | // @NotBlank(message = "视频封面不能为空", groups = {Add.class, Update.class}) |
| | | private String cover; |
| | | |
| | | @ApiModelProperty("视频内容类型:视频、图片") |
| | | @NotBlank(message = "视频类型不能为空") |
| | | private String videoContentType; |
| | | |
| | | @ApiModelProperty("图片列表,如果videoContentType是图片,则必须传值") |
| | | private List<String> videoImgs; |
| | | |
| | | @ApiModelProperty("视频标签") |
| | | @Length(max = 5, message = "最多只能添加五个标签") |
| | |
| | | @Valid |
| | | private FileInfoForm fileInfo; |
| | | |
| | | public static Video getEntityByForm(@NonNull VideoForm form, Video entity) { |
| | | public static Video getEntityByForm(@NonNull WxVideoForm form, Video entity) { |
| | | if(entity == null) { |
| | | entity = new Video(); |
| | | } |
| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import cn.lili.modules.lmk.enums.general.VideoTypeEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty(hidden = true) |
| | | private Boolean authorSelf; |
| | | |
| | | /** |
| | | * @see cn.lili.modules.lmk.enums.general.VideoTypeEnum |
| | | */ |
| | | @ApiModelProperty("视频类型:视频、大健康、神厨,默认不传查视频") |
| | | private String videoType = VideoTypeEnum.VIDEO.getValue(); |
| | | } |
| | | |
| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import cn.lili.modules.lmk.enums.general.VideoTypeEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty("状态") |
| | | private String status; |
| | | |
| | | /** |
| | | * @see cn.lili.modules.lmk.enums.general.VideoTypeEnum |
| | | */ |
| | | @ApiModelProperty("视频类型:视频、大健康、神厨,默认不传查视频") |
| | | private String videoType = VideoTypeEnum.VIDEO.getValue(); |
| | | } |
| | | |
| | |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import java.util.List; |
| | | |
| | | import cn.lili.modules.lmk.enums.general.VideoTypeEnum; |
| | | import org.springframework.lang.NonNull; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | |
| | | @ApiModelProperty("视频来源:recommend推荐、author某作者的视频、collect某作者收藏的视频") |
| | | private String videoFrom; |
| | | |
| | | /** |
| | | * @see cn.lili.modules.lmk.enums.general.VideoTypeEnum |
| | | */ |
| | | @ApiModelProperty("视频类型:视频、大健康、神厨,默认不传查视频") |
| | | private String videoType = VideoTypeEnum.VIDEO.getValue(); |
| | | } |
| | | |
| | |
| | | @ApiModelProperty("视频标签") |
| | | private List<SimpleVideoTagVO> tagList; |
| | | |
| | | @ApiModelProperty("视频内容类型:视频、图片") |
| | | private String videoContentType; |
| | | |
| | | @ApiModelProperty("视频类型:视频、大健康、神厨") |
| | | private String videoType; |
| | | |
| | | @ApiModelProperty(value = "图片列表,json数组", hidden = true) |
| | | private String videoImgs; |
| | | |
| | | @ApiModelProperty("图片列表") |
| | | private List<String> imgs; |
| | | |
| | | /** 视频填充模式 */ |
| | | @ApiModelProperty("视频填充模式") |
| | | private String videoFit; |
| | |
| | | private String videoFileKey; |
| | | private String videoUrl; |
| | | |
| | | /** |
| | | * @see cn.lili.modules.lmk.enums.general.VideoContentTypeEnum |
| | | */ |
| | | @ApiModelProperty("视频内容类型:视频、图片") |
| | | private String videoContentType; |
| | | |
| | | /** |
| | | * @see cn.lili.modules.lmk.enums.general.VideoTypeEnum |
| | | */ |
| | | @ApiModelProperty("视频类型:视频、大健康、神厨") |
| | | private String videoType; |
| | | |
| | | @ApiModelProperty("图集-json数组") |
| | | private String videoImgs; |
| | | |
| | | @ApiModelProperty("图集") |
| | | private List<String> imgs; |
| | | |
| | | @ApiModelProperty("视频标签") |
| | | private List<SimpleVideoTagVO> tagList; |
| | | |
New file |
| | |
| | | package cn.lili.modules.lmk.enums.general; |
| | | |
| | | import lombok.Getter; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | /** |
| | | * 视频内容类型 |
| | | * |
| | | * @author:xp |
| | | * @date:2025/5/14 10:30 |
| | | */ |
| | | @Getter |
| | | public enum VideoContentTypeEnum { |
| | | |
| | | VIDEO("video", "视频"), |
| | | IMG("img", "图片"), |
| | | ; |
| | | |
| | | private final String value; |
| | | |
| | | |
| | | private final String desc; |
| | | |
| | | VideoContentTypeEnum(String value, String desc) { |
| | | this.value = value; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | /** |
| | | * 获取含义 |
| | | * |
| | | * @param value |
| | | * @return |
| | | */ |
| | | public static String getDescByValue(String value) { |
| | | if (StringUtils.isBlank(value)) { |
| | | return null; |
| | | } |
| | | for (VideoContentTypeEnum e : VideoContentTypeEnum.values()){ |
| | | if (value.equals(e.getValue())) { |
| | | return e.getDesc(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.enums.general; |
| | | |
| | | import lombok.Getter; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | /** |
| | | * 视频类型 |
| | | * |
| | | * @author:xp |
| | | * @date:2025/5/14 10:30 |
| | | */ |
| | | @Getter |
| | | public enum VideoTypeEnum { |
| | | |
| | | VIDEO("video", "视频"), |
| | | HEALTH("health", "大健康"), |
| | | COOK("cook", "神厨"), |
| | | ; |
| | | |
| | | private final String value; |
| | | |
| | | |
| | | private final String desc; |
| | | |
| | | VideoTypeEnum(String value, String desc) { |
| | | this.value = value; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | /** |
| | | * 获取含义 |
| | | * |
| | | * @param value |
| | | * @return |
| | | */ |
| | | public static String getDescByValue(String value) { |
| | | if (StringUtils.isBlank(value)) { |
| | | return null; |
| | | } |
| | | for (VideoTypeEnum e : VideoTypeEnum.values()){ |
| | | if (value.equals(e.getValue())) { |
| | | return e.getDesc(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | IPage recommendVideo(IPage page); |
| | | IPage recommendVideo(IPage page, @Param("query") VideoQuery query); |
| | | |
| | | /** |
| | | * 批量更新视频收藏数量 |
| | |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result add(VideoForm form); |
| | | Result add(WxVideoForm form); |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result update(VideoForm form); |
| | | Result update(WxVideoForm form); |
| | | |
| | | /** |
| | | * 批量删除 |
| | |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result publish(VideoForm form); |
| | | Result publish(WxVideoForm form); |
| | | |
| | | /** |
| | | * 平台端视频分页 |
| | |
| | | import cn.lili.modules.lmk.domain.query.AuthorVideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.ManagerVideoQuery; |
| | | import cn.lili.modules.lmk.domain.vo.*; |
| | | import cn.lili.modules.lmk.enums.general.TagCreateTypeEnum; |
| | | import cn.lili.modules.lmk.enums.general.VideoStatusEnum; |
| | | import cn.lili.modules.lmk.enums.general.VideoSupportOpEnum; |
| | | import cn.lili.modules.lmk.enums.general.ViewTypeEnum; |
| | | import cn.lili.modules.lmk.enums.general.*; |
| | | import cn.lili.modules.lmk.service.*; |
| | | import cn.lili.modules.member.entity.dos.FootPrint; |
| | | import cn.lili.modules.member.entity.dos.Member; |
| | | import cn.lili.modules.member.service.FootprintService; |
| | | import cn.lili.modules.member.service.MemberService; |
| | | import cn.lili.utils.COSUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.mapper.VideoMapper; |
| | | import cn.lili.base.Result; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result add(VideoForm form) { |
| | | Video entity = VideoForm.getEntityByForm(form, null); |
| | | public Result add(WxVideoForm form) { |
| | | Video entity = WxVideoForm.getEntityByForm(form, null); |
| | | baseMapper.insert(entity); |
| | | return Result.ok("添加成功"); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result update(VideoForm form) { |
| | | public Result update(WxVideoForm form) { |
| | | Video entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | |
| | | Assert.notNull(vo, "记录不存在"); |
| | | List<SimpleVideoTagVO> tags = videoTagRefService.getTagsByVideoIds(Arrays.asList(id)); |
| | | vo.setTagList(tags); |
| | | vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | if (VideoContentTypeEnum.VIDEO.getValue().equals(vo.getVideoContentType())) { |
| | | vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | } else if (VideoContentTypeEnum.IMG.getValue().equals(vo.getVideoContentType()) && StringUtils.isNotBlank(vo.getVideoImgs())) { |
| | | vo.setImgs(JSON.parseArray(vo.getVideoImgs(), String.class).stream().map(fileKey -> cosUtil.getPreviewUrl(fileKey)).collect(Collectors.toList())); |
| | | } |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result publish(VideoForm form) { |
| | | public Result publish(WxVideoForm form) { |
| | | // 1.保存视频 |
| | | Video video = VideoForm.getEntityByForm(form, null); |
| | | Video video = WxVideoForm.getEntityByForm(form, null); |
| | | video.setAuthorId(UserContext.getCurrentUserId()); |
| | | video.setStatus(VideoStatusEnum.AUDITING.getValue()); |
| | | video.setCoverUrl(form.getCover()); |
| | | video.setVideoType(VideoTypeEnum.VIDEO.getValue()); |
| | | if (VideoContentTypeEnum.IMG.getValue().equals(form.getVideoContentType())) { |
| | | video.setVideoImgs(JSON.toJSONString(form.getVideoImgs())); |
| | | } |
| | | baseMapper.insert(video); |
| | | // 2.处理标签 |
| | | List<VideoTagRef> videoTagRefs = form.getTags().stream().map(tag -> { |
| | |
| | | IPage<WxVideoVO> page = PageUtil.getPage(query, WxVideoVO.class); |
| | | switch (query.getVideoFrom()) { |
| | | case "recommend": |
| | | baseMapper.recommendVideo(page); |
| | | baseMapper.recommendVideo(page, query); |
| | | break; |
| | | case "author": |
| | | AuthorVideoQuery query1 = new AuthorVideoQuery(); |
| | |
| | | v.setGoods(new VideoGoodsVO()); |
| | | v.setTagList(tagMap.get(v.getId())); |
| | | v.setCollected(CollectionUtils.isNotEmpty(collectMap.get(v.getId()))); |
| | | v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | // v.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) { |
| | | // v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | v.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | } else if (VideoContentTypeEnum.IMG.getValue().equals(v.getVideoContentType()) && StringUtils.isNotBlank(v.getVideoImgs())) { |
| | | v.setImgs(JSON.parseArray(v.getVideoImgs(), String.class).stream().map(fileKey -> cosUtil.getPreviewUrl(fileKey)).collect(Collectors.toList())); |
| | | } |
| | | v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey())); |
| | | v.setSubscribeThisAuthor(subscribes.contains(v.getAuthorId())); |
| | | }); |
| | |
| | | baseMapper.getAuthorVideoPage(page, query); |
| | | for (WxVideoVO vo : page.getRecords()) { |
| | | vo.setCoverUrl(cosUtil.getPreviewUrl(vo.getCoverFileKey())); |
| | | vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | // vo.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | // vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | vo.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | vo.setOptions(VideoSupportOpEnum.getVideoOpByStatus(vo.getStatus())); |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | |
| | | baseMapper.getAuthorCollectVideoPage(page, query); |
| | | for (WxVideoVO vo : page.getRecords()) { |
| | | vo.setCoverUrl(cosUtil.getPreviewUrl(vo.getCoverFileKey())); |
| | | vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | // vo.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | // vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | vo.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | vo.setCollected(Boolean.TRUE); |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | |
| | | return Result.error("视频不存在"); |
| | | } |
| | | vo.setCoverUrl(cosUtil.getPreviewUrl(vo.getCoverFileKey())); |
| | | vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | // vo.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | // vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | vo.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | List<WxVideoTagForm> tags = videoTagRefService.getTagsByVideoIds(Arrays.asList(vo.getId())) |
| | | .stream() |
| | | .map(i -> { |
| | |
| | | cosSTS.setStsEndTime(cosSTS.getStsStartTime() + cosConfigProperty.getDurationSeconds() - 30); |
| | | cosSTS.setBucket(cosConfigProperty.getBucket()); |
| | | cosSTS.setRegion(cosConfigProperty.getRegion()); |
| | | cosSTS.setEndpoint(cosConfigProperty.getEndpoint()); |
| | | return cosSTS; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | <result column="weight" property="weight" /> |
| | | <result column="audit_pass_time" property="auditPassTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="video_content_type" property="videoContentType" /> |
| | | <result column="video_type" property="videoType" /> |
| | | <result column="video_imgs" property="videoImgs" /> |
| | | </resultMap> |
| | | |
| | | <!-- 微信推荐视频 --> |
| | |
| | | <result column="collect_num" property="collectNum" /> |
| | | <result column="comment_num" property="commentNum" /> |
| | | <result column="status" property="status" /> |
| | | <result column="video_content_type" property="videoContentType" /> |
| | | <result column="video_type" property="videoType" /> |
| | | <result column="video_imgs" property="videoImgs" /> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | LV.video_duration, |
| | | LV.video_file_key, |
| | | LV.title, |
| | | LV.goods_id, |
| | | LV.goods_view_num, |
| | | LV.goods_order_num, |
| | | LV.recommend, |
| | |
| | | LV.weight, |
| | | LV.audit_pass_time, |
| | | LV.update_time, |
| | | LV.video_content_type, |
| | | LV.video_type, |
| | | LV.video_imgs, |
| | | LV.id, |
| | | LM.nick_name as authorName |
| | | FROM |
| | |
| | | LV.video_duration, |
| | | LV.video_file_key, |
| | | LV.title, |
| | | LV.goods_id, |
| | | LV.goods_view_num, |
| | | LV.goods_order_num, |
| | | LV.recommend, |
| | |
| | | LV.weight, |
| | | LV.audit_pass_time, |
| | | LV.update_time, |
| | | LV.video_content_type, |
| | | LV.video_type, |
| | | LV.video_imgs, |
| | | LV.id, |
| | | LM.nick_name as authorName |
| | | FROM |
| | |
| | | LV.video_duration, |
| | | LV.video_file_key, |
| | | LV.title, |
| | | LV.goods_id, |
| | | LV.goods_view_num, |
| | | LV.goods_order_num, |
| | | LV.recommend, |
| | |
| | | LV.weight, |
| | | LV.audit_pass_time, |
| | | LV.update_time, |
| | | LV.video_content_type, |
| | | LV.video_type, |
| | | LV.video_imgs, |
| | | LV.id, |
| | | LM.nick_name as authorName |
| | | FROM |
| | |
| | | ) AS LVT ON LV.id = LVT.video_id |
| | | </if> |
| | | WHERE |
| | | LV.delete_flag = 0 |
| | | LV.delete_flag = 0 AND LV.video_type = #{query.videoType} |
| | | <if test="query.title != null and query.title != ''">AND LV.title LIKE CONCAT('%', #{query.title}, '%')</if> |
| | | <if test="query.authorId != null and query.authorId != ''">AND LV.author_id = #{query.authorId}</if> |
| | | <if test="query.status != null and query.status != ''">AND LV.status = #{query.status}</if> |
| | |
| | | LV.video_duration, |
| | | LV.video_file_key, |
| | | LV.title, |
| | | LV.goods_id, |
| | | LV.goods_view_num, |
| | | LV.goods_order_num, |
| | | LV.recommend, |
| | |
| | | LV.weight, |
| | | LV.audit_pass_time, |
| | | LV.update_time, |
| | | LV.video_content_type, |
| | | LV.video_type, |
| | | LV.video_imgs, |
| | | LV.id, |
| | | LM.nick_name as authorName, |
| | | LM.face as authorAvatar |
| | |
| | | lmk_video LV |
| | | LEFT JOIN li_member LM ON LV.author_id = LM.id |
| | | WHERE |
| | | LV.delete_flag = 0 AND LV.status = '1' |
| | | LV.delete_flag = 0 AND LV.status = '1' AND LV.video_type = #{query.videoType} |
| | | </select> |
| | | |
| | | |
| | |
| | | LV.video_duration, |
| | | LV.video_file_key, |
| | | LV.title, |
| | | LV.goods_id, |
| | | LV.goods_view_num, |
| | | LV.goods_order_num, |
| | | LV.recommend, |
| | |
| | | LV.weight, |
| | | LV.audit_pass_time, |
| | | LV.update_time, |
| | | LV.video_content_type, |
| | | LV.video_type, |
| | | LV.video_imgs, |
| | | LV.id, |
| | | LM.nick_name as authorName, |
| | | LM.face as authorAvatar |
| | |
| | | AND LV.status = '1' |
| | | </if> |
| | | AND LV.author_id = #{query.authorId} |
| | | AND LV.video_type = #{query.videoType} |
| | | ORDER BY |
| | | LV.collect_num DESC |
| | | </select> |
| | |
| | | LV.video_duration, |
| | | LV.video_file_key, |
| | | LV.title, |
| | | LV.goods_id, |
| | | LV.goods_view_num, |
| | | LV.goods_order_num, |
| | | LV.recommend, |
| | |
| | | LV.weight, |
| | | LV.audit_pass_time, |
| | | LV.update_time, |
| | | LV.video_content_type, |
| | | LV.video_type, |
| | | LV.video_imgs, |
| | | LV.id, |
| | | LM.nick_name as authorName, |
| | | LM.face as authorAvatar |
| | |
| | | INNER JOIN lmk_video LV ON LMC.ref_id = LV.id AND LV.delete_flag = 0 AND LV.status = '1' |
| | | LEFT JOIN li_member LM ON LV.author_id = LM.id |
| | | WHERE |
| | | LMC.delete_flag = 0 AND LMC.user_id = #{query.authorId} AND LMC.collect_type = 'video' |
| | | LMC.delete_flag = 0 AND LMC.user_id = #{query.authorId} AND LMC.collect_type = 'video' AND LV.video_type = #{query.videoType} |
| | | ORDER BY |
| | | LMC.create_time DESC |
| | | </select> |
| | |
| | | LV.video_duration, |
| | | LV.video_file_key, |
| | | LV.title, |
| | | LV.goods_id, |
| | | LV.goods_view_num, |
| | | LV.goods_order_num, |
| | | LV.recommend, |
| | |
| | | LV.weight, |
| | | LV.audit_pass_time, |
| | | LV.update_time, |
| | | LV.video_content_type, |
| | | LV.video_type, |
| | | LV.video_imgs, |
| | | LV.id |
| | | FROM |
| | | lmk_video LV |
| | |
| | | import cn.lili.modules.lmk.domain.form.VideoAuditingForm; |
| | | import cn.lili.modules.lmk.domain.form.VideoDownForm; |
| | | import cn.lili.modules.lmk.domain.form.VideoRecommendForm; |
| | | import cn.lili.modules.lmk.domain.form.WxVideoForm; |
| | | import cn.lili.modules.lmk.domain.query.ManagerVideoQuery; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import lombok.RequiredArgsConstructor; |
| | | import java.util.List; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import cn.lili.modules.lmk.service.VideoService; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.VideoForm; |
| | | import cn.lili.modules.lmk.domain.query.VideoQuery; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "添加", notes = "添加") |
| | | public Result add(@RequestBody @Validated(Add.class) VideoForm form) { |
| | | public Result add(@RequestBody @Validated(Add.class) WxVideoForm form) { |
| | | return videoService.add(form); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public Result update(@RequestBody @Validated(Update.class) VideoForm form) { |
| | | public Result update(@RequestBody @Validated(Update.class) WxVideoForm form) { |
| | | return videoService.update(form); |
| | | } |
| | | |