MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / IncrUseToken

Method IncrUseToken

service/ai-key/iml.go:38–46  ·  view source on GitHub ↗
(ctx context.Context, id string, useToken int)

Source from the content-addressed store, hash-verified

36}
37
38func (i *imlAIKeyService) IncrUseToken(ctx context.Context, id string, useToken int) error {
39 info, err := i.store.GetByUUID(ctx, id)
40 if err != nil {
41 return err
42 }
43
44 info.UseToken += useToken
45 return i.store.Save(ctx, info)
46}
47
48func (i *imlAIKeyService) SearchUnExpiredByPage(ctx context.Context, w map[string]interface{}, page, pageSize int, order string) ([]*Key, int64, error) {
49 sql := "(expire_time = 0 || expire_time > ?)"

Callers

nothing calls this directly

Calls 1

SaveMethod · 0.65

Tested by

no test coverage detected