feat(admin-user): 增加超级管理员实名信息查询

This commit is contained in:
yml
2026-11-22 19:21:24 +08:00
parent 20be2273d5
commit 8c41c258fa
9 changed files with 304 additions and 16 deletions
@@ -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):