Merge remote-tracking branch 'origin/dev' into dev
26个文件已修改
13个文件已添加
2 文件已复制
3 文件已重命名
4个文件已删除
| | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.group.Update; |
| | | import cn.lili.modules.lmk.domain.form.CustomerTagForm; |
| | | import cn.lili.modules.lmk.domain.form.MemberTagForm; |
| | | import cn.lili.modules.lmk.domain.form.CustomerTagRefForm; |
| | | import cn.lili.modules.lmk.domain.query.CustomerQuery; |
| | | import cn.lili.modules.lmk.domain.query.CustomerTagQuery; |
| | | import cn.lili.modules.lmk.service.CustomerService; |
| | | import cn.lili.modules.lmk.service.CustomerTagRefService; |
| | | import cn.lili.modules.lmk.service.CustomerTagService; |
| | | import cn.lili.modules.lmk.service.MemberTagService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | public class CustomerController { |
| | | |
| | | private final CustomerService customerService; |
| | | private final CustomerTagService customerTagService; |
| | | private final MemberTagService memberTagService; |
| | | private final CustomerTagRefService customerTagRefService; |
| | | |
| | | @ApiOperation(value = "商铺下拉列表") |
| | |
| | | |
| | | @PostMapping("/addTag") |
| | | @ApiOperation(value = "添加标签", notes = "添加标签") |
| | | public Result add(@RequestBody @Validated(Add.class) CustomerTagForm form) { |
| | | return customerTagService.add(form); |
| | | public Result add(@RequestBody @Validated(Add.class) MemberTagForm form) { |
| | | return memberTagService.add(form); |
| | | } |
| | | |
| | | @PutMapping("/editTag") |
| | | @ApiOperation(value = "修改标签", notes = "修改标签") |
| | | public Result update(@RequestBody @Validated(Update.class) CustomerTagForm form) { |
| | | return customerTagService.update(form); |
| | | public Result update(@RequestBody @Validated(Update.class) MemberTagForm form) { |
| | | return memberTagService.update(form); |
| | | } |
| | | |
| | | @DeleteMapping("/tag/{id}") |
| | | @ApiOperation(value = "ID删除标签", notes = "ID删除") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | return customerTagService.removeById(id); |
| | | return memberTagService.removeById(id); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/tagList") |
| | | @ApiOperation(value = "标签列表", notes = "标签列表") |
| | | public Result list() { |
| | | return customerTagService.all(); |
| | | return memberTagService.all(); |
| | | } |
| | | @GetMapping("/pageTagList") |
| | | @ApiOperation(value = "分页标签列表", notes = "标签列表") |
| | | public Result pageList(CustomerTagQuery query) { |
| | | return customerTagService.page(query); |
| | | return memberTagService.page(query); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/customerAddTag") |
| | | @ApiOperation(value = "添加客户标签标识", notes = "添加客户标签标识") |
| | | public Result addCustomerTag(@RequestBody @Validated(Add.class) CustomerTagForm form) { |
| | | return customerTagService.addCustomerTag(form); |
| | | public Result addCustomerTag(@RequestBody @Validated(Add.class) MemberTagForm form) { |
| | | return memberTagService.addMemberTag(form); |
| | | } |
| | | |
| | | // @PostMapping("/customerAddTag") |
| | |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @ApiOperation(value = "分页", notes = "分页") |
| | | @ApiOperation(value = "我的关注用户分页", notes = "我的关注用户分页") |
| | | public Result page(MySubscribeQuery query) { |
| | | return mySubscribeService.page(query); |
| | | } |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | import cn.lili.group.Update; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.group.Update; |
| | | import cn.lili.modules.lmk.domain.form.ThumbsUpRecordForm; |
| | | import cn.lili.modules.lmk.domain.form.VideoFootPrintForm; |
| | | import cn.lili.modules.lmk.domain.form.VideoHomePageInfoForm; |
| | | import cn.lili.modules.lmk.domain.form.WxVideoForm; |
| | | import cn.lili.modules.lmk.domain.query.*; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import lombok.RequiredArgsConstructor; |
| | | import java.util.List; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import cn.lili.modules.lmk.service.VideoService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import cn.lili.modules.lmk.service.VideoService; |
| | | import cn.lili.base.Result; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 视频内容 前端控制器 |
| | |
| | | public Result esSearch(VideoEsQuery query) { |
| | | return videoService.esSearch(query); |
| | | } |
| | | |
| | | @PostMapping("/goods/similarly") |
| | | @ApiOperation(value = "挂相同商品的视频", notes = "挂相同商品的视频") |
| | | public Result goodsSimilarly(@RequestBody VideoQuery query) { |
| | | return videoService.recommendVideo(query); |
| | | } |
| | | |
| | | @GetMapping("/history") |
| | | @ApiOperation(value = "获取历史播放记录") |
| | | public Result getHistoryPage(VideoHistoryQuery query) { |
| | | return videoService.getHistoryPage(query); |
| | | } |
| | | } |
| | |
| | | import cn.lili.common.enums.ResultUtil; |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.common.vo.PageVO; |
| | | import cn.lili.common.vo.ResultMessage; |
| | | import cn.lili.modules.member.entity.dto.FootPrintQueryParams; |
| | | import cn.lili.modules.member.service.FootprintService; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.catalina.User; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private COSUtil cosUtil; |
| | | |
| | | @ApiOperation(value = "分页获取") |
| | | @GetMapping |
| | | public ResultMessage<IPage<EsGoodsIndex>> getByPage(FootPrintQueryParams params) { |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "根据id删除") |
| | | @ApiImplicitParam(name = "ids", value = "商品ID", required = true, allowMultiple = true, dataType = "String", paramType = "path") |
| | | @DeleteMapping(value = "/delByIds/{ids}") |
| | | public ResultMessage<Object> delAllByIds(@NotNull(message = "商品ID不能为空") @PathVariable("ids") List ids) { |
| | | footprintService.deleteByIds(ids); |
| | | @ApiImplicitParam(name = "ids", value = "关联ID", required = true, allowMultiple = true, dataType = "String", paramType = "path") |
| | | @DeleteMapping(value = "/delByIds/{viewType}/{ids}") |
| | | public ResultMessage<Object> delAllByIds(@NotNull(message = "关联ID不能为空") @PathVariable("ids") List ids, @PathVariable("viewType") String viewType) { |
| | | footprintService.deleteByIds(ids, viewType); |
| | | return ResultUtil.success(); |
| | | |
| | | } |
| | |
| | | user.setUsername(UuidUtils.getUUID()); |
| | | user.setNickName("微信用户"); |
| | | user.setPassword(DEFAULT_PASSWORD); |
| | | user.setFace("https://i.loli.net/2020/11/19/LyN6JF7zZRskdIe.png"); |
| | | user.setFace(""); |
| | | user.setDisabled(Boolean.TRUE); |
| | | memberService.registerHandler(user); |
| | | } |
| | | |
File was renamed from framework/src/main/java/cn/lili/modules/lmk/domain/entity/CustomerTag.java |
| | |
| | | import cn.lili.mybatis.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.time.LocalDateTime; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author zxl |
| | | * @since 2025-05-14 |
| | | */ |
| | | @Data |
| | | @TableName("lmk_customer_tag") |
| | | public class CustomerTag extends BaseEntity { |
| | | @TableName("lmk_goods_tag") |
| | | public class GoodsTag extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField("tag_id") |
| | | private String tagId; |
| | | |
| | | @TableField("goods_id") |
| | | private String goodsId; |
| | | |
| | | @TableField("tag_name") |
| | | /** 标签名称*/ |
| | | private String tagName; |
copy from framework/src/main/java/cn/lili/modules/lmk/domain/entity/CustomerTag.java
copy to framework/src/main/java/cn/lili/modules/lmk/domain/entity/MemberTag.java
File was copied from framework/src/main/java/cn/lili/modules/lmk/domain/entity/CustomerTag.java |
| | |
| | | import cn.lili.mybatis.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.time.LocalDateTime; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author zxl |
| | | * @since 2025-05-14 |
| | | */ |
| | | @Data |
| | | @TableName("lmk_customer_tag") |
| | | public class CustomerTag extends BaseEntity { |
| | | @TableName("lmk_member_tag") |
| | | public class MemberTag extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField("tag_id") |
| | | private String tagId; |
| | | |
| | | @TableField("member_id") |
| | | private String memberId; |
| | | |
| | | @TableField("tag_name") |
| | | /** 标签名称*/ |
| | | private String tagName; |
| | |
| | | @ApiModelProperty("文件原始名") |
| | | private String originalFileName; |
| | | |
| | | private String url; |
| | | |
| | | private String cover; |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.form; |
| | | |
| | | import cn.lili.base.AbsForm; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.group.Update; |
| | | import cn.lili.modules.lmk.domain.entity.GoodsTag; |
| | | import cn.lili.modules.lmk.domain.entity.MemberTag; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.lang.NonNull; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 表单 |
| | | * |
| | | * @author zxl |
| | | * @since 2025-05-14 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "GoodsTag表单", description = "表单") |
| | | public class GoodsTagForm extends AbsForm { |
| | | |
| | | @NotBlank(message = "不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("标签Id") |
| | | private List<String> tagIds; |
| | | |
| | | |
| | | @NotBlank(message = "不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("") |
| | | private String createType; |
| | | |
| | | |
| | | /** |
| | | * 客户id |
| | | */ |
| | | @ApiModelProperty("商品id") |
| | | private String goodsId; |
| | | |
| | | public static GoodsTag getEntityByForm(@NonNull GoodsTagForm form, GoodsTag entity) { |
| | | if (entity == null) { |
| | | entity = new GoodsTag(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.form; |
| | | |
| | | import cn.lili.base.AbsForm; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.group.Update; |
| | | import cn.lili.modules.lmk.domain.entity.MemberTag; |
| | | import org.springframework.beans.BeanUtils; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | import org.springframework.lang.NonNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 表单 |
| | | * |
| | | * @author zxl |
| | | * @since 2025-05-14 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "MemberTag表单", description = "表单") |
| | | public class MemberTagForm extends AbsForm { |
| | | |
| | | @NotBlank(message = "不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("标签Id") |
| | | private List<String> tagIds; |
| | | |
| | | |
| | | @NotBlank(message = "不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("") |
| | | private String createType; |
| | | |
| | | |
| | | /** |
| | | * 客户id |
| | | */ |
| | | @ApiModelProperty("客户id") |
| | | private String memberId; |
| | | |
| | | public static MemberTag getEntityByForm(@NonNull MemberTagForm form, MemberTag entity) { |
| | | if (entity == null) { |
| | | entity = new MemberTag(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author:xp |
| | | * @date:2025/7/2 10:08 |
| | | */ |
| | | @Data |
| | | @ApiModel("相同商品视频") |
| | | public class GoodsSimilarlyQuery extends AbsQuery { |
| | | |
| | | // TODO 查询挂了同一商品的视频不应该区分是推荐视频还是大健康,该字段只是先写在这,暂时不用 |
| | | @ApiModelProperty("视频类型") |
| | | private String videoType; |
| | | |
| | | @ApiModelProperty("商品id,这里用商品id而不是skuId") |
| | | private List<String> goodsIds; |
| | | |
| | | @ApiModelProperty("当前的视频id,查询时直接排除该视频") |
| | | private String currentVideoId; |
| | | } |
| | |
| | | @ApiModelProperty("标签分类") |
| | | private String tagTypeId; |
| | | |
| | | @ApiModelProperty("标签类别key") |
| | | private String tagTypeKey; |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 视频标签查询 |
| | | * |
| | | * @author xp |
| | | * @since 2025-05-13 |
| | | */ |
| | | @Data |
| | | public class VideoHistoryQuery extends AbsQuery { |
| | | |
| | | private String userId; |
| | | |
| | | } |
| | | |
| | |
| | | @ApiModel(value = "Video查询参数", description = "视频内容查询参数") |
| | | public class VideoQuery extends AbsQuery { |
| | | |
| | | /* ----------------------------- author某作者的视频、collect某作者收藏的视频、like某作者点赞的视频 ------------------------------- */ |
| | | @ApiModelProperty("作者id") |
| | | private String authorId; |
| | | |
| | | @ApiModelProperty("视频来源:recommend推荐、author某作者的视频、collect某作者收藏的视频、like某作者点赞的视频") |
| | | @ApiModelProperty("视频来源:recommend推荐、author某作者的视频、collect某作者收藏的视频、like某作者点赞的视频、search搜索、goodsSimilarly查挂同一商品的视频") |
| | | private String videoFrom; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * @see cn.lili.modules.lmk.enums.general.VideoTypeEnum |
| | |
| | | @ApiModelProperty("视频类型:视频、大健康、神厨,默认不传查视频") |
| | | private String videoType = VideoTypeEnum.VIDEO.getValue(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /* ----------------------------- search搜索 ------------------------------- */ |
| | | @ApiModelProperty("搜索视频的关键词") |
| | | private String keyword; |
| | | |
| | | /* ----------------------------- goodsSimilarly查挂同一商品的视频 ------------------------------- */ |
| | | @ApiModelProperty("商品id,这里用商品id而不是skuId") |
| | | private List<String> goodsIds; |
| | | |
| | | @ApiModelProperty("当前的视频id,查询时直接排除该视频") |
| | | private String currentVideoId; |
| | | } |
| | | |
copy from framework/src/main/java/cn/lili/modules/lmk/domain/vo/CustomerTagVO.java
copy to framework/src/main/java/cn/lili/modules/lmk/domain/vo/GoodsTagVO.java
File was copied from framework/src/main/java/cn/lili/modules/lmk/domain/vo/CustomerTagVO.java |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.CustomerTag; |
| | | import org.springframework.lang.NonNull; |
| | | import org.springframework.beans.BeanUtils; |
| | | import cn.lili.modules.lmk.domain.entity.MemberTag; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.lang.NonNull; |
| | | |
| | | /** |
| | | * 展示 |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "响应数据", description = "响应数据") |
| | | public class CustomerTagVO extends AbsVo { |
| | | public class GoodsTagVO extends AbsVo { |
| | | |
| | | /** */ |
| | | @ApiModelProperty("标签Id") |
| | | private String tagId; |
| | | |
| | | @ApiModelProperty("客户id") |
| | | private String goodsId; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("标签名称") |
| | | private String tagName; |
| | | |
| | | /** */ |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("创建方式") |
| | | private String createType; |
| | | |
| | | |
| | | |
| | | public static CustomerTagVO getVoByEntity(@NonNull CustomerTag entity, CustomerTagVO vo) { |
| | | if(vo == null) { |
| | | vo = new CustomerTagVO(); |
| | | public static GoodsTagVO getVoByEntity(@NonNull MemberTag entity, GoodsTagVO vo) { |
| | | if (vo == null) { |
| | | vo = new GoodsTagVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
File was renamed from framework/src/main/java/cn/lili/modules/lmk/domain/vo/CustomerTagVO.java |
| | |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.CustomerTag; |
| | | import cn.lili.modules.lmk.domain.entity.MemberTag; |
| | | 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; |
| | | |
| | | /** |
| | | * 展示 |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "响应数据", description = "响应数据") |
| | | public class CustomerTagVO extends AbsVo { |
| | | public class MemberTagVO extends AbsVo { |
| | | |
| | | /** */ |
| | | @ApiModelProperty("标签Id") |
| | | private String tagId; |
| | | |
| | | @ApiModelProperty("客户id") |
| | | private String memberId; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("标签名称") |
| | | private String tagName; |
| | | |
| | | /** */ |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("创建方式") |
| | | private String createType; |
| | | |
| | | |
| | | |
| | | public static CustomerTagVO getVoByEntity(@NonNull CustomerTag entity, CustomerTagVO vo) { |
| | | if(vo == null) { |
| | | vo = new CustomerTagVO(); |
| | | public static MemberTagVO getVoByEntity(@NonNull MemberTag entity, MemberTagVO vo) { |
| | | if (vo == null) { |
| | | vo = new MemberTagVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author:xp |
| | | * @date:2025/7/4 17:43 |
| | | */ |
| | | @Data |
| | | @ApiModel("视频播放记录") |
| | | public class VideoHistoryVO extends WxVideoVO { |
| | | |
| | | @ApiModelProperty("历史记录id") |
| | | private String historyId; |
| | | |
| | | @ApiModelProperty("播放至") |
| | | private String playAt; |
| | | |
| | | @ApiModelProperty("观看日期") |
| | | private Date playTime; |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.GoodsTag; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * Mapper 接口 |
| | | * |
| | | * @author zxl |
| | | * @since 2025-05-14 |
| | | */ |
| | | @Mapper |
| | | public interface GoodsTagMapper extends BaseMapper<GoodsTag> { |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.MemberTag; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * Mapper 接口 |
| | | * |
| | | * @author zxl |
| | | * @since 2025-05-14 |
| | | */ |
| | | @Mapper |
| | | public interface MemberTagMapper extends BaseMapper<MemberTag> { |
| | | |
| | | } |
| | |
| | | IPage managerPage(IPage page, @Param("query") ManagerVideoQuery query); |
| | | |
| | | /** |
| | | * 查出5个推荐视频 |
| | | * 查推荐视频 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | * @return |
| | | */ |
| | | List<VideoIndex> getEsPage(@Param("start") int start, @Param("pageSize") int pageSize); |
| | | |
| | | /** |
| | | * 查询挂了同一商品的视频 |
| | | * |
| | | * @param page |
| | | * @param goodsSimilarlyQuery |
| | | */ |
| | | IPage goodsSimilarlyPage(IPage page, @Param("query") GoodsSimilarlyQuery goodsSimilarlyQuery); |
| | | |
| | | /** |
| | | * 获取播放记录 |
| | | * |
| | | * @param page |
| | | * @param query |
| | | * @return |
| | | */ |
| | | IPage getHistoryPage(IPage page, @Param("query") VideoHistoryQuery query); |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.entity.GoodsTag; |
| | | import cn.lili.modules.lmk.domain.form.GoodsTagForm; |
| | | import cn.lili.modules.lmk.domain.query.CustomerTagQuery; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 服务类 |
| | | * |
| | | * @author zxl |
| | | * @since 2025-05-14 |
| | | */ |
| | | public interface GoodsTagService extends IService<GoodsTag> { |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result addGoodsTag(GoodsTagForm form); |
| | | |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | Result remove(List<String> ids); |
| | | |
| | | /** |
| | | * id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result removeById(String id); |
| | | |
| | | |
| | | /** |
| | | * 列表 |
| | | * |
| | | * @return |
| | | */ |
| | | Result getByGoodsId(String goodsId); |
| | | } |
File was renamed from framework/src/main/java/cn/lili/modules/lmk/service/CustomerTagService.java |
| | |
| | | package cn.lili.modules.lmk.service; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.entity.CustomerTag; |
| | | import cn.lili.modules.lmk.domain.form.CustomerTagForm; |
| | | import cn.lili.modules.lmk.domain.entity.MemberTag; |
| | | import cn.lili.modules.lmk.domain.form.MemberTagForm; |
| | | import cn.lili.modules.lmk.domain.query.CustomerTagQuery; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 服务类 |
| | | * 服务类 |
| | | * |
| | | * @author zxl |
| | | * @since 2025-05-14 |
| | | */ |
| | | public interface CustomerTagService extends IService<CustomerTag> { |
| | | public interface MemberTagService extends IService<MemberTag> { |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result add(CustomerTagForm form); |
| | | Result add(MemberTagForm form); |
| | | |
| | | /** |
| | | * 修改 |
| | | * |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result update(CustomerTagForm form); |
| | | Result update(MemberTagForm form); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result page(CustomerTagQuery query); |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result detail(Integer id); |
| | | |
| | | /** |
| | | * 列表 |
| | | * |
| | | * @return |
| | | */ |
| | | Result all(); |
| | | |
| | | Result addCustomerTag(CustomerTagForm form); |
| | | Result addMemberTag(MemberTagForm form); |
| | | |
| | | Result getByMemberId(String memberId); |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | Result esSearch(VideoEsQuery query); |
| | | |
| | | /** |
| | | * 获取播放记录 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result getHistoryPage(VideoHistoryQuery query); |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.entity.GoodsTag; |
| | | import cn.lili.modules.lmk.domain.entity.Tag; |
| | | import cn.lili.modules.lmk.domain.form.GoodsTagForm; |
| | | import cn.lili.modules.lmk.domain.query.CustomerTagQuery; |
| | | import cn.lili.modules.lmk.domain.vo.MemberTagVO; |
| | | import cn.lili.modules.lmk.mapper.GoodsTagMapper; |
| | | import cn.lili.modules.lmk.service.GoodsTagService; |
| | | import cn.lili.modules.lmk.service.TagService; |
| | | import cn.lili.utils.PageUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | | * |
| | | * @author zxl |
| | | * @since 2025-05-14 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class GoodsTagServiceImpl extends ServiceImpl<GoodsTagMapper, GoodsTag> implements GoodsTagService { |
| | | |
| | | private final TagService tagService; |
| | | |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @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("删除成功"); |
| | | } |
| | | |
| | | @Override |
| | | public Result getByGoodsId(String goodsId) { |
| | | LambdaQueryWrapper<GoodsTag> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(GoodsTag::getGoodsId, goodsId); |
| | | return Result.ok().data(baseMapper.selectList(queryWrapper)); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Result addGoodsTag(GoodsTagForm form) { |
| | | LambdaQueryWrapper<Tag> query = new LambdaQueryWrapper<>(); |
| | | query.in(Tag::getId, form.getTagIds()); |
| | | List<Tag> tags = tagService.list(query); |
| | | List<GoodsTag> GoodsTags = tags.stream().map(tag -> { |
| | | GoodsTag GoodsTag = new GoodsTag(); |
| | | GoodsTag.setTagId(tag.getId()); |
| | | GoodsTag.setGoodsId(form.getGoodsId()); |
| | | GoodsTag.setTagName(tag.getTagName()); |
| | | GoodsTag.setCreateType(form.getCreateType()); |
| | | return GoodsTag; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | this.saveBatch(GoodsTags); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | |
| | | public Result delCustomerTag(String id) { |
| | | |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.entity.MemberTag; |
| | | import cn.lili.modules.lmk.domain.entity.Tag; |
| | | import cn.lili.modules.lmk.domain.form.MemberTagForm; |
| | | import cn.lili.modules.lmk.domain.query.CustomerTagQuery; |
| | | import cn.lili.modules.lmk.domain.vo.MemberTagVO; |
| | | import cn.lili.modules.lmk.mapper.MemberTagMapper; |
| | | import cn.lili.modules.lmk.service.MemberTagService; |
| | | import cn.lili.modules.lmk.service.TagService; |
| | | import cn.lili.utils.PageUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | | * |
| | | * @author zxl |
| | | * @since 2025-05-14 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class MemberTagServiceImpl extends ServiceImpl<MemberTagMapper, MemberTag> implements MemberTagService { |
| | | |
| | | private final TagService tagService; |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result add(MemberTagForm form) { |
| | | MemberTag entity = MemberTagForm.getEntityByForm(form, null); |
| | | baseMapper.insert(entity); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result update(MemberTagForm form) { |
| | | MemberTag 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(CustomerTagQuery query) { |
| | | IPage<MemberTag> page = PageUtil.getPage(query, MemberTag.class); |
| | | |
| | | LambdaQueryWrapper<MemberTag> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | |
| | | baseMapper.selectPage(page, lambdaQueryWrapper); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 列表 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result all() { |
| | | List<MemberTag> entities = baseMapper.selectList(null); |
| | | List<MemberTagVO> vos = entities.stream() |
| | | .map(entity -> MemberTagVO.getVoByEntity(entity, null)) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | |
| | | @Override |
| | | public Result addMemberTag(MemberTagForm form) { |
| | | |
| | | LambdaQueryWrapper<MemberTag> deleteQuery = new LambdaQueryWrapper<>(); |
| | | deleteQuery.eq(MemberTag::getMemberId, form.getMemberId()); |
| | | baseMapper.delete(deleteQuery); |
| | | |
| | | LambdaQueryWrapper<Tag> query = new LambdaQueryWrapper<>(); |
| | | query.in(Tag::getId, form.getTagIds()); |
| | | List<Tag> tags = tagService.list(query); |
| | | List<MemberTag> memberTags = tags.stream().map(tag -> { |
| | | MemberTag memberTag = new MemberTag(); |
| | | memberTag.setTagId(tag.getId()); |
| | | memberTag.setMemberId(form.getMemberId()); |
| | | memberTag.setTagName(tag.getTagName()); |
| | | memberTag.setCreateType(form.getCreateType()); |
| | | return memberTag; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | this.saveBatch(memberTags); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | @Override |
| | | public Result getByMemberId(String memberId) { |
| | | LambdaQueryWrapper<MemberTag> query = new LambdaQueryWrapper<>(); |
| | | query.eq(MemberTag::getMemberId, memberId); |
| | | List<MemberTag> memberTags = baseMapper.selectList(query); |
| | | return Result.ok().data(memberTags); |
| | | } |
| | | |
| | | |
| | | public Result delCustomerTag(String id) { |
| | | |
| | | return null; |
| | | } |
| | | } |
| | |
| | | baseMapper.getAuthorLikeVideoPage(page, query3); |
| | | break; |
| | | case "search": // 加载es搜索视频 |
| | | VideoEsQuery query4 = new VideoEsQuery(); |
| | | BeanUtils.copyProperties(query, query4); |
| | | query4.setPageNumber((int) query.getPageNumber()); |
| | | query4.setPageSize((int) query.getPageSize()); |
| | | return this.esSearch(query4); |
| | | VideoEsQuery videoEsQuery = new VideoEsQuery(); |
| | | BeanUtils.copyProperties(query, videoEsQuery); |
| | | videoEsQuery.setPageNumber((int) query.getPageNumber()); |
| | | videoEsQuery.setPageSize((int) query.getPageSize()); |
| | | return this.esSearch(videoEsQuery); |
| | | case "goodsSimilarly": // 悬挂相同商品的推荐视频 |
| | | GoodsSimilarlyQuery goodsSimilarlyQuery = new GoodsSimilarlyQuery(); |
| | | BeanUtils.copyProperties(query, goodsSimilarlyQuery); |
| | | baseMapper.goodsSimilarlyPage(page, goodsSimilarlyQuery); |
| | | break; |
| | | case "history": |
| | | VideoHistoryQuery videoHistoryQuery = new VideoHistoryQuery(); |
| | | BeanUtils.copyProperties(query, videoHistoryQuery); |
| | | videoHistoryQuery.setUserId(UserContext.getCurrentUserId()); |
| | | baseMapper.getHistoryPage(page, videoHistoryQuery); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | |
| | | v.setCommentNum(this.getCommentNum(v.getId(), v.getCommentNum())); |
| | | v.setCollectNum(this.getCollectNum(v.getId(), v.getCollectNum())); |
| | | v.setThumbsUpNum(this.getThumbsUpNum(v.getId(), v.getThumbsUpNum())); |
| | | v.setAuthorAvatar(cosUtil.getPreviewUrl(v.getAuthorAvatar())); |
| | | if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) { |
| | | v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey())); |
| | |
| | | public Result healthRecommendVideo(WxHealthVideoQuery query) { |
| | | IPage<WxVideoVO> page = PageUtil.getPage(query, WxVideoVO.class); |
| | | //获取大健康视频列表 |
| | | baseMapper.recommendHealthVideo(page,query); |
| | | baseMapper.recommendHealthVideo(page,query); |
| | | if (page.getTotal() > 0) { |
| | | page.getRecords().forEach(v -> { |
| | | v.setAuthorAvatar(cosUtil.getPreviewUrl(v.getAuthorAvatar())); |
| | | if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) { |
| | | v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey())); |
| | |
| | | IPage<WxVideoVO> page = PageUtil.getPage(query, WxVideoVO.class); |
| | | baseMapper.wxKitchenVideoQuery(page, query); |
| | | page.getRecords().forEach(v -> { |
| | | v.setAuthorAvatar(cosUtil.getPreviewUrl(v.getAuthorAvatar())); |
| | | if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) { |
| | | v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey())); |
| | |
| | | |
| | | @Override |
| | | public Result saveViewRecord(VideoFootPrintForm form) { |
| | | FootPrint footPrint = new FootPrint(); |
| | | footPrint.setViewType(ViewTypeEnum.VIDEO.getValue()); |
| | | footPrint.setRefId(form.getVideoId()); |
| | | footPrint.setMemberId(UserContext.getCurrentUserId()); |
| | | footPrint.setViewDuration(form.getViewDuration()); |
| | | footPrint.setPlayAt(form.getPlayAt()); |
| | | footprintService.saveFootprint(footPrint); |
| | | FootPrint one = new LambdaQueryChainWrapper<>(footprintService.getBaseMapper()) |
| | | .eq(FootPrint::getRefId, form.getVideoId()) |
| | | .eq(FootPrint::getMemberId, UserContext.getCurrentUserId()) |
| | | .eq(FootPrint::getViewType, ViewTypeEnum.VIDEO.getValue()) |
| | | .one(); |
| | | if (Objects.nonNull(one)) { |
| | | one.setViewDuration(one.getViewDuration() + form.getViewDuration()); |
| | | one.setPlayAt(form.getPlayAt()); |
| | | footprintService.updateById(one); |
| | | } else { |
| | | FootPrint footPrint = new FootPrint(); |
| | | footPrint.setViewType(ViewTypeEnum.VIDEO.getValue()); |
| | | footPrint.setRefId(form.getVideoId()); |
| | | footPrint.setMemberId(UserContext.getCurrentUserId()); |
| | | footPrint.setViewDuration(form.getViewDuration()); |
| | | footPrint.setPlayAt(form.getPlayAt()); |
| | | footprintService.saveFootprint(footPrint); |
| | | } |
| | | return Result.ok(); |
| | | } |
| | | |
| | |
| | | v.setCommentNum(this.getCommentNum(v.getId(), v.getCommentNum())); |
| | | v.setCollectNum(this.getCollectNum(v.getId(), v.getCollectNum())); |
| | | v.setThumbsUpNum(this.getThumbsUpNum(v.getId(), v.getThumbsUpNum())); |
| | | v.setAuthorAvatar(cosUtil.getPreviewUrl(v.getAuthorAvatar())); |
| | | if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) { |
| | | v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey())); |
| | |
| | | v.setCommentNum(this.getCommentNum(v.getId(), v.getCommentNum())); |
| | | v.setCollectNum(this.getCollectNum(v.getId(), v.getCollectNum())); |
| | | v.setThumbsUpNum(this.getThumbsUpNum(v.getId(), v.getThumbsUpNum())); |
| | | v.setAuthorAvatar(cosUtil.getPreviewUrl(v.getAuthorAvatar())); |
| | | if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) { |
| | | v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey())); |
| | |
| | | v.setCommentNum(this.getCommentNum(v.getId(), v.getCommentNum())); |
| | | v.setCollectNum(this.getCollectNum(v.getId(), v.getCollectNum())); |
| | | v.setThumbsUpNum(this.getThumbsUpNum(v.getId(), v.getThumbsUpNum())); |
| | | v.setAuthorAvatar(cosUtil.getPreviewUrl(v.getAuthorAvatar())); |
| | | if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) { |
| | | v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey())); |
| | |
| | | // 判断是否关注作者、是否点赞、是否收藏 |
| | | wxVideoVO.setCollected(CollectionUtils.isNotEmpty(collectMap.get(wxVideoVO.getId()))); |
| | | wxVideoVO.setThumbsUp(CollectionUtils.isNotEmpty(thumbsUpMap.get(wxVideoVO.getId()))); |
| | | wxVideoVO.setAuthorAvatar(cosUtil.getPreviewUrl(wxVideoVO.getAuthorAvatar())); |
| | | if (UserContext.getCurrentUserId().equals(wxVideoVO.getAuthorId())) { |
| | | wxVideoVO.setSubscribeThisAuthor(Boolean.TRUE); |
| | | } else { |
| | |
| | | }).collect(Collectors.toList()); |
| | | return Result.ok().data(vos).total(searchHits.getTotalHits()); |
| | | } |
| | | |
| | | @Override |
| | | public Result getHistoryPage(VideoHistoryQuery query) { |
| | | query.setUserId(UserContext.getCurrentUserId()); |
| | | IPage<VideoHistoryVO> page = PageUtil.getPage(query, VideoHistoryVO.class); |
| | | baseMapper.getHistoryPage(page, query); |
| | | if (CollectionUtils.isNotEmpty(page.getRecords())) { |
| | | if (page.getTotal() > 0) { |
| | | List<String> videoIds = page.getRecords().stream().map(VideoHistoryVO::getId).collect(Collectors.toList()); |
| | | Map<String, List<SimpleVideoTagVO>> tagMap = videoTagRefService.getTagsByVideoIds(videoIds) |
| | | .stream() |
| | | .collect(Collectors.groupingBy(SimpleVideoTagVO::getVideoId)); |
| | | Map<String, List<SimpleMyCollectVO>> collectMap = myCollectService.getCollectsByVideoIds(videoIds) |
| | | .stream() |
| | | .collect(Collectors.groupingBy(SimpleMyCollectVO::getRefId)); |
| | | Map<String, List<SimpleMyThumbsUpVO>> thumbsUpMap = thumbsUpRecordService.getThumbssByVideoIds(videoIds) |
| | | .stream() |
| | | .collect(Collectors.groupingBy(SimpleMyThumbsUpVO::getRefId)); |
| | | List<String> subscribes = mySubscribeService.getSubscribesByUserId(UserContext.getCurrentUserId()); |
| | | // 3. 获取视频临时访问地址、设置视频标签、我是否收藏、是否点赞、作者是否关注 |
| | | page.getRecords().forEach(v -> { |
| | | v.setTagList(tagMap.get(v.getId())); |
| | | v.setCollected(CollectionUtils.isNotEmpty(collectMap.get(v.getId()))); |
| | | v.setThumbsUp(CollectionUtils.isNotEmpty(thumbsUpMap.get(v.getId()))); |
| | | v.setCommentNum(this.getCommentNum(v.getId(), v.getCommentNum())); |
| | | v.setCollectNum(this.getCollectNum(v.getId(), v.getCollectNum())); |
| | | v.setThumbsUpNum(this.getThumbsUpNum(v.getId(), v.getThumbsUpNum())); |
| | | v.setAuthorAvatar(cosUtil.getPreviewUrl(v.getAuthorAvatar())); |
| | | if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) { |
| | | v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey())); |
| | | } else if (VideoContentTypeEnum.IMG.getValue().equals(v.getVideoContentType()) && StringUtils.isNotBlank(v.getVideoImgs())) { |
| | | v.setImgs(JSON.parseArray(v.getVideoImgs(), String.class).stream().map(fileKey -> cosUtil.getPreviewUrl(fileKey)).collect(Collectors.toList())); |
| | | } |
| | | if (CollectionUtils.isNotEmpty(v.getGoodsList())) { |
| | | v.getGoodsList().stream().forEach(goods -> { |
| | | goods.setThumbnail(cosUtil.getPreviewUrl(goods.getThumbnail())); |
| | | }); |
| | | } |
| | | v.setSubscribeThisAuthor(subscribes.contains(v.getAuthorId())); |
| | | }); |
| | | } |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty(value = "会员头像") |
| | | private String face; |
| | | |
| | | @ApiModelProperty(value = "会员状态") |
| | | @ApiModelProperty(value = "会员状态:true 表示没被禁用, false 被禁用") |
| | | private Boolean disabled; |
| | | |
| | | @ApiModelProperty(value = "是否开通店铺") |
| | |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 会员修改 |
| | |
| | | |
| | | @ApiModelProperty(value = "会员头像") |
| | | private String face; |
| | | |
| | | private List<String> tags; |
| | | } |
| | |
| | | import cn.lili.common.security.sensitive.Sensitive; |
| | | import cn.lili.common.security.sensitive.enums.SensitiveStrategy; |
| | | import cn.lili.common.utils.BeanUtil; |
| | | import cn.lili.modules.lmk.domain.vo.CustomerTagVO; |
| | | import cn.lili.modules.lmk.domain.vo.MemberTagVO; |
| | | import cn.lili.modules.member.entity.dos.Member; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value = "客户标签列表") |
| | | private List<CustomerTagVO> customerTagList; |
| | | private List<MemberTagVO> tags; |
| | | |
| | | /** |
| | | * 为null则不在黑名单内 |
| | |
| | | |
| | | @Select("select * from li_member ${ew.customSqlSegment}") |
| | | IPage<MemberVO> pageByMemberVO(IPage<MemberVO> page, @Param(Constants.WRAPPER) Wrapper<Member> queryWrapper); |
| | | |
| | | MemberVO getVoById(@Param("id") String id); |
| | | } |
| | |
| | | package cn.lili.modules.member.service; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.common.vo.PageVO; |
| | | import cn.lili.modules.member.entity.dos.FootPrint; |
| | | import cn.lili.modules.member.entity.dto.FootPrintQueryParams; |
| | |
| | | * 根据ID进行清除会员的历史足迹 |
| | | * |
| | | * @param ids 商品ID列表 |
| | | * @param viewType 浏览类型 |
| | | * @return 处理结果 |
| | | */ |
| | | boolean deleteByIds(List<String> ids); |
| | | boolean deleteByIds(List<String> ids, String viewType); |
| | | |
| | | /** |
| | | * 获取会员浏览历史分页 |
| | |
| | | */ |
| | | long getFootprintNum(); |
| | | |
| | | } |
| | | } |
| | |
| | | package cn.lili.modules.member.serviceimpl; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.modules.goods.entity.dos.GoodsSku; |
| | | import cn.lili.modules.goods.service.GoodsSkuService; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean deleteByIds(List<String> ids) { |
| | | public boolean deleteByIds(List<String> ids, String viewType) { |
| | | LambdaQueryWrapper<FootPrint> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
| | | lambdaQueryWrapper.eq(FootPrint::getMemberId, UserContext.getCurrentUser().getId()); |
| | | lambdaQueryWrapper.eq(FootPrint::getViewType, viewType); |
| | | lambdaQueryWrapper.in(FootPrint::getRefId, ids); |
| | | return this.remove(lambdaQueryWrapper); |
| | | } |
| | |
| | | lambdaQueryWrapper.eq(FootPrint::getDeleteFlag, false); |
| | | return this.count(lambdaQueryWrapper); |
| | | } |
| | | |
| | | } |
| | |
| | | import cn.lili.modules.connect.entity.dto.ConnectAuthUser; |
| | | import cn.lili.modules.connect.service.ConnectService; |
| | | import cn.lili.modules.lmk.domain.entity.VideoAccount; |
| | | import cn.lili.modules.lmk.domain.form.MemberTagForm; |
| | | import cn.lili.modules.lmk.service.MemberTagService; |
| | | import cn.lili.modules.lmk.service.VideoAccountService; |
| | | import cn.lili.modules.member.aop.annotation.PointLogPoint; |
| | | import cn.lili.modules.member.entity.dos.Member; |
| | |
| | | import cn.lili.mybatis.util.PageUtil; |
| | | import cn.lili.rocketmq.RocketmqSendCallbackBuilder; |
| | | import cn.lili.rocketmq.tags.MemberTagsEnum; |
| | | import cn.lili.utils.COSUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | |
| | | |
| | | @Autowired |
| | | private VideoAccountService videoAccountService; |
| | | |
| | | @Autowired |
| | | private MemberTagService memberTagService; |
| | | |
| | | @Autowired |
| | | private COSUtil cosUtil; |
| | | |
| | | @Override |
| | | public Member findByUsername(String userName) { |
| | |
| | | authUser.setNickname(CommonUtil.getSpecialStr("用户")); |
| | | } |
| | | if (CharSequenceUtil.isEmpty(authUser.getAvatar())) { |
| | | authUser.setAvatar("https://i.loli.net/2020/11/19/LyN6JF7zZRskdIe.png"); |
| | | authUser.setAvatar(""); |
| | | } |
| | | try { |
| | | // String username = UuidUtils.getUUID(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public Member updateMember(ManagerMemberEditDTO managerMemberEditDTO) { |
| | | //过滤会员昵称敏感词 |
| | | if (CharSequenceUtil.isNotBlank(managerMemberEditDTO.getNickName())) { |
| | |
| | | //传递修改会员信息 |
| | | BeanUtil.copyProperties(managerMemberEditDTO, member); |
| | | this.updateById(member); |
| | | if (managerMemberEditDTO.getTags() != null) { |
| | | MemberTagForm memberTagForm = new MemberTagForm(); |
| | | memberTagForm.setMemberId(member.getId()); |
| | | memberTagForm.setTagIds(managerMemberEditDTO.getTags()); |
| | | memberTagForm.setCreateType("MANAGER"); |
| | | memberTagService.addMemberTag(memberTagForm); |
| | | } |
| | | return member; |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public MemberVO getMember(String id) { |
| | | return new MemberVO(this.getById(id)); |
| | | MemberVO member = baseMapper.getVoById(id); |
| | | if (Objects.nonNull(member)) { |
| | | member.setFace(cosUtil.getPreviewUrl(member.getFace())); |
| | | } |
| | | return member; |
| | | } |
| | | |
| | | @Override |
| | |
| | | private String email; |
| | | |
| | | @ApiModelProperty(value = "用户头像") |
| | | private String avatar = "https://i.loli.net/2020/11/19/LyN6JF7zZRskdIe.png"; |
| | | private String avatar = ""; |
| | | |
| | | @ApiModelProperty(value = "是否是超级管理员 超级管理员/普通管理员") |
| | | private Boolean isSuper = false; |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.rocketmq.spring.core.RocketMQTemplate; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private Cache cache; |
| | | |
| | | @Override |
| | | public IPage<StoreVO> findByConditionPage(StoreSearchParams storeSearchParams, PageVO page) { |
| | | return this.baseMapper.getStoreList(PageUtil.initPage(page), storeSearchParams.queryWrapper()); |
| | | public IPage<StoreVO> findByConditionPage(StoreSearchParams storeSearchParams, PageVO vo) { |
| | | Page<StoreVO> page = PageUtil.initPage(vo); |
| | | this.baseMapper.getStoreList(page, storeSearchParams.queryWrapper()); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | |
| | | return this.getOne(lambdaQueryWrapper, false); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | <result property="experience" column="experience"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="blackId" column="blackId"/> |
| | | <collection property="customerTagList" ofType="cn.lili.modules.lmk.domain.vo.CustomerTagVO" |
| | | <collection property="customerTagList" ofType="cn.lili.modules.lmk.domain.vo.MemberTagVO" |
| | | select="selectTagByMemberId" |
| | | column="id" |
| | | /> |
| | |
| | | ORDER BY lm.create_time DESC |
| | | </select> |
| | | |
| | | <select id="selectTagByMemberId" resultType="cn.lili.modules.lmk.domain.vo.CustomerTagVO"> |
| | | <select id="selectTagByMemberId" resultType="cn.lili.modules.lmk.domain.vo.MemberTagVO"> |
| | | SELECT |
| | | LCT.id, |
| | | LCT.tag_name, |
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.GoodsTagMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.GoodsTagVO"> |
| | | <result column="tag_id" property="tagId"/> |
| | | <result column="tag_name" property="tagName"/> |
| | | <result column="create_type" property="createType"/> |
| | | <result column="create_by" property="createBy"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_by" property="updateBy"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | </resultMap> |
| | | </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.member.mapper.MemberMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="cn.lili.modules.member.entity.vo.MemberVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="username" property="username"/> |
| | | <result column="nick_name" property="nickName"/> |
| | | <result column="sex" property="sex"/> |
| | | <result column="birthday" property="birthday"/> |
| | | <result column="region_id" property="regionId"/> |
| | | <result column="region" property="region"/> |
| | | <result column="mobile" property="mobile"/> |
| | | <result column="point" property="point"/> |
| | | <result column="total_point" property="totalPoint"/> |
| | | <result column="face" property="face"/> |
| | | <result column="disabled" property="disabled"/> |
| | | <result column="have_store" property="haveStore"/> |
| | | <result column="store_id" property="storeId"/> |
| | | <result column="open_id" property="openId"/> |
| | | <result column="client_enum" property="clientEnum"/> |
| | | <result column="last_login_date" property="lastLoginDate"/> |
| | | <result column="grade_id" property="gradeId"/> |
| | | <result column="experience" property="experience"/> |
| | | <collection property="tags" ofType="cn.lili.modules.lmk.domain.vo.MemberTagVO"> |
| | | <id column="member_tag_id" property="id"/> |
| | | <result column="tag_name" property="tagName"/> |
| | | <result column="tag_id" property="tagId"/> |
| | | </collection> |
| | | |
| | | </resultMap> |
| | | <select id="getVoById" resultMap="BaseResultMap"> |
| | | select m.*, mt.id member_tag_id, mt.tag_name, mt.tag_id |
| | | from li_member m |
| | | left join lmk_member_tag mt on m.id = mt.member_id and mt.delete_flag = 0 |
| | | where m.id = #{id} and m.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.MemberTagMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.MemberTagVO"> |
| | | <result column="tag_id" property="tagId"/> |
| | | <result column="tag_name" property="tagName"/> |
| | | <result column="create_type" property="createType"/> |
| | | <result column="create_by" property="createBy"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_by" property="updateBy"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="getById" resultMap="BaseResultMap"> |
| | | SELECT LCT.tag_name, |
| | | LCT.create_type, |
| | | LCT.create_by, |
| | | LCT.create_time, |
| | | LCT.update_by, |
| | | LCT.update_time, |
| | | LCT.id |
| | | FROM lmk_customer_tag LCT |
| | | WHERE LCT.id = #{id} |
| | | AND LCT.delete_flag = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="getPage" resultMap="BaseResultMap"> |
| | | SELECT LCT.tag_name, |
| | | LCT.create_type, |
| | | LCT.create_by, |
| | | LCT.create_time, |
| | | LCT.update_by, |
| | | LCT.update_time, |
| | | LCT.id |
| | | FROM lmk_customer_tag LCT |
| | | WHERE LCT.delete_flag = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <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" /> |
| | |
| | | LMS.subscribe_user_id, |
| | | LMS.id, |
| | | LM.nick_name, |
| | | LM.face, |
| | | (SELECT COUNT(*) FROM lmk_my_subscribe WHERE subscribe_user_id = LMS.subscribe_user_id AND delete_flag = 0) as fans_num |
| | | LM.face |
| | | FROM |
| | | lmk_my_subscribe LMS |
| | | LEFT JOIN li_member LM ON LMS.subscribe_user_id = LM.id |
| | |
| | | and t.tag_name like concat('%',#{query.tagName},'%') |
| | | </if> |
| | | <if test="query.tagTypeId != null and query.tagTypeId != ''"> |
| | | and t.tag_type_id like concat('%',#{query.tagTypeId},'%') |
| | | and t.tag_type_id = #{query.tagTypeId} |
| | | </if> |
| | | <if test="query.tagTypeKey != null and query.tagTypeKey != ''"> |
| | | and tt.type_key = #{query.tagTypeKey} |
| | | </if> |
| | | order by t.sort_num |
| | | </select> |
| | |
| | | LG.price |
| | | FROM |
| | | lmk_video_goods LVG |
| | | INNER JOIN li_goods LG ON LVG.goods_id = LG.id AND LG.market_enable = 'UPPER' AND LG.delete_flag = 0 |
| | | INNER JOIN li_goods_sku LG ON LVG.goods_sku_id = LG.id AND LG.market_enable = 'UPPER' AND LG.delete_flag = 0 |
| | | WHERE |
| | | LVG.video_id = #{id} AND LVG.delete_flag = 0 |
| | | ORDER BY |
| | |
| | | <collection property="goodsList" column="id" select="getVideoGoods" ofType="cn.lili.modules.lmk.domain.vo.VideoGoodsDetailVO"/> |
| | | </resultMap> |
| | | |
| | | <!-- 播放历史 --> |
| | | <resultMap id="HistoryMap" type="cn.lili.modules.lmk.domain.vo.VideoHistoryVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="author_id" property="authorId" /> |
| | | <result column="authorName" property="authorName" /> |
| | | <result column="authorAvatar" property="authorAvatar" /> |
| | | <result column="cover_url" property="coverFileKey" /> |
| | | <result column="video_file_key" property="videoFileKey" /> |
| | | <result column="video_fit" property="videoFit" /> |
| | | <result column="video_duration" property="videoDuration" /> |
| | | <result column="title" property="title" /> |
| | | <result column="collect_num" property="collectNum" /> |
| | | <result column="comment_num" property="commentNum" /> |
| | | <result column="thumbs_up_num" property="thumbsUpNum" /> |
| | | <result column="status" property="status" /> |
| | | <result column="video_content_type" property="videoContentType" /> |
| | | <result column="video_type" property="videoType" /> |
| | | <result column="video_imgs" property="videoImgs" /> |
| | | <result column="historyId" property="historyId" /> |
| | | <result column="play_at" property="playAt" /> |
| | | <result column="playTime" property="playTime" /> |
| | | <collection property="goodsList" column="id" select="getVideoGoods" ofType="cn.lili.modules.lmk.domain.vo.VideoGoodsDetailVO"/> |
| | | </resultMap> |
| | | |
| | | <select id="getById" resultMap="BaseResultMap"> |
| | | SELECT |
| | |
| | | ORDER BY |
| | | LV.create_time DESC |
| | | </select> |
| | | |
| | | <select id="goodsSimilarlyPage" resultMap="WxResultMap"> |
| | | 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.comment_num, |
| | | LV.collect_num, |
| | | LV.thumbs_up_num, |
| | | LV.weight, |
| | | LV.audit_pass_time, |
| | | LV.update_time, |
| | | LV.create_time, |
| | | LV.video_content_type, |
| | | LV.video_type, |
| | | LV.video_imgs, |
| | | LV.id, |
| | | CASE |
| | | WHEN LM.nick_name IS NOT NULL THEN LM.nick_name |
| | | WHEN LM.nick_name IS NULL THEN (SELECT nick_name FROM li_admin_user WHERE id = LV.author_id) |
| | | ELSE '' |
| | | END as authorName, |
| | | CASE |
| | | WHEN LM.face IS NOT NULL THEN LM.face |
| | | WHEN LM.face IS NULL THEN (SELECT avatar FROM li_admin_user WHERE id = LV.author_id) |
| | | ELSE '' |
| | | END as authorAvatar |
| | | FROM |
| | | lmk_video LV |
| | | INNER JOIN lmk_video_goods LVG ON LVG.video_id = LV.id AND LVG.goods_id in <foreach collection="query.goodsIds" open="(" item="goodsId" close=")" separator=",">#{goodsId}</foreach> |
| | | LEFT JOIN li_member LM ON LV.author_id = LM.id |
| | | WHERE |
| | | LV.delete_flag = 0 AND LV.status = '1' AND LV.id != #{query.currentVideoId} |
| | | ORDER BY |
| | | LV.create_time DESC |
| | | </select> |
| | | |
| | | <select id="getHistoryPage" resultMap="HistoryMap"> |
| | | 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.comment_num, |
| | | LV.collect_num, |
| | | LV.thumbs_up_num, |
| | | LV.weight, |
| | | LV.audit_pass_time, |
| | | LV.update_time, |
| | | LV.create_time, |
| | | LV.video_content_type, |
| | | LV.video_type, |
| | | LV.video_imgs, |
| | | LV.id, |
| | | CASE |
| | | WHEN LM.nick_name IS NOT NULL THEN LM.nick_name |
| | | WHEN LM.nick_name IS NULL THEN (SELECT nick_name FROM li_admin_user WHERE id = LV.author_id) |
| | | ELSE '' |
| | | END as authorName, |
| | | CASE |
| | | WHEN LM.face IS NOT NULL THEN LM.face |
| | | WHEN LM.face IS NULL THEN (SELECT avatar FROM li_admin_user WHERE id = LV.author_id) |
| | | ELSE '' |
| | | END as authorAvatar, |
| | | LFP.id as historyId, |
| | | LFP.play_at, |
| | | LFP.update_time as playTime |
| | | FROM |
| | | li_foot_print LFP |
| | | INNER JOIN lmk_video LV ON LFP.ref_id = LV.id AND LFP.view_type = 'video' AND LFP.delete_flag = 0 AND LFP.member_id = #{query.userId} |
| | | LEFT JOIN li_member LM ON LV.author_id = LM.id |
| | | WHERE |
| | | LV.delete_flag = 0 AND LV.status = '1' |
| | | ORDER BY |
| | | LFP.update_time DESC |
| | | </select> |
| | | |
| | | <select id="recommendHealthVideo" resultMap="WxResultMap"> |
| | | SELECT |
| | | LV.author_id, |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.common.enums.ResultUtil; |
| | | import cn.lili.common.vo.PageVO; |
| | | import cn.lili.common.vo.ResultMessage; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.group.Update; |
| | | import cn.lili.modules.lmk.domain.form.CustomerTagForm; |
| | | import cn.lili.modules.lmk.domain.form.MemberTagForm; |
| | | import cn.lili.modules.lmk.domain.form.CustomerTagRefForm; |
| | | import cn.lili.modules.lmk.domain.query.CustomerQuery; |
| | | import cn.lili.modules.lmk.domain.query.CustomerTagQuery; |
| | | import cn.lili.modules.lmk.service.CustomerService; |
| | | import cn.lili.modules.lmk.service.CustomerTagRefService; |
| | | import cn.lili.modules.lmk.service.CustomerTagService; |
| | | import cn.lili.modules.member.entity.vo.MemberSearchVO; |
| | | import cn.lili.modules.member.entity.vo.MemberVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.service.MemberTagService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | @RequestMapping("/manager/customerManager") |
| | | public class CustomerController { |
| | | private final CustomerService customerService; |
| | | private final CustomerTagService customerTagService; |
| | | private final CustomerTagRefService customerTagRefService; |
| | | private final MemberTagService memberTagService; |
| | | |
| | | @ApiOperation(value = "商铺下拉列表") |
| | | @GetMapping("/store/selectOption") |
| | |
| | | |
| | | @PostMapping("/addTag") |
| | | @ApiOperation(value = "添加标签", notes = "添加标签") |
| | | public Result add(@RequestBody @Validated(Add.class) CustomerTagForm form) { |
| | | return customerTagService.add(form); |
| | | public Result add(@RequestBody @Validated(Add.class) MemberTagForm form) { |
| | | return memberTagService.add(form); |
| | | } |
| | | |
| | | @PutMapping("/editTag") |
| | | @ApiOperation(value = "修改标签", notes = "修改标签") |
| | | public Result update(@RequestBody @Validated(Update.class) CustomerTagForm form) { |
| | | return customerTagService.update(form); |
| | | public Result update(@RequestBody @Validated(Update.class) MemberTagForm form) { |
| | | return memberTagService.update(form); |
| | | } |
| | | |
| | | @DeleteMapping("/tag/{id}") |
| | | @ApiOperation(value = "ID删除标签", notes = "ID删除") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | return customerTagService.removeById(id); |
| | | return memberTagService.removeById(id); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/tagList") |
| | | @ApiOperation(value = "标签列表", notes = "标签列表") |
| | | public Result list() { |
| | | return customerTagService.all(); |
| | | return memberTagService.all(); |
| | | } |
| | | @GetMapping("/pageTagList") |
| | | @ApiOperation(value = "分页标签列表", notes = "标签列表") |
| | | public Result pageList(CustomerTagQuery query) { |
| | | return customerTagService.page(query); |
| | | return memberTagService.page(query); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/customerAddTag") |
| | | @ApiOperation(value = "添加客户标签标识", notes = "添加客户标签标识") |
| | | public Result addCustomerTag(@RequestBody @Validated(Add.class) CustomerTagForm form) { |
| | | return customerTagService.addCustomerTag(form); |
| | | public Result addCustomerTag(@RequestBody @Validated(Add.class) MemberTagForm form) { |
| | | return memberTagService.addMemberTag(form); |
| | | } |
| | | |
| | | // @PostMapping("/customerAddTag") |
| | |
| | | // return customerTagRefService.add(form); |
| | | // } |
| | | |
| | | @PutMapping("/customerEditTag") |
| | | @ApiOperation(value = "修改客户标签标识", notes = "修改客户标签标识") |
| | | public Result update(@RequestBody @Validated(Update.class) CustomerTagRefForm form) { |
| | | return customerTagRefService.update(form); |
| | | } |
| | | |
| | | @DeleteMapping("/customerDelTag/{id}") |
| | | @ApiOperation(value = "删除客户标签标识ID删除", notes = "删除客户标签标识ID删除") |
| | | public Result removeCustomerTagById(@PathVariable("id") String id) { |
| | | return customerTagRefService.removeById(id); |
| | | return memberTagService.removeById(id); |
| | | } |
| | | |
| | | } |