From 8065107726ad1fc13591c9bc47819207948bc45c Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期日, 15 六月 2025 19:28:55 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev --- framework/src/main/java/cn/lili/modules/lmk/service/KitchenVideoTypeRefService.java | 70 ++ framework/src/main/java/cn/lili/modules/lmk/domain/vo/KitchenVideoTypeVO.java | 34 + framework/src/main/java/cn/lili/modules/lmk/domain/vo/VideoVO.java | 4 framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java | 150 +++++ framework/src/main/java/cn/lili/modules/lmk/domain/form/KitchenVideoTypeRefForm.java | 42 + framework/src/main/java/cn/lili/modules/lmk/domain/vo/KitchenTypeVO.java | 43 + framework/src/main/java/cn/lili/modules/lmk/domain/form/KitchenVideoForm.java | 59 ++ framework/src/main/java/cn/lili/modules/lmk/service/impl/KitchenTypeServiceImpl.java | 135 ++++ framework/src/main/resources/mapper/lmk/VideoMapper.xml | 105 +++ framework/src/main/java/cn/lili/modules/lmk/domain/query/KitchenVideoTypeRefQuery.java | 22 framework/src/main/java/cn/lili/modules/lmk/domain/entity/KitchenType.java | 33 + manager-api/src/main/java/cn/lili/controller/lmk/KitchenTypeController.java | 76 ++ framework/src/main/java/cn/lili/modules/lmk/domain/entity/KitchenVideoTypeRef.java | 37 + framework/src/main/java/cn/lili/modules/lmk/service/VideoService.java | 51 + framework/src/main/java/cn/lili/modules/lmk/mapper/VideoMapper.java | 14 framework/src/main/java/cn/lili/modules/lmk/domain/query/KitchenVideoQuery.java | 39 + framework/src/main/java/cn/lili/modules/lmk/domain/query/KitchenTypeQuery.java | 24 framework/src/main/resources/mapper/lmk/KitchenTypeMapper.xml | 48 + framework/src/main/java/cn/lili/modules/lmk/domain/form/HealthVideoForm.java | 54 + framework/src/main/java/cn/lili/modules/lmk/domain/vo/KitchenVideoVO.java | 116 ++++ framework/src/main/java/cn/lili/modules/lmk/mapper/KitchenTypeMapper.java | 34 + manager-api/src/main/java/cn/lili/controller/lmk/HealthController.java | 44 + framework/src/main/java/cn/lili/modules/lmk/service/KitchenTypeService.java | 65 ++ framework/src/main/java/cn/lili/modules/lmk/domain/query/HealthVideoQuery.java | 39 + framework/src/main/java/cn/lili/modules/lmk/domain/vo/KitchenVideoTypeRefVO.java | 39 + framework/src/main/java/cn/lili/modules/lmk/domain/form/KitchenTypeForm.java | 45 + manager-api/src/main/java/cn/lili/controller/lmk/KitchenVideoController.java | 59 ++ framework/src/main/java/cn/lili/modules/lmk/mapper/KitchenVideoTypeRefMapper.java | 37 + framework/src/main/java/cn/lili/modules/lmk/service/impl/KitchenVideoTypeRefServiceImpl.java | 126 ++++ framework/src/main/resources/mapper/lmk/KitchenVideoTypeRefMapper.xml | 53 + 30 files changed, 1,688 insertions(+), 9 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/entity/KitchenType.java b/framework/src/main/java/cn/lili/modules/lmk/domain/entity/KitchenType.java new file mode 100644 index 0000000..7c22910 --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/domain/entity/KitchenType.java @@ -0,0 +1,33 @@ +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; + + +} diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/entity/KitchenVideoTypeRef.java b/framework/src/main/java/cn/lili/modules/lmk/domain/entity/KitchenVideoTypeRef.java new file mode 100644 index 0000000..b58f66e --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/domain/entity/KitchenVideoTypeRef.java @@ -0,0 +1,37 @@ +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; + + +} diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/form/HealthVideoForm.java b/framework/src/main/java/cn/lili/modules/lmk/domain/form/HealthVideoForm.java new file mode 100644 index 0000000..d372d82 --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/domain/form/HealthVideoForm.java @@ -0,0 +1,54 @@ +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; + + /** 浣滆�卛d */ + @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; + + + +} diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/form/KitchenTypeForm.java b/framework/src/main/java/cn/lili/modules/lmk/domain/form/KitchenTypeForm.java new file mode 100644 index 0000000..3887943 --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/domain/form/KitchenTypeForm.java @@ -0,0 +1,45 @@ +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; + } + +} diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/form/KitchenVideoForm.java b/framework/src/main/java/cn/lili/modules/lmk/domain/form/KitchenVideoForm.java new file mode 100644 index 0000000..cb7906c --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/domain/form/KitchenVideoForm.java @@ -0,0 +1,59 @@ +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; + + /** 浣滆�卛d */ + @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; + + + + + +} diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/form/KitchenVideoTypeRefForm.java b/framework/src/main/java/cn/lili/modules/lmk/domain/form/KitchenVideoTypeRefForm.java new file mode 100644 index 0000000..5f33b2c --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/domain/form/KitchenVideoTypeRefForm.java @@ -0,0 +1,42 @@ +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; + } + +} diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/query/HealthVideoQuery.java b/framework/src/main/java/cn/lili/modules/lmk/domain/query/HealthVideoQuery.java new file mode 100644 index 0000000..47b29b2 --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/domain/query/HealthVideoQuery.java @@ -0,0 +1,39 @@ +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 = "骞冲彴绔疺ideo鏌ヨ鍙傛暟", 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(); +} + diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/query/KitchenTypeQuery.java b/framework/src/main/java/cn/lili/modules/lmk/domain/query/KitchenTypeQuery.java new file mode 100644 index 0000000..678b28c --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/domain/query/KitchenTypeQuery.java @@ -0,0 +1,24 @@ +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; +} + diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/query/KitchenVideoQuery.java b/framework/src/main/java/cn/lili/modules/lmk/domain/query/KitchenVideoQuery.java new file mode 100644 index 0000000..f48ba62 --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/domain/query/KitchenVideoQuery.java @@ -0,0 +1,39 @@ +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 = "骞冲彴绔帹绁濾ideo鏌ヨ鍙傛暟", 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(); +} + diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/query/KitchenVideoTypeRefQuery.java b/framework/src/main/java/cn/lili/modules/lmk/domain/query/KitchenVideoTypeRefQuery.java new file mode 100644 index 0000000..e8cbb92 --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/domain/query/KitchenVideoTypeRefQuery.java @@ -0,0 +1,22 @@ +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 { +} + diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/vo/KitchenTypeVO.java b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/KitchenTypeVO.java new file mode 100644 index 0000000..a56c395 --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/KitchenTypeVO.java @@ -0,0 +1,43 @@ +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; + } + +} diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/vo/KitchenVideoTypeRefVO.java b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/KitchenVideoTypeRefVO.java new file mode 100644 index 0000000..b8295a9 --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/KitchenVideoTypeRefVO.java @@ -0,0 +1,39 @@ +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; + } + +} diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/vo/KitchenVideoTypeVO.java b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/KitchenVideoTypeVO.java new file mode 100644 index 0000000..fbfd923 --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/KitchenVideoTypeVO.java @@ -0,0 +1,34 @@ +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; + + +} diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/vo/KitchenVideoVO.java b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/KitchenVideoVO.java new file mode 100644 index 0000000..2c436fc --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/KitchenVideoVO.java @@ -0,0 +1,116 @@ +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 { + + /** 浣滆�卛d */ + @ApiModelProperty("浣滆�卛d") + 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 = "鍥剧墖鍒楄〃锛宩son鏁扮粍", 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; + } + +} diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/vo/VideoVO.java b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/VideoVO.java index fae271e..8c217e8 100644 --- a/framework/src/main/java/cn/lili/modules/lmk/domain/vo/VideoVO.java +++ b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/VideoVO.java @@ -30,6 +30,10 @@ @ApiModelProperty("鍥剧墖灏侀潰") private String coverUrl; + /** 灏侀潰鏄剧ず鍦板潃 */ + @ApiModelProperty("灏侀潰鏄剧ず鍦板潃") + private String coverShowUrl; + /** 瑙嗛鍦板潃 */ @ApiModelProperty("瑙嗛鍦板潃") private String videoFileKey; diff --git a/framework/src/main/java/cn/lili/modules/lmk/mapper/KitchenTypeMapper.java b/framework/src/main/java/cn/lili/modules/lmk/mapper/KitchenTypeMapper.java new file mode 100644 index 0000000..199b8c8 --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/mapper/KitchenTypeMapper.java @@ -0,0 +1,34 @@ +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); + +} diff --git a/framework/src/main/java/cn/lili/modules/lmk/mapper/KitchenVideoTypeRefMapper.java b/framework/src/main/java/cn/lili/modules/lmk/mapper/KitchenVideoTypeRefMapper.java new file mode 100644 index 0000000..c6157e8 --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/mapper/KitchenVideoTypeRefMapper.java @@ -0,0 +1,37 @@ +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); + +} diff --git a/framework/src/main/java/cn/lili/modules/lmk/mapper/VideoMapper.java b/framework/src/main/java/cn/lili/modules/lmk/mapper/VideoMapper.java index 4b2675f..263072f 100644 --- a/framework/src/main/java/cn/lili/modules/lmk/mapper/VideoMapper.java +++ b/framework/src/main/java/cn/lili/modules/lmk/mapper/VideoMapper.java @@ -1,9 +1,7 @@ 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; @@ -112,4 +110,14 @@ * @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); } diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/KitchenTypeService.java b/framework/src/main/java/cn/lili/modules/lmk/service/KitchenTypeService.java new file mode 100644 index 0000000..322ea84 --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/service/KitchenTypeService.java @@ -0,0 +1,65 @@ +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(); +} diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/KitchenVideoTypeRefService.java b/framework/src/main/java/cn/lili/modules/lmk/service/KitchenVideoTypeRefService.java new file mode 100644 index 0000000..c7b6152 --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/service/KitchenVideoTypeRefService.java @@ -0,0 +1,70 @@ +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); +} diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/VideoService.java b/framework/src/main/java/cn/lili/modules/lmk/service/VideoService.java index 0a4b93d..6492e48 100644 --- a/framework/src/main/java/cn/lili/modules/lmk/service/VideoService.java +++ b/framework/src/main/java/cn/lili/modules/lmk/service/VideoService.java @@ -1,13 +1,15 @@ 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; /** @@ -183,4 +185,47 @@ * @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); + } diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/KitchenTypeServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/KitchenTypeServiceImpl.java new file mode 100644 index 0000000..d2e0f9c --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/KitchenTypeServiceImpl.java @@ -0,0 +1,135 @@ +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()); + + // 涓虹┖鎶汭llegalArgumentException锛屽仛鍏ㄥ眬寮傚父澶勭悊 + 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); + } +} diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/KitchenVideoTypeRefServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/KitchenVideoTypeRefServiceImpl.java new file mode 100644 index 0000000..6aac262 --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/KitchenVideoTypeRefServiceImpl.java @@ -0,0 +1,126 @@ +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()); + + // 涓虹┖鎶汭llegalArgumentException锛屽仛鍏ㄥ眬寮傚父澶勭悊 + 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); + } +} diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java index 4a4448c..4b5cbe6 100644 --- a/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java @@ -3,8 +3,7 @@ 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.*; @@ -17,10 +16,10 @@ 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; @@ -55,6 +54,7 @@ private final MySubscribeService mySubscribeService; private final MemberService memberService; private final VideoAccountService videoAccountService; + private final KitchenVideoTypeRefService kitchenVideoTypeRefService; private final VideoGoodsService videoGoodsService; @@ -439,4 +439,148 @@ 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("鍒犻櫎鎴愬姛"); + } } diff --git a/framework/src/main/resources/mapper/lmk/KitchenTypeMapper.xml b/framework/src/main/resources/mapper/lmk/KitchenTypeMapper.xml new file mode 100644 index 0000000..ce33f35 --- /dev/null +++ b/framework/src/main/resources/mapper/lmk/KitchenTypeMapper.xml @@ -0,0 +1,48 @@ +<?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> diff --git a/framework/src/main/resources/mapper/lmk/KitchenVideoTypeRefMapper.xml b/framework/src/main/resources/mapper/lmk/KitchenVideoTypeRefMapper.xml new file mode 100644 index 0000000..42268c3 --- /dev/null +++ b/framework/src/main/resources/mapper/lmk/KitchenVideoTypeRefMapper.xml @@ -0,0 +1,53 @@ +<?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> diff --git a/framework/src/main/resources/mapper/lmk/VideoMapper.xml b/framework/src/main/resources/mapper/lmk/VideoMapper.xml index b2bd6bd..f212216 100644 --- a/framework/src/main/resources/mapper/lmk/VideoMapper.xml +++ b/framework/src/main/resources/mapper/lmk/VideoMapper.xml @@ -27,6 +27,31 @@ <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"> @@ -353,5 +378,85 @@ 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> diff --git a/manager-api/src/main/java/cn/lili/controller/lmk/HealthController.java b/manager-api/src/main/java/cn/lili/controller/lmk/HealthController.java new file mode 100644 index 0000000..f983a29 --- /dev/null +++ b/manager-api/src/main/java/cn/lili/controller/lmk/HealthController.java @@ -0,0 +1,44 @@ +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); + } +} diff --git a/manager-api/src/main/java/cn/lili/controller/lmk/KitchenTypeController.java b/manager-api/src/main/java/cn/lili/controller/lmk/KitchenTypeController.java new file mode 100644 index 0000000..d2c3d80 --- /dev/null +++ b/manager-api/src/main/java/cn/lili/controller/lmk/KitchenTypeController.java @@ -0,0 +1,76 @@ +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(); + } +} diff --git a/manager-api/src/main/java/cn/lili/controller/lmk/KitchenVideoController.java b/manager-api/src/main/java/cn/lili/controller/lmk/KitchenVideoController.java new file mode 100644 index 0000000..1b2c182 --- /dev/null +++ b/manager-api/src/main/java/cn/lili/controller/lmk/KitchenVideoController.java @@ -0,0 +1,59 @@ +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); + } +} -- Gitblit v1.8.0