other 新增用户身份查询接口
This commit is contained in:
parent
1ba237c1e8
commit
5ff660ad04
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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)));
|
||||
}
|
||||
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* true:bd,false:不是.
|
||||
*/
|
||||
private Boolean bd;
|
||||
|
||||
/**
|
||||
* true:bd Leader,false:不是.
|
||||
*/
|
||||
private Boolean bdLeader;
|
||||
|
||||
/**
|
||||
* 货运代理: true:是 false:不是.
|
||||
*/
|
||||
private Boolean freightAgent;
|
||||
|
||||
/**
|
||||
* 历史身份.
|
||||
*/
|
||||
private List<String> historyIdentity;
|
||||
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user