|
|
@@ -3,10 +3,12 @@ package shop.alien.gateway.controller;
|
|
|
import io.swagger.annotations.*;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import shop.alien.entity.result.R;
|
|
|
import shop.alien.entity.store.vo.LifeUserVo;
|
|
|
import shop.alien.gateway.config.BaseRedisService;
|
|
|
+import shop.alien.gateway.service.ActivityInviteConfigService;
|
|
|
import shop.alien.gateway.service.LifeUserService;
|
|
|
|
|
|
/**
|
|
|
@@ -24,6 +26,8 @@ public class LifeUserController {
|
|
|
|
|
|
private final BaseRedisService baseRedisService;
|
|
|
|
|
|
+ private final ActivityInviteConfigService activityInviteConfigService;
|
|
|
+
|
|
|
@ApiOperation("用户登录")
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
@ApiImplicitParams({
|
|
|
@@ -50,6 +54,13 @@ public class LifeUserController {
|
|
|
if (null == userVo) {
|
|
|
return R.fail("登录失败");
|
|
|
}
|
|
|
+
|
|
|
+ if(StringUtils.isNotBlank(inviteCode)){
|
|
|
+ String bindResult = activityInviteConfigService.bindInviteCode(userVo.getId(), inviteCode);
|
|
|
+ if(StringUtils.isNotBlank(bindResult) && !bindResult.equals("绑定成功")){
|
|
|
+ return R.fail(bindResult);
|
|
|
+ }
|
|
|
+ }
|
|
|
return R.data(userVo);
|
|
|
}
|
|
|
|