| New file |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.service.AdCoverService; |
| | | import cn.lili.modules.lmk.service.AdImgService; |
| | | import cn.lili.modules.lmk.service.KitchenCustomizeService; |
| | | import cn.lili.modules.lmk.service.KitchenTagService; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * 私厨模块 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "私厨模块", tags = "私厨模块") |
| | | @RestController |
| | | @RequestMapping("/buyer/lmk/kitchen") |
| | | public class KitchenController { |
| | | private final KitchenCustomizeService kitchenCustomizeService; |
| | | private final AdCoverService adCoverService; |
| | | private final AdImgService adImgService; |
| | | private final KitchenTagService kitchenTagService; |
| | | |
| | | /** |
| | | * 私厨 banner |
| | | * @return banner 列表 |
| | | */ |
| | | @GetMapping("/banner") |
| | | public Result getKitchenBanner(){ |
| | | return adImgService.getKitchenBanner(); |
| | | } |
| | | |
| | | /** |
| | | * 私厨标签 |
| | | * @return 私厨标签 |
| | | */ |
| | | @GetMapping("/kitchenTag") |
| | | public Result getKitchenTag(){ |
| | | return kitchenTagService.getKitchenTag(); |
| | | } |
| | | |
| | | /** |
| | | * 私厨商品 |
| | | * @return 私厨商品 |
| | | */ |
| | | @GetMapping("/kitchenGoods") |
| | | public Result getKitchenGoods(String id){ |
| | | return kitchenCustomizeService.getKitchenGoods(id); |
| | | } |
| | | |
| | | /** |
| | | * 厨师封面 |
| | | * @return 厨师封面 |
| | | */ |
| | | @GetMapping("/kitchenCover") |
| | | public Result getKitchenCover(){ |
| | | return adCoverService.getKitchenCover(); |
| | | } |
| | | } |
| 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 java.io.Serializable; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 厨师封面图片 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Data |
| | | @TableName("lmk_ad_cover") |
| | | public class AdCover extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField("cover_url") |
| | | /** 图片地址 */ |
| | | private String coverUrl; |
| | | |
| | | |
| | | } |
| 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 java.io.Serializable; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 私厨定制广告图片 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Data |
| | | @TableName("lmk_ad_img") |
| | | public class AdImg extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField("sort") |
| | | /** */ |
| | | private Integer sort; |
| | | |
| | | @TableField("open_type") |
| | | /** 打开类型 */ |
| | | private String openType; |
| | | |
| | | @TableField("direct_url") |
| | | /** 跳转路径 */ |
| | | private String directUrl; |
| | | |
| | | @TableField("cover_url") |
| | | /** 图片地址 */ |
| | | private String coverUrl; |
| | | |
| | | |
| | | } |
| 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 java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 厨师定制模块 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Data |
| | | @TableName("lmk_kitchen_customize") |
| | | public class KitchenCustomize extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField("goods_id") |
| | | /** 商品id */ |
| | | private String goodsId; |
| | | |
| | | @TableField("sku_id") |
| | | /** skuId */ |
| | | private String skuId; |
| | | |
| | | @TableField("combo_name") |
| | | /** 套餐名字 */ |
| | | private String comboName; |
| | | |
| | | @TableField("remark") |
| | | /** 备注 */ |
| | | private String remark; |
| | | |
| | | @TableField("num") |
| | | /** 人数 */ |
| | | private String num; |
| | | |
| | | @TableField("cover_img") |
| | | /** 封面图片 */ |
| | | private String coverImg; |
| | | |
| | | @TableField("orgin_price") |
| | | /** 原价 */ |
| | | private BigDecimal orginPrice; |
| | | |
| | | @TableField("tag_id") |
| | | /** 标签id */ |
| | | private String tagId; |
| | | |
| | | @TableField("status") |
| | | /** 启用状态 */ |
| | | private String status; |
| | | |
| | | @TableField("sort") |
| | | /** 排序 */ |
| | | private Integer sort; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package cn.lili.modules.lmk.domain.entity; |
| | | |
| | | import cn.lili.modules.lmk.enums.general.StoreCouponStausEnum; |
| | | import cn.lili.mybatis.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 私厨定制标签 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Data |
| | | @TableName("lmk_kitchen_tag") |
| | | public class KitchenTag extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField("tag_name") |
| | | /** 标签名称 */ |
| | | private String tagName; |
| | | |
| | | @TableField("sort") |
| | | /** 显示顺序 */ |
| | | private Integer sort; |
| | | /** |
| | | * @see StoreCouponStausEnum |
| | | * 启用状态 |
| | | */ |
| | | private String enable; |
| | | |
| | | |
| | | } |
| 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.AdCover; |
| | | 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 peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "AdCover表单", description = "厨师封面图片表单") |
| | | public class AdCoverForm extends AbsForm { |
| | | |
| | | @NotBlank(message = "图片地址不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("图片地址") |
| | | private String coverUrl; |
| | | |
| | | public static AdCover getEntityByForm(@NonNull AdCoverForm form, AdCover entity) { |
| | | if(entity == null) { |
| | | entity = new AdCover(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | |
| | | } |
| 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.AdImg; |
| | | 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 peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "AdImg表单", description = "私厨定制广告图片表单") |
| | | public class AdImgForm extends AbsForm { |
| | | |
| | | // @NotNull(message = "不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("") |
| | | private Integer sort; |
| | | |
| | | // @NotBlank(message = "打开类型不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("打开类型") |
| | | private String openType; |
| | | |
| | | // @NotBlank(message = "跳转路径不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("跳转路径") |
| | | private String directUrl; |
| | | |
| | | @NotBlank(message = "图片地址不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("图片地址") |
| | | private String coverUrl; |
| | | |
| | | public static AdImg getEntityByForm(@NonNull AdImgForm form, AdImg entity) { |
| | | if(entity == null) { |
| | | entity = new AdImg(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | |
| | | } |
| 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.KitchenCustomize; |
| | | 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.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 厨师定制模块表单 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "KitchenCustomize表单", description = "厨师定制模块表单") |
| | | public class KitchenCustomizeForm extends AbsForm { |
| | | |
| | | @NotNull(message = "商品id不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("商品id") |
| | | private String goodsId; |
| | | |
| | | @NotNull(message = "skuId不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("skuId") |
| | | private String skuId; |
| | | |
| | | @NotBlank(message = "套餐名字不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("套餐名字") |
| | | private String comboName; |
| | | |
| | | @NotBlank(message = "备注不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | @NotBlank(message = "人数不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("人数") |
| | | private String num; |
| | | |
| | | @NotBlank(message = "封面图片不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("封面图片") |
| | | private String coverImg; |
| | | |
| | | @NotNull(message = "原价不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("原价") |
| | | private BigDecimal orginPrice; |
| | | |
| | | @NotNull(message = "标签id不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("标签id") |
| | | private String tagId; |
| | | |
| | | @NotBlank(message = "启用状态不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("启用状态") |
| | | private String status; |
| | | |
| | | @NotNull(message = "排序不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("排序") |
| | | private Integer sort; |
| | | |
| | | public static KitchenCustomize getEntityByForm(@NonNull KitchenCustomizeForm form, KitchenCustomize entity) { |
| | | if(entity == null) { |
| | | entity = new KitchenCustomize(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | |
| | | } |
| 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.KitchenTag; |
| | | import cn.lili.modules.lmk.enums.general.StoreCouponStausEnum; |
| | | 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 peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "KitchenTag表单", description = "私厨定制标签表单") |
| | | public class KitchenTagForm extends AbsForm { |
| | | |
| | | @NotBlank(message = "标签名称不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("标签名称") |
| | | private String tagName; |
| | | |
| | | @NotNull(message = "显示顺序不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("显示顺序") |
| | | private Integer sort; |
| | | |
| | | @NotNull(message = "是否启用", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("是否启用") |
| | | /** |
| | | * @see StoreCouponStausEnum |
| | | */ |
| | | private String enable; |
| | | |
| | | public static KitchenTag getEntityByForm(@NonNull KitchenTagForm form, KitchenTag entity) { |
| | | if(entity == null) { |
| | | entity = new KitchenTag(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | |
| | | } |
| 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 peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "AdCover查询参数", description = "厨师封面图片查询参数") |
| | | public class AdCoverQuery extends AbsQuery { |
| | | } |
| | | |
| 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 peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "AdImg查询参数", description = "私厨定制广告图片查询参数") |
| | | public class AdImgQuery extends AbsQuery { |
| | | } |
| | | |
| New file |
| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import java.util.List; |
| | | |
| | | import cn.lili.modules.lmk.enums.general.StoreCouponStausEnum; |
| | | 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 peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "KitchenCustomize查询参数", description = "厨师定制模块查询参数") |
| | | public class KitchenCustomizeQuery extends AbsQuery { |
| | | /** |
| | | * 分类id |
| | | */ |
| | | private String tagId; |
| | | /** |
| | | * @see StoreCouponStausEnum |
| | | * 启用状态 |
| | | */ |
| | | private String status; |
| | | /** |
| | | * 套餐名字 |
| | | */ |
| | | private String comboName; |
| | | } |
| | | |
| New file |
| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import java.util.List; |
| | | |
| | | import cn.lili.modules.lmk.enums.general.StoreCouponStausEnum; |
| | | 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 peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "KitchenTag查询参数", description = "私厨定制标签查询参数") |
| | | public class KitchenTagQuery extends AbsQuery { |
| | | /** |
| | | * @see StoreCouponStausEnum |
| | | * 启用状态 |
| | | */ |
| | | private String enable; |
| | | /** |
| | | * 分类名称 |
| | | */ |
| | | private String tagName; |
| | | } |
| | | |
| New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | import cn.lili.modules.lmk.domain.entity.AdCover; |
| | | 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 peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "厨师封面图片响应数据", description = "厨师封面图片响应数据") |
| | | public class AdCoverVO extends AbsVo { |
| | | |
| | | /** 图片地址 */ |
| | | @ApiModelProperty("图片地址") |
| | | private String coverUrl; |
| | | |
| | | public static AdCoverVO getVoByEntity(@NonNull AdCover entity, AdCoverVO vo) { |
| | | if(vo == null) { |
| | | vo = new AdCoverVO(); |
| | | } |
| | | 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.AdImg; |
| | | 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 peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "私厨定制广告图片响应数据", description = "私厨定制广告图片响应数据") |
| | | public class AdImgVO extends AbsVo { |
| | | |
| | | /** 排序 */ |
| | | @ApiModelProperty("排序") |
| | | private Integer sort; |
| | | |
| | | /** 打开类型 */ |
| | | @ApiModelProperty("打开类型") |
| | | private String openType; |
| | | |
| | | /** 跳转路径 */ |
| | | @ApiModelProperty("跳转路径") |
| | | private String directUrl; |
| | | |
| | | /** 图片地址 */ |
| | | @ApiModelProperty("图片地址") |
| | | private String coverUrl; |
| | | |
| | | public static AdImgVO getVoByEntity(@NonNull AdImg entity, AdImgVO vo) { |
| | | if(vo == null) { |
| | | vo = new AdImgVO(); |
| | | } |
| | | 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.KitchenCustomize; |
| | | 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.math.BigDecimal; |
| | | |
| | | /** |
| | | * 厨师定制模块展示 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "厨师定制模块响应数据", description = "厨师定制模块响应数据") |
| | | public class KitchenCustomizeVO extends AbsVo { |
| | | |
| | | /** 商品id */ |
| | | @ApiModelProperty("商品id") |
| | | private String goodsId; |
| | | |
| | | /** skuId */ |
| | | @ApiModelProperty("skuId") |
| | | private String skuId; |
| | | |
| | | /** 套餐名字 */ |
| | | @ApiModelProperty("套餐名字") |
| | | private String comboName; |
| | | |
| | | /** 备注 */ |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | /** 人数 */ |
| | | @ApiModelProperty("人数") |
| | | private String num; |
| | | |
| | | /** 封面图片 */ |
| | | @ApiModelProperty("封面图片") |
| | | private String coverImg; |
| | | |
| | | /** 原价 */ |
| | | @ApiModelProperty("原价") |
| | | private BigDecimal orginPrice; |
| | | |
| | | /** 标签id */ |
| | | @ApiModelProperty("标签id") |
| | | private String tagId; |
| | | |
| | | /** 启用状态 */ |
| | | @ApiModelProperty("启用状态") |
| | | private String status; |
| | | |
| | | /** 排序 */ |
| | | @ApiModelProperty("排序") |
| | | private Integer sort; |
| | | |
| | | /** 商品名称 */ |
| | | @ApiModelProperty("商品名称") |
| | | private String goodsName; |
| | | |
| | | /** 价格 */ |
| | | @ApiModelProperty("价格") |
| | | private BigDecimal price; |
| | | |
| | | /** 图片 */ |
| | | @ApiModelProperty("图片") |
| | | private String thumbnail; |
| | | |
| | | public static KitchenCustomizeVO getVoByEntity(@NonNull KitchenCustomize entity, KitchenCustomizeVO vo) { |
| | | if(vo == null) { |
| | | vo = new KitchenCustomizeVO(); |
| | | } |
| | | 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.KitchenTag; |
| | | 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 peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "私厨定制标签响应数据", description = "私厨定制标签响应数据") |
| | | public class KitchenTagVO extends AbsVo { |
| | | |
| | | /** 标签名称 */ |
| | | @ApiModelProperty("标签名称") |
| | | private String tagName; |
| | | |
| | | /** 显示顺序 */ |
| | | @ApiModelProperty("显示顺序") |
| | | private Integer sort; |
| | | |
| | | /** 是否启用 */ |
| | | @ApiModelProperty("是否启用") |
| | | private String enable; |
| | | |
| | | public static KitchenTagVO getVoByEntity(@NonNull KitchenTag entity, KitchenTagVO vo) { |
| | | if(vo == null) { |
| | | vo = new KitchenTagVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | private String des; |
| | | |
| | | public static StoreCouponStausEnum select(String name){ |
| | | for (StoreCouponStausEnum value : StoreCouponStausEnum.values()) { |
| | | if (value.name().equals(name)) { |
| | | return value; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.AdCover; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import cn.lili.modules.lmk.domain.vo.AdCoverVO; |
| | | import cn.lili.modules.lmk.domain.form.AdCoverForm; |
| | | import cn.lili.modules.lmk.domain.query.AdCoverQuery; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 厨师封面图片 Mapper 接口 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Mapper |
| | | public interface AdCoverMapper extends BaseMapper<AdCover> { |
| | | |
| | | /** |
| | | * id查找厨师封面图片 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | AdCoverVO getById(String id); |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | IPage getPage(IPage page, @Param("query") AdCoverQuery query); |
| | | |
| | | } |
| New file |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.AdImg; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import cn.lili.modules.lmk.domain.vo.AdImgVO; |
| | | import cn.lili.modules.lmk.domain.form.AdImgForm; |
| | | import cn.lili.modules.lmk.domain.query.AdImgQuery; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 私厨定制广告图片 Mapper 接口 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Mapper |
| | | public interface AdImgMapper extends BaseMapper<AdImg> { |
| | | |
| | | /** |
| | | * id查找私厨定制广告图片 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | AdImgVO getById(String id); |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | IPage getPage(IPage page, @Param("query") AdImgQuery query); |
| | | |
| | | } |
| New file |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.KitchenCustomize; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import cn.lili.modules.lmk.domain.vo.KitchenCustomizeVO; |
| | | import cn.lili.modules.lmk.domain.form.KitchenCustomizeForm; |
| | | import cn.lili.modules.lmk.domain.query.KitchenCustomizeQuery; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 厨师定制模块 Mapper 接口 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Mapper |
| | | public interface KitchenCustomizeMapper extends BaseMapper<KitchenCustomize> { |
| | | |
| | | /** |
| | | * id查找厨师定制模块 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | KitchenCustomizeVO getById(String id); |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | IPage getPage(IPage page, @Param("query") KitchenCustomizeQuery query); |
| | | |
| | | } |
| New file |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.KitchenTag; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import cn.lili.modules.lmk.domain.vo.KitchenTagVO; |
| | | import cn.lili.modules.lmk.domain.form.KitchenTagForm; |
| | | import cn.lili.modules.lmk.domain.query.KitchenTagQuery; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 私厨定制标签 Mapper 接口 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Mapper |
| | | public interface KitchenTagMapper extends BaseMapper<KitchenTag> { |
| | | |
| | | /** |
| | | * id查找私厨定制标签 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | KitchenTagVO getById(String id); |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | IPage getPage(IPage page, @Param("query") KitchenTagQuery query); |
| | | |
| | | } |
| New file |
| | |
| | | package cn.lili.modules.lmk.service; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.AdCover; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.AdCoverForm; |
| | | import cn.lili.modules.lmk.domain.query.AdCoverQuery; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 厨师封面图片 服务类 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | public interface AdCoverService extends IService<AdCover> { |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result add(AdCoverForm form); |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result update(AdCoverForm form); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | Result remove(List<String> ids); |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result removeById(String id); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result page(AdCoverQuery query); |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result detail(String id); |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | Result all(); |
| | | |
| | | Result getKitchenCover(); |
| | | } |
| New file |
| | |
| | | package cn.lili.modules.lmk.service; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.AdImg; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.AdImgForm; |
| | | import cn.lili.modules.lmk.domain.query.AdImgQuery; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 私厨定制广告图片 服务类 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | public interface AdImgService extends IService<AdImg> { |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result add(AdImgForm form); |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result update(AdImgForm form); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | Result remove(List<String> ids); |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result removeById(String id); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result page(AdImgQuery query); |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result detail(String id); |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | Result all(); |
| | | |
| | | Result getKitchenBanner(); |
| | | } |
| New file |
| | |
| | | package cn.lili.modules.lmk.service; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.KitchenCustomize; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.KitchenCustomizeForm; |
| | | import cn.lili.modules.lmk.domain.query.KitchenCustomizeQuery; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 厨师定制模块 服务类 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | public interface KitchenCustomizeService extends IService<KitchenCustomize> { |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result add(KitchenCustomizeForm form); |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result update(KitchenCustomizeForm form); |
| | | |
| | | Result updateStatus( String id , String status); |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | Result remove(List<String> ids); |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result removeById(String id); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result page(KitchenCustomizeQuery query); |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result detail(String id); |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | Result all(); |
| | | |
| | | Result getKitchenGoods(String id); |
| | | } |
| New file |
| | |
| | | package cn.lili.modules.lmk.service; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.KitchenTag; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.KitchenTagForm; |
| | | import cn.lili.modules.lmk.domain.query.KitchenTagQuery; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 私厨定制标签 服务类 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | public interface KitchenTagService extends IService<KitchenTag> { |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result add(KitchenTagForm form); |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result update(KitchenTagForm form); |
| | | |
| | | Result updateStatus(String id,String status); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | Result remove(List<String> ids); |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result removeById(String id); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result page(KitchenTagQuery query); |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result detail(String id); |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | Result all(); |
| | | |
| | | Result getKitchenTag(); |
| | | } |
| New file |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import cn.lili.common.exception.ServiceException; |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.modules.lmk.domain.entity.AdImg; |
| | | import cn.lili.utils.COSUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.domain.entity.AdCover; |
| | | import cn.lili.modules.lmk.mapper.AdCoverMapper; |
| | | import cn.lili.modules.lmk.service.AdCoverService; |
| | | import cn.lili.base.Result; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import cn.lili.modules.lmk.domain.form.AdCoverForm; |
| | | import cn.lili.modules.lmk.domain.vo.AdCoverVO; |
| | | import cn.lili.modules.lmk.domain.query.AdCoverQuery; |
| | | import org.abego.treelayout.internal.util.java.lang.string.StringUtil; |
| | | 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.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 厨师封面图片 服务实现类 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class AdCoverServiceImpl extends ServiceImpl<AdCoverMapper, AdCover> implements AdCoverService { |
| | | |
| | | private final AdCoverMapper adCoverMapper; |
| | | private final COSUtil cosUtil; |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result add(AdCoverForm form) { |
| | | AdCover entity = AdCoverForm.getEntityByForm(form, null); |
| | | List<AdCover> adCovers = baseMapper.selectList(null); |
| | | if (!adCovers.isEmpty()) { |
| | | throw new ServiceException("已经有封面存在了"); |
| | | } |
| | | baseMapper.insert(entity); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result update(AdCoverForm form) { |
| | | AdCover 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(AdCoverQuery query) { |
| | | IPage<AdCoverVO> page = PageUtil.getPage(query, AdCoverVO.class); |
| | | baseMapper.getPage(page, query); |
| | | for (AdCoverVO record : page.getRecords()) { |
| | | if (StringUtils.isNotBlank(record.getCoverUrl())&&!record.getCoverUrl().contains("http")) { |
| | | record.setCoverUrl(cosUtil.getPreviewUrl(record.getCoverUrl())); |
| | | } |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result detail(String id) { |
| | | AdCoverVO vo = baseMapper.getById(id); |
| | | Assert.notNull(vo, "记录不存在"); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result all() { |
| | | List<AdCover> entities = baseMapper.selectList(null); |
| | | List<AdCoverVO> vos = entities.stream() |
| | | .map(entity -> AdCoverVO.getVoByEntity(entity, null)) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | |
| | | @Override |
| | | public Result getKitchenCover() { |
| | | List<AdCover> adCovers = baseMapper.selectList(null); |
| | | if (adCovers.size()>1) { |
| | | AdCover adImg = adCovers.get(0); |
| | | adCovers = new ArrayList<>(); |
| | | adCovers.add(adImg); |
| | | } |
| | | return Result.ok().data(adCovers); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import cn.lili.common.exception.ServiceException; |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.utils.COSUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.domain.entity.AdImg; |
| | | import cn.lili.modules.lmk.mapper.AdImgMapper; |
| | | import cn.lili.modules.lmk.service.AdImgService; |
| | | import cn.lili.base.Result; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import cn.lili.modules.lmk.domain.form.AdImgForm; |
| | | import cn.lili.modules.lmk.domain.vo.AdImgVO; |
| | | import cn.lili.modules.lmk.domain.query.AdImgQuery; |
| | | import org.abego.treelayout.internal.util.java.lang.string.StringUtil; |
| | | 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.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 私厨定制广告图片 服务实现类 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class AdImgServiceImpl extends ServiceImpl<AdImgMapper, AdImg> implements AdImgService { |
| | | |
| | | private final AdImgMapper adImgMapper; |
| | | private final COSUtil cosUtil; |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result add(AdImgForm form) { |
| | | AdImg entity = AdImgForm.getEntityByForm(form, null); |
| | | List<AdImg> adImgs = baseMapper.selectList(null); |
| | | if (!adImgs.isEmpty()) { |
| | | throw new ServiceException("当前封面有图片了"); |
| | | } |
| | | baseMapper.insert(entity); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result update(AdImgForm form) { |
| | | AdImg 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(AdImgQuery query) { |
| | | IPage<AdImgVO> page = PageUtil.getPage(query, AdImgVO.class); |
| | | baseMapper.getPage(page, query); |
| | | for (AdImgVO record : page.getRecords()) { |
| | | if (StringUtils.isNotBlank(record.getCoverUrl())&&!record.getCoverUrl().contains("http")) { |
| | | record.setCoverUrl(cosUtil.getPreviewUrl(record.getCoverUrl())); |
| | | } |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result detail(String id) { |
| | | AdImgVO vo = baseMapper.getById(id); |
| | | Assert.notNull(vo, "记录不存在"); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result all() { |
| | | List<AdImg> entities = baseMapper.selectList(null); |
| | | List<AdImgVO> vos = entities.stream() |
| | | .map(entity -> AdImgVO.getVoByEntity(entity, null)) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | |
| | | @Override |
| | | public Result getKitchenBanner() { |
| | | List<AdImg> adImgs = baseMapper.selectList(null); |
| | | if (adImgs.size()>1) { |
| | | AdImg adImg = adImgs.get(0); |
| | | adImgs = new ArrayList<>(); |
| | | adImgs.add(adImg); |
| | | } |
| | | return Result.ok().data(adImgs); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import cn.lili.common.exception.ServiceException; |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.modules.lmk.domain.entity.KitchenTag; |
| | | import cn.lili.modules.lmk.domain.vo.AdImgVO; |
| | | import cn.lili.modules.lmk.enums.general.StoreCouponStausEnum; |
| | | import cn.lili.utils.COSUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.domain.entity.KitchenCustomize; |
| | | import cn.lili.modules.lmk.mapper.KitchenCustomizeMapper; |
| | | import cn.lili.modules.lmk.service.KitchenCustomizeService; |
| | | 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.KitchenCustomizeForm; |
| | | import cn.lili.modules.lmk.domain.vo.KitchenCustomizeVO; |
| | | import cn.lili.modules.lmk.domain.query.KitchenCustomizeQuery; |
| | | 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.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 厨师定制模块 服务实现类 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class KitchenCustomizeServiceImpl extends ServiceImpl<KitchenCustomizeMapper, KitchenCustomize> implements KitchenCustomizeService { |
| | | |
| | | private final KitchenCustomizeMapper kitchenCustomizeMapper; |
| | | private final COSUtil cosUtil; |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result add(KitchenCustomizeForm form) { |
| | | KitchenCustomize entity = KitchenCustomizeForm.getEntityByForm(form, null); |
| | | baseMapper.insert(entity); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result update(KitchenCustomizeForm form) { |
| | | KitchenCustomize entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | baseMapper.updateById(entity); |
| | | return Result.ok("修改成功"); |
| | | } |
| | | |
| | | @Override |
| | | public Result updateStatus(String id, String status) { |
| | | if (StoreCouponStausEnum.select(status) == null) { |
| | | throw new ServiceException("当前状态不存在"); |
| | | } |
| | | KitchenCustomize kitchenCustomize = baseMapper.selectById(id); |
| | | if (kitchenCustomize == null) { |
| | | throw new ServiceException("分类不存在"); |
| | | } |
| | | kitchenCustomize.setStatus(status); |
| | | baseMapper.updateById(kitchenCustomize); |
| | | 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(KitchenCustomizeQuery query) { |
| | | IPage<KitchenCustomizeVO> page = PageUtil.getPage(query, KitchenCustomizeVO.class); |
| | | baseMapper.getPage(page, query); |
| | | for (KitchenCustomizeVO record : page.getRecords()) { |
| | | if (StringUtils.isNotBlank(record.getThumbnail())&&!record.getThumbnail().contains("http")) { |
| | | record.setThumbnail(cosUtil.getPreviewUrl(record.getThumbnail())); |
| | | } |
| | | if (StringUtils.isNotBlank(record.getCoverImg())&&!record.getCoverImg().contains("http")) { |
| | | record.setCoverImg(cosUtil.getPreviewUrl(record.getCoverImg())); |
| | | } |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result detail(String id) { |
| | | KitchenCustomizeVO vo = baseMapper.getById(id); |
| | | Assert.notNull(vo, "记录不存在"); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result all() { |
| | | List<KitchenCustomize> entities = baseMapper.selectList(null); |
| | | List<KitchenCustomizeVO> vos = entities.stream() |
| | | .map(entity -> KitchenCustomizeVO.getVoByEntity(entity, null)) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | |
| | | @Override |
| | | public Result getKitchenGoods(String id) { |
| | | if (StringUtils.isBlank(id)) { |
| | | return Result.ok().data(new ArrayList<>()); |
| | | } |
| | | // kitchenCustomizeMapper.getKitchenGoods(); |
| | | return null; |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import cn.lili.common.exception.ServiceException; |
| | | import cn.lili.modules.lmk.enums.general.StoreCouponStausEnum; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.domain.entity.KitchenTag; |
| | | import cn.lili.modules.lmk.mapper.KitchenTagMapper; |
| | | import cn.lili.modules.lmk.service.KitchenTagService; |
| | | 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.KitchenTagForm; |
| | | import cn.lili.modules.lmk.domain.vo.KitchenTagVO; |
| | | import cn.lili.modules.lmk.domain.query.KitchenTagQuery; |
| | | 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 peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class KitchenTagServiceImpl extends ServiceImpl<KitchenTagMapper, KitchenTag> implements KitchenTagService { |
| | | |
| | | private final KitchenTagMapper kitchenTagMapper; |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result add(KitchenTagForm form) { |
| | | if (StoreCouponStausEnum.select(form.getEnable()) == null) { |
| | | throw new ServiceException("当前状态不存在"); |
| | | } |
| | | KitchenTag entity = KitchenTagForm.getEntityByForm(form, null); |
| | | baseMapper.insert(entity); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result update(KitchenTagForm form) { |
| | | if (StoreCouponStausEnum.select(form.getEnable()) == null) { |
| | | throw new ServiceException("当前状态不存在"); |
| | | } |
| | | KitchenTag entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | baseMapper.updateById(entity); |
| | | return Result.ok("修改成功"); |
| | | } |
| | | |
| | | @Override |
| | | public Result updateStatus(String id, String status) { |
| | | if (StoreCouponStausEnum.select(status) == null) { |
| | | throw new ServiceException("当前状态不存在"); |
| | | } |
| | | KitchenTag entity = baseMapper.selectById(id); |
| | | if (entity == null) { |
| | | throw new ServiceException("分类不存在"); |
| | | } |
| | | entity.setEnable(status); |
| | | 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(KitchenTagQuery query) { |
| | | IPage<KitchenTagVO> page = PageUtil.getPage(query, KitchenTagVO.class); |
| | | baseMapper.getPage(page, query); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result detail(String id) { |
| | | KitchenTagVO vo = baseMapper.getById(id); |
| | | Assert.notNull(vo, "记录不存在"); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result all() { |
| | | List<KitchenTag> entities = baseMapper.selectList(null); |
| | | List<KitchenTagVO> vos = entities.stream() |
| | | .map(entity -> KitchenTagVO.getVoByEntity(entity, null)) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | |
| | | @Override |
| | | public Result getKitchenTag() { |
| | | LambdaQueryWrapper<KitchenTag> query = Wrappers.<KitchenTag>lambdaQuery().eq(KitchenTag::getEnable, StoreCouponStausEnum.ENABLE.name()) |
| | | .orderByAsc(KitchenTag::getSort); |
| | | List<KitchenTag> kitchenTags = baseMapper.selectList(query); |
| | | return Result.ok().data(kitchenTags); |
| | | } |
| | | } |
| 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.AdCoverMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.AdCoverVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="cover_url" property="coverUrl" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <select id="getById" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LAC.cover_url, |
| | | LAC.id |
| | | FROM |
| | | lmk_ad_cover LAC |
| | | WHERE |
| | | LAC.id = #{id} AND LAC.delete_flag = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="getPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LAC.cover_url, |
| | | LAC.id |
| | | FROM |
| | | lmk_ad_cover LAC |
| | | WHERE |
| | | LAC.delete_flag = 0 |
| | | </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.AdImgMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.AdImgVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="sort" property="sort" /> |
| | | <result column="open_type" property="openType" /> |
| | | <result column="direct_url" property="directUrl" /> |
| | | <result column="cover_url" property="coverUrl" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <select id="getById" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LAI.sort, |
| | | LAI.open_type, |
| | | LAI.direct_url, |
| | | LAI.cover_url, |
| | | LAI.id |
| | | FROM |
| | | lmk_ad_img LAI |
| | | WHERE |
| | | LAI.id = #{id} AND LAI.delete_flag = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="getPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LAI.sort, |
| | | LAI.open_type, |
| | | LAI.direct_url, |
| | | LAI.cover_url, |
| | | LAI.id |
| | | FROM |
| | | lmk_ad_img LAI |
| | | WHERE |
| | | LAI.delete_flag = 0 |
| | | </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.KitchenCustomizeMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.KitchenCustomizeVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="goods_id" property="goodsId" /> |
| | | <result column="sku_id" property="skuId" /> |
| | | <result column="combo_name" property="comboName" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="num" property="num" /> |
| | | <result column="cover_img" property="coverImg" /> |
| | | <result column="orgin_price" property="orginPrice" /> |
| | | <result column="tag_id" property="tagId" /> |
| | | <result column="status" property="status" /> |
| | | <result column="sort" property="sort" /> |
| | | <result column="goods_name" property="goodsName" /> |
| | | <result column="price" property="price" /> |
| | | <result column="thumbnail" property="thumbnail" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <select id="getById" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LKC.goods_id, |
| | | LKC.sku_id, |
| | | LKC.combo_name, |
| | | LKC.remark, |
| | | LKC.num, |
| | | LKC.cover_img, |
| | | LKC.orgin_price, |
| | | LKC.tag_id, |
| | | LKC.status, |
| | | LKC.sort, |
| | | LKC.id |
| | | FROM |
| | | lmk_kitchen_customize LKC |
| | | WHERE |
| | | LKC.id = #{id} AND LKC.delete_flag = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="getPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LKC.goods_id, |
| | | LKC.sku_id, |
| | | LKC.combo_name, |
| | | LKC.remark, |
| | | LKC.num, |
| | | LKC.cover_img, |
| | | LKC.orgin_price, |
| | | LKC.tag_id, |
| | | LKC.STATUS, |
| | | LKC.sort, |
| | | LKC.id, |
| | | lgs.goods_name, |
| | | lgs.price, |
| | | lgs.thumbnail |
| | | FROM |
| | | lmk_kitchen_customize LKC JOIN li_goods_sku lgs ON lgs.id = LKC.sku_id AND lgs.delete_flag = 0 |
| | | WHERE |
| | | LKC.delete_flag = 0 |
| | | <if test="query.comboName !='' and query.comboName != null"> |
| | | and LKC.combo_name like concat('%',#{query.comboName},'%') |
| | | </if> |
| | | <if test="query.status !='' and query.status != null"> |
| | | and LKC.STATUS = #{query.status} |
| | | </if> |
| | | <if test="query.tagId !='' and query.tagId != null"> |
| | | and LKC.tag_id = #{query.tagId} |
| | | </if> |
| | | order by LKC.create_time desc |
| | | </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.KitchenTagMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.KitchenTagVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="tag_name" property="tagName" /> |
| | | <result column="sort" property="sort" /> |
| | | <result column="enable" property="enable" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <select id="getById" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LKT.tag_name, |
| | | LKT.sort, |
| | | LKT.id |
| | | FROM |
| | | lmk_kitchen_tag LKT |
| | | WHERE |
| | | LKT.id = #{id} AND LKT.delete_flag = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="getPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LKT.tag_name, |
| | | LKT.sort, |
| | | LKT.id, |
| | | LKT.enable |
| | | FROM |
| | | lmk_kitchen_tag LKT |
| | | WHERE |
| | | LKT.delete_flag = 0 |
| | | <if test="query.enable != '' and query.enable !=null"> |
| | | and LKT.enable = #{query.enable} |
| | | </if> |
| | | <if test="query.tagName != '' and query.tagName !=null"> |
| | | and LKT.tag_name like concat('%',#{query.tagName},'%') |
| | | </if> |
| | | order by LKT.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | import cn.lili.group.Update; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.modules.lmk.service.AdCoverService; |
| | | 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.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.AdCoverForm; |
| | | import cn.lili.modules.lmk.domain.query.AdCoverQuery; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * 厨师封面图片 前端控制器 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "厨师封面图片", tags = "厨师封面图片管理") |
| | | @RestController |
| | | @RequestMapping("/manager/lmk/ad-cover") |
| | | public class AdCoverController { |
| | | |
| | | private final AdCoverService adCoverService; |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "添加", notes = "添加") |
| | | public Result add(@RequestBody @Validated(Add.class) AdCoverForm form) { |
| | | return adCoverService.add(form); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public Result update(@RequestBody @Validated(Update.class) AdCoverForm form) { |
| | | return adCoverService.update(form); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation(value = "ID删除", notes = "ID删除") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | return adCoverService.removeById(id); |
| | | } |
| | | |
| | | @DeleteMapping("/batch") |
| | | @ApiOperation(value = "批量删除", notes = "批量删除") |
| | | public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) { |
| | | return adCoverService.remove(ids); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @ApiOperation(value = "分页", notes = "分页") |
| | | public Result page(AdCoverQuery query) { |
| | | return adCoverService.page(query); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | public Result detail(@PathVariable("id") String id) { |
| | | return adCoverService.detail(id); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "列表", notes = "列表") |
| | | public Result list() { |
| | | return adCoverService.all(); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | import cn.lili.group.Update; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.modules.lmk.service.AdImgService; |
| | | 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.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.AdImgForm; |
| | | import cn.lili.modules.lmk.domain.query.AdImgQuery; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * 私厨定制广告图片 前端控制器 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "私厨定制广告图片", tags = "私厨定制广告图片管理") |
| | | @RestController |
| | | @RequestMapping("/manager/lmk/ad-img") |
| | | public class AdImgController { |
| | | |
| | | private final AdImgService adImgService; |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "添加", notes = "添加") |
| | | public Result add(@RequestBody @Validated(Add.class) AdImgForm form) { |
| | | return adImgService.add(form); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public Result update(@RequestBody @Validated(Update.class) AdImgForm form) { |
| | | return adImgService.update(form); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation(value = "ID删除", notes = "ID删除") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | return adImgService.removeById(id); |
| | | } |
| | | |
| | | @DeleteMapping("/batch") |
| | | @ApiOperation(value = "批量删除", notes = "批量删除") |
| | | public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) { |
| | | return adImgService.remove(ids); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @ApiOperation(value = "分页", notes = "分页") |
| | | public Result page(AdImgQuery query) { |
| | | return adImgService.page(query); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | public Result detail(@PathVariable("id") String id) { |
| | | return adImgService.detail(id); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "列表", notes = "列表") |
| | | public Result list() { |
| | | return adImgService.all(); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | import cn.lili.group.Update; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.modules.lmk.service.KitchenCustomizeService; |
| | | 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.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.KitchenCustomizeForm; |
| | | import cn.lili.modules.lmk.domain.query.KitchenCustomizeQuery; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * 厨师定制模块 前端控制器 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "厨师定制模块", tags = "厨师定制模块管理") |
| | | @RestController |
| | | @RequestMapping("/manager/lmk/kitchen-customize") |
| | | public class KitchenCustomizeController { |
| | | |
| | | private final KitchenCustomizeService kitchenCustomizeService; |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "添加", notes = "添加") |
| | | public Result add(@RequestBody @Validated(Add.class) KitchenCustomizeForm form) { |
| | | return kitchenCustomizeService.add(form); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public Result update(@RequestBody @Validated(Update.class) KitchenCustomizeForm form) { |
| | | return kitchenCustomizeService.update(form); |
| | | } |
| | | @PutMapping("/{id}/{status}") |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public Result updateStatus(@PathVariable String id ,@PathVariable String status) { |
| | | return kitchenCustomizeService.updateStatus(id,status); |
| | | } |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation(value = "ID删除", notes = "ID删除") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | return kitchenCustomizeService.removeById(id); |
| | | } |
| | | |
| | | @DeleteMapping("/batch") |
| | | @ApiOperation(value = "批量删除", notes = "批量删除") |
| | | public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) { |
| | | return kitchenCustomizeService.remove(ids); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @ApiOperation(value = "分页", notes = "分页") |
| | | public Result page(KitchenCustomizeQuery query) { |
| | | return kitchenCustomizeService.page(query); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | public Result detail(@PathVariable("id") String id) { |
| | | return kitchenCustomizeService.detail(id); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "列表", notes = "列表") |
| | | public Result list() { |
| | | return kitchenCustomizeService.all(); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | import cn.lili.group.Update; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.modules.lmk.service.KitchenTagService; |
| | | 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.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.KitchenTagForm; |
| | | import cn.lili.modules.lmk.domain.query.KitchenTagQuery; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * 私厨定制标签 前端控制器 |
| | | * |
| | | * @author peng |
| | | * @since 2025-12-24 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "私厨定制标签", tags = "私厨定制标签管理") |
| | | @RestController |
| | | @RequestMapping("/manager/lmk/kitchen-tag") |
| | | public class KitchenTagController { |
| | | |
| | | private final KitchenTagService kitchenTagService; |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "添加", notes = "添加") |
| | | public Result add(@RequestBody @Validated(Add.class) KitchenTagForm form) { |
| | | return kitchenTagService.add(form); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public Result update(@RequestBody @Validated(Update.class) KitchenTagForm form) { |
| | | return kitchenTagService.update(form); |
| | | } |
| | | @PutMapping("/{id}/{status}") |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public Result update(@PathVariable String id ,@PathVariable String status) { |
| | | return kitchenTagService.updateStatus(id,status); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation(value = "ID删除", notes = "ID删除") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | return kitchenTagService.removeById(id); |
| | | } |
| | | |
| | | @DeleteMapping("/batch") |
| | | @ApiOperation(value = "批量删除", notes = "批量删除") |
| | | public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) { |
| | | return kitchenTagService.remove(ids); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @ApiOperation(value = "分页", notes = "分页") |
| | | public Result page(KitchenTagQuery query) { |
| | | return kitchenTagService.page(query); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | public Result detail(@PathVariable("id") String id) { |
| | | return kitchenTagService.detail(id); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "列表", notes = "列表") |
| | | public Result list() { |
| | | return kitchenTagService.all(); |
| | | } |
| | | } |