分享 领取
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.market.dto.MkCarouselDTO;
|
||||
import com.czg.market.entity.MkCarousel;
|
||||
import com.czg.market.service.MkCarouselService;
|
||||
import com.czg.market.service.MkShareBaseService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -20,19 +18,44 @@ import java.util.List;
|
||||
* @author ww
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user/carousel")
|
||||
@RequestMapping("/user")
|
||||
public class UCarouselController {
|
||||
|
||||
@Resource
|
||||
private MkCarouselService mkCarouselService;
|
||||
|
||||
@Resource
|
||||
private MkShareBaseService mkShareBaseService;
|
||||
|
||||
|
||||
/**
|
||||
* 轮播图配置
|
||||
*/
|
||||
@GetMapping
|
||||
@SaAdminCheckPermission(parentName = "轮播图配置", value = "carousel:config", name = "轮播图-列表")
|
||||
@GetMapping("/carousel")
|
||||
public CzgResult<List<MkCarousel>> getCarousels(MkCarouselDTO carouselDTO) {
|
||||
carouselDTO.setShopId(StpKit.USER.getShopId());
|
||||
return CzgResult.success(mkCarouselService.getCarousels(carouselDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分享 领取触发
|
||||
*
|
||||
* @param tagType
|
||||
* @param shopId
|
||||
* @param fromUserId 分享人的shopUserId
|
||||
* @param toUserId 被分享人的shopUserId
|
||||
*/
|
||||
public record ShareClaim(String tagType, Long shopId, Long fromUserId, Long toUserId) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分享 领取触发
|
||||
* 会绑定上下级关系
|
||||
*/
|
||||
@PostMapping("/shareClaim")
|
||||
public CzgResult<Void> shareClaim(@RequestBody ShareClaim shareClaim) {
|
||||
mkShareBaseService.shareClaim(shareClaim.tagType, shareClaim.shopId, shareClaim.fromUserId, shareClaim.toUserId);
|
||||
return CzgResult.success();
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,6 @@ import com.mybatisflex.core.paginate.Page;
|
||||
import io.seata.core.exception.TransactionException;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.core.NestedExceptionUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -107,19 +106,6 @@ public class UDistributionController {
|
||||
return CzgResult.success(distributionUserService.getInviteCode(shopId, shopUserId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销员中心-获取邀请码
|
||||
*/
|
||||
@GetMapping("/autoGetInviteCode")
|
||||
public CzgResult<String> autoGetInviteCode(@RequestParam Long shopId, @RequestParam Long shopUserId) {
|
||||
try {
|
||||
return CzgResult.success(distributionUserService.getInviteCode(shopId, shopUserId));
|
||||
} catch (Exception e) {
|
||||
String rootMsg = NestedExceptionUtils.getMostSpecificCause(e).getMessage();
|
||||
log.error("获取邀请码失败用户:{},:{}", shopUserId, rootMsg);
|
||||
return CzgResult.success("");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销员中心-实名认证
|
||||
@@ -133,20 +119,6 @@ public class UDistributionController {
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销员中心-无感-绑定邀请人
|
||||
*/
|
||||
@PostMapping("/autoBindInviteUser")
|
||||
public CzgResult<Map<String, Object>> autoBindInviteUser(@RequestBody MkDistributionUserDTO param) throws TransactionException {
|
||||
try {
|
||||
bindInviteUser(param);
|
||||
} catch (Exception e) {
|
||||
log.error("无感绑定邀请人失败:{}", param, e);
|
||||
}
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分销员中心-绑定邀请人
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user