用户端获取分享的基础配置

This commit is contained in:
2026-01-28 14:39:55 +08:00
parent 25b9a5b389
commit e3887148c1
3 changed files with 15 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ package com.czg.controller.user;
import com.czg.market.dto.MkCarouselDTO; import com.czg.market.dto.MkCarouselDTO;
import com.czg.market.entity.MkCarousel; import com.czg.market.entity.MkCarousel;
import com.czg.market.entity.MkShareBase;
import com.czg.market.service.MkCarouselService; import com.czg.market.service.MkCarouselService;
import com.czg.market.service.MkShareBaseService; import com.czg.market.service.MkShareBaseService;
import com.czg.resp.CzgResult; import com.czg.resp.CzgResult;
@@ -48,6 +49,13 @@ public class UCarouselController {
public record ShareClaim(String tagType, Long shopId, Long fromUserId, Long toUserId) { public record ShareClaim(String tagType, Long shopId, Long fromUserId, Long toUserId) {
} }
/**
* 分享 基础配置
*/
@PostMapping("/share")
public CzgResult<MkShareBase> share(@RequestParam Long shopId) {
return CzgResult.success(mkShareBaseService.getShareBase(shopId));
}
/** /**
* 分享 领取触发 * 分享 领取触发

View File

@@ -1,5 +1,6 @@
package com.czg.market.entity; package com.czg.market.entity;
import com.czg.market.dto.ShopCouponDTO;
import com.mybatisflex.annotation.Column; import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id; import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table; import com.mybatisflex.annotation.Table;
@@ -57,6 +58,11 @@ public class MkShareBase implements Serializable {
* 分享人奖励的优惠券ID关联优惠券表 * 分享人奖励的优惠券ID关联优惠券表
*/ */
private Long sharerCouponId; private Long sharerCouponId;
/**
* 分享人奖励的优惠券信息
*/
@Column(ignore = true)
private ShopCouponDTO sharerCoupon;
/** /**
* 分享人奖励的优惠券名称 * 分享人奖励的优惠券名称
*/ */

View File

@@ -39,6 +39,7 @@ public class MkShareBaseServiceImpl extends ServiceImpl<MkShareBaseMapper, MkSha
ShopCouponDTO sharerCoupon = shopCouponService.getCouponById(shareBase.getSharerCouponId()); ShopCouponDTO sharerCoupon = shopCouponService.getCouponById(shareBase.getSharerCouponId());
if (sharerCoupon != null) { if (sharerCoupon != null) {
shareBase.setSharerCouponName(sharerCoupon.getTitle()); shareBase.setSharerCouponName(sharerCoupon.getTitle());
shareBase.setSharerCoupon(sharerCoupon);
} }
} }
if (shareBase.getSharedUserCouponId() != null) { if (shareBase.getSharedUserCouponId() != null) {