mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-11 04:50:25 +08:00
增加使用账号查询ACME用户数量的API
This commit is contained in:
@@ -124,7 +124,7 @@ func (this *ACMEUserDAO) UpdateACMEUserRegistration(tx *dbs.Tx, acmeUserId int64
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CountACMEUsersWithAdminId 计算用户数量
|
// CountACMEUsersWithAdminId 计算用户数量
|
||||||
func (this *ACMEUserDAO) CountACMEUsersWithAdminId(tx *dbs.Tx, adminId int64, userId int64) (int64, error) {
|
func (this *ACMEUserDAO) CountACMEUsersWithAdminId(tx *dbs.Tx, adminId int64, userId int64, accountId int64) (int64, error) {
|
||||||
query := this.Query(tx)
|
query := this.Query(tx)
|
||||||
if adminId > 0 {
|
if adminId > 0 {
|
||||||
query.Attr("adminId", adminId)
|
query.Attr("adminId", adminId)
|
||||||
@@ -132,6 +132,9 @@ func (this *ACMEUserDAO) CountACMEUsersWithAdminId(tx *dbs.Tx, adminId int64, us
|
|||||||
if userId > 0 {
|
if userId > 0 {
|
||||||
query.Attr("userId", userId)
|
query.Attr("userId", userId)
|
||||||
}
|
}
|
||||||
|
if accountId > 0 {
|
||||||
|
query.Attr("accountId", accountId)
|
||||||
|
}
|
||||||
|
|
||||||
return query.
|
return query.
|
||||||
State(ACMEUserStateEnabled).
|
State(ACMEUserStateEnabled).
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ func (this *ACMEUserService) CountACMEUsers(ctx context.Context, req *pb.CountAc
|
|||||||
|
|
||||||
tx := this.NullTx()
|
tx := this.NullTx()
|
||||||
|
|
||||||
count, err := acmemodels.SharedACMEUserDAO.CountACMEUsersWithAdminId(tx, adminId, userId)
|
count, err := acmemodels.SharedACMEUserDAO.CountACMEUsersWithAdminId(tx, adminId, userId, req.AcmeProviderAccountId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user