| | |
| | | package cn.lili.controller.goods; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.common.enums.ResultCode; |
| | | import cn.lili.common.enums.ResultUtil; |
| | | import cn.lili.common.exception.ServiceException; |
| | |
| | | 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.modules.lmk.domain.query.VideoGoodsEsQuery; |
| | | import cn.lili.modules.search.entity.dos.EsGoodsIndex; |
| | | import cn.lili.modules.search.entity.dos.EsGoodsRelatedInfo; |
| | | import cn.lili.modules.search.entity.dto.EsGoodsSearchDTO; |
| | |
| | | return ResultUtil.data(goodsSearchService.searchGoodsByPage(goodsSearchParams, pageVO)); |
| | | } |
| | | |
| | | @ApiOperation(value = "商品分页-发布视频时关联商品") |
| | | @GetMapping("/video/es") |
| | | public Result videoGoodsEsPage(VideoGoodsEsQuery query) { |
| | | return goodsSearchService.videoGoodsEsPage(query); |
| | | } |
| | | |
| | | @ApiOperation(value = "从ES中获取相关商品品牌名称,分类名称及属性") |
| | | @GetMapping("/es/related") |
| | | public ResultMessage<EsGoodsRelatedInfo> getGoodsRelatedByPageFromEs(EsGoodsSearchDTO goodsSearchParams, PageVO pageVO) { |
New file |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.modules.lmk.domain.form.ShareClickRecordForm; |
| | | import cn.lili.modules.lmk.domain.form.ShareForm; |
| | | import cn.lili.modules.lmk.service.ShareService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * 分享记录 前端控制器 |
| | | * |
| | | * @author xp |
| | | * @since 2025-06-16 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "分享记录", tags = "分享记录管理") |
| | | @RestController |
| | | @RequestMapping("/buyer/lmk/share") |
| | | public class ShareController { |
| | | |
| | | private final ShareService shareService; |
| | | |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "添加分享", notes = "添加分享") |
| | | public Result add(@RequestBody @Validated(Add.class) ShareForm form) { |
| | | return shareService.add(form); |
| | | } |
| | | |
| | | @PostMapping("/click/record") |
| | | @ApiOperation(value = "添加分享访问记录", notes = "添加分享访问记录") |
| | | public Result addShareClick(@RequestBody @Validated(Add.class) ShareClickRecordForm form) { |
| | | return shareService.addShareClick(form); |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public Result update(@RequestBody @Validated(Update.class) WxVideoForm form) { |
| | | return videoService.update(form); |
| | | return videoService.updatePublish(form); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation(value = "ID删除", notes = "ID删除") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | return videoService.removeById(id); |
| | | } |
| | | |
| | | @PostMapping("/down/{id}") |
| | | @ApiOperation(value = "用户下架视频", notes = "用户下架视频") |
| | | public Result downVideo(@PathVariable("id") String id) { |
| | | return videoService.buyerDownVideo(id); |
| | | } |
| | | |
| | | @DeleteMapping("/batch") |
| | |
| | | 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 = "视频商品查看") |
| | | public Result getGoodsDetail(@PathVariable("videoId") String videoId) { |
| | | return videoService.getGoodsDetail(videoId); |
| | | } |
| | | |
| | | @PostMapping("/view/record") |
| | | @ApiOperation(value = "保存观看记录", notes = "保存观看记录") |
| | |
| | | package cn.lili.controller.passport.connect; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.common.enums.ResultUtil; |
| | | import cn.lili.common.security.token.Token; |
| | | import cn.lili.common.vo.ResultMessage; |
| | |
| | | return ResultUtil.data(this.connectService.miniProgramAutoLogin(params)); |
| | | } |
| | | |
| | | @GetMapping("/silent-login") |
| | | @ApiOperation(value = "小程序静默登录--不获取用户信息") |
| | | public Result silentLogin(String code) { |
| | | return this.connectService.silentLogin(code); |
| | | } |
| | | |
| | | @GetMapping("/subscribeMessage") |
| | | @ApiOperation(value = "消息订阅") |
| | | public ResultMessage<List<WechatMPMessage>> autoLogin() { |
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----- |
| | |
| | | |
| | | # 腾讯cos-sts配置 |
| | | cos: |
| | | secretId: AKIDYyBCzb1FOPGx0fCXfdOwJVWM1TjqmW3N # 腾讯ARM用户的secretId |
| | | secretKey: DD1b1LWVIvPlusAOYjnfKm150jO0NYWH # 腾讯ARM用户的secretKey |
| | | secretId: AKID6zd07yZtwjFVVGkxvc2C5h26uTmpc9QQ # 腾讯ARM用户的secretId |
| | | secretKey: lFTcV6RVIo43lCMFsEKAk36tRjlVzC8n # 腾讯ARM用户的secretKey |
| | | durationSeconds: 1800 # STS临时访问凭证有效期,单位秒,默认1800s,主账号最长2小时,子账号(ARM用户)36小时 |
| | | bucket: lmk-1308069279 |
| | | bucket: lmk-1356772813 |
| | | region: ap-chengdu |
| | | endpoint: https://lmk-1308069279.cos.ap-chengdu.myqcloud.com # 访问域名 |
| | | endpoint: https://lmk-1356772813.cos.ap-chengdu.myqcloud.com # 访问域名 |
| | | urlExpireMinute: 360 # 预签名url有效时间(分钟) |
| | | actions: # sts的权限 |
| | | - cos:ListMultipartUploads |
| | | - cos:GetBucket |
| | | - cos:GetBucketACL |
| | | - cos:GetObject |
| | | - cos:GetObjectACL |
| | | - cos:GetObjectTagging |
| | | - cos:GetSymlink |
| | | - cos:HeadObject |
| | | - cos:ListMultipartUploads |
| | | - cos:ListParts |
| | | - cos:AbortMultipartUpload |
| | | - cos:AppendObject |
| | | - cos:CompleteMultipartUpload |
| | | - cos:DeleteMultipleObjects |
| | | - cos:DeleteObject |
| | | - cos:InitiateMultipartUpload |
| | | - cos:PostObject |
| | | - cos:PutObject |
| | | - cos:UploadPart |
| | | - cos:DeleteObject |
| | | - cos:PutObjectACL |
| | | - cos:PutObjectCopy |
| | | - cos:PutObjectTagging |
| | | - cos:RenameObject |
| | | - cos:UploadPart |
| | | - cos:UploadPartCopy |
| | | resources: # 能操作哪些资源 |
| | | - qcs::cos:ap-chengdu:uid/1308069279:lmk-1308069279/* |
| | | - qcs::cos::uid/1356772813:lmk-1356772813/* |
| | |
| | | package cn.lili.modules.connect.service; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.cache.CachePrefix; |
| | | import cn.lili.common.security.token.Token; |
| | | import cn.lili.modules.connect.entity.Connect; |
| | |
| | | * @param type 平台类型 |
| | | */ |
| | | void loginBindUser(String userId, String unionId, String type); |
| | | } |
| | | |
| | | /** |
| | | * 小程序静默登录 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | | Result silentLogin(String code); |
| | | } |
| | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.cache.Cache; |
| | | import cn.lili.common.enums.ClientTypeEnum; |
| | | import cn.lili.common.enums.ResultCode; |
| | |
| | | */ |
| | | @Autowired |
| | | private RocketmqCustomProperties rocketmqCustomProperties; |
| | | |
| | | static String DEFAULT_PASSWORD = "111111"; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Result silentLogin(String code) { |
| | | JSONObject res = this.getConnect(code); |
| | | String unionId = res.getStr("unionid"); |
| | | String openId = res.getStr("openid"); |
| | | Member user = memberService.findByUUID(openId); |
| | | // 不存在就注册 |
| | | if (Objects.isNull(user)) { |
| | | user = new Member(); |
| | | user.setUuId(openId); |
| | | user.setUsername(UuidUtils.getUUID()); |
| | | user.setNickName("微信用户"); |
| | | user.setPassword(DEFAULT_PASSWORD); |
| | | 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赋值 |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.entity; |
| | | |
| | | import cn.lili.mybatis.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 厨神类型 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Data |
| | | @TableName("lmk_kitchen_type") |
| | | public class KitchenType extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField("type_name") |
| | | /** 厨神类型 */ |
| | | private String typeName; |
| | | |
| | | @TableField("use_num") |
| | | /** 使用次数 */ |
| | | private Long useNum; |
| | | |
| | | @TableField("sort_num") |
| | | /** 排序字段 */ |
| | | private Long sortNum; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.entity; |
| | | |
| | | import cn.lili.mybatis.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 厨神视频标签关系表 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Data |
| | | @TableName("lmk_kitchen_video_type_ref") |
| | | public class KitchenVideoTypeRef implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId |
| | | @ApiModelProperty(value = "唯一标识", hidden = true) |
| | | private String id; |
| | | |
| | | @TableField("video_id") |
| | | /** 视频id */ |
| | | private String videoId; |
| | | |
| | | @TableField("kitchen_type_id") |
| | | /** 厨神标签id */ |
| | | private String kitchenTypeId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.entity; |
| | | |
| | | import cn.lili.mybatis.BaseIdAndDeleteEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 分享记录 |
| | | * |
| | | * @author xp |
| | | * @since 2025-06-16 |
| | | */ |
| | | @Data |
| | | @TableName("lmk_share") |
| | | public class Share extends BaseIdAndDeleteEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField("share_type") |
| | | /** 哪个业务的分享 */ |
| | | private String shareType; |
| | | |
| | | @TableField("ref_id") |
| | | /** 业务id */ |
| | | private String refId; |
| | | |
| | | @TableField("share_user") |
| | | /** 分享人 */ |
| | | private String shareUser; |
| | | |
| | | @TableField("share_time") |
| | | /** 分享时间 */ |
| | | private Date shareTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.entity; |
| | | |
| | | import cn.lili.mybatis.BaseIdAndDeleteEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 分享点击记录 |
| | | * |
| | | * @author xp |
| | | * @since 2025-06-16 |
| | | */ |
| | | @Data |
| | | @TableName("lmk_share_click_record") |
| | | public class ShareClickRecord extends BaseIdAndDeleteEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField("share_id") |
| | | /** 分享id */ |
| | | private String shareId; |
| | | |
| | | @TableField("user_id") |
| | | /** 谁点了这个分享 */ |
| | | private String userId; |
| | | |
| | | @TableField("click_time") |
| | | /** 点击时间 */ |
| | | private Date clickTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 视频商品中间表 |
| | | * |
| | | * @author xp |
| | | * @since 2025-06-15 |
| | | */ |
| | | @Data |
| | | @TableName("lmk_video_goods") |
| | | public class VideoGoods { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId |
| | | @ApiModelProperty(value = "唯一标识", hidden = true) |
| | | private String id; |
| | | |
| | | @TableField("video_id") |
| | | /** 视频id */ |
| | | private String videoId; |
| | | |
| | | @TableField("goods_id") |
| | | /** 商品id */ |
| | | private String goodsId; |
| | | |
| | | @TableField("order_num") |
| | | /** 排序 */ |
| | | private Integer orderNum; |
| | | |
| | | @TableField("goods_num") |
| | | /** 商品数量 */ |
| | | private Integer goodsNum; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ApiModelProperty(value = "删除标志 true/false 删除/未删除", hidden = true) |
| | | private Boolean deleteFlag; |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.form; |
| | | |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.group.Update; |
| | | import cn.lili.mybatis.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 大健康视频内容 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-12 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "大健康视频内容", description = "大健康视频内容") |
| | | public class HealthVideoForm extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 作者id */ |
| | | @ApiModelProperty(value = "主键id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "图片封面") |
| | | /** 图片封面 */ |
| | | @NotBlank(message = "封面图片不能为空", groups = {Add.class, Update.class}) |
| | | private String coverUrl; |
| | | |
| | | @TableField("video_file_key") |
| | | /** 视频地址 */ |
| | | @NotBlank(message = "视频地址不能为空", groups = {Add.class, Update.class}) |
| | | private String videoFileKey; |
| | | |
| | | |
| | | /** 视频长度(秒) */ |
| | | // @NotNull(message = "视频长度不能为空", groups = {Add.class, Update.class}) |
| | | private Long videoDuration; |
| | | |
| | | /** 视频标题 */ |
| | | @NotBlank(message = "标题不能为空", groups = {Add.class, Update.class}) |
| | | private String title; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.form; |
| | | |
| | | import cn.lili.group.Update; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.base.AbsForm; |
| | | import cn.lili.modules.lmk.domain.entity.KitchenType; |
| | | import org.springframework.beans.BeanUtils; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import org.springframework.lang.NonNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 厨神类型表单 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "KitchenType表单", description = "厨神类型表单") |
| | | public class KitchenTypeForm extends AbsForm { |
| | | |
| | | @NotBlank(message = "厨神类型不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("厨神类型") |
| | | private String typeName; |
| | | |
| | | @ApiModelProperty("使用次数") |
| | | private Long useNum; |
| | | |
| | | @NotNull(message = "排序字段不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("排序字段") |
| | | private Long sortNum; |
| | | |
| | | public static KitchenType getEntityByForm(@NonNull KitchenTypeForm form, KitchenType entity) { |
| | | if(entity == null) { |
| | | entity = new KitchenType(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.form; |
| | | |
| | | import cn.lili.group.Add; |
| | | import cn.lili.group.Update; |
| | | import cn.lili.mybatis.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.Size; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 厨神视频发布 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-12 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "厨神视频发布", description = "厨神视频发布") |
| | | public class KitchenVideoForm extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 作者id */ |
| | | @ApiModelProperty(value = "主键id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "图片封面") |
| | | /** 图片封面 */ |
| | | @NotBlank(message = "封面图片不能为空", groups = {Add.class, Update.class}) |
| | | private String coverUrl; |
| | | |
| | | @TableField("video_file_key") |
| | | /** 视频地址 */ |
| | | @NotBlank(message = "视频地址不能为空", groups = {Add.class, Update.class}) |
| | | private String videoFileKey; |
| | | |
| | | |
| | | /** 视频长度(秒) */ |
| | | // @NotNull(message = "视频长度不能为空", groups = {Add.class, Update.class}) |
| | | private Long videoDuration; |
| | | |
| | | /** 视频标题 */ |
| | | @NotBlank(message = "标题不能为空", groups = {Add.class, Update.class}) |
| | | private String title; |
| | | |
| | | /** 标签列表 */ |
| | | @Size(min = 1,max = 5, message = "标签列表不能为空",groups = {Add.class, Update.class}) |
| | | private List<String> checkKitchenType; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.form; |
| | | |
| | | import cn.lili.group.Update; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.base.AbsForm; |
| | | import cn.lili.modules.lmk.domain.entity.KitchenVideoTypeRef; |
| | | import org.springframework.beans.BeanUtils; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import org.springframework.lang.NonNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 厨神视频标签关系表表单 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "KitchenVideoTypeRef表单", description = "厨神视频标签关系表表单") |
| | | public class KitchenVideoTypeRefForm extends AbsForm { |
| | | |
| | | @NotBlank(message = "视频id不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("视频id") |
| | | private String videoId; |
| | | |
| | | @NotBlank(message = "厨神标签id不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("厨神标签id") |
| | | private String kitchenTypeId; |
| | | |
| | | public static KitchenVideoTypeRef getEntityByForm(@NonNull KitchenVideoTypeRefForm form, KitchenVideoTypeRef entity) { |
| | | if(entity == null) { |
| | | entity = new KitchenVideoTypeRef(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.form; |
| | | |
| | | import cn.lili.group.Update; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.base.AbsForm; |
| | | import cn.lili.modules.lmk.domain.entity.ShareClickRecord; |
| | | import org.springframework.beans.BeanUtils; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import org.springframework.lang.NonNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 分享点击记录表单 |
| | | * |
| | | * @author xp |
| | | * @since 2025-06-16 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "ShareClickRecord表单", description = "分享点击记录表单") |
| | | public class ShareClickRecordForm extends AbsForm { |
| | | |
| | | @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) { |
| | | entity = new ShareClickRecord(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.form; |
| | | |
| | | import cn.lili.group.Update; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.base.AbsForm; |
| | | import cn.lili.modules.lmk.domain.entity.Share; |
| | | import org.springframework.beans.BeanUtils; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import org.springframework.lang.NonNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 分享记录表单 |
| | | * |
| | | * @author xp |
| | | * @since 2025-06-16 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "Share表单", description = "分享记录表单") |
| | | public class ShareForm extends AbsForm { |
| | | |
| | | @NotBlank(message = "业务类型不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("哪个业务的分享") |
| | | private String shareType; |
| | | |
| | | @NotBlank(message = "业务id不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("业务id") |
| | | private String refId; |
| | | |
| | | @NotBlank(message = "分享人不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("分享人") |
| | | private String shareUser; |
| | | |
| | | @ApiModelProperty("分享时间") |
| | | private Date shareTime; |
| | | |
| | | public static Share getEntityByForm(@NonNull ShareForm form, Share entity) { |
| | | if(entity == null) { |
| | | entity = new Share(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | |
| | | } |
| | |
| | | import cn.lili.group.Add; |
| | | import cn.lili.base.AbsForm; |
| | | import cn.lili.modules.lmk.domain.entity.Video; |
| | | import org.hibernate.validator.constraints.Length; |
| | | import cn.lili.modules.lmk.domain.vo.VideoGoodsPublishVO; |
| | | import org.springframework.beans.BeanUtils; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | |
| | | import org.springframework.lang.NonNull; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | private List<String> videoImgs; |
| | | |
| | | @ApiModelProperty("视频标签") |
| | | @Length(max = 5, message = "最多只能添加五个标签") |
| | | @Size(max = 5, message = "最多只能添加五个标签", groups = {Add.class, Update.class}) |
| | | private List<WxVideoTagForm> tags = new ArrayList<>(2); |
| | | |
| | | // @NotBlank(message = "商品id不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("商品id") |
| | | private String goodsId; |
| | | @ApiModelProperty("商品列表") |
| | | private List<VideoGoodsPublishVO> goodsList; |
| | | |
| | | @ApiModelProperty("视频填充模式") |
| | | private String videoFit; |
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; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 视频内容查询 |
| | | * |
| | | * @author xp |
| | | * @since 2025-05-16 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "平台端Video查询参数", description = "视频内容查询参数") |
| | | public class HealthVideoQuery extends AbsQuery { |
| | | |
| | | @ApiModelProperty("标题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty("视频标签") |
| | | private List<String> tagList; |
| | | |
| | | @ApiModelProperty("作者") |
| | | private String authorId; |
| | | |
| | | @ApiModelProperty("状态") |
| | | private String status; |
| | | |
| | | /** |
| | | * @see VideoTypeEnum |
| | | */ |
| | | @ApiModelProperty("视频类型:视频、大健康、神厨,默认不传查视频") |
| | | private String videoType = VideoTypeEnum.HEALTH.getValue(); |
| | | } |
| | | |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 厨神类型查询 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "KitchenType查询参数", description = "厨神类型查询参数") |
| | | public class KitchenTypeQuery extends AbsQuery { |
| | | @ApiModelProperty("标签名称") |
| | | private String typeName; |
| | | } |
| | | |
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; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 视频内容查询 |
| | | * |
| | | * @author xp |
| | | * @since 2025-05-16 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "平台端厨神Video查询参数", description = "视频内容查询参数") |
| | | public class KitchenVideoQuery extends AbsQuery { |
| | | |
| | | @ApiModelProperty("标题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty("视频标签") |
| | | private List<String> typeList; |
| | | |
| | | @ApiModelProperty("作者") |
| | | private String authorId; |
| | | |
| | | @ApiModelProperty("状态") |
| | | private String status; |
| | | |
| | | /** |
| | | * @see VideoTypeEnum |
| | | */ |
| | | @ApiModelProperty("视频类型:视频、大健康、神厨,默认不传查视频") |
| | | private String videoType = VideoTypeEnum.COOK.getValue(); |
| | | } |
| | | |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 厨神视频标签关系表查询 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "KitchenVideoTypeRef查询参数", description = "厨神视频标签关系表查询参数") |
| | | public class KitchenVideoTypeRefQuery extends AbsQuery { |
| | | } |
| | | |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 分享点击记录查询 |
| | | * |
| | | * @author xp |
| | | * @since 2025-06-16 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "ShareClickRecord查询参数", description = "分享点击记录查询参数") |
| | | public class ShareClickRecordQuery extends AbsQuery { |
| | | } |
| | | |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 分享记录查询 |
| | | * |
| | | * @author xp |
| | | * @since 2025-06-16 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "Share查询参数", description = "分享记录查询参数") |
| | | public class ShareQuery extends AbsQuery { |
| | | } |
| | | |
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; |
| | | |
| | | /** |
| | | * 发布视频时,关联商品的查询 |
| | | * |
| | | * @author:xp |
| | | * @date:2025/6/13 10:04 |
| | | */ |
| | | @Data |
| | | @ApiModel("发布视频时,关联商品的查询") |
| | | public class VideoGoodsEsQuery { |
| | | |
| | | @ApiModelProperty("搜索关键词") |
| | | private String keyword; |
| | | |
| | | @ApiModelProperty("查自家店铺的商品") |
| | | private Boolean searchFromSelfStore; |
| | | |
| | | |
| | | private int pageNumber; |
| | | |
| | | private int pageSize; |
| | | } |
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(); |
| | | } |
| | | |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | import cn.lili.modules.lmk.domain.entity.KitchenType; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import org.springframework.beans.BeanUtils; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 厨神类型展示 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "厨神类型响应数据", description = "厨神类型响应数据") |
| | | public class KitchenTypeVO extends AbsVo { |
| | | |
| | | /** 厨神类型 */ |
| | | @ApiModelProperty("厨神类型") |
| | | private String typeName; |
| | | |
| | | /** 使用次数 */ |
| | | @ApiModelProperty("使用次数") |
| | | private Long useNum; |
| | | |
| | | /** 排序字段 */ |
| | | @ApiModelProperty("排序字段") |
| | | private Long sortNum; |
| | | |
| | | public static KitchenTypeVO getVoByEntity(@NonNull KitchenType entity, KitchenTypeVO vo) { |
| | | if(vo == null) { |
| | | vo = new KitchenTypeVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | import cn.lili.modules.lmk.domain.entity.KitchenVideoTypeRef; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import org.springframework.beans.BeanUtils; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 厨神视频标签关系表展示 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "厨神视频标签关系表响应数据", description = "厨神视频标签关系表响应数据") |
| | | public class KitchenVideoTypeRefVO extends AbsVo { |
| | | |
| | | /** 视频id */ |
| | | @ApiModelProperty("视频id") |
| | | private String videoId; |
| | | |
| | | /** 厨神标签id */ |
| | | @ApiModelProperty("厨神标签id") |
| | | private String kitchenTypeId; |
| | | |
| | | public static KitchenVideoTypeRefVO getVoByEntity(@NonNull KitchenVideoTypeRef entity, KitchenVideoTypeRefVO vo) { |
| | | if(vo == null) { |
| | | vo = new KitchenVideoTypeRefVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | import cn.lili.modules.lmk.domain.entity.KitchenVideoTypeRef; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.lang.NonNull; |
| | | |
| | | /** |
| | | * 厨神视频标签关系表展示 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "厨神视频标签关系表响应数据", description = "厨神视频标签关系表响应数据") |
| | | public class KitchenVideoTypeVO extends AbsVo { |
| | | |
| | | /** 视频id */ |
| | | @ApiModelProperty("视频id") |
| | | private String videoId; |
| | | |
| | | /** 分类id */ |
| | | @ApiModelProperty("分类id") |
| | | private String id; |
| | | |
| | | /** 分类名称 */ |
| | | @ApiModelProperty("分类名称") |
| | | private String typeName; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | import cn.lili.modules.lmk.domain.entity.Video; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.lang.NonNull; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 视频内容展示 |
| | | * |
| | | * @author xp |
| | | * @since 2025-05-16 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "视频内容响应数据", description = "视频内容响应数据") |
| | | public class KitchenVideoVO extends AbsVo { |
| | | |
| | | /** 作者id */ |
| | | @ApiModelProperty("作者id") |
| | | private String authorId; |
| | | private String authorName; |
| | | |
| | | /** 图片封面 */ |
| | | @ApiModelProperty("图片封面") |
| | | private String coverUrl; |
| | | |
| | | /** 封面显示地址 */ |
| | | @ApiModelProperty("封面显示地址") |
| | | private String coverShowUrl; |
| | | |
| | | /** 视频地址 */ |
| | | @ApiModelProperty("视频地址") |
| | | private String videoFileKey; |
| | | private String videoUrl; |
| | | |
| | | @ApiModelProperty("视频标签") |
| | | private List<KitchenVideoTypeVO> typeList; |
| | | |
| | | @ApiModelProperty("视频内容类型:视频、图片") |
| | | private String videoContentType; |
| | | |
| | | @ApiModelProperty("视频类型:视频、大健康、神厨") |
| | | private String videoType; |
| | | |
| | | @ApiModelProperty(value = "图片列表,json数组", hidden = true) |
| | | private String videoImgs; |
| | | |
| | | @ApiModelProperty("图片列表") |
| | | private List<String> imgs; |
| | | |
| | | /** 视频填充模式 */ |
| | | @ApiModelProperty("视频填充模式") |
| | | private String videoFit; |
| | | |
| | | @ApiModelProperty("视频长度:秒") |
| | | private Long videoDuration; |
| | | |
| | | /** 视频标题 */ |
| | | @ApiModelProperty("视频标题") |
| | | private String title; |
| | | |
| | | /** 商品id */ |
| | | @ApiModelProperty("商品id") |
| | | private String goodsId; |
| | | |
| | | /** 商品查看次数 */ |
| | | @ApiModelProperty("商品查看次数") |
| | | private Long goodsViewNum; |
| | | |
| | | /** 商品下单次数 */ |
| | | @ApiModelProperty("商品下单次数") |
| | | private Long goodsOrderNum; |
| | | |
| | | /** 是否推荐 */ |
| | | @ApiModelProperty("是否推荐") |
| | | private Boolean recommend; |
| | | |
| | | /** 状态 */ |
| | | @ApiModelProperty("状态") |
| | | private String status; |
| | | |
| | | /** 播放量 */ |
| | | @ApiModelProperty("播放量") |
| | | private Long playNum; |
| | | |
| | | /** 收藏数 */ |
| | | @ApiModelProperty("收藏数") |
| | | private Long collectNum; |
| | | |
| | | /** 评论数 */ |
| | | @ApiModelProperty("评论数") |
| | | private Long commentNum; |
| | | |
| | | /** 权重 */ |
| | | @ApiModelProperty("权重") |
| | | private double weight; |
| | | |
| | | /** 审核通过时间 */ |
| | | @ApiModelProperty("审核通过时间") |
| | | private Date auditPassTime; |
| | | |
| | | public static KitchenVideoVO getVoByEntity(@NonNull Video entity, KitchenVideoVO vo) { |
| | | if(vo == null) { |
| | | vo = new KitchenVideoVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | import cn.lili.modules.lmk.domain.entity.ShareClickRecord; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import org.springframework.beans.BeanUtils; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 分享点击记录展示 |
| | | * |
| | | * @author xp |
| | | * @since 2025-06-16 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "分享点击记录响应数据", description = "分享点击记录响应数据") |
| | | public class ShareClickRecordVO extends AbsVo { |
| | | |
| | | /** 分享id */ |
| | | @ApiModelProperty("分享id") |
| | | private String shareId; |
| | | |
| | | /** 谁点了这个分享 */ |
| | | @ApiModelProperty("谁点了这个分享") |
| | | private String userId; |
| | | |
| | | /** 点击时间 */ |
| | | @ApiModelProperty("点击时间") |
| | | private Date clickTime; |
| | | |
| | | public static ShareClickRecordVO getVoByEntity(@NonNull ShareClickRecord entity, ShareClickRecordVO vo) { |
| | | if(vo == null) { |
| | | vo = new ShareClickRecordVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | import cn.lili.modules.lmk.domain.entity.Share; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import org.springframework.beans.BeanUtils; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 分享记录展示 |
| | | * |
| | | * @author xp |
| | | * @since 2025-06-16 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "分享记录响应数据", description = "分享记录响应数据") |
| | | public class ShareVO extends AbsVo { |
| | | |
| | | /** 哪个业务的分享 */ |
| | | @ApiModelProperty("哪个业务的分享") |
| | | private String shareType; |
| | | |
| | | /** 业务id */ |
| | | @ApiModelProperty("业务id") |
| | | private String refId; |
| | | |
| | | /** 分享人 */ |
| | | @ApiModelProperty("分享人") |
| | | private String shareUser; |
| | | |
| | | /** 分享时间 */ |
| | | @ApiModelProperty("分享时间") |
| | | private Date shareTime; |
| | | |
| | | public static ShareVO getVoByEntity(@NonNull Share entity, ShareVO vo) { |
| | | if(vo == null) { |
| | | vo = new ShareVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author:xp |
| | | * @date:2025/6/16 9:11 |
| | | */ |
| | | @Data |
| | | @ApiModel("视频商品详情") |
| | | public class VideoGoodsDetailVO { |
| | | |
| | | @ApiModelProperty("商品id") |
| | | private String goodsId; |
| | | |
| | | @ApiModelProperty("商品名称") |
| | | private String goodsName; |
| | | |
| | | @ApiModelProperty("价格") |
| | | private String price; |
| | | |
| | | @ApiModelProperty("缩略图") |
| | | private String thumbnail; |
| | | |
| | | @ApiModelProperty("商品数量") |
| | | private Integer goodsNum; |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author:xp |
| | | * @date:2025/6/15 19:10 |
| | | */ |
| | | @Data |
| | | @ApiModel("发布视频-商品信息") |
| | | public class VideoGoodsPublishVO { |
| | | |
| | | @ApiModelProperty("商品id") |
| | | private String goodsId; |
| | | |
| | | @ApiModelProperty("商品数量") |
| | | private Integer goodsNum; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("图片封面") |
| | | private String coverUrl; |
| | | |
| | | /** 封面显示地址 */ |
| | | @ApiModelProperty("封面显示地址") |
| | | private String coverShowUrl; |
| | | |
| | | /** 视频地址 */ |
| | | @ApiModelProperty("视频地址") |
| | | private String videoFileKey; |
| | |
| | | |
| | | /** 商品id */ |
| | | @ApiModelProperty("商品id") |
| | | private String goodsId; |
| | | |
| | | /** 商品查看次数 */ |
| | | @ApiModelProperty("商品查看次数") |
| | | private Long goodsViewNum; |
| | | |
| | | /** 商品下单次数 */ |
| | | @ApiModelProperty("商品下单次数") |
| | | private Long goodsOrderNum; |
| | | private List<VideoGoodsDetailVO> goodsList; |
| | | |
| | | /** 是否推荐 */ |
| | | @ApiModelProperty("是否推荐") |
| | |
| | | @ApiModelProperty("视频标签") |
| | | private List<WxVideoTagForm> tags; |
| | | |
| | | @ApiModelProperty("图集-json数组") |
| | | private String videoImgs; |
| | | |
| | | @ApiModelProperty("图集") |
| | | private List<String> imgs; |
| | | |
| | | /** |
| | | * @see cn.lili.modules.lmk.enums.general.VideoContentTypeEnum |
| | | */ |
| | | @ApiModelProperty("视频内容类型:视频、图片") |
| | | private String videoContentType; |
| | | |
| | | /** 视频填充模式 */ |
| | | @ApiModelProperty("视频填充模式") |
| | | private String videoFit; |
| | |
| | | |
| | | /** 商品信息 */ |
| | | @ApiModelProperty("商品信息") |
| | | private String goodsId; |
| | | private List<VideoGoodsDetailVO> goodsList; |
| | | |
| | | @ApiModelProperty("视频长度:秒") |
| | | private Long videoDuration; |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | import cn.lili.modules.lmk.domain.entity.VideoTag; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.lang.NonNull; |
| | | |
| | | /** |
| | | * 视频标签展示 |
| | | * |
| | | * @author xp |
| | | * @since 2025-05-13 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "视频标签响应数据", description = "视频标签响应数据") |
| | | public class WxVideoTagVO { |
| | | |
| | | private String id; |
| | | |
| | | /** 标签名称 */ |
| | | @ApiModelProperty("标签名称") |
| | | private String tagName; |
| | | |
| | | |
| | | public static WxVideoTagVO getVoByEntity(@NonNull VideoTag entity, WxVideoTagVO vo) { |
| | | if(vo == null) { |
| | | vo = new WxVideoTagVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("视频标签") |
| | | private List<SimpleVideoTagVO> tagList; |
| | | |
| | | @ApiModelProperty("视频时长:秒") |
| | | private Long videoDuration; |
| | | |
| | | /** 视频填充模式 */ |
| | | @ApiModelProperty("视频填充模式") |
| | | private String videoFit; |
| | |
| | | |
| | | /** 商品信息 */ |
| | | @ApiModelProperty("商品信息") |
| | | private VideoGoodsVO goods; |
| | | private List<VideoGoodsDetailVO> goodsList; |
| | | |
| | | @ApiModelProperty("当前用户是否收藏了该视频") |
| | | private Boolean collected = Boolean.FALSE; |
| | |
| | | @Getter |
| | | public enum VideoSupportOpEnum { |
| | | |
| | | UP("UP", "发布"), |
| | | // UP("UP", "发布"), |
| | | DOWN("DOWN", "下架"), |
| | | DELETE("DELETE", "删除"), |
| | | EDIT("EDIT", "编辑"), |
| | |
| | | if (VideoStatusEnum.AUDITING.getValue().equals(status)) { |
| | | return Arrays.asList(new VideoOption(EDIT.value, EDIT.desc), new VideoOption(DELETE.value, DELETE.desc)); |
| | | } else if (VideoStatusEnum.DISABLE.getValue().equals(status)) { |
| | | return Arrays.asList(new VideoOption(EDIT.value, EDIT.desc), new VideoOption(UP.value, UP.desc), new VideoOption(DELETE.value, DELETE.desc)); |
| | | return Arrays.asList(new VideoOption(EDIT.value, EDIT.desc), new VideoOption(DELETE.value, DELETE.desc)); |
| | | } else if (VideoStatusEnum.PUBLISHED.getValue().equals(status)) { |
| | | return Arrays.asList(new VideoOption(EDIT.value, EDIT.desc), new VideoOption(DOWN.value, DOWN.desc), new VideoOption(DELETE.value, DELETE.desc)); |
| | | } else if (VideoStatusEnum.REJECT.getValue().equals(status)) { |
New file |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.KitchenType; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import cn.lili.modules.lmk.domain.vo.KitchenTypeVO; |
| | | import cn.lili.modules.lmk.domain.form.KitchenTypeForm; |
| | | import cn.lili.modules.lmk.domain.query.KitchenTypeQuery; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 厨神类型 Mapper 接口 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Mapper |
| | | public interface KitchenTypeMapper extends BaseMapper<KitchenType> { |
| | | |
| | | /** |
| | | * id查找厨神类型 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | KitchenTypeVO getById(String id); |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | IPage getPage(IPage page, @Param("query") KitchenTypeQuery query); |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.KitchenVideoTypeRef; |
| | | import cn.lili.modules.lmk.domain.vo.KitchenVideoTypeVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import cn.lili.modules.lmk.domain.vo.KitchenVideoTypeRefVO; |
| | | import cn.lili.modules.lmk.domain.form.KitchenVideoTypeRefForm; |
| | | import cn.lili.modules.lmk.domain.query.KitchenVideoTypeRefQuery; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 厨神视频标签关系表 Mapper 接口 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Mapper |
| | | public interface KitchenVideoTypeRefMapper extends BaseMapper<KitchenVideoTypeRef> { |
| | | |
| | | /** |
| | | * id查找厨神视频标签关系表 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | KitchenVideoTypeRefVO getById(String id); |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | IPage getPage(IPage page, @Param("query") KitchenVideoTypeRefQuery query); |
| | | |
| | | List<KitchenVideoTypeVO> getTypeByVideoIds(@Param("videoIds") List<String> videoIds); |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.ShareClickRecord; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import cn.lili.modules.lmk.domain.vo.ShareClickRecordVO; |
| | | import cn.lili.modules.lmk.domain.form.ShareClickRecordForm; |
| | | import cn.lili.modules.lmk.domain.query.ShareClickRecordQuery; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 分享点击记录 Mapper 接口 |
| | | * |
| | | * @author xp |
| | | * @since 2025-06-16 |
| | | */ |
| | | @Mapper |
| | | public interface ShareClickRecordMapper extends BaseMapper<ShareClickRecord> { |
| | | |
| | | /** |
| | | * id查找分享点击记录 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | ShareClickRecordVO getById(String id); |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | IPage getPage(IPage page, @Param("query") ShareClickRecordQuery query); |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.Share; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import cn.lili.modules.lmk.domain.vo.ShareVO; |
| | | import cn.lili.modules.lmk.domain.form.ShareForm; |
| | | import cn.lili.modules.lmk.domain.query.ShareQuery; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 分享记录 Mapper 接口 |
| | | * |
| | | * @author xp |
| | | * @since 2025-06-16 |
| | | */ |
| | | @Mapper |
| | | public interface ShareMapper extends BaseMapper<Share> { |
| | | |
| | | /** |
| | | * id查找分享记录 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | ShareVO getById(String id); |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | IPage getPage(IPage page, @Param("query") ShareQuery query); |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.VideoGoods; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * 视频商品中间表 Mapper 接口 |
| | | * |
| | | * @author xp |
| | | * @since 2025-06-15 |
| | | */ |
| | | @Mapper |
| | | public interface VideoGoodsMapper extends BaseMapper<VideoGoods> { |
| | | |
| | | |
| | | } |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.Video; |
| | | import cn.lili.modules.lmk.domain.query.AuthorVideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.ManagerVideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.VideoQuery; |
| | | import cn.lili.modules.lmk.domain.vo.CollectTypeNumVO; |
| | | import cn.lili.modules.lmk.domain.vo.VideoAccountVO; |
| | | import cn.lili.modules.lmk.domain.vo.VideoVO; |
| | | import cn.lili.modules.lmk.domain.vo.WxEditVideoVO; |
| | | import cn.lili.modules.lmk.domain.query.*; |
| | | import cn.lili.modules.lmk.domain.vo.*; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | * @return |
| | | */ |
| | | IPage recommendVideo(IPage page, @Param("query") VideoQuery query); |
| | | |
| | | IPage recommendHealthVideo(IPage page, @Param("query") WxHealthVideoQuery query); |
| | | |
| | | /** |
| | | * 批量更新视频收藏数量 |
| | |
| | | * @return |
| | | */ |
| | | WxEditVideoVO wxDetail(@Param("id") String id); |
| | | |
| | | /** |
| | | * 大健康视频分页 |
| | | * |
| | | * @param page |
| | | * @param query |
| | | */ |
| | | IPage healthPage(IPage page, @Param("query") HealthVideoQuery query); |
| | | |
| | | IPage kitchenPage(IPage page, @Param("query") KitchenVideoQuery query); |
| | | |
| | | /** |
| | | * 获取视频悬挂商品 |
| | | * |
| | | * @param videoId |
| | | * @return |
| | | */ |
| | | List<VideoGoodsDetailVO> getVideoGoods(@Param("id") String videoId); |
| | | } |
| | |
| | | * @param id 会员id |
| | | * @return 用户VO |
| | | */ |
| | | MemberVO getMember(String id); |
| | | Result getMember(String id); |
| | | |
| | | |
| | | /** |
New file |
| | |
| | | package cn.lili.modules.lmk.service; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.KitchenType; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.KitchenTypeForm; |
| | | import cn.lili.modules.lmk.domain.query.KitchenTypeQuery; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 厨神类型 服务类 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | public interface KitchenTypeService extends IService<KitchenType> { |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result add(KitchenTypeForm form); |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result update(KitchenTypeForm form); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | Result remove(List<String> ids); |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result removeById(String id); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result page(KitchenTypeQuery query); |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result detail(String id); |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | Result all(); |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.KitchenVideoTypeRef; |
| | | import cn.lili.modules.lmk.domain.vo.KitchenVideoTypeVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.KitchenVideoTypeRefForm; |
| | | import cn.lili.modules.lmk.domain.query.KitchenVideoTypeRefQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 厨神视频标签关系表 服务类 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | public interface KitchenVideoTypeRefService extends IService<KitchenVideoTypeRef> { |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result add(KitchenVideoTypeRefForm form); |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result update(KitchenVideoTypeRefForm form); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | Result remove(List<String> ids); |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result removeById(String id); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result page(KitchenVideoTypeRefQuery query); |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result detail(String id); |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | Result all(); |
| | | |
| | | List<KitchenVideoTypeVO> getTypeByVideoIds(List<String> videoIds); |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.ShareClickRecord; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.ShareClickRecordForm; |
| | | import cn.lili.modules.lmk.domain.query.ShareClickRecordQuery; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 分享点击记录 服务类 |
| | | * |
| | | * @author xp |
| | | * @since 2025-06-16 |
| | | */ |
| | | public interface ShareClickRecordService extends IService<ShareClickRecord> { |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result add(ShareClickRecordForm form); |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result update(ShareClickRecordForm form); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | Result remove(List<String> ids); |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result removeById(String id); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result page(ShareClickRecordQuery query); |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result detail(String id); |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | Result all(); |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.Share; |
| | | import cn.lili.modules.lmk.domain.form.ShareClickRecordForm; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.ShareForm; |
| | | import cn.lili.modules.lmk.domain.query.ShareQuery; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 分享记录 服务类 |
| | | * |
| | | * @author xp |
| | | * @since 2025-06-16 |
| | | */ |
| | | public interface ShareService extends IService<Share> { |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result add(ShareForm form); |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result update(ShareForm form); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | Result remove(List<String> ids); |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result removeById(String id); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result page(ShareQuery query); |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result detail(String id); |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | Result all(); |
| | | |
| | | /** |
| | | * 添加分享访问记录 |
| | | * |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result addShareClick(ShareClickRecordForm form); |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.VideoGoods; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * 视频商品中间表 服务类 |
| | | * |
| | | * @author xp |
| | | * @since 2025-06-15 |
| | | */ |
| | | public interface VideoGoodsService extends IService<VideoGoods> { |
| | | |
| | | } |
| | |
| | | package cn.lili.modules.lmk.service; |
| | | |
| | | import cn.lili.group.Add; |
| | | import cn.lili.modules.lmk.domain.entity.Video; |
| | | import cn.lili.modules.lmk.domain.form.*; |
| | | import cn.lili.modules.lmk.domain.query.AuthorVideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.ManagerVideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.*; |
| | | import cn.lili.modules.lmk.domain.vo.CollectTypeNumVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.query.VideoQuery; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | Result recommendVideo(VideoQuery query); |
| | | |
| | | Result healthRecommendVideo(WxHealthVideoQuery query); |
| | | |
| | | /** |
| | | * 批量更新视频收藏数量 |
| | | * |
| | |
| | | * @return |
| | | */ |
| | | Result wxDetail(String id); |
| | | |
| | | /** |
| | | * 大健康视频发布 |
| | | * |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result healthVideo(HealthVideoForm form); |
| | | /** |
| | | * 修改大健康视频 |
| | | * |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result updateHealthVideo(HealthVideoForm form); |
| | | /** |
| | | * 大健康视频列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result healthPage(HealthVideoQuery query); |
| | | /** |
| | | * 删除大健康视频 |
| | | |
| | | * @param id 主键id |
| | | * @return |
| | | */ |
| | | Result delHealth(String id); |
| | | |
| | | Result addKitchenVideo( KitchenVideoForm form); |
| | | |
| | | Result updateKitchenVideo( KitchenVideoForm form); |
| | | /** |
| | | * 厨神视频列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result KitchenVideoQuery(KitchenVideoQuery query); |
| | | |
| | | Result delKitchen(String id); |
| | | |
| | | /** |
| | | * 视频商品查看 |
| | | * |
| | | * @param videoId |
| | | * @return |
| | | */ |
| | | Result getGoodsDetail(String videoId); |
| | | |
| | | /** |
| | | * 用户下架视频 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result buyerDownVideo(String id); |
| | | |
| | | /** |
| | | * 修改视频 |
| | | * |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result updatePublish(WxVideoForm form); |
| | | } |
| | |
| | | |
| | | import cn.lili.modules.member.entity.vo.MemberVO; |
| | | import cn.lili.modules.member.mapper.MemberMapper; |
| | | import cn.lili.modules.member.service.MemberService; |
| | | import cn.lili.modules.order.order.entity.dto.OrderSearchParams; |
| | | import cn.lili.modules.order.order.entity.vo.OrderSimpleVO; |
| | | import cn.lili.utils.PageUtil; |
| | |
| | | public class CustomerServiceImpl extends ServiceImpl<MemberMapper, Member> implements CustomerService { |
| | | |
| | | private final CustomerMapper customerMapper; |
| | | |
| | | private final MemberService memberService; |
| | | private final LmkStoreMapper storeMapper; |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public Result getMemberPageByWX(CustomerQuery customerQuery) { |
| | | String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); |
| | | String storeId = UserContext.getCurrentUser().getStoreId(); |
| | | if ( storeId == null) { |
| | | return Result.error("该账号没有注册店铺"); |
| | | } |
| | |
| | | |
| | | |
| | | @Override |
| | | public MemberVO getMember(String id) { |
| | | return null; |
| | | public Result getMember(String id) { |
| | | MemberVO memberVO = memberService.getMember(id); |
| | | //查询用户标签 |
| | | // memberVO.setCustomerTagList(); |
| | | return Result.ok().data(memberVO); |
| | | } |
| | | |
| | | @Override |
New file |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.domain.entity.KitchenType; |
| | | import cn.lili.modules.lmk.mapper.KitchenTypeMapper; |
| | | import cn.lili.modules.lmk.service.KitchenTypeService; |
| | | import cn.lili.base.Result; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import cn.lili.modules.lmk.domain.form.KitchenTypeForm; |
| | | import cn.lili.modules.lmk.domain.vo.KitchenTypeVO; |
| | | import cn.lili.modules.lmk.domain.query.KitchenTypeQuery; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.RequiredArgsConstructor; |
| | | import cn.lili.utils.PageUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 厨神类型 服务实现类 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class KitchenTypeServiceImpl extends ServiceImpl<KitchenTypeMapper, KitchenType> implements KitchenTypeService { |
| | | |
| | | private final KitchenTypeMapper kitchenTypeMapper; |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result add(KitchenTypeForm form) { |
| | | KitchenType entity = KitchenTypeForm.getEntityByForm(form, null); |
| | | entity.setUseNum(0L); |
| | | LambdaQueryWrapper<KitchenType> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.eq(KitchenType::getTypeName, form.getTypeName()); |
| | | List<KitchenType> kitchenTypes = baseMapper.selectList(wrapper); |
| | | if (!kitchenTypes.isEmpty()) { |
| | | return Result.error("添加失败标签存在"); |
| | | } |
| | | baseMapper.insert(entity); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result update(KitchenTypeForm form) { |
| | | KitchenType entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | //校验标签是否存在 |
| | | LambdaQueryWrapper<KitchenType> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.eq(KitchenType::getTypeName, form.getTypeName()); |
| | | List<KitchenType> kitchenTypes = baseMapper.selectList(wrapper); |
| | | if (!kitchenTypes.isEmpty()) { |
| | | return Result.error("修改失败标签存在"); |
| | | } |
| | | baseMapper.updateById(entity); |
| | | return Result.ok("修改成功"); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result remove(List<String> ids) { |
| | | baseMapper.deleteBatchIds(ids); |
| | | return Result.ok("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result removeById(String id) { |
| | | baseMapper.deleteById(id); |
| | | return Result.ok("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result page(KitchenTypeQuery query) { |
| | | IPage<KitchenTypeVO> page = PageUtil.getPage(query, KitchenTypeVO.class); |
| | | baseMapper.getPage(page, query); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result detail(String id) { |
| | | KitchenTypeVO vo = baseMapper.getById(id); |
| | | Assert.notNull(vo, "记录不存在"); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result all() { |
| | | List<KitchenType> entities = baseMapper.selectList(null); |
| | | List<KitchenTypeVO> vos = entities.stream() |
| | | .map(entity -> KitchenTypeVO.getVoByEntity(entity, null)) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import cn.lili.modules.lmk.domain.vo.KitchenVideoTypeVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.domain.entity.KitchenVideoTypeRef; |
| | | import cn.lili.modules.lmk.mapper.KitchenVideoTypeRefMapper; |
| | | import cn.lili.modules.lmk.service.KitchenVideoTypeRefService; |
| | | import cn.lili.base.Result; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import cn.lili.modules.lmk.domain.form.KitchenVideoTypeRefForm; |
| | | import cn.lili.modules.lmk.domain.vo.KitchenVideoTypeRefVO; |
| | | import cn.lili.modules.lmk.domain.query.KitchenVideoTypeRefQuery; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.RequiredArgsConstructor; |
| | | import cn.lili.utils.PageUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 厨神视频标签关系表 服务实现类 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class KitchenVideoTypeRefServiceImpl extends ServiceImpl<KitchenVideoTypeRefMapper, KitchenVideoTypeRef> implements KitchenVideoTypeRefService { |
| | | |
| | | private final KitchenVideoTypeRefMapper kitchenVideoTypeRefMapper; |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result add(KitchenVideoTypeRefForm form) { |
| | | KitchenVideoTypeRef entity = KitchenVideoTypeRefForm.getEntityByForm(form, null); |
| | | baseMapper.insert(entity); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result update(KitchenVideoTypeRefForm form) { |
| | | KitchenVideoTypeRef entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛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(KitchenVideoTypeRefQuery query) { |
| | | IPage<KitchenVideoTypeRefVO> page = PageUtil.getPage(query, KitchenVideoTypeRefVO.class); |
| | | baseMapper.getPage(page, query); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result detail(String id) { |
| | | KitchenVideoTypeRefVO vo = baseMapper.getById(id); |
| | | Assert.notNull(vo, "记录不存在"); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result all() { |
| | | List<KitchenVideoTypeRef> entities = baseMapper.selectList(null); |
| | | List<KitchenVideoTypeRefVO> vos = entities.stream() |
| | | .map(entity -> KitchenVideoTypeRefVO.getVoByEntity(entity, null)) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | |
| | | @Override |
| | | public List<KitchenVideoTypeVO> getTypeByVideoIds(List<String> videoIds) { |
| | | return baseMapper.getTypeByVideoIds(videoIds); |
| | | } |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.domain.entity.ShareClickRecord; |
| | | import cn.lili.modules.lmk.mapper.ShareClickRecordMapper; |
| | | import cn.lili.modules.lmk.service.ShareClickRecordService; |
| | | import cn.lili.base.Result; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import cn.lili.modules.lmk.domain.form.ShareClickRecordForm; |
| | | import cn.lili.modules.lmk.domain.vo.ShareClickRecordVO; |
| | | import cn.lili.modules.lmk.domain.query.ShareClickRecordQuery; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.RequiredArgsConstructor; |
| | | import cn.lili.utils.PageUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 分享点击记录 服务实现类 |
| | | * |
| | | * @author xp |
| | | * @since 2025-06-16 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class ShareClickRecordServiceImpl extends ServiceImpl<ShareClickRecordMapper, ShareClickRecord> implements ShareClickRecordService { |
| | | |
| | | private final ShareClickRecordMapper shareClickRecordMapper; |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result add(ShareClickRecordForm form) { |
| | | ShareClickRecord entity = ShareClickRecordForm.getEntityByForm(form, null); |
| | | baseMapper.insert(entity); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result update(ShareClickRecordForm form) { |
| | | ShareClickRecord 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(ShareClickRecordQuery query) { |
| | | IPage<ShareClickRecordVO> page = PageUtil.getPage(query, ShareClickRecordVO.class); |
| | | baseMapper.getPage(page, query); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result detail(String id) { |
| | | ShareClickRecordVO vo = baseMapper.getById(id); |
| | | Assert.notNull(vo, "记录不存在"); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result all() { |
| | | List<ShareClickRecord> entities = baseMapper.selectList(null); |
| | | List<ShareClickRecordVO> vos = entities.stream() |
| | | .map(entity -> ShareClickRecordVO.getVoByEntity(entity, null)) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.modules.lmk.domain.entity.ShareClickRecord; |
| | | import cn.lili.modules.lmk.domain.form.ShareClickRecordForm; |
| | | import cn.lili.modules.lmk.service.ShareClickRecordService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.domain.entity.Share; |
| | | import cn.lili.modules.lmk.mapper.ShareMapper; |
| | | import cn.lili.modules.lmk.service.ShareService; |
| | | import cn.lili.base.Result; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import cn.lili.modules.lmk.domain.form.ShareForm; |
| | | import cn.lili.modules.lmk.domain.vo.ShareVO; |
| | | import cn.lili.modules.lmk.domain.query.ShareQuery; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.RequiredArgsConstructor; |
| | | import cn.lili.utils.PageUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 分享记录 服务实现类 |
| | | * |
| | | * @author xp |
| | | * @since 2025-06-16 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class ShareServiceImpl extends ServiceImpl<ShareMapper, Share> implements ShareService { |
| | | |
| | | private final ShareMapper shareMapper; |
| | | private final ShareClickRecordService shareClickRecordService; |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result add(ShareForm form) { |
| | | // 没分享过才新增 |
| | | boolean exists = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .eq(Share::getShareType, form.getShareType()) |
| | | .eq(Share::getRefId, form.getRefId()) |
| | | .eq(Share::getShareUser, form.getShareUser()) |
| | | .exists(); |
| | | if (! exists) { |
| | | Share entity = ShareForm.getEntityByForm(form, null); |
| | | entity.setShareTime(new Date()); |
| | | baseMapper.insert(entity); |
| | | } |
| | | return Result.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result update(ShareForm form) { |
| | | Share 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(ShareQuery query) { |
| | | IPage<ShareVO> page = PageUtil.getPage(query, ShareVO.class); |
| | | baseMapper.getPage(page, query); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result detail(String id) { |
| | | ShareVO vo = baseMapper.getById(id); |
| | | Assert.notNull(vo, "记录不存在"); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result all() { |
| | | List<Share> entities = baseMapper.selectList(null); |
| | | List<ShareVO> vos = entities.stream() |
| | | .map(entity -> ShareVO.getVoByEntity(entity, null)) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | |
| | | @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, share.getId()) |
| | | .exists(); |
| | | if (! exists) { |
| | | ShareClickRecord record = new ShareClickRecord(); |
| | | record.setShareId(share.getId()); |
| | | record.setUserId(UserContext.getCurrentUserId()); |
| | | record.setClickTime(new Date()); |
| | | shareClickRecordService.save(record); |
| | | } |
| | | return Result.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.VideoGoods; |
| | | import cn.lili.modules.lmk.mapper.VideoGoodsMapper; |
| | | import cn.lili.modules.lmk.service.VideoGoodsService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 视频商品中间表 服务实现类 |
| | | * |
| | | * @author xp |
| | | * @since 2025-06-15 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class VideoGoodsServiceImpl extends ServiceImpl<VideoGoodsMapper, VideoGoods> implements VideoGoodsService { |
| | | |
| | | private final VideoGoodsMapper videoGoodsMapper; |
| | | |
| | | } |
| | |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.modules.lmk.domain.entity.*; |
| | | import cn.lili.modules.lmk.domain.form.*; |
| | | import cn.lili.modules.lmk.domain.query.AuthorVideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.ManagerVideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.*; |
| | | import cn.lili.modules.lmk.domain.vo.*; |
| | | import cn.lili.modules.lmk.enums.general.*; |
| | | import cn.lili.modules.lmk.service.*; |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.mapper.VideoMapper; |
| | | import cn.lili.base.Result; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import cn.lili.modules.lmk.domain.query.VideoQuery; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.collections4.ListUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | private final MySubscribeService mySubscribeService; |
| | | private final MemberService memberService; |
| | | private final VideoAccountService videoAccountService; |
| | | private final KitchenVideoTypeRefService kitchenVideoTypeRefService; |
| | | private final VideoGoodsService videoGoodsService; |
| | | |
| | | |
| | | /** |
| | |
| | | return videoTagRef; |
| | | }).collect(Collectors.toList()); |
| | | videoTagRefService.saveBatch(videoTagRefs); |
| | | // 3.保存视频文件信息 |
| | | // 3. 保存视频文件信息 |
| | | lmkFileService.addByForm(form.getFileInfo()); |
| | | // 4. 处理选择的商品 |
| | | if (CollectionUtils.isNotEmpty(form.getGoodsList())) { |
| | | List<VideoGoods> videoGoods = new ArrayList<>(2); |
| | | for (int i = 0; i < form.getGoodsList().size(); i++) { |
| | | VideoGoods e = new VideoGoods(); |
| | | e.setVideoId(video.getId()); |
| | | e.setGoodsId(form.getGoodsList().get(i).getGoodsId()); |
| | | e.setGoodsNum(form.getGoodsList().get(i).getGoodsNum()); |
| | | e.setOrderNum(i); |
| | | videoGoods.add(e); |
| | | } |
| | | videoGoodsService.saveBatch(videoGoods); |
| | | } |
| | | return Result.ok("发布成功,视频审核中~"); |
| | | } |
| | | |
| | | @Override |
| | | public Result updatePublish(WxVideoForm form) { |
| | | Video video = baseMapper.selectById(form.getId()); |
| | | if (Objects.isNull(video)) { |
| | | return Result.error("修改视频不存在"); |
| | | } |
| | | // 1.修改视频 |
| | | WxVideoForm.getEntityByForm(form, video); |
| | | video.setAuthorId(UserContext.getCurrentUserId()); |
| | | video.setStatus(VideoStatusEnum.AUDITING.getValue()); |
| | | video.setCoverUrl(form.getCover()); |
| | | video.setVideoType(VideoTypeEnum.VIDEO.getValue()); |
| | | if (VideoContentTypeEnum.IMG.getValue().equals(form.getVideoContentType())) { |
| | | video.setVideoImgs(JSON.toJSONString(form.getVideoImgs())); |
| | | } |
| | | baseMapper.updateById(video); |
| | | // 2.处理标签---删除之前的视频标签关系,再新增 |
| | | new LambdaUpdateChainWrapper<>(videoTagRefService.getBaseMapper()) |
| | | .eq(VideoTagRef::getVideoId, video.getId()) |
| | | .remove(); |
| | | List<VideoTagRef> videoTagRefs = form.getTags().stream().map(tag -> { |
| | | VideoTagRef videoTagRef = new VideoTagRef(); |
| | | videoTagRef.setVideoId(video.getId()); |
| | | if (StringUtils.isBlank(tag.getId())) { |
| | | VideoTag videoTag = new LambdaQueryChainWrapper<>(videoTagService.getBaseMapper()) |
| | | .eq(VideoTag::getTagName, tag.getTagName()) |
| | | .one(); |
| | | if (Objects.nonNull(videoTag)) { |
| | | videoTagRef.setVideoTagId(videoTag.getId()); |
| | | } else { |
| | | videoTag = new VideoTag(); |
| | | videoTag.setTagName(tag.getTagName()); |
| | | videoTag.setCreateType(TagCreateTypeEnum.USER.getValue()); |
| | | videoTagService.save(videoTag); |
| | | videoTagRef.setVideoTagId(videoTag.getId()); |
| | | } |
| | | } else { |
| | | videoTagRef.setVideoTagId(tag.getId()); |
| | | } |
| | | return videoTagRef; |
| | | }).collect(Collectors.toList()); |
| | | videoTagRefService.saveBatch(videoTagRefs); |
| | | // 3. 保存视频文件信息 |
| | | lmkFileService.addByForm(form.getFileInfo()); |
| | | // 4. 处理选择的商品,先删除之前的再新增 |
| | | new LambdaUpdateChainWrapper<>(videoGoodsService.getBaseMapper()) |
| | | .eq(VideoGoods::getVideoId, video.getId()) |
| | | .remove(); |
| | | if (CollectionUtils.isNotEmpty(form.getGoodsList())) { |
| | | List<VideoGoods> videoGoods = new ArrayList<>(2); |
| | | for (int i = 0; i < form.getGoodsList().size(); i++) { |
| | | VideoGoods e = new VideoGoods(); |
| | | e.setVideoId(video.getId()); |
| | | e.setGoodsId(form.getGoodsList().get(i).getGoodsId()); |
| | | e.setGoodsNum(form.getGoodsList().get(i).getGoodsNum()); |
| | | e.setOrderNum(i); |
| | | videoGoods.add(e); |
| | | } |
| | | videoGoodsService.saveBatch(videoGoods); |
| | | } |
| | | return Result.ok("发布成功,视频审核中~"); |
| | | } |
| | | |
| | | @Override |
| | | public Result managerPage(ManagerVideoQuery query) { |
| | |
| | | if (page.getTotal() > 0) { |
| | | Map<String, List<SimpleVideoTagVO>> tagMap = videoTagRefService.getTagsByVideoIds( |
| | | page.getRecords().stream().map(VideoVO::getId).collect(Collectors.toList()) |
| | | ).stream().collect(Collectors.groupingBy(SimpleVideoTagVO::getVideoId));; |
| | | ).stream().collect(Collectors.groupingBy(SimpleVideoTagVO::getVideoId)); |
| | | // 3. 获取视频临时访问地址、设置视频标签 |
| | | page.getRecords().forEach(v -> { |
| | | v.setTagList(tagMap.get(v.getId())); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Result buyerDownVideo(String id) { |
| | | new LambdaUpdateChainWrapper<>(baseMapper) |
| | | .eq(Video::getId, id) |
| | | .set(Video::getStatus, VideoStatusEnum.DISABLE.getValue()) |
| | | .update(); |
| | | return Result.ok("下架成功"); |
| | | } |
| | | |
| | | @Override |
| | | public Result recommendVideo(VideoQuery query) { |
| | | // 推荐算法: 1. 根据用户的收藏视频的标签 2. 根据用户关注的作者的其它视频 3. 根据用户的观看记录(观看时长较长的、重复观看次数较多的) 4. 基于相似用户的观看行为来给该用户推荐 |
| | | IPage<WxVideoVO> page = PageUtil.getPage(query, WxVideoVO.class); |
| | |
| | | List<String> subscribes = mySubscribeService.getSubscribesByUserId(UserContext.getCurrentUserId()); |
| | | // 3. 获取视频临时访问地址、设置视频标签、我是否收藏、作者是否关注 |
| | | page.getRecords().forEach(v -> { |
| | | v.setGoods(new VideoGoodsVO()); |
| | | 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.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())); |
| | | } |
| | | v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey())); |
| | | |
| | | v.setSubscribeThisAuthor(subscribes.contains(v.getAuthorId())); |
| | | }); |
| | | } |
| | | return Result.ok().data(page.getRecords()); |
| | | } |
| | | |
| | | @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.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(cosUtil::getPreviewUrl).collect(Collectors.toList())); |
| | | } |
| | | }); |
| | | } |
| | | return Result.ok().data(page.getRecords()); |
| | |
| | | query.setAuthorSelf(UserContext.getCurrentUserId().equals(query.getAuthorId())); |
| | | baseMapper.getAuthorVideoPage(page, query); |
| | | for (WxVideoVO vo : page.getRecords()) { |
| | | vo.setCoverUrl(cosUtil.getPreviewUrl(vo.getCoverFileKey())); |
| | | // vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | vo.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | if (VideoContentTypeEnum.VIDEO.getValue().equals(vo.getVideoContentType())) { |
| | | vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | vo.setCoverUrl(cosUtil.getPreviewUrl(vo.getCoverFileKey())); |
| | | } else if (VideoContentTypeEnum.IMG.getValue().equals(vo.getVideoContentType()) && StringUtils.isNotBlank(vo.getVideoImgs())) { |
| | | vo.setImgs(JSON.parseArray(vo.getVideoImgs(), String.class).stream().map(fileKey -> cosUtil.getPreviewUrl(fileKey)).collect(Collectors.toList())); |
| | | } |
| | | |
| | | |
| | | vo.setOptions(VideoSupportOpEnum.getVideoOpByStatus(vo.getStatus())); |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | |
| | | IPage<WxVideoVO> page = PageUtil.getPage(query, WxVideoVO.class); |
| | | baseMapper.getAuthorCollectVideoPage(page, query); |
| | | for (WxVideoVO vo : page.getRecords()) { |
| | | vo.setCoverUrl(cosUtil.getPreviewUrl(vo.getCoverFileKey())); |
| | | // vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | vo.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | if (VideoContentTypeEnum.VIDEO.getValue().equals(vo.getVideoContentType())) { |
| | | vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | vo.setCoverUrl(cosUtil.getPreviewUrl(vo.getCoverFileKey())); |
| | | } else if (VideoContentTypeEnum.IMG.getValue().equals(vo.getVideoContentType()) && StringUtils.isNotBlank(vo.getVideoImgs())) { |
| | | vo.setImgs(JSON.parseArray(vo.getVideoImgs(), String.class).stream().map(fileKey -> cosUtil.getPreviewUrl(fileKey)).collect(Collectors.toList())); |
| | | } |
| | | vo.setCollected(Boolean.TRUE); |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | @Override |
| | | public Result getGoodsDetail(String videoId) { |
| | | List<VideoGoodsDetailVO> goodsList = baseMapper.getVideoGoods(videoId); |
| | | return Result.ok().data(goodsList); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (Objects.isNull(vo)) { |
| | | return Result.error("视频不存在"); |
| | | } |
| | | vo.setCoverUrl(cosUtil.getPreviewUrl(vo.getCoverFileKey())); |
| | | // vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | vo.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | if (VideoContentTypeEnum.VIDEO.getValue().equals(vo.getVideoContentType())) { |
| | | vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | vo.setCoverUrl(cosUtil.getPreviewUrl(vo.getCoverFileKey())); |
| | | } else if (VideoContentTypeEnum.IMG.getValue().equals(vo.getVideoContentType()) && StringUtils.isNotBlank(vo.getVideoImgs())) { |
| | | vo.setImgs(JSON.parseArray(vo.getVideoImgs(), String.class).stream().map(fileKey -> cosUtil.getPreviewUrl(fileKey)).collect(Collectors.toList())); |
| | | } |
| | | List<WxVideoTagForm> tags = videoTagRefService.getTagsByVideoIds(Arrays.asList(vo.getId())) |
| | | .stream() |
| | | .map(i -> { |
| | |
| | | vo.setTags(tags); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | @Override |
| | | public Result healthVideo(HealthVideoForm form) { |
| | | Video video = new Video(); |
| | | BeanUtils.copyProperties(form, video); |
| | | video.setAuthorId(UserContext.getCurrentUserId()); |
| | | video.setVideoType(VideoTypeEnum.HEALTH.getValue()); |
| | | //设置填充模式 保持比例,完整显示 |
| | | video.setVideoFit("contain"); |
| | | video.setVideoContentType(VideoContentTypeEnum.VIDEO.getValue()); |
| | | video.setStatus(VideoStatusEnum.PUBLISHED.getValue()); |
| | | baseMapper.insert(video); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | @Override |
| | | public Result healthPage(HealthVideoQuery query) { |
| | | IPage<VideoVO> page = PageUtil.getPage(query, VideoVO.class); |
| | | // 1. 先查出视频信息 |
| | | baseMapper.healthPage(page, query); |
| | | // 2. 单独查出标签信息 |
| | | if (page.getTotal() > 0) { |
| | | Map<String, List<SimpleVideoTagVO>> tagMap = videoTagRefService.getTagsByVideoIds( |
| | | page.getRecords().stream().map(VideoVO::getId).collect(Collectors.toList()) |
| | | ).stream().collect(Collectors.groupingBy(SimpleVideoTagVO::getVideoId));; |
| | | // 3. 获取视频临时访问地址、设置视频标签 |
| | | page.getRecords().forEach(v -> { |
| | | v.setTagList(tagMap.get(v.getId())); |
| | | v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | v.setCoverShowUrl(cosUtil.getPreviewUrl(v.getCoverUrl())); |
| | | }); |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | @Override |
| | | public Result updateHealthVideo(HealthVideoForm form) { |
| | | Video entity = baseMapper.selectById(form.getId()); |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | baseMapper.updateById(entity); |
| | | return Result.ok("修改成功"); |
| | | } |
| | | |
| | | @Override |
| | | public Result delHealth(String id) { |
| | | Video entity = baseMapper.selectById(id); |
| | | Assert.notNull(entity, "记录不存在"); |
| | | String videoType = entity.getVideoType(); |
| | | if (!VideoTypeEnum.HEALTH.getValue().equals(videoType)) { |
| | | log.error("删除非大健康视频视频id为------->"+id); |
| | | return Result.error("删除失败"); |
| | | } |
| | | baseMapper.deleteById(id); |
| | | return Result.ok("删除成功"); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result addKitchenVideo(KitchenVideoForm form) { |
| | | Video video = new Video(); |
| | | BeanUtils.copyProperties(form, video); |
| | | video.setAuthorId(UserContext.getCurrentUserId()); |
| | | video.setVideoType(VideoTypeEnum.COOK.getValue()); |
| | | //设置填充模式 保持比例,完整显示 |
| | | video.setVideoFit("contain"); |
| | | video.setVideoContentType(VideoContentTypeEnum.VIDEO.getValue()); |
| | | video.setStatus(VideoStatusEnum.PUBLISHED.getValue()); |
| | | baseMapper.insert(video); |
| | | String id = video.getId(); |
| | | List<KitchenVideoTypeRef> collect = form.getCheckKitchenType().stream().map(item -> { |
| | | KitchenVideoTypeRef kitchenVideoTypeRef = new KitchenVideoTypeRef(); |
| | | //设置视频id |
| | | kitchenVideoTypeRef.setVideoId(id); |
| | | //设置标签id |
| | | kitchenVideoTypeRef.setKitchenTypeId(item); |
| | | return kitchenVideoTypeRef; |
| | | } |
| | | ).collect(Collectors.toList()); |
| | | kitchenVideoTypeRefService.saveBatch(collect); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result updateKitchenVideo(KitchenVideoForm form) { |
| | | Video video = baseMapper.selectById(form.getId()); |
| | | Assert.notNull(video, "记录不存在"); |
| | | BeanUtils.copyProperties(form, video); |
| | | baseMapper.updateById(video); |
| | | //删除原来的类型关系 |
| | | kitchenVideoTypeRefService.remove(Wrappers.<KitchenVideoTypeRef>lambdaQuery() |
| | | .eq(KitchenVideoTypeRef::getVideoId, form.getId())); |
| | | String id = video.getId(); |
| | | List<KitchenVideoTypeRef> collect = form.getCheckKitchenType().stream().map(item -> { |
| | | KitchenVideoTypeRef kitchenVideoTypeRef = new KitchenVideoTypeRef(); |
| | | //设置视频id |
| | | kitchenVideoTypeRef.setVideoId(id); |
| | | //设置标签id |
| | | kitchenVideoTypeRef.setKitchenTypeId(item); |
| | | return kitchenVideoTypeRef; |
| | | } |
| | | ).collect(Collectors.toList()); |
| | | kitchenVideoTypeRefService.saveBatch(collect); |
| | | return Result.ok("修改成功"); |
| | | } |
| | | |
| | | @Override |
| | | public Result KitchenVideoQuery(KitchenVideoQuery query) { |
| | | IPage<KitchenVideoVO> page = PageUtil.getPage(query, KitchenVideoVO.class); |
| | | // 1. 先查出视频信息 |
| | | baseMapper.kitchenPage(page, query); |
| | | // 2. 单独查出标签信息 |
| | | if (page.getTotal() > 0) { |
| | | Map<String, List<KitchenVideoTypeVO>> typeMap = kitchenVideoTypeRefService |
| | | .getTypeByVideoIds( |
| | | page.getRecords() |
| | | .stream().map(KitchenVideoVO::getId).collect(Collectors.toList())) |
| | | .stream().collect(Collectors.groupingBy(KitchenVideoTypeVO::getVideoId)); |
| | | // 3. 获取视频临时访问地址、设置视频标签 |
| | | page.getRecords().forEach(v -> { |
| | | v.setTypeList(typeMap.get(v.getId())); |
| | | v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | v.setCoverShowUrl(cosUtil.getPreviewUrl(v.getCoverUrl())); |
| | | }); |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result delKitchen(String id) { |
| | | Video entity = baseMapper.selectById(id); |
| | | Assert.notNull(entity, "记录不存在"); |
| | | String videoType = entity.getVideoType(); |
| | | if (!VideoTypeEnum.COOK.getValue().equals(videoType)) { |
| | | log.error("删除非大神厨视频视频id为------->"+id); |
| | | return Result.error("删除失败"); |
| | | } |
| | | baseMapper.deleteById(id); |
| | | kitchenVideoTypeRefService.remove(Wrappers.<KitchenVideoTypeRef>lambdaQuery() |
| | | .eq(KitchenVideoTypeRef::getVideoId, id)); |
| | | return Result.ok("删除成功"); |
| | | } |
| | | } |
| | |
| | | |
| | | import cn.lili.modules.lmk.domain.query.WxVideoTagQuery; |
| | | import cn.lili.modules.lmk.domain.vo.SimpleVideoTagVO; |
| | | import cn.lili.modules.lmk.domain.vo.WxVideoTagVO; |
| | | import cn.lili.modules.lmk.enums.general.TagCreateTypeEnum; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.domain.entity.VideoTag; |
| | |
| | | |
| | | @Override |
| | | public Result recommend(WxVideoTagQuery query) { |
| | | List<VideoTagVO> tags = new ArrayList<>(3); |
| | | List<WxVideoTagVO> tags = new ArrayList<>(3); |
| | | switch (query.getSearchType()) { |
| | | case "HOT": |
| | | // TODO 热门标签通过定时任务统计表lmk_video_tag_ref数量到lmk_video_tag中 |
| | |
| | | .orderByDesc(VideoTag::getUseNum) |
| | | .last("limit 3") |
| | | .list().stream().map(entity -> { |
| | | return VideoTagVO.getVoByEntity(entity, null); |
| | | return WxVideoTagVO.getVoByEntity(entity, null); |
| | | }).collect(Collectors.toList()); |
| | | case "SEARCH": |
| | | tags = new LambdaQueryChainWrapper<>(baseMapper) |
| | |
| | | .like(VideoTag::getTagName, query.getTagName()) |
| | | .last("limit 3") |
| | | .list().stream().map(entity -> { |
| | | return VideoTagVO.getVoByEntity(entity, null); |
| | | return WxVideoTagVO.getVoByEntity(entity, null); |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | return Result.ok().data(tags); |
| | |
| | | @ApiModelProperty(value = "客户标签列表") |
| | | private List<CustomerTagVO> customerTagList; |
| | | |
| | | /** |
| | | * 为null则不在黑名单内 |
| | | */ |
| | | @ApiModelProperty(value = "黑名单id") |
| | | private String blackId; |
| | | |
| | | public MemberVO(Member member) { |
| | | BeanUtil.copyProperties(member, this); |
| | | } |
| | |
| | | QRLoginResultVo loginWithSession(String token); |
| | | |
| | | Member findByUUID(String uuid); |
| | | } |
| | | |
| | | void registerHandler(Member user); |
| | | } |
| | |
| | | * @param member |
| | | */ |
| | | @Transactional |
| | | @Override |
| | | public void registerHandler(Member member) { |
| | | member.setId(SnowFlake.getIdStr()); |
| | | //保存会员 |
| | |
| | | package cn.lili.modules.order.order.serviceimpl; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import cn.lili.common.enums.ResultCode; |
| | | import cn.lili.common.exception.ServiceException; |
| | | import cn.lili.modules.order.order.entity.dos.OrderPackage; |
| | |
| | | import cn.lili.modules.order.order.mapper.OrderPackageMapper; |
| | | import cn.lili.modules.order.order.service.OrderPackageItemService; |
| | | import cn.lili.modules.order.order.service.OrderPackageService; |
| | | import cn.lili.modules.system.entity.dos.Logistics; |
| | | import cn.lili.modules.system.entity.vo.Traces; |
| | | import cn.lili.modules.system.service.LogisticsService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | orderPackageVO.setOrderPackageItemList(orderPackageItemList); |
| | | String str = orderPackage.getConsigneeMobile(); |
| | | str = str.substring(str.length() - 4); |
| | | // Traces traces = logisticsService.getLogisticTrack(orderPackage.getLogisticsCode(), orderPackage.getLogisticsNo(), str); |
| | | // orderPackageVO.setTraces(traces); |
| | | //不需要取是否打开的可能存在现在不发送快递需要查询物流信息 |
| | | List<Logistics> list = logisticsService.list(Wrappers.<Logistics>lambdaQuery() |
| | | .eq(Logistics::getCode, |
| | | orderPackage.getLogisticsCode())); |
| | | String logisticsId = orderPackage.getLogisticsCode(); |
| | | if (ArrayUtil.isNotEmpty(list)) { |
| | | logisticsId = list.get(0).getId(); |
| | | } |
| | | Traces traces = logisticsService.getLogisticTrack(logisticsId, orderPackage.getLogisticsNo(), str); |
| | | orderPackageVO.setTraces(traces); |
| | | orderPackageVOS.add(orderPackageVO); |
| | | }); |
| | | |
| | |
| | | package cn.lili.modules.search.service; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.common.vo.PageVO; |
| | | import cn.lili.modules.lmk.domain.query.VideoGoodsEsQuery; |
| | | import cn.lili.modules.search.entity.dos.EsGoodsIndex; |
| | | import cn.lili.modules.search.entity.dos.EsGoodsRelatedInfo; |
| | | import cn.lili.modules.search.entity.dto.EsGoodsSearchDTO; |
| | |
| | | * @return 商品索引 |
| | | */ |
| | | EsGoodsIndex getEsGoodsById(String id); |
| | | |
| | | /** |
| | | * 商品分页,发布视频时关联商品的查询 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result videoGoodsEsPage(VideoGoodsEsQuery query); |
| | | } |
| | |
| | | import cn.hutool.core.convert.Convert; |
| | | import cn.hutool.core.text.CharSequenceUtil; |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.cache.Cache; |
| | | import cn.lili.cache.CachePrefix; |
| | | import cn.lili.common.exception.ServiceException; |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.common.vo.PageVO; |
| | | import cn.lili.modules.goods.entity.enums.GoodsAuthEnum; |
| | | import cn.lili.modules.goods.entity.enums.GoodsStatusEnum; |
| | | import cn.lili.modules.lmk.domain.query.VideoGoodsEsQuery; |
| | | import cn.lili.modules.search.entity.dos.EsGoodsIndex; |
| | | import cn.lili.modules.search.entity.dos.EsGoodsRelatedInfo; |
| | | import cn.lili.modules.search.entity.dto.EsGoodsSearchDTO; |
| | |
| | | import org.elasticsearch.index.query.functionscore.FieldValueFactorFunctionBuilder; |
| | | import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder; |
| | | import org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders; |
| | | import org.elasticsearch.index.search.MultiMatchQuery; |
| | | import org.elasticsearch.search.aggregations.*; |
| | | import org.elasticsearch.search.aggregations.bucket.nested.ParsedNested; |
| | | import org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.elasticsearch.core.*; |
| | | import org.springframework.data.elasticsearch.core.query.NativeSearchQuery; |
| | | import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; |
| | |
| | | return this.restTemplate.get(id, EsGoodsIndex.class); |
| | | } |
| | | |
| | | @Override |
| | | public Result videoGoodsEsPage(VideoGoodsEsQuery q) { |
| | | // 判断商品索引是否存在 |
| | | if (!restTemplate.indexOps(EsGoodsIndex.class).exists()) { |
| | | return Result.ok(); |
| | | } |
| | | // 根据销量倒序排列 |
| | | Pageable pageable = PageRequest.of(q.getPageNumber(), q.getPageSize(), Sort.by("buyCount").descending()); |
| | | |
| | | NativeSearchQueryBuilder queryBuilder = new NativeSearchQueryBuilder(); |
| | | queryBuilder.withPageable(pageable); |
| | | |
| | | BoolQueryBuilder boolQuery = QueryBuilders.boolQuery(); |
| | | |
| | | // 关键词匹配商品名称、商品编号 |
| | | if (!StringUtils.isEmpty(q.getKeyword())) { |
| | | boolQuery.must(QueryBuilders.multiMatchQuery(q.getKeyword(), "goodsName", "sn")); |
| | | } |
| | | |
| | | if (q.getSearchFromSelfStore()) { |
| | | // 如果只查自家店铺商品 |
| | | boolQuery.must(QueryBuilders.termQuery("storeId", UserContext.getCurrentUser().getStoreId())); |
| | | } |
| | | |
| | | queryBuilder.withQuery(boolQuery); |
| | | |
| | | NativeSearchQuery query = queryBuilder.build(); |
| | | SearchHits<EsGoodsIndex> searchHits = restTemplate.search(query, EsGoodsIndex.class); |
| | | List<EsGoodsIndex> data = searchHits.stream().map(hit -> hit.getContent()).collect(Collectors.toList()); |
| | | return Result.ok().data(data).total(searchHits.getTotalHits()); |
| | | } |
| | | |
| | | /** |
| | | * 转换搜索结果为聚合商品展示信息 |
| | | * |
New file |
| | |
| | | package cn.lili.mybatis; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | |
| | | /** |
| | | * 数据库基础实体类 |
| | | * |
| | | * @author Chopper |
| | | * @version v1.0 |
| | | * @since 2020/8/20 14:34 |
| | | */ |
| | | @Data |
| | | @JsonIgnoreProperties(value = { "handler", "fieldHandler"}) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public abstract class BaseIdAndDeleteEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | @TableId |
| | | @ApiModelProperty(value = "唯一标识", hidden = true) |
| | | private String id; |
| | | |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ApiModelProperty(value = "删除标志 true/false 删除/未删除", hidden = true) |
| | | private Boolean deleteFlag; |
| | | |
| | | } |
| | |
| | | <result property="gradeId" column="grade_id"/> |
| | | <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" |
| | | select="selectTagByMemberId" |
| | | column="id" |
| | |
| | | |
| | | <select id="getPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | * |
| | | LM.* |
| | | FROM |
| | | li_member lm |
| | | li_member LM |
| | | LEFT JOIN lmk_customer_black LMK ON LM.id = LMK.user_id and LMK.delete_flag = 0 |
| | | <where> |
| | | <!-- 用户名模糊查询 --> |
| | | <if test="query.username != null and query.username != ''"> |
| | | AND lm.username LIKE CONCAT('%', #{query.username}, '%') |
| | | AND LM.username LIKE CONCAT('%', #{query.username}, '%') |
| | | </if> |
| | | |
| | | <!-- 昵称模糊查询 --> |
| | | <if test="query.nickName != null and query.nickName != ''"> |
| | | AND lm.nick_name LIKE CONCAT('%', #{query.nickName}, '%') |
| | | AND LM.nick_name LIKE CONCAT('%', #{query.nickName}, '%') |
| | | </if> |
| | | |
| | | <!-- 手机号码精确查询 --> |
| | | <if test="query.mobile != null and query.mobile != ''"> |
| | | AND lm.mobile = #{query.mobile} |
| | | AND LM.mobile = #{query.mobile} |
| | | </if> |
| | | |
| | | <!-- 会员状态转 --> |
| | | <if test="query.disabled != null and query.disabled != ''"> |
| | | AND lm.disabled = #{query.disabled} |
| | | AND LM.disabled = #{query.disabled} |
| | | </if> |
| | | |
| | | <!-- 商铺id --> |
| | | <if test="query.storeId != null and query.storeId != ''"> |
| | | AND lm.store_id = #{query.storeId} |
| | | AND LM.store_id = #{query.storeId} |
| | | </if> |
| | | AND EXISTS ( |
| | | SELECT 1 |
| | | FROM li_order lo |
| | | WHERE lo.member_id = lm.id |
| | | ) |
| | | AND LM.delete_flag = 0 |
| | | </where> |
| | | ORDER BY lm.create_time DESC |
| | | </select> |
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.KitchenTypeMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.KitchenTypeVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="type_name" property="typeName" /> |
| | | <result column="use_num" property="useNum" /> |
| | | <result column="sort_num" property="sortNum" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <select id="getById" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LKT.type_name, |
| | | LKT.use_num, |
| | | LKT.sort_num, |
| | | LKT.id |
| | | FROM |
| | | lmk_kitchen_type LKT |
| | | WHERE |
| | | LKT.id = #{id} AND LKT.delete_flag = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="getPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LKT.type_name, |
| | | LKT.use_num, |
| | | LKT.sort_num, |
| | | LKT.id |
| | | FROM |
| | | lmk_kitchen_type LKT |
| | | WHERE |
| | | LKT.delete_flag = 0 |
| | | <if test="query.typeName != null and query.typeName != ''"> |
| | | AND LKT.type_name LIKE CONCAT('%', #{query.typeName},'%') |
| | | </if> |
| | | order by LKT.sort_num asc |
| | | </select> |
| | | |
| | | </mapper> |
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.KitchenVideoTypeRefMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.KitchenVideoTypeRefVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="video_id" property="videoId" /> |
| | | <result column="kitchen_type_id" property="kitchenTypeId" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <select id="getById" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LKVTR.video_id, |
| | | LKVTR.kitchen_type_id, |
| | | LKVTR.id |
| | | FROM |
| | | lmk_kitchen_video_type_ref LKVTR |
| | | WHERE |
| | | LKVTR.id = #{id} AND LKVTR.delete_flag = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="getPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LKVTR.video_id, |
| | | LKVTR.kitchen_type_id, |
| | | LKVTR.id |
| | | FROM |
| | | lmk_kitchen_video_type_ref LKVTR |
| | | WHERE |
| | | LKVTR.delete_flag = 0 |
| | | </select> |
| | | |
| | | <select id="getTypeByVideoIds" resultType="cn.lili.modules.lmk.domain.vo.KitchenVideoTypeVO"> |
| | | SELECT |
| | | LKVTR.video_id, |
| | | LKT.id, |
| | | LKT.type_name |
| | | FROM |
| | | lmk_kitchen_video_type_ref LKVTR |
| | | JOIN lmk_kitchen_type LKT ON LKVTR.kitchen_type_id = LKT.id |
| | | WHERE |
| | | LKVTR.video_id IN <foreach collection="videoIds" open="(" item="videoId" close=")" separator=",">#{videoId}</foreach> |
| | | </select> |
| | | |
| | | </mapper> |
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.ShareClickRecordMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.ShareClickRecordVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="share_id" property="shareId" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="click_time" property="clickTime" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <select id="getById" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LSCR.share_id, |
| | | LSCR.user_id, |
| | | LSCR.click_time, |
| | | LSCR.id |
| | | FROM |
| | | lmk_share_click_record LSCR |
| | | WHERE |
| | | LSCR.id = #{id} AND LSCR.delete_flag = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="getPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LSCR.share_id, |
| | | LSCR.user_id, |
| | | LSCR.click_time, |
| | | LSCR.id |
| | | FROM |
| | | lmk_share_click_record LSCR |
| | | WHERE |
| | | LSCR.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.ShareMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.ShareVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="share_type" property="shareType" /> |
| | | <result column="ref_id" property="refId" /> |
| | | <result column="share_user" property="shareUser" /> |
| | | <result column="share_time" property="shareTime" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <select id="getById" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LS.share_type, |
| | | LS.ref_id, |
| | | LS.share_user, |
| | | LS.share_time, |
| | | LS.id |
| | | FROM |
| | | lmk_share LS |
| | | WHERE |
| | | LS.id = #{id} AND LS.delete_flag = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="getPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LS.share_type, |
| | | LS.ref_id, |
| | | LS.share_user, |
| | | LS.share_time, |
| | | LS.id |
| | | FROM |
| | | lmk_share LS |
| | | WHERE |
| | | LS.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.VideoGoodsMapper"> |
| | | |
| | | |
| | | |
| | | </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="video_duration" property="videoDuration" /> |
| | | <result column="recommend" property="recommend" /> |
| | | <result column="status" property="status" /> |
| | | <result column="play_num" property="playNum" /> |
| | | <result column="collect_num" property="collectNum" /> |
| | | <result column="comment_num" property="commentNum" /> |
| | | <result column="weight" property="weight" /> |
| | | <result column="audit_pass_time" property="auditPassTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="video_content_type" property="videoContentType" /> |
| | | <result column="video_type" property="videoType" /> |
| | | <result column="video_imgs" property="videoImgs" /> |
| | | <collection property="goodsList" column="id" select="getVideoGoods" ofType="cn.lili.modules.lmk.domain.vo.VideoGoodsDetailVO"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="VideoGoodsMap" type="cn.lili.modules.lmk.domain.vo.VideoGoodsDetailVO"> |
| | | <result column="goods_id" property="goodsId"/> |
| | | <result column="goods_num" property="goodsNum"/> |
| | | <result column="goods_name" property="goodsName"/> |
| | | <result column="thumbnail" property="thumbnail"/> |
| | | <result column="price" property="price"/> |
| | | </resultMap> |
| | | |
| | | <select id="getVideoGoods" parameterType="string" resultMap="VideoGoodsMap"> |
| | | SELECT |
| | | LVG.goods_id, |
| | | LVG.goods_num, |
| | | LVG.order_num, |
| | | LG.goods_name, |
| | | LG.thumbnail, |
| | | 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 |
| | | WHERE |
| | | LVG.video_id = #{id} AND LVG.delete_flag = 0 |
| | | ORDER BY |
| | | LVG.order_num ASC |
| | | </select> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="KitchenVideoMap" type="cn.lili.modules.lmk.domain.vo.KitchenVideoVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="author_id" property="authorId" /> |
| | | <result column="authorName" property="authorName" /> |
| | | <result column="cover_url" property="coverUrl" /> |
| | | <result column="video_file_key" property="videoFileKey" /> |
| | | <result column="video_fit" property="videoFit" /> |
| | | <result column="title" property="title" /> |
| | | <result column="goods_view_num" property="goodsViewNum" /> |
| | | <result column="video_duration" property="videoDuration" /> |
| | | <result column="goods_order_num" property="goodsOrderNum" /> |
| | |
| | | <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="video_content_type" property="videoContentType" /> |
| | | <result column="video_type" property="videoType" /> |
| | | <result column="video_imgs" property="videoImgs" /> |
| | | <collection property="goodsList" column="id" select="getVideoGoods" ofType="cn.lili.modules.lmk.domain.vo.VideoGoodsDetailVO"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | LEFT JOIN li_member LM ON LV.author_id = LM.id |
| | | 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> |
| | | |
| | | |
| | |
| | | <result column="video_fit" property="videoFit" /> |
| | | <result column="title" property="title" /> |
| | | <result column="video_duration" property="videoDuration" /> |
| | | <result column="goods_id" property="goodsId" /> |
| | | <result column="video_imgs" property="videoImgs" /> |
| | | <result column="video_content_type" property="videoContentType" /> |
| | | <collection property="goodsList" column="id" select="getVideoGoods" ofType="cn.lili.modules.lmk.domain.vo.VideoGoodsDetailVO"/> |
| | | </resultMap> |
| | | |
| | | <select id="wxDetail" resultMap="WxEditResultMap"> |
| | | 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 |
| | | FROM |
| | |
| | | WHERE |
| | | LV.delete_flag = 0 AND LV.id = #{id} |
| | | </select> |
| | | <select id="healthPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LV.author_id, |
| | | LV.cover_url, |
| | | LV.video_fit, |
| | | LV.video_duration, |
| | | LV.video_file_key, |
| | | LV.title, |
| | | LV.goods_view_num, |
| | | LV.goods_order_num, |
| | | LV.recommend, |
| | | LV.status, |
| | | LV.play_num, |
| | | LV.collect_num, |
| | | LV.comment_num, |
| | | LV.weight, |
| | | LV.audit_pass_time, |
| | | LV.update_time, |
| | | LV.video_content_type, |
| | | LV.video_type, |
| | | LV.video_imgs, |
| | | LV.id, |
| | | LM.nick_name as authorName |
| | | FROM |
| | | lmk_video LV |
| | | LEFT JOIN li_member LM ON LV.author_id = LM.id |
| | | <if test="query.tagList != null and query.tagList.size > 0"> |
| | | INNER JOIN ( |
| | | SELECT DISTINCT video_id |
| | | FROM lmk_video_tag_ref |
| | | WHERE video_tag_id IN |
| | | <foreach collection="query.tagList" open="(" item="tagId" close=")" separator=",">#{tagId}</foreach> |
| | | ) AS LVT ON LV.id = LVT.video_id |
| | | </if> |
| | | WHERE |
| | | LV.delete_flag = 0 AND LV.video_type = #{query.videoType} |
| | | <if test="query.title != null and query.title != ''">AND LV.title LIKE CONCAT('%', #{query.title}, '%')</if> |
| | | <if test="query.authorId != null and query.authorId != ''">AND LV.author_id = #{query.authorId}</if> |
| | | <if test="query.status != null and query.status != ''">AND LV.status = #{query.status}</if> |
| | | </select> |
| | | |
| | | <select id="kitchenPage" resultMap="KitchenVideoMap"> |
| | | SELECT |
| | | LV.author_id, |
| | | LV.cover_url, |
| | | LV.video_fit, |
| | | LV.video_duration, |
| | | LV.video_file_key, |
| | | LV.title, |
| | | LV.goods_view_num, |
| | | LV.goods_order_num, |
| | | LV.recommend, |
| | | LV.status, |
| | | LV.play_num, |
| | | LV.collect_num, |
| | | LV.comment_num, |
| | | LV.weight, |
| | | LV.audit_pass_time, |
| | | LV.update_time, |
| | | LV.video_content_type, |
| | | LV.video_type, |
| | | LV.video_imgs, |
| | | LV.id, |
| | | LM.nick_name as authorName |
| | | FROM |
| | | lmk_video LV |
| | | LEFT JOIN li_member LM ON LV.author_id = LM.id |
| | | <if test="query.typeList != null and query.typeList.size > 0"> |
| | | INNER JOIN ( |
| | | SELECT DISTINCT video_id |
| | | FROM lmk_kitchen_video_type_ref |
| | | WHERE kitchen_type_id IN |
| | | <foreach collection="query.typeList" open="(" item="tagId" close=")" separator=",">#{tagId}</foreach> |
| | | ) AS LVT ON LV.id = LVT.video_id |
| | | </if> |
| | | WHERE |
| | | LV.delete_flag = 0 AND LV.video_type = #{query.videoType} |
| | | <if test="query.title != null and query.title != ''">AND LV.title LIKE CONCAT('%', #{query.title}, '%')</if> |
| | | <if test="query.authorId != null and query.authorId != ''">AND LV.author_id = #{query.authorId}</if> |
| | | <if test="query.status != null and query.status != ''">AND LV.status = #{query.status}</if> |
| | | </select> |
| | | </mapper> |
| | |
| | | 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 |
| | |
| | | return customerService.getStoreSelectOptions(); |
| | | } |
| | | |
| | | @ApiOperation(value = "获得客户详情") |
| | | @GetMapping("/{id}") |
| | | public Result getCustomerInfo(@PathVariable String id){ |
| | | return customerService.getMember(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "客户分页列表") |
| | | @GetMapping |
New file |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.group.Update; |
| | | import cn.lili.modules.lmk.domain.form.HealthVideoForm; |
| | | import cn.lili.modules.lmk.domain.query.HealthVideoQuery; |
| | | import cn.lili.modules.lmk.service.VideoService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "大健康", tags = "大健康") |
| | | @RestController |
| | | @RequestMapping("/manager/lkm/health") |
| | | public class HealthController { |
| | | private final VideoService videoService; |
| | | |
| | | @PostMapping("/healthVideo") |
| | | @ApiOperation(value = "大健康视频发布", notes = "大健康视频发布") |
| | | public Result healthVideo(@RequestBody @Validated(Add.class) HealthVideoForm form) { |
| | | return videoService.healthVideo(form); |
| | | } |
| | | @PostMapping("/updateHealthVideo") |
| | | @ApiOperation(value = "大健康视频发布", notes = "大健康视频发布") |
| | | public Result updateHealthVideo(@RequestBody @Validated(Update.class) HealthVideoForm form) { |
| | | return videoService.updateHealthVideo(form); |
| | | } |
| | | @PostMapping("/page") |
| | | @ApiOperation(value = "大健康视频列表", notes = "大健康视频列表") |
| | | public Result page(@RequestBody HealthVideoQuery query) { |
| | | return videoService.healthPage(query); |
| | | } |
| | | //删除大厨神视频 |
| | | @PostMapping("/del/{id}") |
| | | @ApiOperation(value = "删除大厨神视频", notes = "删除大厨神视频") |
| | | public Result delHealth(@PathVariable("id") String id) { |
| | | return videoService.delHealth(id); |
| | | } |
| | | } |
New file |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | import cn.lili.group.Update; |
| | | import cn.lili.group.Add; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import lombok.RequiredArgsConstructor; |
| | | import java.util.List; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import cn.lili.modules.lmk.service.KitchenTypeService; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.KitchenTypeForm; |
| | | import cn.lili.modules.lmk.domain.query.KitchenTypeQuery; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * 厨神类型 前端控制器 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "厨神类型", tags = "厨神类型管理") |
| | | @RestController |
| | | @RequestMapping("/manager/lmk/kitchen-type") |
| | | public class KitchenTypeController { |
| | | |
| | | private final KitchenTypeService kitchenTypeService; |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "添加", notes = "添加") |
| | | public Result add(@RequestBody @Validated(Add.class) KitchenTypeForm form) { |
| | | return kitchenTypeService.add(form); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public Result update(@RequestBody @Validated(Update.class) KitchenTypeForm form) { |
| | | return kitchenTypeService.update(form); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation(value = "ID删除", notes = "ID删除") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | return kitchenTypeService.removeById(id); |
| | | } |
| | | |
| | | @DeleteMapping("/batch") |
| | | @ApiOperation(value = "批量删除", notes = "批量删除") |
| | | public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) { |
| | | return kitchenTypeService.remove(ids); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @ApiOperation(value = "分页", notes = "分页") |
| | | public Result page(KitchenTypeQuery query) { |
| | | return kitchenTypeService.page(query); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | public Result detail(@PathVariable("id") String id) { |
| | | return kitchenTypeService.detail(id); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "列表", notes = "列表") |
| | | public Result list() { |
| | | return kitchenTypeService.all(); |
| | | } |
| | | } |
New file |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.group.Update; |
| | | import cn.lili.modules.lmk.domain.form.HealthVideoForm; |
| | | import cn.lili.modules.lmk.domain.form.KitchenTypeForm; |
| | | import cn.lili.modules.lmk.domain.form.KitchenVideoForm; |
| | | import cn.lili.modules.lmk.domain.query.HealthVideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.KitchenTypeQuery; |
| | | import cn.lili.modules.lmk.domain.query.KitchenVideoQuery; |
| | | import cn.lili.modules.lmk.service.KitchenTypeService; |
| | | import cn.lili.modules.lmk.service.VideoService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 厨神视频 前端控制器 |
| | | * |
| | | * @author wp |
| | | * @since 2025-06-13 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "厨神视频", tags = "厨神视频管理") |
| | | @RestController |
| | | @RequestMapping("/manager/lmk/kitchen-video") |
| | | public class KitchenVideoController { |
| | | |
| | | private final VideoService videoService; |
| | | |
| | | @PostMapping("/addKitchenVideo") |
| | | @ApiOperation(value = "厨神视频发布", notes = "厨神视频发布") |
| | | public Result addKitchenVideo(@RequestBody @Validated(Add.class) KitchenVideoForm form) { |
| | | return videoService.addKitchenVideo(form); |
| | | } |
| | | @PostMapping("/updateKitchenVideo") |
| | | @ApiOperation(value = "厨神视频修改", notes = "厨神视频修改") |
| | | public Result updateKitchenVideo(@RequestBody @Validated(Update.class) KitchenVideoForm form) { |
| | | return videoService.updateKitchenVideo(form); |
| | | } |
| | | @PostMapping("/page") |
| | | @ApiOperation(value = "厨神视频列表", notes = "厨神视频列表") |
| | | public Result page(@RequestBody KitchenVideoQuery query) { |
| | | return videoService.KitchenVideoQuery(query); |
| | | } |
| | | |
| | | @PostMapping("/del/{id}") |
| | | @ApiOperation(value = "删除大厨神视频", notes = "删除大厨神视频") |
| | | public Result delKitchen(@PathVariable("id") String id) { |
| | | return videoService.delKitchen(id); |
| | | } |
| | | } |
| | |
| | | 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列表") |