Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
# framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java
New file |
| | |
| | | package cn.lili.modules.lmk.domain.entity; |
| | | |
| | | import cn.lili.mybatis.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 厨神类型 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Data |
| | | @TableName("lmk_kitchen_type") |
| | | public class KitchenType extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField("type_name") |
| | | /** 厨神类型 */ |
| | | private String typeName; |
| | | |
| | | @TableField("use_num") |
| | | /** 使用次数 */ |
| | | private Long useNum; |
| | | |
| | | @TableField("sort_num") |
| | | /** 排序字段 */ |
| | | private Long sortNum; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.entity; |
| | | |
| | | import cn.lili.mybatis.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 厨神视频标签关系表 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Data |
| | | @TableName("lmk_kitchen_video_type_ref") |
| | | public class KitchenVideoTypeRef implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId |
| | | @ApiModelProperty(value = "唯一标识", hidden = true) |
| | | private String id; |
| | | |
| | | @TableField("video_id") |
| | | /** 视频id */ |
| | | private String videoId; |
| | | |
| | | @TableField("kitchen_type_id") |
| | | /** 厨神标签id */ |
| | | private String kitchenTypeId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.form; |
| | | |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.group.Update; |
| | | import cn.lili.mybatis.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 大健康视频内容 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-12 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "大健康视频内容", description = "大健康视频内容") |
| | | public class HealthVideoForm extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 作者id */ |
| | | @ApiModelProperty(value = "主键id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "图片封面") |
| | | /** 图片封面 */ |
| | | @NotBlank(message = "封面图片不能为空", groups = {Add.class, Update.class}) |
| | | private String coverUrl; |
| | | |
| | | @TableField("video_file_key") |
| | | /** 视频地址 */ |
| | | @NotBlank(message = "视频地址不能为空", groups = {Add.class, Update.class}) |
| | | private String videoFileKey; |
| | | |
| | | |
| | | /** 视频长度(秒) */ |
| | | // @NotNull(message = "视频长度不能为空", groups = {Add.class, Update.class}) |
| | | private Long videoDuration; |
| | | |
| | | /** 视频标题 */ |
| | | @NotBlank(message = "标题不能为空", groups = {Add.class, Update.class}) |
| | | private String title; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.form; |
| | | |
| | | import cn.lili.group.Update; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.base.AbsForm; |
| | | import cn.lili.modules.lmk.domain.entity.KitchenType; |
| | | import org.springframework.beans.BeanUtils; |
| | | 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.Date; |
| | | |
| | | /** |
| | | * 厨神类型表单 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "KitchenType表单", description = "厨神类型表单") |
| | | public class KitchenTypeForm extends AbsForm { |
| | | |
| | | @NotBlank(message = "厨神类型不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("厨神类型") |
| | | private String typeName; |
| | | |
| | | @ApiModelProperty("使用次数") |
| | | private Long useNum; |
| | | |
| | | @NotNull(message = "排序字段不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("排序字段") |
| | | private Long sortNum; |
| | | |
| | | public static KitchenType getEntityByForm(@NonNull KitchenTypeForm form, KitchenType entity) { |
| | | if(entity == null) { |
| | | entity = new KitchenType(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.form; |
| | | |
| | | import cn.lili.group.Add; |
| | | import cn.lili.group.Update; |
| | | import cn.lili.mybatis.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.Size; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 厨神视频发布 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-12 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "厨神视频发布", description = "厨神视频发布") |
| | | public class KitchenVideoForm extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 作者id */ |
| | | @ApiModelProperty(value = "主键id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "图片封面") |
| | | /** 图片封面 */ |
| | | @NotBlank(message = "封面图片不能为空", groups = {Add.class, Update.class}) |
| | | private String coverUrl; |
| | | |
| | | @TableField("video_file_key") |
| | | /** 视频地址 */ |
| | | @NotBlank(message = "视频地址不能为空", groups = {Add.class, Update.class}) |
| | | private String videoFileKey; |
| | | |
| | | |
| | | /** 视频长度(秒) */ |
| | | // @NotNull(message = "视频长度不能为空", groups = {Add.class, Update.class}) |
| | | private Long videoDuration; |
| | | |
| | | /** 视频标题 */ |
| | | @NotBlank(message = "标题不能为空", groups = {Add.class, Update.class}) |
| | | private String title; |
| | | |
| | | /** 标签列表 */ |
| | | @Size(min = 1,max = 5, message = "标签列表不能为空",groups = {Add.class, Update.class}) |
| | | private List<String> checkKitchenType; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.form; |
| | | |
| | | import cn.lili.group.Update; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.base.AbsForm; |
| | | import cn.lili.modules.lmk.domain.entity.KitchenVideoTypeRef; |
| | | import org.springframework.beans.BeanUtils; |
| | | 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.Date; |
| | | |
| | | /** |
| | | * 厨神视频标签关系表表单 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "KitchenVideoTypeRef表单", description = "厨神视频标签关系表表单") |
| | | public class KitchenVideoTypeRefForm extends AbsForm { |
| | | |
| | | @NotBlank(message = "视频id不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("视频id") |
| | | private String videoId; |
| | | |
| | | @NotBlank(message = "厨神标签id不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("厨神标签id") |
| | | private String kitchenTypeId; |
| | | |
| | | public static KitchenVideoTypeRef getEntityByForm(@NonNull KitchenVideoTypeRefForm form, KitchenVideoTypeRef entity) { |
| | | if(entity == null) { |
| | | entity = new KitchenVideoTypeRef(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | 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; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 视频内容查询 |
| | | * |
| | | * @author xp |
| | | * @since 2025-05-16 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "平台端Video查询参数", description = "视频内容查询参数") |
| | | public class HealthVideoQuery extends AbsQuery { |
| | | |
| | | @ApiModelProperty("标题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty("视频标签") |
| | | private List<String> tagList; |
| | | |
| | | @ApiModelProperty("作者") |
| | | private String authorId; |
| | | |
| | | @ApiModelProperty("状态") |
| | | private String status; |
| | | |
| | | /** |
| | | * @see VideoTypeEnum |
| | | */ |
| | | @ApiModelProperty("视频类型:视频、大健康、神厨,默认不传查视频") |
| | | private String videoType = VideoTypeEnum.HEALTH.getValue(); |
| | | } |
| | | |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 厨神类型查询 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "KitchenType查询参数", description = "厨神类型查询参数") |
| | | public class KitchenTypeQuery extends AbsQuery { |
| | | @ApiModelProperty("标签名称") |
| | | private String typeName; |
| | | } |
| | | |
New file |
| | |
| | | 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; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 视频内容查询 |
| | | * |
| | | * @author xp |
| | | * @since 2025-05-16 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "平台端厨神Video查询参数", description = "视频内容查询参数") |
| | | public class KitchenVideoQuery extends AbsQuery { |
| | | |
| | | @ApiModelProperty("标题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty("视频标签") |
| | | private List<String> typeList; |
| | | |
| | | @ApiModelProperty("作者") |
| | | private String authorId; |
| | | |
| | | @ApiModelProperty("状态") |
| | | private String status; |
| | | |
| | | /** |
| | | * @see VideoTypeEnum |
| | | */ |
| | | @ApiModelProperty("视频类型:视频、大健康、神厨,默认不传查视频") |
| | | private String videoType = VideoTypeEnum.COOK.getValue(); |
| | | } |
| | | |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 厨神视频标签关系表查询 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "KitchenVideoTypeRef查询参数", description = "厨神视频标签关系表查询参数") |
| | | public class KitchenVideoTypeRefQuery extends AbsQuery { |
| | | } |
| | | |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | import cn.lili.modules.lmk.domain.entity.KitchenType; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import org.springframework.beans.BeanUtils; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 厨神类型展示 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "厨神类型响应数据", description = "厨神类型响应数据") |
| | | public class KitchenTypeVO extends AbsVo { |
| | | |
| | | /** 厨神类型 */ |
| | | @ApiModelProperty("厨神类型") |
| | | private String typeName; |
| | | |
| | | /** 使用次数 */ |
| | | @ApiModelProperty("使用次数") |
| | | private Long useNum; |
| | | |
| | | /** 排序字段 */ |
| | | @ApiModelProperty("排序字段") |
| | | private Long sortNum; |
| | | |
| | | public static KitchenTypeVO getVoByEntity(@NonNull KitchenType entity, KitchenTypeVO vo) { |
| | | if(vo == null) { |
| | | vo = new KitchenTypeVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | import cn.lili.modules.lmk.domain.entity.KitchenVideoTypeRef; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import org.springframework.beans.BeanUtils; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 厨神视频标签关系表展示 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "厨神视频标签关系表响应数据", description = "厨神视频标签关系表响应数据") |
| | | public class KitchenVideoTypeRefVO extends AbsVo { |
| | | |
| | | /** 视频id */ |
| | | @ApiModelProperty("视频id") |
| | | private String videoId; |
| | | |
| | | /** 厨神标签id */ |
| | | @ApiModelProperty("厨神标签id") |
| | | private String kitchenTypeId; |
| | | |
| | | public static KitchenVideoTypeRefVO getVoByEntity(@NonNull KitchenVideoTypeRef entity, KitchenVideoTypeRefVO vo) { |
| | | if(vo == null) { |
| | | vo = new KitchenVideoTypeRefVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | import cn.lili.modules.lmk.domain.entity.KitchenVideoTypeRef; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.lang.NonNull; |
| | | |
| | | /** |
| | | * 厨神视频标签关系表展示 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "厨神视频标签关系表响应数据", description = "厨神视频标签关系表响应数据") |
| | | public class KitchenVideoTypeVO extends AbsVo { |
| | | |
| | | /** 视频id */ |
| | | @ApiModelProperty("视频id") |
| | | private String videoId; |
| | | |
| | | /** 分类id */ |
| | | @ApiModelProperty("分类id") |
| | | private String id; |
| | | |
| | | /** 分类名称 */ |
| | | @ApiModelProperty("分类名称") |
| | | private String typeName; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | import cn.lili.modules.lmk.domain.entity.Video; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.lang.NonNull; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 视频内容展示 |
| | | * |
| | | * @author xp |
| | | * @since 2025-05-16 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "视频内容响应数据", description = "视频内容响应数据") |
| | | public class KitchenVideoVO extends AbsVo { |
| | | |
| | | /** 作者id */ |
| | | @ApiModelProperty("作者id") |
| | | private String authorId; |
| | | private String authorName; |
| | | |
| | | /** 图片封面 */ |
| | | @ApiModelProperty("图片封面") |
| | | private String coverUrl; |
| | | |
| | | /** 封面显示地址 */ |
| | | @ApiModelProperty("封面显示地址") |
| | | private String coverShowUrl; |
| | | |
| | | /** 视频地址 */ |
| | | @ApiModelProperty("视频地址") |
| | | private String videoFileKey; |
| | | private String videoUrl; |
| | | |
| | | @ApiModelProperty("视频标签") |
| | | private List<KitchenVideoTypeVO> typeList; |
| | | |
| | | @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; |
| | | |
| | | @ApiModelProperty("视频长度:秒") |
| | | private Long videoDuration; |
| | | |
| | | /** 视频标题 */ |
| | | @ApiModelProperty("视频标题") |
| | | private String title; |
| | | |
| | | /** 商品id */ |
| | | @ApiModelProperty("商品id") |
| | | private String goodsId; |
| | | |
| | | /** 商品查看次数 */ |
| | | @ApiModelProperty("商品查看次数") |
| | | private Long goodsViewNum; |
| | | |
| | | /** 商品下单次数 */ |
| | | @ApiModelProperty("商品下单次数") |
| | | private Long goodsOrderNum; |
| | | |
| | | /** 是否推荐 */ |
| | | @ApiModelProperty("是否推荐") |
| | | private Boolean recommend; |
| | | |
| | | /** 状态 */ |
| | | @ApiModelProperty("状态") |
| | | private String status; |
| | | |
| | | /** 播放量 */ |
| | | @ApiModelProperty("播放量") |
| | | private Long playNum; |
| | | |
| | | /** 收藏数 */ |
| | | @ApiModelProperty("收藏数") |
| | | private Long collectNum; |
| | | |
| | | /** 评论数 */ |
| | | @ApiModelProperty("评论数") |
| | | private Long commentNum; |
| | | |
| | | /** 权重 */ |
| | | @ApiModelProperty("权重") |
| | | private double weight; |
| | | |
| | | /** 审核通过时间 */ |
| | | @ApiModelProperty("审核通过时间") |
| | | private Date auditPassTime; |
| | | |
| | | public static KitchenVideoVO getVoByEntity(@NonNull Video entity, KitchenVideoVO vo) { |
| | | if(vo == null) { |
| | | vo = new KitchenVideoVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("图片封面") |
| | | private String coverUrl; |
| | | |
| | | /** 封面显示地址 */ |
| | | @ApiModelProperty("封面显示地址") |
| | | private String coverShowUrl; |
| | | |
| | | /** 视频地址 */ |
| | | @ApiModelProperty("视频地址") |
| | | private String videoFileKey; |
New file |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.KitchenType; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import cn.lili.modules.lmk.domain.vo.KitchenTypeVO; |
| | | import cn.lili.modules.lmk.domain.form.KitchenTypeForm; |
| | | import cn.lili.modules.lmk.domain.query.KitchenTypeQuery; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 厨神类型 Mapper 接口 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Mapper |
| | | public interface KitchenTypeMapper extends BaseMapper<KitchenType> { |
| | | |
| | | /** |
| | | * id查找厨神类型 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | KitchenTypeVO getById(String id); |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | IPage getPage(IPage page, @Param("query") KitchenTypeQuery query); |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.KitchenVideoTypeRef; |
| | | import cn.lili.modules.lmk.domain.vo.KitchenVideoTypeVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import cn.lili.modules.lmk.domain.vo.KitchenVideoTypeRefVO; |
| | | import cn.lili.modules.lmk.domain.form.KitchenVideoTypeRefForm; |
| | | import cn.lili.modules.lmk.domain.query.KitchenVideoTypeRefQuery; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 厨神视频标签关系表 Mapper 接口 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Mapper |
| | | public interface KitchenVideoTypeRefMapper extends BaseMapper<KitchenVideoTypeRef> { |
| | | |
| | | /** |
| | | * id查找厨神视频标签关系表 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | KitchenVideoTypeRefVO getById(String id); |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | IPage getPage(IPage page, @Param("query") KitchenVideoTypeRefQuery query); |
| | | |
| | | List<KitchenVideoTypeVO> getTypeByVideoIds(@Param("videoIds") List<String> videoIds); |
| | | |
| | | } |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.Video; |
| | | import cn.lili.modules.lmk.domain.query.AuthorVideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.ManagerVideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.VideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.*; |
| | | import cn.lili.modules.lmk.domain.vo.CollectTypeNumVO; |
| | | import cn.lili.modules.lmk.domain.vo.VideoAccountVO; |
| | | import cn.lili.modules.lmk.domain.vo.VideoVO; |
| | |
| | | * @return |
| | | */ |
| | | WxEditVideoVO wxDetail(@Param("id") String id); |
| | | |
| | | /** |
| | | * 大健康视频分页 |
| | | * |
| | | * @param page |
| | | * @param query |
| | | */ |
| | | IPage healthPage(IPage page, @Param("query") HealthVideoQuery query); |
| | | |
| | | IPage kitchenPage(IPage page, @Param("query") KitchenVideoQuery query); |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.KitchenType; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.KitchenTypeForm; |
| | | import cn.lili.modules.lmk.domain.query.KitchenTypeQuery; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 厨神类型 服务类 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | public interface KitchenTypeService extends IService<KitchenType> { |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result add(KitchenTypeForm form); |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result update(KitchenTypeForm form); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | Result remove(List<String> ids); |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result removeById(String id); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result page(KitchenTypeQuery query); |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result detail(String id); |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | Result all(); |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.KitchenVideoTypeRef; |
| | | import cn.lili.modules.lmk.domain.vo.KitchenVideoTypeVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.KitchenVideoTypeRefForm; |
| | | import cn.lili.modules.lmk.domain.query.KitchenVideoTypeRefQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 厨神视频标签关系表 服务类 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | public interface KitchenVideoTypeRefService extends IService<KitchenVideoTypeRef> { |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result add(KitchenVideoTypeRefForm form); |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result update(KitchenVideoTypeRefForm form); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | Result remove(List<String> ids); |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result removeById(String id); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result page(KitchenVideoTypeRefQuery query); |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result detail(String id); |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | Result all(); |
| | | |
| | | List<KitchenVideoTypeVO> getTypeByVideoIds(List<String> videoIds); |
| | | } |
| | |
| | | package cn.lili.modules.lmk.service; |
| | | |
| | | import cn.lili.group.Add; |
| | | import cn.lili.modules.lmk.domain.entity.Video; |
| | | import cn.lili.modules.lmk.domain.form.*; |
| | | import cn.lili.modules.lmk.domain.query.AuthorVideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.ManagerVideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.*; |
| | | import cn.lili.modules.lmk.domain.vo.CollectTypeNumVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.query.VideoQuery; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | Result wxDetail(String id); |
| | | |
| | | /** |
| | | * 大健康视频发布 |
| | | * |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result healthVideo(HealthVideoForm form); |
| | | /** |
| | | * 修改大健康视频 |
| | | * |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result updateHealthVideo(HealthVideoForm form); |
| | | /** |
| | | * 大健康视频列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result healthPage(HealthVideoQuery query); |
| | | /** |
| | | * 删除大健康视频 |
| | | |
| | | * @param id 主键id |
| | | * @return |
| | | */ |
| | | Result delHealth(String id); |
| | | |
| | | Result addKitchenVideo( KitchenVideoForm form); |
| | | |
| | | Result updateKitchenVideo( KitchenVideoForm form); |
| | | /** |
| | | * 厨神视频列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result KitchenVideoQuery(KitchenVideoQuery query); |
| | | |
| | | Result delKitchen(String id); |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.domain.entity.KitchenType; |
| | | import cn.lili.modules.lmk.mapper.KitchenTypeMapper; |
| | | import cn.lili.modules.lmk.service.KitchenTypeService; |
| | | import cn.lili.base.Result; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import cn.lili.modules.lmk.domain.form.KitchenTypeForm; |
| | | import cn.lili.modules.lmk.domain.vo.KitchenTypeVO; |
| | | import cn.lili.modules.lmk.domain.query.KitchenTypeQuery; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.RequiredArgsConstructor; |
| | | import cn.lili.utils.PageUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 厨神类型 服务实现类 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class KitchenTypeServiceImpl extends ServiceImpl<KitchenTypeMapper, KitchenType> implements KitchenTypeService { |
| | | |
| | | private final KitchenTypeMapper kitchenTypeMapper; |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result add(KitchenTypeForm form) { |
| | | KitchenType entity = KitchenTypeForm.getEntityByForm(form, null); |
| | | entity.setUseNum(0L); |
| | | LambdaQueryWrapper<KitchenType> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.eq(KitchenType::getTypeName, form.getTypeName()); |
| | | List<KitchenType> kitchenTypes = baseMapper.selectList(wrapper); |
| | | if (!kitchenTypes.isEmpty()) { |
| | | return Result.error("添加失败标签存在"); |
| | | } |
| | | baseMapper.insert(entity); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result update(KitchenTypeForm form) { |
| | | KitchenType entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | //校验标签是否存在 |
| | | LambdaQueryWrapper<KitchenType> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.eq(KitchenType::getTypeName, form.getTypeName()); |
| | | List<KitchenType> kitchenTypes = baseMapper.selectList(wrapper); |
| | | if (!kitchenTypes.isEmpty()) { |
| | | return Result.error("修改失败标签存在"); |
| | | } |
| | | baseMapper.updateById(entity); |
| | | return Result.ok("修改成功"); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result remove(List<String> ids) { |
| | | baseMapper.deleteBatchIds(ids); |
| | | return Result.ok("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result removeById(String id) { |
| | | baseMapper.deleteById(id); |
| | | return Result.ok("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result page(KitchenTypeQuery query) { |
| | | IPage<KitchenTypeVO> page = PageUtil.getPage(query, KitchenTypeVO.class); |
| | | baseMapper.getPage(page, query); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result detail(String id) { |
| | | KitchenTypeVO vo = baseMapper.getById(id); |
| | | Assert.notNull(vo, "记录不存在"); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result all() { |
| | | List<KitchenType> entities = baseMapper.selectList(null); |
| | | List<KitchenTypeVO> vos = entities.stream() |
| | | .map(entity -> KitchenTypeVO.getVoByEntity(entity, null)) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import cn.lili.modules.lmk.domain.vo.KitchenVideoTypeVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.domain.entity.KitchenVideoTypeRef; |
| | | import cn.lili.modules.lmk.mapper.KitchenVideoTypeRefMapper; |
| | | import cn.lili.modules.lmk.service.KitchenVideoTypeRefService; |
| | | import cn.lili.base.Result; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import cn.lili.modules.lmk.domain.form.KitchenVideoTypeRefForm; |
| | | import cn.lili.modules.lmk.domain.vo.KitchenVideoTypeRefVO; |
| | | import cn.lili.modules.lmk.domain.query.KitchenVideoTypeRefQuery; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.RequiredArgsConstructor; |
| | | import cn.lili.utils.PageUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 厨神视频标签关系表 服务实现类 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class KitchenVideoTypeRefServiceImpl extends ServiceImpl<KitchenVideoTypeRefMapper, KitchenVideoTypeRef> implements KitchenVideoTypeRefService { |
| | | |
| | | private final KitchenVideoTypeRefMapper kitchenVideoTypeRefMapper; |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result add(KitchenVideoTypeRefForm form) { |
| | | KitchenVideoTypeRef entity = KitchenVideoTypeRefForm.getEntityByForm(form, null); |
| | | baseMapper.insert(entity); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result update(KitchenVideoTypeRefForm form) { |
| | | KitchenVideoTypeRef entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | baseMapper.updateById(entity); |
| | | return Result.ok("修改成功"); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result remove(List<String> ids) { |
| | | baseMapper.deleteBatchIds(ids); |
| | | return Result.ok("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result removeById(String id) { |
| | | baseMapper.deleteById(id); |
| | | return Result.ok("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result page(KitchenVideoTypeRefQuery query) { |
| | | IPage<KitchenVideoTypeRefVO> page = PageUtil.getPage(query, KitchenVideoTypeRefVO.class); |
| | | baseMapper.getPage(page, query); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result detail(String id) { |
| | | KitchenVideoTypeRefVO vo = baseMapper.getById(id); |
| | | Assert.notNull(vo, "记录不存在"); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result all() { |
| | | List<KitchenVideoTypeRef> entities = baseMapper.selectList(null); |
| | | List<KitchenVideoTypeRefVO> vos = entities.stream() |
| | | .map(entity -> KitchenVideoTypeRefVO.getVoByEntity(entity, null)) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | |
| | | @Override |
| | | public List<KitchenVideoTypeVO> getTypeByVideoIds(List<String> videoIds) { |
| | | return baseMapper.getTypeByVideoIds(videoIds); |
| | | } |
| | | } |
| | |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.modules.lmk.domain.entity.*; |
| | | import cn.lili.modules.lmk.domain.form.*; |
| | | import cn.lili.modules.lmk.domain.query.AuthorVideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.ManagerVideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.*; |
| | | import cn.lili.modules.lmk.domain.vo.*; |
| | | import cn.lili.modules.lmk.enums.general.*; |
| | | import cn.lili.modules.lmk.service.*; |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.mapper.VideoMapper; |
| | | import cn.lili.base.Result; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import cn.lili.modules.lmk.domain.query.VideoQuery; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.collections4.ListUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | private final MySubscribeService mySubscribeService; |
| | | private final MemberService memberService; |
| | | private final VideoAccountService videoAccountService; |
| | | private final KitchenVideoTypeRefService kitchenVideoTypeRefService; |
| | | private final VideoGoodsService videoGoodsService; |
| | | |
| | | |
| | |
| | | vo.setTags(tags); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | @Override |
| | | public Result healthVideo(HealthVideoForm form) { |
| | | Video video = new Video(); |
| | | BeanUtils.copyProperties(form, video); |
| | | video.setAuthorId(UserContext.getCurrentUserId()); |
| | | video.setVideoType(VideoTypeEnum.HEALTH.getValue()); |
| | | //设置填充模式 保持比例,完整显示 |
| | | video.setVideoFit("contain"); |
| | | video.setVideoContentType(VideoContentTypeEnum.VIDEO.getValue()); |
| | | video.setStatus(VideoStatusEnum.PUBLISHED.getValue()); |
| | | baseMapper.insert(video); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | @Override |
| | | public Result healthPage(HealthVideoQuery query) { |
| | | IPage<VideoVO> page = PageUtil.getPage(query, VideoVO.class); |
| | | // 1. 先查出视频信息 |
| | | baseMapper.healthPage(page, query); |
| | | // 2. 单独查出标签信息 |
| | | if (page.getTotal() > 0) { |
| | | Map<String, List<SimpleVideoTagVO>> tagMap = videoTagRefService.getTagsByVideoIds( |
| | | page.getRecords().stream().map(VideoVO::getId).collect(Collectors.toList()) |
| | | ).stream().collect(Collectors.groupingBy(SimpleVideoTagVO::getVideoId));; |
| | | // 3. 获取视频临时访问地址、设置视频标签 |
| | | page.getRecords().forEach(v -> { |
| | | v.setTagList(tagMap.get(v.getId())); |
| | | v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | v.setCoverShowUrl(cosUtil.getPreviewUrl(v.getCoverUrl())); |
| | | }); |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | @Override |
| | | public Result updateHealthVideo(HealthVideoForm form) { |
| | | Video entity = baseMapper.selectById(form.getId()); |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | baseMapper.updateById(entity); |
| | | return Result.ok("修改成功"); |
| | | } |
| | | |
| | | @Override |
| | | public Result delHealth(String id) { |
| | | Video entity = baseMapper.selectById(id); |
| | | Assert.notNull(entity, "记录不存在"); |
| | | String videoType = entity.getVideoType(); |
| | | if (!VideoTypeEnum.HEALTH.getValue().equals(videoType)) { |
| | | log.error("删除非大健康视频视频id为------->"+id); |
| | | return Result.error("删除失败"); |
| | | } |
| | | baseMapper.deleteById(id); |
| | | return Result.ok("删除成功"); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result addKitchenVideo(KitchenVideoForm form) { |
| | | Video video = new Video(); |
| | | BeanUtils.copyProperties(form, video); |
| | | video.setAuthorId(UserContext.getCurrentUserId()); |
| | | video.setVideoType(VideoTypeEnum.COOK.getValue()); |
| | | //设置填充模式 保持比例,完整显示 |
| | | video.setVideoFit("contain"); |
| | | video.setVideoContentType(VideoContentTypeEnum.VIDEO.getValue()); |
| | | video.setStatus(VideoStatusEnum.PUBLISHED.getValue()); |
| | | baseMapper.insert(video); |
| | | String id = video.getId(); |
| | | List<KitchenVideoTypeRef> collect = form.getCheckKitchenType().stream().map(item -> { |
| | | KitchenVideoTypeRef kitchenVideoTypeRef = new KitchenVideoTypeRef(); |
| | | //设置视频id |
| | | kitchenVideoTypeRef.setVideoId(id); |
| | | //设置标签id |
| | | kitchenVideoTypeRef.setKitchenTypeId(item); |
| | | return kitchenVideoTypeRef; |
| | | } |
| | | ).collect(Collectors.toList()); |
| | | kitchenVideoTypeRefService.saveBatch(collect); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result updateKitchenVideo(KitchenVideoForm form) { |
| | | Video video = baseMapper.selectById(form.getId()); |
| | | Assert.notNull(video, "记录不存在"); |
| | | BeanUtils.copyProperties(form, video); |
| | | baseMapper.updateById(video); |
| | | //删除原来的类型关系 |
| | | kitchenVideoTypeRefService.remove(Wrappers.<KitchenVideoTypeRef>lambdaQuery() |
| | | .eq(KitchenVideoTypeRef::getVideoId, form.getId())); |
| | | String id = video.getId(); |
| | | List<KitchenVideoTypeRef> collect = form.getCheckKitchenType().stream().map(item -> { |
| | | KitchenVideoTypeRef kitchenVideoTypeRef = new KitchenVideoTypeRef(); |
| | | //设置视频id |
| | | kitchenVideoTypeRef.setVideoId(id); |
| | | //设置标签id |
| | | kitchenVideoTypeRef.setKitchenTypeId(item); |
| | | return kitchenVideoTypeRef; |
| | | } |
| | | ).collect(Collectors.toList()); |
| | | kitchenVideoTypeRefService.saveBatch(collect); |
| | | return Result.ok("修改成功"); |
| | | } |
| | | |
| | | @Override |
| | | public Result KitchenVideoQuery(KitchenVideoQuery query) { |
| | | IPage<KitchenVideoVO> page = PageUtil.getPage(query, KitchenVideoVO.class); |
| | | // 1. 先查出视频信息 |
| | | baseMapper.kitchenPage(page, query); |
| | | // 2. 单独查出标签信息 |
| | | if (page.getTotal() > 0) { |
| | | Map<String, List<KitchenVideoTypeVO>> typeMap = kitchenVideoTypeRefService |
| | | .getTypeByVideoIds( |
| | | page.getRecords() |
| | | .stream().map(KitchenVideoVO::getId).collect(Collectors.toList())) |
| | | .stream().collect(Collectors.groupingBy(KitchenVideoTypeVO::getVideoId)); |
| | | // 3. 获取视频临时访问地址、设置视频标签 |
| | | page.getRecords().forEach(v -> { |
| | | v.setTypeList(typeMap.get(v.getId())); |
| | | v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | v.setCoverShowUrl(cosUtil.getPreviewUrl(v.getCoverUrl())); |
| | | }); |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result delKitchen(String id) { |
| | | Video entity = baseMapper.selectById(id); |
| | | Assert.notNull(entity, "记录不存在"); |
| | | String videoType = entity.getVideoType(); |
| | | if (!VideoTypeEnum.COOK.getValue().equals(videoType)) { |
| | | log.error("删除非大神厨视频视频id为------->"+id); |
| | | return Result.error("删除失败"); |
| | | } |
| | | baseMapper.deleteById(id); |
| | | kitchenVideoTypeRefService.remove(Wrappers.<KitchenVideoTypeRef>lambdaQuery() |
| | | .eq(KitchenVideoTypeRef::getVideoId, id)); |
| | | return Result.ok("删除成功"); |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.lili.modules.lmk.mapper.KitchenTypeMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.KitchenTypeVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="type_name" property="typeName" /> |
| | | <result column="use_num" property="useNum" /> |
| | | <result column="sort_num" property="sortNum" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <select id="getById" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LKT.type_name, |
| | | LKT.use_num, |
| | | LKT.sort_num, |
| | | LKT.id |
| | | FROM |
| | | lmk_kitchen_type LKT |
| | | WHERE |
| | | LKT.id = #{id} AND LKT.delete_flag = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="getPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LKT.type_name, |
| | | LKT.use_num, |
| | | LKT.sort_num, |
| | | LKT.id |
| | | FROM |
| | | lmk_kitchen_type LKT |
| | | WHERE |
| | | LKT.delete_flag = 0 |
| | | <if test="query.typeName != null and query.typeName != ''"> |
| | | AND LKT.type_name LIKE CONCAT('%', #{query.typeName},'%') |
| | | </if> |
| | | order by LKT.sort_num asc |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.lili.modules.lmk.mapper.KitchenVideoTypeRefMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.KitchenVideoTypeRefVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="video_id" property="videoId" /> |
| | | <result column="kitchen_type_id" property="kitchenTypeId" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <select id="getById" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LKVTR.video_id, |
| | | LKVTR.kitchen_type_id, |
| | | LKVTR.id |
| | | FROM |
| | | lmk_kitchen_video_type_ref LKVTR |
| | | WHERE |
| | | LKVTR.id = #{id} AND LKVTR.delete_flag = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="getPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LKVTR.video_id, |
| | | LKVTR.kitchen_type_id, |
| | | LKVTR.id |
| | | FROM |
| | | lmk_kitchen_video_type_ref LKVTR |
| | | WHERE |
| | | LKVTR.delete_flag = 0 |
| | | </select> |
| | | |
| | | <select id="getTypeByVideoIds" resultType="cn.lili.modules.lmk.domain.vo.KitchenVideoTypeVO"> |
| | | SELECT |
| | | LKVTR.video_id, |
| | | LKT.id, |
| | | LKT.type_name |
| | | FROM |
| | | lmk_kitchen_video_type_ref LKVTR |
| | | JOIN lmk_kitchen_type LKT ON LKVTR.kitchen_type_id = LKT.id |
| | | WHERE |
| | | LKVTR.video_id IN <foreach collection="videoIds" open="(" item="videoId" close=")" separator=",">#{videoId}</foreach> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result column="video_type" property="videoType" /> |
| | | <result column="video_imgs" property="videoImgs" /> |
| | | </resultMap> |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="KitchenVideoMap" type="cn.lili.modules.lmk.domain.vo.KitchenVideoVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="author_id" property="authorId" /> |
| | | <result column="authorName" property="authorName" /> |
| | | <result column="cover_url" property="coverUrl" /> |
| | | <result column="video_file_key" property="videoFileKey" /> |
| | | <result column="video_fit" property="videoFit" /> |
| | | <result column="title" property="title" /> |
| | | <result column="goods_id" property="goodsId" /> |
| | | <result column="goods_view_num" property="goodsViewNum" /> |
| | | <result column="video_duration" property="videoDuration" /> |
| | | <result column="goods_order_num" property="goodsOrderNum" /> |
| | | <result column="recommend" property="recommend" /> |
| | | <result column="status" property="status" /> |
| | | <result column="play_num" property="playNum" /> |
| | | <result column="collect_num" property="collectNum" /> |
| | | <result column="comment_num" property="commentNum" /> |
| | | <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> |
| | | |
| | | <!-- 微信推荐视频 --> |
| | | <resultMap id="WxResultMap" type="cn.lili.modules.lmk.domain.vo.WxVideoVO"> |
| | |
| | | WHERE |
| | | LV.delete_flag = 0 AND LV.id = #{id} |
| | | </select> |
| | | <select id="healthPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LV.author_id, |
| | | LV.cover_url, |
| | | LV.video_fit, |
| | | LV.video_duration, |
| | | LV.video_file_key, |
| | | LV.title, |
| | | LV.goods_view_num, |
| | | LV.goods_order_num, |
| | | LV.recommend, |
| | | LV.status, |
| | | LV.play_num, |
| | | LV.collect_num, |
| | | LV.comment_num, |
| | | 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 |
| | | lmk_video LV |
| | | LEFT JOIN li_member LM ON LV.author_id = LM.id |
| | | <if test="query.tagList != null and query.tagList.size > 0"> |
| | | INNER JOIN ( |
| | | SELECT DISTINCT video_id |
| | | FROM lmk_video_tag_ref |
| | | WHERE video_tag_id IN |
| | | <foreach collection="query.tagList" open="(" item="tagId" close=")" separator=",">#{tagId}</foreach> |
| | | ) AS LVT ON LV.id = LVT.video_id |
| | | </if> |
| | | WHERE |
| | | 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> |
| | | </select> |
| | | |
| | | <select id="kitchenPage" resultMap="KitchenVideoMap"> |
| | | SELECT |
| | | LV.author_id, |
| | | LV.cover_url, |
| | | LV.video_fit, |
| | | LV.video_duration, |
| | | LV.video_file_key, |
| | | LV.title, |
| | | LV.goods_view_num, |
| | | LV.goods_order_num, |
| | | LV.recommend, |
| | | LV.status, |
| | | LV.play_num, |
| | | LV.collect_num, |
| | | LV.comment_num, |
| | | 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 |
| | | lmk_video LV |
| | | LEFT JOIN li_member LM ON LV.author_id = LM.id |
| | | <if test="query.typeList != null and query.typeList.size > 0"> |
| | | INNER JOIN ( |
| | | SELECT DISTINCT video_id |
| | | FROM lmk_kitchen_video_type_ref |
| | | WHERE kitchen_type_id IN |
| | | <foreach collection="query.typeList" open="(" item="tagId" close=")" separator=",">#{tagId}</foreach> |
| | | ) AS LVT ON LV.id = LVT.video_id |
| | | </if> |
| | | WHERE |
| | | 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> |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.group.Update; |
| | | import cn.lili.modules.lmk.domain.form.HealthVideoForm; |
| | | import cn.lili.modules.lmk.domain.query.HealthVideoQuery; |
| | | import cn.lili.modules.lmk.service.VideoService; |
| | | 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.*; |
| | | |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "大健康", tags = "大健康") |
| | | @RestController |
| | | @RequestMapping("/manager/lkm/health") |
| | | public class HealthController { |
| | | private final VideoService videoService; |
| | | |
| | | @PostMapping("/healthVideo") |
| | | @ApiOperation(value = "大健康视频发布", notes = "大健康视频发布") |
| | | public Result healthVideo(@RequestBody @Validated(Add.class) HealthVideoForm form) { |
| | | return videoService.healthVideo(form); |
| | | } |
| | | @PostMapping("/updateHealthVideo") |
| | | @ApiOperation(value = "大健康视频发布", notes = "大健康视频发布") |
| | | public Result updateHealthVideo(@RequestBody @Validated(Update.class) HealthVideoForm form) { |
| | | return videoService.updateHealthVideo(form); |
| | | } |
| | | @PostMapping("/page") |
| | | @ApiOperation(value = "大健康视频列表", notes = "大健康视频列表") |
| | | public Result page(@RequestBody HealthVideoQuery query) { |
| | | return videoService.healthPage(query); |
| | | } |
| | | //删除大厨神视频 |
| | | @PostMapping("/del/{id}") |
| | | @ApiOperation(value = "删除大厨神视频", notes = "删除大厨神视频") |
| | | public Result delHealth(@PathVariable("id") String id) { |
| | | return videoService.delHealth(id); |
| | | } |
| | | } |
New file |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | import cn.lili.group.Update; |
| | | import cn.lili.group.Add; |
| | | 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.KitchenTypeService; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.KitchenTypeForm; |
| | | import cn.lili.modules.lmk.domain.query.KitchenTypeQuery; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * 厨神类型 前端控制器 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "厨神类型", tags = "厨神类型管理") |
| | | @RestController |
| | | @RequestMapping("/manager/lmk/kitchen-type") |
| | | public class KitchenTypeController { |
| | | |
| | | private final KitchenTypeService kitchenTypeService; |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "添加", notes = "添加") |
| | | public Result add(@RequestBody @Validated(Add.class) KitchenTypeForm form) { |
| | | return kitchenTypeService.add(form); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public Result update(@RequestBody @Validated(Update.class) KitchenTypeForm form) { |
| | | return kitchenTypeService.update(form); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation(value = "ID删除", notes = "ID删除") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | return kitchenTypeService.removeById(id); |
| | | } |
| | | |
| | | @DeleteMapping("/batch") |
| | | @ApiOperation(value = "批量删除", notes = "批量删除") |
| | | public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) { |
| | | return kitchenTypeService.remove(ids); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @ApiOperation(value = "分页", notes = "分页") |
| | | public Result page(KitchenTypeQuery query) { |
| | | return kitchenTypeService.page(query); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | public Result detail(@PathVariable("id") String id) { |
| | | return kitchenTypeService.detail(id); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "列表", notes = "列表") |
| | | public Result list() { |
| | | return kitchenTypeService.all(); |
| | | } |
| | | } |
New file |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.group.Update; |
| | | import cn.lili.modules.lmk.domain.form.HealthVideoForm; |
| | | import cn.lili.modules.lmk.domain.form.KitchenTypeForm; |
| | | import cn.lili.modules.lmk.domain.form.KitchenVideoForm; |
| | | import cn.lili.modules.lmk.domain.query.HealthVideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.KitchenTypeQuery; |
| | | import cn.lili.modules.lmk.domain.query.KitchenVideoQuery; |
| | | import cn.lili.modules.lmk.service.KitchenTypeService; |
| | | import cn.lili.modules.lmk.service.VideoService; |
| | | 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; |
| | | |
| | | /** |
| | | * 厨神视频 前端控制器 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "厨神视频", tags = "厨神视频管理") |
| | | @RestController |
| | | @RequestMapping("/manager/lmk/kitchen-video") |
| | | public class KitchenVideoController { |
| | | |
| | | private final VideoService videoService; |
| | | |
| | | @PostMapping("/addKitchenVideo") |
| | | @ApiOperation(value = "厨神视频发布", notes = "厨神视频发布") |
| | | public Result addKitchenVideo(@RequestBody @Validated(Add.class) KitchenVideoForm form) { |
| | | return videoService.addKitchenVideo(form); |
| | | } |
| | | @PostMapping("/updateKitchenVideo") |
| | | @ApiOperation(value = "厨神视频修改", notes = "厨神视频修改") |
| | | public Result updateKitchenVideo(@RequestBody @Validated(Update.class) KitchenVideoForm form) { |
| | | return videoService.updateKitchenVideo(form); |
| | | } |
| | | @PostMapping("/page") |
| | | @ApiOperation(value = "厨神视频列表", notes = "厨神视频列表") |
| | | public Result page(@RequestBody KitchenVideoQuery query) { |
| | | return videoService.KitchenVideoQuery(query); |
| | | } |
| | | |
| | | @PostMapping("/del/{id}") |
| | | @ApiOperation(value = "删除大厨神视频", notes = "删除大厨神视频") |
| | | public Result delKitchen(@PathVariable("id") String id) { |
| | | return videoService.delKitchen(id); |
| | | } |
| | | } |