初始化项目
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"cidService/dao"
|
||||
"cidService/model/dto"
|
||||
"cidService/model/entity"
|
||||
"cidService/model/types"
|
||||
"cidservice/dao"
|
||||
"cidservice/model/dto"
|
||||
"cidservice/model/entity"
|
||||
"cidservice/model/types"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
@@ -85,6 +85,15 @@ func (s *cidService) GenerateCID(ctx context.Context, req *dto.GenerateCIDReq) (
|
||||
return nil, gerror.Wrap(err, "获取租户信息失败")
|
||||
}
|
||||
|
||||
// 检查租户请求次数限制
|
||||
allowed, err := RateLimit.CheckTenantRequestLimit(ctx, tenant.Id, nil)
|
||||
if err != nil {
|
||||
return nil, gerror.Wrap(err, "检查租户请求限制失败")
|
||||
}
|
||||
if !allowed {
|
||||
return nil, gerror.New("租户请求次数已超过限制,请稍后再试")
|
||||
}
|
||||
|
||||
// 获取匹配策略
|
||||
strategy, err := s.getMatchingStrategy(ctx, tenant.Level)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user