Skip to content

Commit

Permalink
跳过价格为 0 的 (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
flycash authored Dec 1, 2024
2 parents b9b620f + 76b0faf commit 60da318
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/ai/internal/service/llm/handler/credit/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ func NewHandlerBuilder(creSvc credit.Service, repo repository.LLMCreditLogRepo)

func (h *HandlerBuilder) Next(next handler.Handler) handler.Handler {
return handler.HandleFunc(func(ctx context.Context, req domain.LLMRequest) (domain.LLMResponse, error) {
// 不需要扣除积分
if req.Config.Price == 0 {
return next.Handle(ctx, req)
}
cre, err := h.creditSvc.GetCreditsByUID(ctx, req.Uid)
if err != nil {
return domain.LLMResponse{}, err
Expand Down

0 comments on commit 60da318

Please sign in to comment.