other 新增用户身份查询接口

This commit is contained in:
tianfeng 2025-08-15 00:25:22 +08:00
parent 1ba237c1e8
commit 5ff660ad04
4 changed files with 106 additions and 4 deletions

View File

@ -3,13 +3,13 @@ package com.red.circle.other.adapter.app.h5;
import com.red.circle.common.business.dto.cmd.AppExtCommand;
import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.app.dto.h5.MemberActiveDTO;
import com.red.circle.other.app.dto.h5.UserIdentityVO;
import com.red.circle.other.app.service.h5.MemberActiveService;
import com.red.circle.other.app.service.user.user.UserCountService;
import com.red.circle.other.app.service.user.user.UserIdentityService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
@RequiredArgsConstructor
@RestController
@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
public class MemberActiveController extends BaseController {
private final MemberActiveService memberActiveService;
private final UserIdentityService userIdentityService;
/**
* 工会裂变活动列表
@ -36,4 +37,13 @@ public class MemberActiveController extends BaseController {
public void joinActive(AppExtCommand cmd) {
memberActiveService.joinActive(cmd);
}
/**
* 用户身份信息.
*/
@GetMapping("{userId}/identity")
public UserIdentityVO getUserIdentity(@PathVariable("userId") Long userId) {
return userIdentityService.getUserIdentity(userId);
}
}

View File

@ -0,0 +1,33 @@
package com.red.circle.other.app.service.user.user;
import com.red.circle.framework.core.asserts.ResponseAssert;
import com.red.circle.other.app.dto.h5.UserIdentityVO;
import com.red.circle.other.inner.endpoint.team.target.TeamProfileClient;
import com.red.circle.other.inner.enums.team.TeamMemberRole;
import com.red.circle.other.inner.model.dto.agency.agency.TeamMemberDTO;
import com.red.circle.wallet.inner.endpoint.freight.FreightGoldClient;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.Objects;
@Service
@RequiredArgsConstructor
public class UserIdentityServiceImpl implements UserIdentityService {
private final TeamProfileClient teamProfileClient;
private final FreightGoldClient freightGoldClient;
@Override
public UserIdentityVO getUserIdentity(Long userId) {
TeamMemberDTO teamMember = ResponseAssert.requiredSuccess(
teamProfileClient.getByMemberId(userId));
return new UserIdentityVO()
.setAgent(Objects.nonNull(teamMember) && TeamMemberRole.OWN.eq(teamMember.getRole()))
.setAnchor(Objects.nonNull(teamMember))
.setFreightAgent(
ResponseAssert.requiredSuccess(freightGoldClient.checkFreightAgent(userId)));
}
}

View File

@ -0,0 +1,47 @@
package com.red.circle.other.app.dto.h5;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
@Data
@Accessors(chain = true)
public class UserIdentityVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* true代理false:不是.
*/
private Boolean agent;
/**
* true主播false:不是.
*/
private Boolean anchor;
/**
* truebdfalse:不是.
*/
private Boolean bd;
/**
* truebd Leaderfalse:不是.
*/
private Boolean bdLeader;
/**
* 货运代理: true: false:不是.
*/
private Boolean freightAgent;
/**
* 历史身份.
*/
private List<String> historyIdentity;
}

View File

@ -0,0 +1,12 @@
package com.red.circle.other.app.service.user.user;
import com.red.circle.other.app.dto.h5.UserIdentityVO;
public interface UserIdentityService {
/**
* 用户身份信息.
*/
UserIdentityVO getUserIdentity(Long userId);
}