From 19867568a913c7cd405b9556d15a15d90964dd4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Sun, 24 Jul 2022 10:08:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E9=87=8D=E7=BD=AE=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/db/models/user_identity_dao.go | 9 +++++++++ internal/rpc/services/service_user_identity.go | 17 +++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/internal/db/models/user_identity_dao.go b/internal/db/models/user_identity_dao.go index d47b4838..c28bcc5d 100644 --- a/internal/db/models/user_identity_dao.go +++ b/internal/db/models/user_identity_dao.go @@ -132,6 +132,15 @@ func (this *UserIdentityDAO) CancelUserIdentity(tx *dbs.Tx, identityId int64) er UpdateQuickly() } +// ResetUserIdentity 重置实名认证状态 +func (this *UserIdentityDAO) ResetUserIdentity(tx *dbs.Tx, identityId int64) error { + return this.Query(tx). + Pk(identityId). + Set("status", userconfigs.UserIdentityStatusSubmitted). + Set("updatedAt", time.Now().Unix()). + UpdateQuickly() +} + // RejectUserIdentity 拒绝 func (this *UserIdentityDAO) RejectUserIdentity(tx *dbs.Tx, identityId int64, reason string) error { return this.Query(tx). diff --git a/internal/rpc/services/service_user_identity.go b/internal/rpc/services/service_user_identity.go index 9676bd59..b5d9a343 100644 --- a/internal/rpc/services/service_user_identity.go +++ b/internal/rpc/services/service_user_identity.go @@ -240,6 +240,23 @@ func (this *UserIdentityService) CancelUserIdentity(ctx context.Context, req *pb return this.Success() } +// ResetUserIdentity 重置提交身份审核认证信息 +func (this *UserIdentityService) ResetUserIdentity(ctx context.Context, req *pb.ResetUserIdentityRequest) (*pb.RPCSuccess, error) { + _, err := this.ValidateAdmin(ctx) + if err != nil { + return nil, err + } + + var tx = this.NullTx() + + err = models.SharedUserIdentityDAO.ResetUserIdentity(tx, req.UserIdentityId) + if err != nil { + return nil, err + } + + return this.Success() +} + // RejectUserIdentity 拒绝用户身份认证信息 func (this *UserIdentityService) RejectUserIdentity(ctx context.Context, req *pb.RejectUserIdentityRequest) (*pb.RPCSuccess, error) { _, err := this.ValidateAdmin(ctx)