feat(api-key): 增加 API Key 上次使用时间并补齐测试
This commit is contained in:
@@ -95,6 +95,11 @@ func Status(v string) predicate.APIKey {
|
||||
return predicate.APIKey(sql.FieldEQ(FieldStatus, v))
|
||||
}
|
||||
|
||||
// LastUsedAt applies equality check predicate on the "last_used_at" field. It's identical to LastUsedAtEQ.
|
||||
func LastUsedAt(v time.Time) predicate.APIKey {
|
||||
return predicate.APIKey(sql.FieldEQ(FieldLastUsedAt, v))
|
||||
}
|
||||
|
||||
// Quota applies equality check predicate on the "quota" field. It's identical to QuotaEQ.
|
||||
func Quota(v float64) predicate.APIKey {
|
||||
return predicate.APIKey(sql.FieldEQ(FieldQuota, v))
|
||||
@@ -485,6 +490,56 @@ func StatusContainsFold(v string) predicate.APIKey {
|
||||
return predicate.APIKey(sql.FieldContainsFold(FieldStatus, v))
|
||||
}
|
||||
|
||||
// LastUsedAtEQ applies the EQ predicate on the "last_used_at" field.
|
||||
func LastUsedAtEQ(v time.Time) predicate.APIKey {
|
||||
return predicate.APIKey(sql.FieldEQ(FieldLastUsedAt, v))
|
||||
}
|
||||
|
||||
// LastUsedAtNEQ applies the NEQ predicate on the "last_used_at" field.
|
||||
func LastUsedAtNEQ(v time.Time) predicate.APIKey {
|
||||
return predicate.APIKey(sql.FieldNEQ(FieldLastUsedAt, v))
|
||||
}
|
||||
|
||||
// LastUsedAtIn applies the In predicate on the "last_used_at" field.
|
||||
func LastUsedAtIn(vs ...time.Time) predicate.APIKey {
|
||||
return predicate.APIKey(sql.FieldIn(FieldLastUsedAt, vs...))
|
||||
}
|
||||
|
||||
// LastUsedAtNotIn applies the NotIn predicate on the "last_used_at" field.
|
||||
func LastUsedAtNotIn(vs ...time.Time) predicate.APIKey {
|
||||
return predicate.APIKey(sql.FieldNotIn(FieldLastUsedAt, vs...))
|
||||
}
|
||||
|
||||
// LastUsedAtGT applies the GT predicate on the "last_used_at" field.
|
||||
func LastUsedAtGT(v time.Time) predicate.APIKey {
|
||||
return predicate.APIKey(sql.FieldGT(FieldLastUsedAt, v))
|
||||
}
|
||||
|
||||
// LastUsedAtGTE applies the GTE predicate on the "last_used_at" field.
|
||||
func LastUsedAtGTE(v time.Time) predicate.APIKey {
|
||||
return predicate.APIKey(sql.FieldGTE(FieldLastUsedAt, v))
|
||||
}
|
||||
|
||||
// LastUsedAtLT applies the LT predicate on the "last_used_at" field.
|
||||
func LastUsedAtLT(v time.Time) predicate.APIKey {
|
||||
return predicate.APIKey(sql.FieldLT(FieldLastUsedAt, v))
|
||||
}
|
||||
|
||||
// LastUsedAtLTE applies the LTE predicate on the "last_used_at" field.
|
||||
func LastUsedAtLTE(v time.Time) predicate.APIKey {
|
||||
return predicate.APIKey(sql.FieldLTE(FieldLastUsedAt, v))
|
||||
}
|
||||
|
||||
// LastUsedAtIsNil applies the IsNil predicate on the "last_used_at" field.
|
||||
func LastUsedAtIsNil() predicate.APIKey {
|
||||
return predicate.APIKey(sql.FieldIsNull(FieldLastUsedAt))
|
||||
}
|
||||
|
||||
// LastUsedAtNotNil applies the NotNil predicate on the "last_used_at" field.
|
||||
func LastUsedAtNotNil() predicate.APIKey {
|
||||
return predicate.APIKey(sql.FieldNotNull(FieldLastUsedAt))
|
||||
}
|
||||
|
||||
// IPWhitelistIsNil applies the IsNil predicate on the "ip_whitelist" field.
|
||||
func IPWhitelistIsNil() predicate.APIKey {
|
||||
return predicate.APIKey(sql.FieldIsNull(FieldIPWhitelist))
|
||||
|
||||
Reference in New Issue
Block a user