| | |
| | | // @NotBlank(message = "视频封面不能为空", groups = {Add.class, Update.class}) |
| | | private String cover; |
| | | |
| | | |
| | | @ApiModelProperty("权重") |
| | | // @NotBlank(message = "权重", groups = {Add.class, Update.class}) |
| | | private Double weight; |
| | | |
| | | @ApiModelProperty("视频内容类型:视频、图片") |
| | | @NotBlank(message = "视频类型不能为空") |
| | | private String videoContentType; |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import cn.lili.common.security.context.UserContext; |
| | | 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.MySubscribe; |
| | | import cn.lili.modules.lmk.mapper.MySubscribeMapper; |
| | |
| | | |
| | | private final MySubscribeMapper mySubscribeMapper; |
| | | |
| | | private final COSUtil cosUtil; |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | |
| | | query.setUserId(UserContext.getCurrentUserId()); |
| | | IPage<MySubscribeVO> page = PageUtil.getPage(query, MySubscribeVO.class); |
| | | baseMapper.getPage(page, query); |
| | | page.getRecords().forEach(mySubscribeVO -> { |
| | | String subscribeUserAvatar = mySubscribeVO.getSubscribeUserAvatar(); |
| | | if (StringUtils.isNotBlank(subscribeUserAvatar)&&!subscribeUserAvatar.contains("http")) { |
| | | mySubscribeVO.setSubscribeUserAvatar(cosUtil.getPreviewUrl(subscribeUserAvatar)); |
| | | } |
| | | }); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | |
| | | } else { |
| | | vo.setLikeNum(0L); |
| | | } |
| | | if (StringUtils.isNotBlank(vo.getAvatar())&&!vo.getAvatar().contains("http")) { |
| | | vo.setAvatar(cosUtil.getPreviewUrl(vo.getAvatar())); |
| | | } |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | |
| | | 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 (StringUtils.isNotBlank(v.getAuthorAvatar())&&!v.getAuthorAvatar().contains("http")) { |
| | | 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())); |
| | |
| | | } |
| | | NativeSearchQueryBuilder searchQueryBuilder = createSearchQueryBuilder(searchDTO, pageVo); |
| | | if (Objects.nonNull(searchDTO.getCanFilter()) && searchDTO.getCanFilter()) { |
| | | // 使用sn字段排序并在折叠时选择sn最小的记录 |
| | | searchQueryBuilder.withCollapseField("goodsId.keyword"); |
| | | searchQueryBuilder.withSort(SortBuilders.fieldSort("sn.keyword").order(SortOrder.ASC)); |
| | | } |
| | | NativeSearchQuery searchQuery = searchQueryBuilder.build(); |
| | | searchQuery.setTrackTotalHits(true); |
| | |
| | | </select> |
| | | |
| | | |
| | | <!-- <select id="getPage" resultMap="BaseResultMap">--> |
| | | <!-- SELECT--> |
| | | <!-- LMS.subscribe_user_id,--> |
| | | <!-- LMS.id,--> |
| | | <!-- LM.nick_name,--> |
| | | <!-- LM.face--> |
| | | <!-- FROM--> |
| | | <!-- lmk_my_subscribe LMS--> |
| | | <!-- LEFT JOIN li_member LM ON LMS.subscribe_user_id = LM.id--> |
| | | <!-- WHERE--> |
| | | <!-- LMS.delete_flag = 0 AND LMS.user_id = #{query.userId}--> |
| | | <!-- </select> --> |
| | | |
| | | <select id="getPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LMS.subscribe_user_id, |
| | |
| | | lmk_my_subscribe LMS |
| | | LEFT JOIN li_member LM ON LMS.subscribe_user_id = LM.id |
| | | WHERE |
| | | LMS.delete_flag = 0 AND LMS.user_id = #{query.userId} |
| | | LM.id IS NOT NULL |
| | | and LMS.delete_flag = 0 AND LMS.user_id = #{query.userId} |
| | | UNION ALL |
| | | SELECT |
| | | LMS.subscribe_user_id, |
| | | LMS.id, |
| | | LM.nick_name, |
| | | LM.avatar face |
| | | FROM |
| | | lmk_my_subscribe LMS |
| | | LEFT JOIN li_admin_user LM ON LMS.subscribe_user_id = LM.id |
| | | WHERE |
| | | LM.id IS NOT NULL |
| | | and LMS.delete_flag = 0 AND LMS.user_id = #{query.userId} |
| | | </select> |
| | | |
| | | <select id="getSubscribesByUserId" parameterType="string" resultType="string"> |
| | |
| | | <if test="query.prizeType != null and query.prizeType != ''"> |
| | | AND LPD.prize_type = #{query.prizeType} |
| | | </if> |
| | | order by |
| | | LPD.create_time DESC |
| | | </select> |
| | | <resultMap id="grantRecordMap" type="cn.lili.modules.lmk.domain.vo.GrantRecordVO"> |
| | | <result property="nickname" column="nick_name"/> |
| | |
| | | lmk_scan_prize LSP |
| | | WHERE |
| | | LSP.delete_flag = 0 |
| | | order by |
| | | LSP.create_time DESC |
| | | </select> |
| | | <resultMap id="getStorePrizeMap" type="cn.lili.modules.lmk.domain.vo.StorePrizeVO"> |
| | | <id column="id" property="id"/> |
| | |
| | | <if test="query.title != null and query.title != ''">AND LV.title LIKE CONCAT('%', #{query.title}, '%')</if> |
| | | <if test="query.authorId != null and query.authorId != ''">AND LV.author_id = #{query.authorId}</if> |
| | | <if test="query.status != null and query.status != ''">AND LV.status = #{query.status}</if> |
| | | order by LV.create_time DESC |
| | | </select> |
| | | |
| | | <!-- todo 备份原有的失去了文件--> |
| | |
| | | AND LM.id IS NOT NULL |
| | | ORDER BY |
| | | recommend DESC, |
| | | weight DESC, |
| | | create_time DESC |
| | | </select> |
| | | <select id="recommendVideoByVideoId" resultMap="WxResultMap"> |
| | |
| | | collection="videoIds" open="(" close=")" separator="," item="videoId">#{videoId}</foreach> |
| | | </select> |
| | | |
| | | <!-- <select id="getAuthorVideoPage" 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.video_content_type,--> |
| | | <!-- LV.video_type,--> |
| | | <!-- LV.video_imgs,--> |
| | | <!-- LV.id,--> |
| | | <!-- LM.nick_name as authorName,--> |
| | | <!-- LM.face as authorAvatar--> |
| | | <!-- FROM--> |
| | | <!-- lmk_video LV--> |
| | | <!-- LEFT JOIN li_member LM ON LV.author_id = LM.id--> |
| | | <!-- WHERE--> |
| | | <!-- LV.delete_flag = 0--> |
| | | <!-- <if test="!query.authorSelf">--> |
| | | <!-- AND LV.status = '1'--> |
| | | <!-- </if>--> |
| | | <!-- AND LV.author_id = #{query.authorId}--> |
| | | <!-- AND LV.video_type = #{query.videoType}--> |
| | | <!-- ORDER BY--> |
| | | <!-- LV.collect_num DESC--> |
| | | <!-- </select>--> |
| | | <select id="getAuthorVideoPage" resultMap="WxResultMap"> |
| | | SELECT |
| | | select * from (SELECT |
| | | LV.author_id, |
| | | LV.cover_url, |
| | | LV.video_fit, |
| | |
| | | LV.goods_view_num, |
| | | LV.goods_order_num, |
| | | LV.recommend, |
| | | LV.status, |
| | | LV.STATUS, |
| | | LV.play_num, |
| | | LV.comment_num, |
| | | LV.collect_num, |
| | |
| | | LV.video_type, |
| | | LV.video_imgs, |
| | | LV.id, |
| | | LM.nick_name as authorName, |
| | | LM.face as authorAvatar |
| | | LM.nick_name AS authorName, |
| | | LM.face AS authorAvatar |
| | | FROM |
| | | lmk_video LV |
| | | LEFT JOIN li_member LM ON LV.author_id = LM.id |
| | | WHERE |
| | | LV.delete_flag = 0 |
| | | <if test="!query.authorSelf"> |
| | | AND LV.status = '1' |
| | | </if> |
| | | AND LV.author_id = #{query.authorId} |
| | | AND LV.video_type = #{query.videoType} |
| | | LV.delete_flag = 0 |
| | | <if test="!query.authorSelf"> |
| | | AND LV.status = '1' |
| | | </if> |
| | | AND LV.author_id = #{query.authorId} |
| | | AND LV.video_type = #{query.videoType} |
| | | and lm.id IS NOT NULL |
| | | UNION ALL |
| | | 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.video_content_type, |
| | | LV.video_type, |
| | | LV.video_imgs, |
| | | LV.id, |
| | | LM.nick_name AS authorName, |
| | | LM.avatar AS authorAvatar |
| | | FROM |
| | | lmk_video LV |
| | | LEFT JOIN li_admin_user LM ON LV.author_id = LM.id |
| | | WHERE |
| | | LV.delete_flag = 0 |
| | | <if test="!query.authorSelf"> |
| | | AND LV.status = '1' |
| | | </if> |
| | | AND LV.author_id = #{query.authorId} |
| | | AND LV.video_type = #{query.videoType} |
| | | and lm.id IS NOT NULL) t |
| | | ORDER BY |
| | | LV.collect_num DESC |
| | | t.collect_num DESC |
| | | </select> |
| | | |
| | | <select id="getAuthorCollectVideoPage" resultMap="WxResultMap"> |
| | |
| | | |
| | | import cn.lili.common.aop.annotation.DemoSite; |
| | | import cn.lili.common.enums.ResultUtil; |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.common.vo.PageVO; |
| | | import cn.lili.common.vo.ResultMessage; |
| | | import cn.lili.modules.store.entity.dos.Store; |
| | |
| | | import cn.lili.modules.store.entity.vos.StoreVO; |
| | | import cn.lili.modules.store.service.StoreDetailService; |
| | | import cn.lili.modules.store.service.StoreService; |
| | | import cn.lili.utils.COSUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import jodd.util.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @Autowired |
| | | private StoreDetailService storeDetailService; |
| | | |
| | | @Autowired |
| | | private COSUtil cosUtil; |
| | | @ApiOperation(value = "获取店铺分页列表") |
| | | @GetMapping("/all") |
| | | public ResultMessage<List<Store>> getAll() { |
| | |
| | | @GetMapping(value = "/get/detail/{storeId}") |
| | | public ResultMessage<StoreDetailVO> detail(@PathVariable String storeId) { |
| | | // todo 对于刚提交审核的信息需要等待缓存失效后才能操作,否则缓存信息还在 |
| | | return ResultUtil.data(storeDetailService.getStoreDetailVO(storeId)); |
| | | StoreDetailVO storeDetailVO = storeDetailService.getStoreDetailVO(storeId); |
| | | if (StringUtils.isNotBlank(storeDetailVO.getStoreLogo())&&!storeDetailVO.getStoreLogo().contains("http")) { |
| | | storeDetailVO.setStoreLogo(cosUtil.getPreviewUrl(storeDetailVO.getStoreLogo())); |
| | | } |
| | | if (StringUtils.isNotBlank(storeDetailVO.getLegalPhoto())&&!storeDetailVO.getLegalPhoto().contains("http")) { |
| | | storeDetailVO.setLegalPhoto(cosUtil.getPreviewUrl(storeDetailVO.getLegalPhoto())); |
| | | } |
| | | if (StringUtils.isNotBlank(storeDetailVO.getLicencePhoto())&&!storeDetailVO.getLicencePhoto().contains("http")) { |
| | | storeDetailVO.setLicencePhoto(cosUtil.getPreviewUrl(storeDetailVO.getLicencePhoto())); |
| | | } |
| | | return ResultUtil.data(storeDetailVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加店铺") |