Files
sub2api/backend/ent/sorausagestat/where.go
yangjianbo 13262a5698 feat(sora): 新增 Sora 平台支持并修复高危安全和性能问题
新增功能:
- 新增 Sora 账号管理和 OAuth 认证
- 新增 Sora 视频/图片生成 API 网关
- 新增 Sora 任务调度和缓存机制
- 新增 Sora 使用统计和计费支持
- 前端增加 Sora 平台配置界面

安全修复(代码审核):
- [SEC-001] 限制媒体下载响应体大小(图片 20MB、视频 200MB),防止 DoS 攻击
- [SEC-002] 限制 SDK API 响应大小(1MB),防止内存耗尽
- [SEC-003] 修复 SSRF 风险,添加 URL 验证并强制使用代理配置

BUG 修复(代码审核):
- [BUG-001] 修复 for 循环内 defer 累积导致的资源泄漏
- [BUG-002] 修复图片并发槽位获取失败时已持有锁未释放的永久泄漏

性能优化(代码审核):
- [PERF-001] 添加 Sentinel Token 缓存(3 分钟有效期),减少 PoW 计算开销

技术细节:
- 使用 io.LimitReader 限制所有外部输入的大小
- 添加 urlvalidator 验证防止 SSRF 攻击
- 使用 sync.Map 实现线程安全的包级缓存
- 优化并发槽位管理,添加 releaseAll 模式防止泄漏

影响范围:
- 后端:新增 Sora 相关数据模型、服务、网关和管理接口
- 前端:新增 Sora 平台配置、账号管理和监控界面
- 配置:新增 Sora 相关配置项和环境变量

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-29 16:18:38 +08:00

631 lines
25 KiB
Go

// Code generated by ent, DO NOT EDIT.
package sorausagestat
import (
"time"
"entgo.io/ent/dialect/sql"
"github.com/Wei-Shaw/sub2api/ent/predicate"
)
// ID filters vertices based on their ID field.
func ID(id int64) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldID, id))
}
// IDEQ applies the EQ predicate on the ID field.
func IDEQ(id int64) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldID, id))
}
// IDNEQ applies the NEQ predicate on the ID field.
func IDNEQ(id int64) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNEQ(FieldID, id))
}
// IDIn applies the In predicate on the ID field.
func IDIn(ids ...int64) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldIn(FieldID, ids...))
}
// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...int64) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNotIn(FieldID, ids...))
}
// IDGT applies the GT predicate on the ID field.
func IDGT(id int64) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGT(FieldID, id))
}
// IDGTE applies the GTE predicate on the ID field.
func IDGTE(id int64) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGTE(FieldID, id))
}
// IDLT applies the LT predicate on the ID field.
func IDLT(id int64) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLT(FieldID, id))
}
// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id int64) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLTE(FieldID, id))
}
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAt(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldCreatedAt, v))
}
// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
func UpdatedAt(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldUpdatedAt, v))
}
// AccountID applies equality check predicate on the "account_id" field. It's identical to AccountIDEQ.
func AccountID(v int64) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldAccountID, v))
}
// ImageCount applies equality check predicate on the "image_count" field. It's identical to ImageCountEQ.
func ImageCount(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldImageCount, v))
}
// VideoCount applies equality check predicate on the "video_count" field. It's identical to VideoCountEQ.
func VideoCount(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldVideoCount, v))
}
// ErrorCount applies equality check predicate on the "error_count" field. It's identical to ErrorCountEQ.
func ErrorCount(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldErrorCount, v))
}
// LastErrorAt applies equality check predicate on the "last_error_at" field. It's identical to LastErrorAtEQ.
func LastErrorAt(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldLastErrorAt, v))
}
// TodayImageCount applies equality check predicate on the "today_image_count" field. It's identical to TodayImageCountEQ.
func TodayImageCount(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldTodayImageCount, v))
}
// TodayVideoCount applies equality check predicate on the "today_video_count" field. It's identical to TodayVideoCountEQ.
func TodayVideoCount(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldTodayVideoCount, v))
}
// TodayErrorCount applies equality check predicate on the "today_error_count" field. It's identical to TodayErrorCountEQ.
func TodayErrorCount(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldTodayErrorCount, v))
}
// TodayDate applies equality check predicate on the "today_date" field. It's identical to TodayDateEQ.
func TodayDate(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldTodayDate, v))
}
// ConsecutiveErrorCount applies equality check predicate on the "consecutive_error_count" field. It's identical to ConsecutiveErrorCountEQ.
func ConsecutiveErrorCount(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldConsecutiveErrorCount, v))
}
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
func CreatedAtEQ(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldCreatedAt, v))
}
// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
func CreatedAtNEQ(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNEQ(FieldCreatedAt, v))
}
// CreatedAtIn applies the In predicate on the "created_at" field.
func CreatedAtIn(vs ...time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldIn(FieldCreatedAt, vs...))
}
// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
func CreatedAtNotIn(vs ...time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNotIn(FieldCreatedAt, vs...))
}
// CreatedAtGT applies the GT predicate on the "created_at" field.
func CreatedAtGT(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGT(FieldCreatedAt, v))
}
// CreatedAtGTE applies the GTE predicate on the "created_at" field.
func CreatedAtGTE(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGTE(FieldCreatedAt, v))
}
// CreatedAtLT applies the LT predicate on the "created_at" field.
func CreatedAtLT(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLT(FieldCreatedAt, v))
}
// CreatedAtLTE applies the LTE predicate on the "created_at" field.
func CreatedAtLTE(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLTE(FieldCreatedAt, v))
}
// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
func UpdatedAtEQ(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldUpdatedAt, v))
}
// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
func UpdatedAtNEQ(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNEQ(FieldUpdatedAt, v))
}
// UpdatedAtIn applies the In predicate on the "updated_at" field.
func UpdatedAtIn(vs ...time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldIn(FieldUpdatedAt, vs...))
}
// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
func UpdatedAtNotIn(vs ...time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNotIn(FieldUpdatedAt, vs...))
}
// UpdatedAtGT applies the GT predicate on the "updated_at" field.
func UpdatedAtGT(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGT(FieldUpdatedAt, v))
}
// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
func UpdatedAtGTE(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGTE(FieldUpdatedAt, v))
}
// UpdatedAtLT applies the LT predicate on the "updated_at" field.
func UpdatedAtLT(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLT(FieldUpdatedAt, v))
}
// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
func UpdatedAtLTE(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLTE(FieldUpdatedAt, v))
}
// AccountIDEQ applies the EQ predicate on the "account_id" field.
func AccountIDEQ(v int64) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldAccountID, v))
}
// AccountIDNEQ applies the NEQ predicate on the "account_id" field.
func AccountIDNEQ(v int64) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNEQ(FieldAccountID, v))
}
// AccountIDIn applies the In predicate on the "account_id" field.
func AccountIDIn(vs ...int64) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldIn(FieldAccountID, vs...))
}
// AccountIDNotIn applies the NotIn predicate on the "account_id" field.
func AccountIDNotIn(vs ...int64) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNotIn(FieldAccountID, vs...))
}
// AccountIDGT applies the GT predicate on the "account_id" field.
func AccountIDGT(v int64) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGT(FieldAccountID, v))
}
// AccountIDGTE applies the GTE predicate on the "account_id" field.
func AccountIDGTE(v int64) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGTE(FieldAccountID, v))
}
// AccountIDLT applies the LT predicate on the "account_id" field.
func AccountIDLT(v int64) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLT(FieldAccountID, v))
}
// AccountIDLTE applies the LTE predicate on the "account_id" field.
func AccountIDLTE(v int64) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLTE(FieldAccountID, v))
}
// ImageCountEQ applies the EQ predicate on the "image_count" field.
func ImageCountEQ(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldImageCount, v))
}
// ImageCountNEQ applies the NEQ predicate on the "image_count" field.
func ImageCountNEQ(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNEQ(FieldImageCount, v))
}
// ImageCountIn applies the In predicate on the "image_count" field.
func ImageCountIn(vs ...int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldIn(FieldImageCount, vs...))
}
// ImageCountNotIn applies the NotIn predicate on the "image_count" field.
func ImageCountNotIn(vs ...int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNotIn(FieldImageCount, vs...))
}
// ImageCountGT applies the GT predicate on the "image_count" field.
func ImageCountGT(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGT(FieldImageCount, v))
}
// ImageCountGTE applies the GTE predicate on the "image_count" field.
func ImageCountGTE(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGTE(FieldImageCount, v))
}
// ImageCountLT applies the LT predicate on the "image_count" field.
func ImageCountLT(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLT(FieldImageCount, v))
}
// ImageCountLTE applies the LTE predicate on the "image_count" field.
func ImageCountLTE(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLTE(FieldImageCount, v))
}
// VideoCountEQ applies the EQ predicate on the "video_count" field.
func VideoCountEQ(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldVideoCount, v))
}
// VideoCountNEQ applies the NEQ predicate on the "video_count" field.
func VideoCountNEQ(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNEQ(FieldVideoCount, v))
}
// VideoCountIn applies the In predicate on the "video_count" field.
func VideoCountIn(vs ...int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldIn(FieldVideoCount, vs...))
}
// VideoCountNotIn applies the NotIn predicate on the "video_count" field.
func VideoCountNotIn(vs ...int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNotIn(FieldVideoCount, vs...))
}
// VideoCountGT applies the GT predicate on the "video_count" field.
func VideoCountGT(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGT(FieldVideoCount, v))
}
// VideoCountGTE applies the GTE predicate on the "video_count" field.
func VideoCountGTE(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGTE(FieldVideoCount, v))
}
// VideoCountLT applies the LT predicate on the "video_count" field.
func VideoCountLT(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLT(FieldVideoCount, v))
}
// VideoCountLTE applies the LTE predicate on the "video_count" field.
func VideoCountLTE(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLTE(FieldVideoCount, v))
}
// ErrorCountEQ applies the EQ predicate on the "error_count" field.
func ErrorCountEQ(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldErrorCount, v))
}
// ErrorCountNEQ applies the NEQ predicate on the "error_count" field.
func ErrorCountNEQ(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNEQ(FieldErrorCount, v))
}
// ErrorCountIn applies the In predicate on the "error_count" field.
func ErrorCountIn(vs ...int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldIn(FieldErrorCount, vs...))
}
// ErrorCountNotIn applies the NotIn predicate on the "error_count" field.
func ErrorCountNotIn(vs ...int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNotIn(FieldErrorCount, vs...))
}
// ErrorCountGT applies the GT predicate on the "error_count" field.
func ErrorCountGT(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGT(FieldErrorCount, v))
}
// ErrorCountGTE applies the GTE predicate on the "error_count" field.
func ErrorCountGTE(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGTE(FieldErrorCount, v))
}
// ErrorCountLT applies the LT predicate on the "error_count" field.
func ErrorCountLT(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLT(FieldErrorCount, v))
}
// ErrorCountLTE applies the LTE predicate on the "error_count" field.
func ErrorCountLTE(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLTE(FieldErrorCount, v))
}
// LastErrorAtEQ applies the EQ predicate on the "last_error_at" field.
func LastErrorAtEQ(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldLastErrorAt, v))
}
// LastErrorAtNEQ applies the NEQ predicate on the "last_error_at" field.
func LastErrorAtNEQ(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNEQ(FieldLastErrorAt, v))
}
// LastErrorAtIn applies the In predicate on the "last_error_at" field.
func LastErrorAtIn(vs ...time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldIn(FieldLastErrorAt, vs...))
}
// LastErrorAtNotIn applies the NotIn predicate on the "last_error_at" field.
func LastErrorAtNotIn(vs ...time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNotIn(FieldLastErrorAt, vs...))
}
// LastErrorAtGT applies the GT predicate on the "last_error_at" field.
func LastErrorAtGT(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGT(FieldLastErrorAt, v))
}
// LastErrorAtGTE applies the GTE predicate on the "last_error_at" field.
func LastErrorAtGTE(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGTE(FieldLastErrorAt, v))
}
// LastErrorAtLT applies the LT predicate on the "last_error_at" field.
func LastErrorAtLT(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLT(FieldLastErrorAt, v))
}
// LastErrorAtLTE applies the LTE predicate on the "last_error_at" field.
func LastErrorAtLTE(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLTE(FieldLastErrorAt, v))
}
// LastErrorAtIsNil applies the IsNil predicate on the "last_error_at" field.
func LastErrorAtIsNil() predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldIsNull(FieldLastErrorAt))
}
// LastErrorAtNotNil applies the NotNil predicate on the "last_error_at" field.
func LastErrorAtNotNil() predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNotNull(FieldLastErrorAt))
}
// TodayImageCountEQ applies the EQ predicate on the "today_image_count" field.
func TodayImageCountEQ(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldTodayImageCount, v))
}
// TodayImageCountNEQ applies the NEQ predicate on the "today_image_count" field.
func TodayImageCountNEQ(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNEQ(FieldTodayImageCount, v))
}
// TodayImageCountIn applies the In predicate on the "today_image_count" field.
func TodayImageCountIn(vs ...int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldIn(FieldTodayImageCount, vs...))
}
// TodayImageCountNotIn applies the NotIn predicate on the "today_image_count" field.
func TodayImageCountNotIn(vs ...int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNotIn(FieldTodayImageCount, vs...))
}
// TodayImageCountGT applies the GT predicate on the "today_image_count" field.
func TodayImageCountGT(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGT(FieldTodayImageCount, v))
}
// TodayImageCountGTE applies the GTE predicate on the "today_image_count" field.
func TodayImageCountGTE(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGTE(FieldTodayImageCount, v))
}
// TodayImageCountLT applies the LT predicate on the "today_image_count" field.
func TodayImageCountLT(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLT(FieldTodayImageCount, v))
}
// TodayImageCountLTE applies the LTE predicate on the "today_image_count" field.
func TodayImageCountLTE(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLTE(FieldTodayImageCount, v))
}
// TodayVideoCountEQ applies the EQ predicate on the "today_video_count" field.
func TodayVideoCountEQ(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldTodayVideoCount, v))
}
// TodayVideoCountNEQ applies the NEQ predicate on the "today_video_count" field.
func TodayVideoCountNEQ(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNEQ(FieldTodayVideoCount, v))
}
// TodayVideoCountIn applies the In predicate on the "today_video_count" field.
func TodayVideoCountIn(vs ...int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldIn(FieldTodayVideoCount, vs...))
}
// TodayVideoCountNotIn applies the NotIn predicate on the "today_video_count" field.
func TodayVideoCountNotIn(vs ...int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNotIn(FieldTodayVideoCount, vs...))
}
// TodayVideoCountGT applies the GT predicate on the "today_video_count" field.
func TodayVideoCountGT(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGT(FieldTodayVideoCount, v))
}
// TodayVideoCountGTE applies the GTE predicate on the "today_video_count" field.
func TodayVideoCountGTE(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGTE(FieldTodayVideoCount, v))
}
// TodayVideoCountLT applies the LT predicate on the "today_video_count" field.
func TodayVideoCountLT(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLT(FieldTodayVideoCount, v))
}
// TodayVideoCountLTE applies the LTE predicate on the "today_video_count" field.
func TodayVideoCountLTE(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLTE(FieldTodayVideoCount, v))
}
// TodayErrorCountEQ applies the EQ predicate on the "today_error_count" field.
func TodayErrorCountEQ(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldTodayErrorCount, v))
}
// TodayErrorCountNEQ applies the NEQ predicate on the "today_error_count" field.
func TodayErrorCountNEQ(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNEQ(FieldTodayErrorCount, v))
}
// TodayErrorCountIn applies the In predicate on the "today_error_count" field.
func TodayErrorCountIn(vs ...int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldIn(FieldTodayErrorCount, vs...))
}
// TodayErrorCountNotIn applies the NotIn predicate on the "today_error_count" field.
func TodayErrorCountNotIn(vs ...int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNotIn(FieldTodayErrorCount, vs...))
}
// TodayErrorCountGT applies the GT predicate on the "today_error_count" field.
func TodayErrorCountGT(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGT(FieldTodayErrorCount, v))
}
// TodayErrorCountGTE applies the GTE predicate on the "today_error_count" field.
func TodayErrorCountGTE(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGTE(FieldTodayErrorCount, v))
}
// TodayErrorCountLT applies the LT predicate on the "today_error_count" field.
func TodayErrorCountLT(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLT(FieldTodayErrorCount, v))
}
// TodayErrorCountLTE applies the LTE predicate on the "today_error_count" field.
func TodayErrorCountLTE(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLTE(FieldTodayErrorCount, v))
}
// TodayDateEQ applies the EQ predicate on the "today_date" field.
func TodayDateEQ(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldTodayDate, v))
}
// TodayDateNEQ applies the NEQ predicate on the "today_date" field.
func TodayDateNEQ(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNEQ(FieldTodayDate, v))
}
// TodayDateIn applies the In predicate on the "today_date" field.
func TodayDateIn(vs ...time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldIn(FieldTodayDate, vs...))
}
// TodayDateNotIn applies the NotIn predicate on the "today_date" field.
func TodayDateNotIn(vs ...time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNotIn(FieldTodayDate, vs...))
}
// TodayDateGT applies the GT predicate on the "today_date" field.
func TodayDateGT(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGT(FieldTodayDate, v))
}
// TodayDateGTE applies the GTE predicate on the "today_date" field.
func TodayDateGTE(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGTE(FieldTodayDate, v))
}
// TodayDateLT applies the LT predicate on the "today_date" field.
func TodayDateLT(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLT(FieldTodayDate, v))
}
// TodayDateLTE applies the LTE predicate on the "today_date" field.
func TodayDateLTE(v time.Time) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLTE(FieldTodayDate, v))
}
// TodayDateIsNil applies the IsNil predicate on the "today_date" field.
func TodayDateIsNil() predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldIsNull(FieldTodayDate))
}
// TodayDateNotNil applies the NotNil predicate on the "today_date" field.
func TodayDateNotNil() predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNotNull(FieldTodayDate))
}
// ConsecutiveErrorCountEQ applies the EQ predicate on the "consecutive_error_count" field.
func ConsecutiveErrorCountEQ(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldEQ(FieldConsecutiveErrorCount, v))
}
// ConsecutiveErrorCountNEQ applies the NEQ predicate on the "consecutive_error_count" field.
func ConsecutiveErrorCountNEQ(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNEQ(FieldConsecutiveErrorCount, v))
}
// ConsecutiveErrorCountIn applies the In predicate on the "consecutive_error_count" field.
func ConsecutiveErrorCountIn(vs ...int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldIn(FieldConsecutiveErrorCount, vs...))
}
// ConsecutiveErrorCountNotIn applies the NotIn predicate on the "consecutive_error_count" field.
func ConsecutiveErrorCountNotIn(vs ...int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldNotIn(FieldConsecutiveErrorCount, vs...))
}
// ConsecutiveErrorCountGT applies the GT predicate on the "consecutive_error_count" field.
func ConsecutiveErrorCountGT(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGT(FieldConsecutiveErrorCount, v))
}
// ConsecutiveErrorCountGTE applies the GTE predicate on the "consecutive_error_count" field.
func ConsecutiveErrorCountGTE(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldGTE(FieldConsecutiveErrorCount, v))
}
// ConsecutiveErrorCountLT applies the LT predicate on the "consecutive_error_count" field.
func ConsecutiveErrorCountLT(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLT(FieldConsecutiveErrorCount, v))
}
// ConsecutiveErrorCountLTE applies the LTE predicate on the "consecutive_error_count" field.
func ConsecutiveErrorCountLTE(v int) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.FieldLTE(FieldConsecutiveErrorCount, v))
}
// And groups predicates with the AND operator between them.
func And(predicates ...predicate.SoraUsageStat) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.AndPredicates(predicates...))
}
// Or groups predicates with the OR operator between them.
func Or(predicates ...predicate.SoraUsageStat) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.OrPredicates(predicates...))
}
// Not applies the not operator on the given predicate.
func Not(p predicate.SoraUsageStat) predicate.SoraUsageStat {
return predicate.SoraUsageStat(sql.NotPredicates(p))
}