@@ -24,6 +24,7 @@ type UserInfoData struct {
|
||||
type UserInfoPayload struct {
|
||||
Context context.Context
|
||||
UserId uuid.UUID
|
||||
IsOther bool
|
||||
Data *UserInfoData
|
||||
}
|
||||
|
||||
@@ -63,6 +64,29 @@ func (self *UserServiceImpl) GetUserInfo(payload *UserInfoPayload) (result *User
|
||||
return
|
||||
}
|
||||
|
||||
if payload.IsOther {
|
||||
if !userData.AllowPublic {
|
||||
exception := new(exception.Builder).
|
||||
SetStatus(exception.StatusUser).
|
||||
SetService(exception.ServiceUser).
|
||||
SetEndpoint(exception.EndpointUserServiceInfo).
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonErrorUserNotFound).
|
||||
SetError(err).
|
||||
Throw(payload.Context)
|
||||
|
||||
result = &UserInfoResult{
|
||||
Common: shared.CommonResult{
|
||||
HttpCode: 404,
|
||||
Exception: exception,
|
||||
},
|
||||
Data: nil,
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
exception := new(exception.Builder).
|
||||
SetStatus(exception.StatusUser).
|
||||
SetService(exception.ServiceUser).
|
||||
|
||||
Reference in New Issue
Block a user