相关接口增加实名认证状态字段

This commit is contained in:
GoEdgeLab
2022-07-24 11:28:59 +08:00
parent 295aba77bd
commit 94d5a3badc
2 changed files with 43 additions and 16 deletions

View File

@@ -185,7 +185,7 @@ func (this *UserIdentityDAO) FindUserIdentityStatus(tx *dbs.Tx, identityId int64
}
// FindEnabledUserIdentityWithOrgType 查找某个类型的认证信息
func (this *UserIdentityDAO) FindEnabledUserIdentityWithOrgType(tx *dbs.Tx, userId int64, orgType string) (*UserIdentity, error) {
func (this *UserIdentityDAO) FindEnabledUserIdentityWithOrgType(tx *dbs.Tx, userId int64, orgType userconfigs.UserIdentityOrgType) (*UserIdentity, error) {
one, err := this.Query(tx).
Attr("userId", userId).
Attr("orgType", orgType).
@@ -197,3 +197,13 @@ func (this *UserIdentityDAO) FindEnabledUserIdentityWithOrgType(tx *dbs.Tx, user
}
return one.(*UserIdentity), nil
}
// CheckUserIdentityIsVerified 检查实名认证
func (this *UserIdentityDAO) CheckUserIdentityIsVerified(tx *dbs.Tx, userId int64, orgType userconfigs.UserIdentityOrgType) (bool, error) {
return this.Query(tx).
Attr("userId", userId).
Attr("orgType", orgType).
Attr("status", userconfigs.UserIdentityStatusVerified).
State(UserIdentityStateEnabled).
Exist()
}