| | |
| | | import cn.lili.modules.lmk.domain.form.VideoHomePageInfoForm; |
| | | import cn.lili.modules.lmk.domain.form.WxVideoForm; |
| | | import cn.lili.modules.lmk.domain.query.AuthorVideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.HealthVideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.WxHealthVideoQuery; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import lombok.RequiredArgsConstructor; |
| | | import java.util.List; |
| | |
| | | public Result recommendVideo(VideoQuery query) { |
| | | return videoService.recommendVideo(query); |
| | | } |
| | | @GetMapping("/health/recommend") |
| | | @ApiOperation(value = "大健康视频推荐", notes = "大健康视频推荐") |
| | | public Result healthRecommendVideo(WxHealthVideoQuery query) { |
| | | return videoService.healthRecommendVideo(query); |
| | | } |
| | | |
| | | @GetMapping("/goods/detail/{videoId}") |
| | | @ApiOperation(value = "视频商品查看", notes = "视频商品查看") |
New file |
| | |
| | | -----BEGIN CERTIFICATE----- |
| | | MIIEKzCCAxOgAwIBAgIUQI+FRbtTLFAdR9seUI0sqtgzEHcwDQYJKoZIhvcNAQEL |
| | | BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT |
| | | FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg |
| | | Q0EwHhcNMjUwNDAxMDU0NDU0WhcNMzAwMzMxMDU0NDU0WjCBhDETMBEGA1UEAwwK |
| | | MTcxMjU3NzU5MDEbMBkGA1UECgwS5b6u5L+h5ZWG5oi357O757ufMTAwLgYDVQQL |
| | | DCfmt7HlnLPnvo7nm4rnrZDlhpzkuJrnp5HmioDmnInpmZDlhazlj7gxCzAJBgNV |
| | | BAYTAkNOMREwDwYDVQQHDAhTaGVuWmhlbjCCASIwDQYJKoZIhvcNAQEBBQADggEP |
| | | ADCCAQoCggEBAMpJI0pxouUDKZGtpIytAnLQSZMgltCGEmfuuFaMRN0eqiPJHbo0 |
| | | EUiRfJNUCBcFsf71iW5bSA2oxyPxh1oljalUDagBWng+3zaXBoFOHrWoswd0B9u1 |
| | | GdTX/9LEBiLu3MqENckHxI/hx22HuK0vEg2VFroj+5IBIf+KnJoyAkfCH5e8Ea+t |
| | | FCHlsZa5GqC3iAIB+JTmdSHTRKVfjWHGfGLmhHZt/intLDstlKP8IRbtTR9CRXE3 |
| | | Q5mVYURGzQ0VOe9zPGZE2CQ5Zd4ETOHwLRJy78nls4Eqn1D1UOZD88uSSi65MM86 |
| | | msjnH1u3upH1yeTT1Gr4Zvjz8FTjzVAzjL8CAwEAAaOBuTCBtjAJBgNVHRMEAjAA |
| | | MAsGA1UdDwQEAwID+DCBmwYDVR0fBIGTMIGQMIGNoIGKoIGHhoGEaHR0cDovL2V2 |
| | | Y2EuaXRydXMuY29tLmNuL3B1YmxpYy9pdHJ1c2NybD9DQT0xQkQ0MjIwRTUwREJD |
| | | MDRCMDZBRDM5NzU0OTg0NkMwMUMzRThFQkQyJnNnPUhBQ0M0NzFCNjU0MjJFMTJC |
| | | MjdBOUQzM0E4N0FEMUNERjU5MjZFMTQwMzcxMA0GCSqGSIb3DQEBCwUAA4IBAQAf |
| | | BTOdG7IOxZGUujH83E0RULUcAFy/fIhwM15ZgI7dflCNO3n3Vlx3Q/NuHEKS70hH |
| | | kdmNCjusIMVDr8vixYwD3rQ6Dw5oi0DNWihLyj99JdqZlcxHSYsmuFXXWAzpvl1q |
| | | wwAqF1RrrBkoK8T1L3SzZsBRwJcjPZAtQmdaYyZ2wc0RN0LmJQ26Kr+AWTsQ/4NK |
| | | QC2dlIhRRCQzurBt4Y9s75iDnkckDZx82vJ2pCYAIgcPJRLTQ+06wRnMXajaEicN |
| | | lXknSrML7I4jM5zOHzuj7RkviFpTdXep1Tk+4E0pN6pXxLyR7uNJ0YuJqnqcdlTY |
| | | Di0KGtJMK0iUNMKQnFGA |
| | | -----END CERTIFICATE----- |
New file |
| | |
| | | -----BEGIN PRIVATE KEY----- |
| | | MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDKSSNKcaLlAymR |
| | | raSMrQJy0EmTIJbQhhJn7rhWjETdHqojyR26NBFIkXyTVAgXBbH+9YluW0gNqMcj |
| | | 8YdaJY2pVA2oAVp4Pt82lwaBTh61qLMHdAfbtRnU1//SxAYi7tzKhDXJB8SP4cdt |
| | | h7itLxINlRa6I/uSASH/ipyaMgJHwh+XvBGvrRQh5bGWuRqgt4gCAfiU5nUh00Sl |
| | | X41hxnxi5oR2bf4p7Sw7LZSj/CEW7U0fQkVxN0OZlWFERs0NFTnvczxmRNgkOWXe |
| | | BEzh8C0Scu/J5bOBKp9Q9VDmQ/PLkkouuTDPOprI5x9bt7qR9cnk09Rq+Gb48/BU |
| | | 481QM4y/AgMBAAECggEAdJoeFp5USHA/OPL/4/siay43CvEBHif6WiCX74Ohelhf |
| | | uIsIcLnssIj0ZzRMCYFF7fJ5CrzhVsZQLB7gZ404EEAcMxi8no2XOy9pF4YBW7Nn |
| | | p0cx9Gp6/l6X31UROHe5m58EJeItYsbBnxhZ0rJMVLn4xMlTDQFMKLIsvRFQkS2F |
| | | ZHIFqklDP4kFMmpRlCdoLSTldYmFJ5AtepyXYimGA2dpYooDDhgR1FAudrybQFDh |
| | | A2h0iZTTmhABnbW3elL6PydjY4yszvM6I15a/eiynevXKVLyVYBHTV39XUOjJp6f |
| | | XpOW3nuxhkCK2xUfRgOgepxS+3/dauROtM4SQeo56QKBgQDsAoZwYRI0yeTYA0lo |
| | | m+QAwYGcbTaccKOghc6taIJi4xAOH5WloB6Uv+Wx3gn1DufOJt3yeF4/1+2W1oH6 |
| | | 9ZBZwNo98VqMg2oa4DxhX3Oa6v7VTqelFccGGZ+/Lim5bdMfcfapxlv8MB77OPJW |
| | | fCAA514hp2ydkkPprFtcPU1z9QKBgQDba1xyHpKmFuz7kju9OWLBq1x8v2GnOqW6 |
| | | 4ypfNob2ljYTK7BfldPupYF7VC4F6dZqqKlyJqe2rhgRWs49J772AHcGovEHaRsT |
| | | Pi63/EA3ASfi58MmuWI5Y/hFSnM6q14ZTnpD9ZKiInK8HFHjVCrCrfAE1G13/s+R |
| | | K+YpawTBYwKBgQCoqSlQWF69cObk5HxqkLWBQMiSdI4JgIm+5sELtdswNhq8LSAx |
| | | q9sO7JCG6ynsgklwTuBgLlsUfwhguk1LfoA5VBPjHn9aWXPTXxpnb+Ja/MM+xyYR |
| | | WR3RIzDBXIke5fhxyWzAaWxFLlKFsG2nFq98Vdw0asS5WtTDwpPLuFeInQKBgHHG |
| | | nv4x6jsjgikE7+Mz4YipUeEB4CI14AAjkTIj9SHiTBHuwpsd9vI1cgnAYckBMwTF |
| | | hm/BqY+pgKNnIbBGbtfi79VKIo+EKdz1joYq0CV1fPhE00W+NTerJe7QJyYR/E5F |
| | | ClM5AJsAH9x5FuE5IJ8oUGBAwq7JO1p8l/F8I9AfAoGBAMvLmGi36QRzv9VjQO1Z |
| | | S0yG9OjLqdexYl7ogZYW/ys1yZg9mYiFv1wjqkDhegiGM8QyNoUFq2d7cIFZtfz6 |
| | | 3wrcFn4JDW1l9VaB+IM2G4GEsgrZ4wLalKdCRR83KRvuTyjUKZYVvWNNrNzv0gp/ |
| | | 51l5UctJTdE2v4+9OTvpo8b2 |
| | | -----END PRIVATE KEY----- |
| | |
| | | user.setFace("https://i.loli.net/2020/11/19/LyN6JF7zZRskdIe.png"); |
| | | memberService.registerHandler(user); |
| | | } |
| | | |
| | | ConnectAuthUser connectAuthUser = new ConnectAuthUser(); |
| | | connectAuthUser.setUuid(openId); |
| | | connectAuthUser.setNickname(user.getNickName()); |
| | | connectAuthUser.setAvatar(user.getFace()); |
| | | |
| | | |
| | | connectAuthUser.setUsername(UuidUtils.getUUID()); |
| | | |
| | | connectAuthUser.setSource(ConnectEnum.WECHAT); |
| | | connectAuthUser.setType(ClientTypeEnum.WECHAT_MP); |
| | | |
| | | AuthToken authToken = new AuthToken(); |
| | | authToken.setUnionId(unionId); |
| | | connectAuthUser.setToken(authToken); |
| | | |
| | | //发送用户第三方登录消息 |
| | | MemberConnectLoginMessage memberConnectLoginMessage = new MemberConnectLoginMessage(); |
| | | memberConnectLoginMessage.setMember(user); |
| | | memberConnectLoginMessage.setConnectAuthUser(connectAuthUser); |
| | | String destination = |
| | | rocketmqCustomProperties.getMemberTopic() + ":" + MemberTagsEnum.MEMBER_CONNECT_LOGIN.name(); |
| | | //发送用户第三方登录消息 |
| | | rocketMQTemplate.asyncSend(destination, JSONUtil.toJsonStr(memberConnectLoginMessage), |
| | | RocketmqSendCallbackBuilder.commonCallback()); |
| | | Token token = memberTokenGenerate.createToken(user, Boolean.TRUE); |
| | | return Result.ok().data(token); |
| | | } |
| | |
| | | import cn.lili.modules.goods.entity.enums.GoodsStatusEnum; |
| | | import cn.lili.modules.goods.entity.enums.GoodsTypeEnum; |
| | | import cn.lili.mybatis.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.FieldStrategy; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.xkcoding.http.util.StringUtil; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | private Double grade; |
| | | |
| | | @ApiModelProperty(value = "缩略图路径") |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String thumbnail; |
| | | |
| | | @ApiModelProperty(value = "小图路径") |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String small; |
| | | |
| | | @ApiModelProperty(value = "原图路径") |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String original; |
| | | |
| | | @ApiModelProperty(value = "店铺分类id") |
| | |
| | | private String mobileIntro; |
| | | |
| | | @ApiModelProperty(value = "商品视频") |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String goodsVideo; |
| | | |
| | | |
| | |
| | | import cn.lili.mybatis.util.PageUtil; |
| | | import cn.lili.rocketmq.RocketmqSendCallbackBuilder; |
| | | import cn.lili.rocketmq.tags.GoodsTagsEnum; |
| | | import cn.lili.utils.COSUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.rocketmq.spring.core.RocketMQTemplate; |
| | |
| | | @Autowired |
| | | private Cache<GoodsVO> cache; |
| | | |
| | | @Autowired |
| | | private COSUtil cosUtil; |
| | | |
| | | @Override |
| | | public List<Goods> getByBrandIds(List<String> brandIds) { |
| | | LambdaQueryWrapper<Goods> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | |
| | | //检查商品 |
| | | this.checkGoods(goods); |
| | | //向goods加入图片 |
| | | if (goodsOperationDTO.getGoodsGalleryList().size() > 0) { |
| | | if (goodsOperationDTO.getGoodsGalleryList()!=null&& !goodsOperationDTO.getGoodsGalleryList().isEmpty()) { |
| | | this.setGoodsGalleryParam(goodsOperationDTO.getGoodsGalleryList().get(0), goods); |
| | | } |
| | | //添加商品参数 |
| | |
| | | //检查商品信息 |
| | | this.checkGoods(goods); |
| | | //向goods加入图片 |
| | | this.setGoodsGalleryParam(goodsOperationDTO.getGoodsGalleryList().get(0), goods); |
| | | if (goodsOperationDTO.getGoodsGalleryList() != null&& !goodsOperationDTO.getGoodsGalleryList().isEmpty()) { |
| | | this.setGoodsGalleryParam(goodsOperationDTO.getGoodsGalleryList().get(0), goods); |
| | | }else { |
| | | goods.setOriginal(null); |
| | | goods.setSmall(null); |
| | | goods.setThumbnail(null); |
| | | goodsGalleryService.removeByGoodsId(goodsId); |
| | | } |
| | | //添加商品参数 |
| | | if (goodsOperationDTO.getGoodsParamsDTOList() != null && !goodsOperationDTO.getGoodsParamsDTOList().isEmpty()) { |
| | | goods.setParams(JSONUtil.toJsonStr(goodsOperationDTO.getGoodsParamsDTOList())); |
| | |
| | | //缓存获取,如果没有则读取缓存 |
| | | GoodsVO goodsVO = cache.get(CachePrefix.GOODS.getPrefix() + goodsId); |
| | | if (goodsVO != null) { |
| | | // List<String> goodsGalleryList = goodsVO.getGoodsGalleryList(); |
| | | // if (goodsGalleryList != null && !goodsGalleryList.isEmpty()) { |
| | | // List<String> galleryList = goodsGalleryList.stream().map(item -> { |
| | | // if (StringUtils.isNotBlank(item)&&!item.contains("http")) { |
| | | // return cosUtil.getPreviewUrl(item); |
| | | // }else { |
| | | // return item; |
| | | // } |
| | | // }).collect(Collectors.toList()); |
| | | // goodsVO.setGoodsGalleryList(galleryList); |
| | | // } |
| | | return goodsVO; |
| | | } |
| | | //查询商品信息 |
| | |
| | | List<GoodsGallery> galleryList = goodsGalleryService.goodsGalleryList(goodsId); |
| | | for (GoodsGallery goodsGallery : galleryList) { |
| | | images.add(goodsGallery.getOriginal()); |
| | | // String original = goodsGallery.getOriginal(); |
| | | // if (StringUtils.isNotBlank(original)&&!original.contains("http")) { |
| | | // images.add(cosUtil.getPreviewUrl(original)); |
| | | // }else { |
| | | // images.add(goodsGallery.getOriginal()); |
| | | // } |
| | | } |
| | | goodsVO.setGoodsGalleryList(images); |
| | | //商品sku赋值 |
| | |
| | | @ApiModel(value = "ShareClickRecord表单", description = "分享点击记录表单") |
| | | public class ShareClickRecordForm extends AbsForm { |
| | | |
| | | @NotBlank(message = "分享id不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("分享id") |
| | | private String shareId; |
| | | @NotBlank(message = "业务id不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("业务id") |
| | | private String refId; |
| | | |
| | | @NotBlank(message = "分享人不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("分享人id") |
| | | private String shareUserId; |
| | | |
| | | public static ShareClickRecord getEntityByForm(@NonNull ShareClickRecordForm form, ShareClickRecord entity) { |
| | | if(entity == null) { |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import cn.lili.modules.lmk.enums.general.VideoTypeEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 微信小程序大健康查询参数 |
| | | * |
| | | * @author wp |
| | | * @since 2025-05-16 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "微信小程序大健康查询参数", description = "微信小程序大健康查询参数") |
| | | public class WxHealthVideoQuery extends AbsQuery { |
| | | |
| | | /** |
| | | * @see VideoTypeEnum |
| | | */ |
| | | @ApiModelProperty("视频类型:视频、大健康、神厨,默认不传查视频") |
| | | private String videoType = VideoTypeEnum.HEALTH.getValue(); |
| | | } |
| | | |
| | |
| | | @ApiModelProperty("视频标签") |
| | | private List<SimpleVideoTagVO> tagList; |
| | | |
| | | @ApiModelProperty("视频时长:秒") |
| | | private Long videoDuration; |
| | | |
| | | /** 视频填充模式 */ |
| | | @ApiModelProperty("视频填充模式") |
| | | private String videoFit; |
| | |
| | | */ |
| | | IPage recommendVideo(IPage page, @Param("query") VideoQuery query); |
| | | |
| | | IPage recommendHealthVideo(IPage page, @Param("query") WxHealthVideoQuery query); |
| | | |
| | | /** |
| | | * 批量更新视频收藏数量 |
| | | * |
| | |
| | | */ |
| | | Result recommendVideo(VideoQuery query); |
| | | |
| | | Result healthRecommendVideo(WxHealthVideoQuery query); |
| | | |
| | | /** |
| | | * 批量更新视频收藏数量 |
| | | * |
| | |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | |
| | | @Override |
| | | public Result addShareClick(ShareClickRecordForm form) { |
| | | // 查出分享记录 |
| | | Share share = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .eq(Share::getShareUser, form.getShareUserId()) |
| | | .eq(Share::getRefId, form.getRefId()) |
| | | .one(); |
| | | if (Objects.isNull(share)) { |
| | | return Result.ok(); |
| | | } |
| | | // 没有访问过才添加 |
| | | boolean exists = new LambdaQueryChainWrapper<>(shareClickRecordService.getBaseMapper()) |
| | | .eq(ShareClickRecord::getUserId, UserContext.getCurrentUserId()) |
| | | .eq(ShareClickRecord::getShareId, form.getShareId()) |
| | | .eq(ShareClickRecord::getShareId, share.getId()) |
| | | .exists(); |
| | | if (! exists) { |
| | | ShareClickRecord record = ShareClickRecordForm.getEntityByForm(form, null); |
| | | ShareClickRecord record = new ShareClickRecord(); |
| | | record.setShareId(share.getId()); |
| | | record.setUserId(UserContext.getCurrentUserId()); |
| | | record.setClickTime(new Date()); |
| | | shareClickRecordService.save(record); |
| | |
| | | v.setTagList(tagMap.get(v.getId())); |
| | | v.setCollected(CollectionUtils.isNotEmpty(collectMap.get(v.getId()))); |
| | | if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) { |
| | | // v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | v.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | // v.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | } else if (VideoContentTypeEnum.IMG.getValue().equals(v.getVideoContentType()) && StringUtils.isNotBlank(v.getVideoImgs())) { |
| | | v.setImgs(JSON.parseArray(v.getVideoImgs(), String.class).stream().map(fileKey -> cosUtil.getPreviewUrl(fileKey)).collect(Collectors.toList())); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Result healthRecommendVideo(WxHealthVideoQuery query) { |
| | | IPage<WxVideoVO> page = PageUtil.getPage(query, WxVideoVO.class); |
| | | //获取大健康视频列表 |
| | | baseMapper.recommendHealthVideo(page,query); |
| | | if (page.getTotal() > 0) { |
| | | page.getRecords().forEach(v -> { |
| | | if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) { |
| | | v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | // v.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | } else if (VideoContentTypeEnum.IMG.getValue().equals(v.getVideoContentType()) && StringUtils.isNotBlank(v.getVideoImgs())) { |
| | | v.setImgs(JSON.parseArray(v.getVideoImgs(), String.class).stream().map(cosUtil::getPreviewUrl).collect(Collectors.toList())); |
| | | } |
| | | v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey())); |
| | | }); |
| | | } |
| | | return Result.ok().data(page.getRecords()); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateCollectNumBatch(List<CollectTypeNumVO> numList) { |
| | | // 按500条数据进行拆分 |
| | |
| | | <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" /> |
| | |
| | | WHERE |
| | | LV.delete_flag = 0 AND LV.status = '1' AND LV.video_type = #{query.videoType} |
| | | </select> |
| | | <select id="recommendHealthVideo" 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.weight, |
| | | LV.audit_pass_time, |
| | | LV.update_time, |
| | | LV.video_content_type, |
| | | LV.video_type, |
| | | LV.video_imgs, |
| | | LV.id, |
| | | LAU.nick_name AS authorName, |
| | | LAU.avatar AS authorAvatar |
| | | FROM |
| | | lmk_video LV |
| | | LEFT JOIN li_admin_user LAU ON LV.author_id = LAU.id |
| | | WHERE |
| | | LV.delete_flag = 0 AND LV.status = '1' AND LV.video_type = #{query.videoType} |
| | | AND LV.video_content_type = 'video' |
| | | </select> |
| | | |
| | | |
| | | <update id="updateCollectNumBatch"> |
| | |
| | | import cn.lili.common.enums.ResultCode; |
| | | import cn.lili.common.enums.ResultUtil; |
| | | import cn.lili.common.exception.ServiceException; |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.common.vo.ResultMessage; |
| | | import cn.lili.modules.goods.entity.dos.Goods; |
| | | import cn.lili.modules.goods.entity.dos.GoodsSku; |
| | |
| | | import cn.lili.modules.goods.entity.vos.GoodsVO; |
| | | import cn.lili.modules.goods.service.GoodsService; |
| | | import cn.lili.modules.goods.service.GoodsSkuService; |
| | | import cn.lili.utils.COSUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | /** |
| | | * 管理端,商品管理接口 |
| | |
| | | @Autowired |
| | | private GoodsSkuService goodsSkuService; |
| | | |
| | | @Autowired |
| | | private COSUtil cosUtil; |
| | | |
| | | @ApiOperation(value = "分页获取") |
| | | @GetMapping(value = "/list") |
| | | public ResultMessage<IPage<Goods>> getByPage(GoodsSearchParams goodsSearchParams) { |
| | |
| | | @GetMapping(value = "/auth/list") |
| | | public ResultMessage<IPage<Goods>> getAuthPage(GoodsSearchParams goodsSearchParams) { |
| | | goodsSearchParams.setAuthFlag(GoodsAuthEnum.TOBEAUDITED.name()); |
| | | return ResultUtil.data(goodsService.queryByParams(goodsSearchParams)); |
| | | IPage<Goods> page = goodsService.queryByParams(goodsSearchParams); |
| | | page.getRecords().forEach(item -> { |
| | | String original = item.getOriginal(); |
| | | String goodsVideo = item.getGoodsVideo(); |
| | | if (StringUtils.isNotBlank(original)&&!original.contains("http")) { |
| | | item.setOriginal(cosUtil.getPreviewUrl(original)); |
| | | } |
| | | if (StringUtils.isNotBlank(goodsVideo)&&!goodsVideo.contains("http")) { |
| | | item.setGoodsVideo(cosUtil.getPreviewUrl(goodsVideo)); |
| | | } |
| | | }); |
| | | return ResultUtil.data(page); |
| | | } |
| | | |
| | | @PreventDuplicateSubmissions |
| | |
| | | import cn.lili.common.exception.ServiceException; |
| | | import cn.lili.common.security.OperationalJudgment; |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.common.vo.ResultMessage; |
| | | import cn.lili.modules.goods.entity.dos.Goods; |
| | | import cn.lili.modules.goods.entity.dos.GoodsSku; |
| | |
| | | import cn.lili.modules.statistics.aop.enums.PageViewEnum; |
| | | import cn.lili.modules.store.entity.dos.StoreDetail; |
| | | import cn.lili.modules.store.service.StoreDetailService; |
| | | import cn.lili.utils.COSUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | */ |
| | | @Autowired |
| | | private GoodsSkuService goodsSkuService; |
| | | @Autowired |
| | | private COSUtil cosUtil; |
| | | |
| | | |
| | | @ApiOperation(value = "分页获取商品列表") |
| | |
| | | //获取当前登录商家账号 |
| | | String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); |
| | | goodsSearchParams.setStoreId(storeId); |
| | | return ResultUtil.data(goodsService.queryByParams(goodsSearchParams)); |
| | | IPage<Goods> page = goodsService.queryByParams(goodsSearchParams); |
| | | page.getRecords().forEach(goodsVO -> { |
| | | if (StringUtils.isNotBlank(goodsVO.getOriginal())&& !goodsVO.getOriginal().contains("http")) { |
| | | goodsVO.setOriginal(cosUtil.getPreviewUrl(goodsVO.getOriginal())); |
| | | } |
| | | if (StringUtils.isNotBlank(goodsVO.getGoodsVideo())&& !goodsVO.getGoodsVideo().contains("http")) { |
| | | goodsVO.setGoodsVideo(cosUtil.getPreviewUrl(goodsVO.getGoodsVideo())); |
| | | } |
| | | }); |
| | | return ResultUtil.data(page); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页获取商品Sku列表") |