feat(admin-user): 增加超级管理员实名信息查询
This commit is contained in:
@@ -232,6 +232,31 @@ func (h *Handler) ManualRealname(c *gin.Context) {
|
||||
response.OK(c, item)
|
||||
}
|
||||
|
||||
func (h *Handler) RealnameIdentity(c *gin.Context) {
|
||||
c.Header("Cache-Control", "no-store")
|
||||
c.Header("Pragma", "no-cache")
|
||||
adminID, ok := currentAdminID(c)
|
||||
if !ok {
|
||||
response.Unauthorized(c, "缺少管理员上下文")
|
||||
return
|
||||
}
|
||||
userID, ok := parseID(c)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
item, err := h.service.ViewRealnameIdentity(
|
||||
c.Request.Context(),
|
||||
adminID,
|
||||
userID,
|
||||
auditMeta(c),
|
||||
)
|
||||
if err != nil {
|
||||
writeAdminUserError(c, err)
|
||||
return
|
||||
}
|
||||
response.OK(c, item)
|
||||
}
|
||||
|
||||
func (h *Handler) AdjustWallet(c *gin.Context) {
|
||||
adminID, ok := currentAdminID(c)
|
||||
if !ok {
|
||||
@@ -296,6 +321,8 @@ func writeAdminUserError(c *gin.Context, err error) {
|
||||
response.Error(c, http.StatusConflict, "realname_id_no_used", "该身份证号已绑定其他实名账号,不能重复认证")
|
||||
case errors.Is(err, ErrRealnameNotRevocable):
|
||||
response.Error(c, http.StatusConflict, "realname_not_revocable", "该用户当前没有可撤销的实名信息")
|
||||
case errors.Is(err, ErrRealnameIdentityUnavailable):
|
||||
response.Error(c, http.StatusUnprocessableEntity, "realname_identity_unavailable", "实名信息暂时无法查看")
|
||||
case errors.Is(err, ErrInvalidWalletDirection):
|
||||
response.BadRequest(c, "调账方向不正确,仅支持加款(in)或扣款(out)")
|
||||
case errors.Is(err, ErrInvalidWalletAmount):
|
||||
|
||||
Reference in New Issue
Block a user