mirror of
https://gitee.com/wanwujie/sub2api
synced 2026-04-03 06:52:13 +08:00
feat(Sora): 完成Sora网关接入与媒体能力
新增 Sora 网关路由、账号调度与同步服务\n补充媒体代理与签名 URL、模型列表动态拉取\n完善计费配置、前端支持与相关测试
This commit is contained in:
@@ -52,6 +52,14 @@ type Group struct {
|
||||
ImagePrice2k *float64 `json:"image_price_2k,omitempty"`
|
||||
// ImagePrice4k holds the value of the "image_price_4k" field.
|
||||
ImagePrice4k *float64 `json:"image_price_4k,omitempty"`
|
||||
// SoraImagePrice360 holds the value of the "sora_image_price_360" field.
|
||||
SoraImagePrice360 *float64 `json:"sora_image_price_360,omitempty"`
|
||||
// SoraImagePrice540 holds the value of the "sora_image_price_540" field.
|
||||
SoraImagePrice540 *float64 `json:"sora_image_price_540,omitempty"`
|
||||
// SoraVideoPricePerRequest holds the value of the "sora_video_price_per_request" field.
|
||||
SoraVideoPricePerRequest *float64 `json:"sora_video_price_per_request,omitempty"`
|
||||
// SoraVideoPricePerRequestHd holds the value of the "sora_video_price_per_request_hd" field.
|
||||
SoraVideoPricePerRequestHd *float64 `json:"sora_video_price_per_request_hd,omitempty"`
|
||||
// 是否仅允许 Claude Code 客户端
|
||||
ClaudeCodeOnly bool `json:"claude_code_only,omitempty"`
|
||||
// 非 Claude Code 请求降级使用的分组 ID
|
||||
@@ -170,7 +178,7 @@ func (*Group) scanValues(columns []string) ([]any, error) {
|
||||
values[i] = new([]byte)
|
||||
case group.FieldIsExclusive, group.FieldClaudeCodeOnly, group.FieldModelRoutingEnabled:
|
||||
values[i] = new(sql.NullBool)
|
||||
case group.FieldRateMultiplier, group.FieldDailyLimitUsd, group.FieldWeeklyLimitUsd, group.FieldMonthlyLimitUsd, group.FieldImagePrice1k, group.FieldImagePrice2k, group.FieldImagePrice4k:
|
||||
case group.FieldRateMultiplier, group.FieldDailyLimitUsd, group.FieldWeeklyLimitUsd, group.FieldMonthlyLimitUsd, group.FieldImagePrice1k, group.FieldImagePrice2k, group.FieldImagePrice4k, group.FieldSoraImagePrice360, group.FieldSoraImagePrice540, group.FieldSoraVideoPricePerRequest, group.FieldSoraVideoPricePerRequestHd:
|
||||
values[i] = new(sql.NullFloat64)
|
||||
case group.FieldID, group.FieldDefaultValidityDays, group.FieldFallbackGroupID:
|
||||
values[i] = new(sql.NullInt64)
|
||||
@@ -309,6 +317,34 @@ func (_m *Group) assignValues(columns []string, values []any) error {
|
||||
_m.ImagePrice4k = new(float64)
|
||||
*_m.ImagePrice4k = value.Float64
|
||||
}
|
||||
case group.FieldSoraImagePrice360:
|
||||
if value, ok := values[i].(*sql.NullFloat64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field sora_image_price_360", values[i])
|
||||
} else if value.Valid {
|
||||
_m.SoraImagePrice360 = new(float64)
|
||||
*_m.SoraImagePrice360 = value.Float64
|
||||
}
|
||||
case group.FieldSoraImagePrice540:
|
||||
if value, ok := values[i].(*sql.NullFloat64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field sora_image_price_540", values[i])
|
||||
} else if value.Valid {
|
||||
_m.SoraImagePrice540 = new(float64)
|
||||
*_m.SoraImagePrice540 = value.Float64
|
||||
}
|
||||
case group.FieldSoraVideoPricePerRequest:
|
||||
if value, ok := values[i].(*sql.NullFloat64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field sora_video_price_per_request", values[i])
|
||||
} else if value.Valid {
|
||||
_m.SoraVideoPricePerRequest = new(float64)
|
||||
*_m.SoraVideoPricePerRequest = value.Float64
|
||||
}
|
||||
case group.FieldSoraVideoPricePerRequestHd:
|
||||
if value, ok := values[i].(*sql.NullFloat64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field sora_video_price_per_request_hd", values[i])
|
||||
} else if value.Valid {
|
||||
_m.SoraVideoPricePerRequestHd = new(float64)
|
||||
*_m.SoraVideoPricePerRequestHd = value.Float64
|
||||
}
|
||||
case group.FieldClaudeCodeOnly:
|
||||
if value, ok := values[i].(*sql.NullBool); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field claude_code_only", values[i])
|
||||
@@ -479,6 +515,26 @@ func (_m *Group) String() string {
|
||||
builder.WriteString(fmt.Sprintf("%v", *v))
|
||||
}
|
||||
builder.WriteString(", ")
|
||||
if v := _m.SoraImagePrice360; v != nil {
|
||||
builder.WriteString("sora_image_price_360=")
|
||||
builder.WriteString(fmt.Sprintf("%v", *v))
|
||||
}
|
||||
builder.WriteString(", ")
|
||||
if v := _m.SoraImagePrice540; v != nil {
|
||||
builder.WriteString("sora_image_price_540=")
|
||||
builder.WriteString(fmt.Sprintf("%v", *v))
|
||||
}
|
||||
builder.WriteString(", ")
|
||||
if v := _m.SoraVideoPricePerRequest; v != nil {
|
||||
builder.WriteString("sora_video_price_per_request=")
|
||||
builder.WriteString(fmt.Sprintf("%v", *v))
|
||||
}
|
||||
builder.WriteString(", ")
|
||||
if v := _m.SoraVideoPricePerRequestHd; v != nil {
|
||||
builder.WriteString("sora_video_price_per_request_hd=")
|
||||
builder.WriteString(fmt.Sprintf("%v", *v))
|
||||
}
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("claude_code_only=")
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.ClaudeCodeOnly))
|
||||
builder.WriteString(", ")
|
||||
|
||||
@@ -49,6 +49,14 @@ const (
|
||||
FieldImagePrice2k = "image_price_2k"
|
||||
// FieldImagePrice4k holds the string denoting the image_price_4k field in the database.
|
||||
FieldImagePrice4k = "image_price_4k"
|
||||
// FieldSoraImagePrice360 holds the string denoting the sora_image_price_360 field in the database.
|
||||
FieldSoraImagePrice360 = "sora_image_price_360"
|
||||
// FieldSoraImagePrice540 holds the string denoting the sora_image_price_540 field in the database.
|
||||
FieldSoraImagePrice540 = "sora_image_price_540"
|
||||
// FieldSoraVideoPricePerRequest holds the string denoting the sora_video_price_per_request field in the database.
|
||||
FieldSoraVideoPricePerRequest = "sora_video_price_per_request"
|
||||
// FieldSoraVideoPricePerRequestHd holds the string denoting the sora_video_price_per_request_hd field in the database.
|
||||
FieldSoraVideoPricePerRequestHd = "sora_video_price_per_request_hd"
|
||||
// FieldClaudeCodeOnly holds the string denoting the claude_code_only field in the database.
|
||||
FieldClaudeCodeOnly = "claude_code_only"
|
||||
// FieldFallbackGroupID holds the string denoting the fallback_group_id field in the database.
|
||||
@@ -149,6 +157,10 @@ var Columns = []string{
|
||||
FieldImagePrice1k,
|
||||
FieldImagePrice2k,
|
||||
FieldImagePrice4k,
|
||||
FieldSoraImagePrice360,
|
||||
FieldSoraImagePrice540,
|
||||
FieldSoraVideoPricePerRequest,
|
||||
FieldSoraVideoPricePerRequestHd,
|
||||
FieldClaudeCodeOnly,
|
||||
FieldFallbackGroupID,
|
||||
FieldModelRouting,
|
||||
@@ -307,6 +319,26 @@ func ByImagePrice4k(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldImagePrice4k, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// BySoraImagePrice360 orders the results by the sora_image_price_360 field.
|
||||
func BySoraImagePrice360(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldSoraImagePrice360, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// BySoraImagePrice540 orders the results by the sora_image_price_540 field.
|
||||
func BySoraImagePrice540(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldSoraImagePrice540, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// BySoraVideoPricePerRequest orders the results by the sora_video_price_per_request field.
|
||||
func BySoraVideoPricePerRequest(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldSoraVideoPricePerRequest, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// BySoraVideoPricePerRequestHd orders the results by the sora_video_price_per_request_hd field.
|
||||
func BySoraVideoPricePerRequestHd(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldSoraVideoPricePerRequestHd, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByClaudeCodeOnly orders the results by the claude_code_only field.
|
||||
func ByClaudeCodeOnly(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldClaudeCodeOnly, opts...).ToFunc()
|
||||
|
||||
@@ -140,6 +140,26 @@ func ImagePrice4k(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldEQ(FieldImagePrice4k, v))
|
||||
}
|
||||
|
||||
// SoraImagePrice360 applies equality check predicate on the "sora_image_price_360" field. It's identical to SoraImagePrice360EQ.
|
||||
func SoraImagePrice360(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldEQ(FieldSoraImagePrice360, v))
|
||||
}
|
||||
|
||||
// SoraImagePrice540 applies equality check predicate on the "sora_image_price_540" field. It's identical to SoraImagePrice540EQ.
|
||||
func SoraImagePrice540(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldEQ(FieldSoraImagePrice540, v))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequest applies equality check predicate on the "sora_video_price_per_request" field. It's identical to SoraVideoPricePerRequestEQ.
|
||||
func SoraVideoPricePerRequest(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldEQ(FieldSoraVideoPricePerRequest, v))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestHd applies equality check predicate on the "sora_video_price_per_request_hd" field. It's identical to SoraVideoPricePerRequestHdEQ.
|
||||
func SoraVideoPricePerRequestHd(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldEQ(FieldSoraVideoPricePerRequestHd, v))
|
||||
}
|
||||
|
||||
// ClaudeCodeOnly applies equality check predicate on the "claude_code_only" field. It's identical to ClaudeCodeOnlyEQ.
|
||||
func ClaudeCodeOnly(v bool) predicate.Group {
|
||||
return predicate.Group(sql.FieldEQ(FieldClaudeCodeOnly, v))
|
||||
@@ -1010,6 +1030,206 @@ func ImagePrice4kNotNil() predicate.Group {
|
||||
return predicate.Group(sql.FieldNotNull(FieldImagePrice4k))
|
||||
}
|
||||
|
||||
// SoraImagePrice360EQ applies the EQ predicate on the "sora_image_price_360" field.
|
||||
func SoraImagePrice360EQ(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldEQ(FieldSoraImagePrice360, v))
|
||||
}
|
||||
|
||||
// SoraImagePrice360NEQ applies the NEQ predicate on the "sora_image_price_360" field.
|
||||
func SoraImagePrice360NEQ(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldNEQ(FieldSoraImagePrice360, v))
|
||||
}
|
||||
|
||||
// SoraImagePrice360In applies the In predicate on the "sora_image_price_360" field.
|
||||
func SoraImagePrice360In(vs ...float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldIn(FieldSoraImagePrice360, vs...))
|
||||
}
|
||||
|
||||
// SoraImagePrice360NotIn applies the NotIn predicate on the "sora_image_price_360" field.
|
||||
func SoraImagePrice360NotIn(vs ...float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldNotIn(FieldSoraImagePrice360, vs...))
|
||||
}
|
||||
|
||||
// SoraImagePrice360GT applies the GT predicate on the "sora_image_price_360" field.
|
||||
func SoraImagePrice360GT(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldGT(FieldSoraImagePrice360, v))
|
||||
}
|
||||
|
||||
// SoraImagePrice360GTE applies the GTE predicate on the "sora_image_price_360" field.
|
||||
func SoraImagePrice360GTE(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldGTE(FieldSoraImagePrice360, v))
|
||||
}
|
||||
|
||||
// SoraImagePrice360LT applies the LT predicate on the "sora_image_price_360" field.
|
||||
func SoraImagePrice360LT(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldLT(FieldSoraImagePrice360, v))
|
||||
}
|
||||
|
||||
// SoraImagePrice360LTE applies the LTE predicate on the "sora_image_price_360" field.
|
||||
func SoraImagePrice360LTE(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldLTE(FieldSoraImagePrice360, v))
|
||||
}
|
||||
|
||||
// SoraImagePrice360IsNil applies the IsNil predicate on the "sora_image_price_360" field.
|
||||
func SoraImagePrice360IsNil() predicate.Group {
|
||||
return predicate.Group(sql.FieldIsNull(FieldSoraImagePrice360))
|
||||
}
|
||||
|
||||
// SoraImagePrice360NotNil applies the NotNil predicate on the "sora_image_price_360" field.
|
||||
func SoraImagePrice360NotNil() predicate.Group {
|
||||
return predicate.Group(sql.FieldNotNull(FieldSoraImagePrice360))
|
||||
}
|
||||
|
||||
// SoraImagePrice540EQ applies the EQ predicate on the "sora_image_price_540" field.
|
||||
func SoraImagePrice540EQ(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldEQ(FieldSoraImagePrice540, v))
|
||||
}
|
||||
|
||||
// SoraImagePrice540NEQ applies the NEQ predicate on the "sora_image_price_540" field.
|
||||
func SoraImagePrice540NEQ(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldNEQ(FieldSoraImagePrice540, v))
|
||||
}
|
||||
|
||||
// SoraImagePrice540In applies the In predicate on the "sora_image_price_540" field.
|
||||
func SoraImagePrice540In(vs ...float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldIn(FieldSoraImagePrice540, vs...))
|
||||
}
|
||||
|
||||
// SoraImagePrice540NotIn applies the NotIn predicate on the "sora_image_price_540" field.
|
||||
func SoraImagePrice540NotIn(vs ...float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldNotIn(FieldSoraImagePrice540, vs...))
|
||||
}
|
||||
|
||||
// SoraImagePrice540GT applies the GT predicate on the "sora_image_price_540" field.
|
||||
func SoraImagePrice540GT(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldGT(FieldSoraImagePrice540, v))
|
||||
}
|
||||
|
||||
// SoraImagePrice540GTE applies the GTE predicate on the "sora_image_price_540" field.
|
||||
func SoraImagePrice540GTE(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldGTE(FieldSoraImagePrice540, v))
|
||||
}
|
||||
|
||||
// SoraImagePrice540LT applies the LT predicate on the "sora_image_price_540" field.
|
||||
func SoraImagePrice540LT(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldLT(FieldSoraImagePrice540, v))
|
||||
}
|
||||
|
||||
// SoraImagePrice540LTE applies the LTE predicate on the "sora_image_price_540" field.
|
||||
func SoraImagePrice540LTE(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldLTE(FieldSoraImagePrice540, v))
|
||||
}
|
||||
|
||||
// SoraImagePrice540IsNil applies the IsNil predicate on the "sora_image_price_540" field.
|
||||
func SoraImagePrice540IsNil() predicate.Group {
|
||||
return predicate.Group(sql.FieldIsNull(FieldSoraImagePrice540))
|
||||
}
|
||||
|
||||
// SoraImagePrice540NotNil applies the NotNil predicate on the "sora_image_price_540" field.
|
||||
func SoraImagePrice540NotNil() predicate.Group {
|
||||
return predicate.Group(sql.FieldNotNull(FieldSoraImagePrice540))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestEQ applies the EQ predicate on the "sora_video_price_per_request" field.
|
||||
func SoraVideoPricePerRequestEQ(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldEQ(FieldSoraVideoPricePerRequest, v))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestNEQ applies the NEQ predicate on the "sora_video_price_per_request" field.
|
||||
func SoraVideoPricePerRequestNEQ(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldNEQ(FieldSoraVideoPricePerRequest, v))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestIn applies the In predicate on the "sora_video_price_per_request" field.
|
||||
func SoraVideoPricePerRequestIn(vs ...float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldIn(FieldSoraVideoPricePerRequest, vs...))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestNotIn applies the NotIn predicate on the "sora_video_price_per_request" field.
|
||||
func SoraVideoPricePerRequestNotIn(vs ...float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldNotIn(FieldSoraVideoPricePerRequest, vs...))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestGT applies the GT predicate on the "sora_video_price_per_request" field.
|
||||
func SoraVideoPricePerRequestGT(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldGT(FieldSoraVideoPricePerRequest, v))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestGTE applies the GTE predicate on the "sora_video_price_per_request" field.
|
||||
func SoraVideoPricePerRequestGTE(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldGTE(FieldSoraVideoPricePerRequest, v))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestLT applies the LT predicate on the "sora_video_price_per_request" field.
|
||||
func SoraVideoPricePerRequestLT(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldLT(FieldSoraVideoPricePerRequest, v))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestLTE applies the LTE predicate on the "sora_video_price_per_request" field.
|
||||
func SoraVideoPricePerRequestLTE(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldLTE(FieldSoraVideoPricePerRequest, v))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestIsNil applies the IsNil predicate on the "sora_video_price_per_request" field.
|
||||
func SoraVideoPricePerRequestIsNil() predicate.Group {
|
||||
return predicate.Group(sql.FieldIsNull(FieldSoraVideoPricePerRequest))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestNotNil applies the NotNil predicate on the "sora_video_price_per_request" field.
|
||||
func SoraVideoPricePerRequestNotNil() predicate.Group {
|
||||
return predicate.Group(sql.FieldNotNull(FieldSoraVideoPricePerRequest))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestHdEQ applies the EQ predicate on the "sora_video_price_per_request_hd" field.
|
||||
func SoraVideoPricePerRequestHdEQ(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldEQ(FieldSoraVideoPricePerRequestHd, v))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestHdNEQ applies the NEQ predicate on the "sora_video_price_per_request_hd" field.
|
||||
func SoraVideoPricePerRequestHdNEQ(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldNEQ(FieldSoraVideoPricePerRequestHd, v))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestHdIn applies the In predicate on the "sora_video_price_per_request_hd" field.
|
||||
func SoraVideoPricePerRequestHdIn(vs ...float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldIn(FieldSoraVideoPricePerRequestHd, vs...))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestHdNotIn applies the NotIn predicate on the "sora_video_price_per_request_hd" field.
|
||||
func SoraVideoPricePerRequestHdNotIn(vs ...float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldNotIn(FieldSoraVideoPricePerRequestHd, vs...))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestHdGT applies the GT predicate on the "sora_video_price_per_request_hd" field.
|
||||
func SoraVideoPricePerRequestHdGT(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldGT(FieldSoraVideoPricePerRequestHd, v))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestHdGTE applies the GTE predicate on the "sora_video_price_per_request_hd" field.
|
||||
func SoraVideoPricePerRequestHdGTE(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldGTE(FieldSoraVideoPricePerRequestHd, v))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestHdLT applies the LT predicate on the "sora_video_price_per_request_hd" field.
|
||||
func SoraVideoPricePerRequestHdLT(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldLT(FieldSoraVideoPricePerRequestHd, v))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestHdLTE applies the LTE predicate on the "sora_video_price_per_request_hd" field.
|
||||
func SoraVideoPricePerRequestHdLTE(v float64) predicate.Group {
|
||||
return predicate.Group(sql.FieldLTE(FieldSoraVideoPricePerRequestHd, v))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestHdIsNil applies the IsNil predicate on the "sora_video_price_per_request_hd" field.
|
||||
func SoraVideoPricePerRequestHdIsNil() predicate.Group {
|
||||
return predicate.Group(sql.FieldIsNull(FieldSoraVideoPricePerRequestHd))
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestHdNotNil applies the NotNil predicate on the "sora_video_price_per_request_hd" field.
|
||||
func SoraVideoPricePerRequestHdNotNil() predicate.Group {
|
||||
return predicate.Group(sql.FieldNotNull(FieldSoraVideoPricePerRequestHd))
|
||||
}
|
||||
|
||||
// ClaudeCodeOnlyEQ applies the EQ predicate on the "claude_code_only" field.
|
||||
func ClaudeCodeOnlyEQ(v bool) predicate.Group {
|
||||
return predicate.Group(sql.FieldEQ(FieldClaudeCodeOnly, v))
|
||||
|
||||
@@ -258,6 +258,62 @@ func (_c *GroupCreate) SetNillableImagePrice4k(v *float64) *GroupCreate {
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetSoraImagePrice360 sets the "sora_image_price_360" field.
|
||||
func (_c *GroupCreate) SetSoraImagePrice360(v float64) *GroupCreate {
|
||||
_c.mutation.SetSoraImagePrice360(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableSoraImagePrice360 sets the "sora_image_price_360" field if the given value is not nil.
|
||||
func (_c *GroupCreate) SetNillableSoraImagePrice360(v *float64) *GroupCreate {
|
||||
if v != nil {
|
||||
_c.SetSoraImagePrice360(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetSoraImagePrice540 sets the "sora_image_price_540" field.
|
||||
func (_c *GroupCreate) SetSoraImagePrice540(v float64) *GroupCreate {
|
||||
_c.mutation.SetSoraImagePrice540(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableSoraImagePrice540 sets the "sora_image_price_540" field if the given value is not nil.
|
||||
func (_c *GroupCreate) SetNillableSoraImagePrice540(v *float64) *GroupCreate {
|
||||
if v != nil {
|
||||
_c.SetSoraImagePrice540(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetSoraVideoPricePerRequest sets the "sora_video_price_per_request" field.
|
||||
func (_c *GroupCreate) SetSoraVideoPricePerRequest(v float64) *GroupCreate {
|
||||
_c.mutation.SetSoraVideoPricePerRequest(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableSoraVideoPricePerRequest sets the "sora_video_price_per_request" field if the given value is not nil.
|
||||
func (_c *GroupCreate) SetNillableSoraVideoPricePerRequest(v *float64) *GroupCreate {
|
||||
if v != nil {
|
||||
_c.SetSoraVideoPricePerRequest(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetSoraVideoPricePerRequestHd sets the "sora_video_price_per_request_hd" field.
|
||||
func (_c *GroupCreate) SetSoraVideoPricePerRequestHd(v float64) *GroupCreate {
|
||||
_c.mutation.SetSoraVideoPricePerRequestHd(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableSoraVideoPricePerRequestHd sets the "sora_video_price_per_request_hd" field if the given value is not nil.
|
||||
func (_c *GroupCreate) SetNillableSoraVideoPricePerRequestHd(v *float64) *GroupCreate {
|
||||
if v != nil {
|
||||
_c.SetSoraVideoPricePerRequestHd(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetClaudeCodeOnly sets the "claude_code_only" field.
|
||||
func (_c *GroupCreate) SetClaudeCodeOnly(v bool) *GroupCreate {
|
||||
_c.mutation.SetClaudeCodeOnly(v)
|
||||
@@ -632,6 +688,22 @@ func (_c *GroupCreate) createSpec() (*Group, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(group.FieldImagePrice4k, field.TypeFloat64, value)
|
||||
_node.ImagePrice4k = &value
|
||||
}
|
||||
if value, ok := _c.mutation.SoraImagePrice360(); ok {
|
||||
_spec.SetField(group.FieldSoraImagePrice360, field.TypeFloat64, value)
|
||||
_node.SoraImagePrice360 = &value
|
||||
}
|
||||
if value, ok := _c.mutation.SoraImagePrice540(); ok {
|
||||
_spec.SetField(group.FieldSoraImagePrice540, field.TypeFloat64, value)
|
||||
_node.SoraImagePrice540 = &value
|
||||
}
|
||||
if value, ok := _c.mutation.SoraVideoPricePerRequest(); ok {
|
||||
_spec.SetField(group.FieldSoraVideoPricePerRequest, field.TypeFloat64, value)
|
||||
_node.SoraVideoPricePerRequest = &value
|
||||
}
|
||||
if value, ok := _c.mutation.SoraVideoPricePerRequestHd(); ok {
|
||||
_spec.SetField(group.FieldSoraVideoPricePerRequestHd, field.TypeFloat64, value)
|
||||
_node.SoraVideoPricePerRequestHd = &value
|
||||
}
|
||||
if value, ok := _c.mutation.ClaudeCodeOnly(); ok {
|
||||
_spec.SetField(group.FieldClaudeCodeOnly, field.TypeBool, value)
|
||||
_node.ClaudeCodeOnly = value
|
||||
@@ -1092,6 +1164,102 @@ func (u *GroupUpsert) ClearImagePrice4k() *GroupUpsert {
|
||||
return u
|
||||
}
|
||||
|
||||
// SetSoraImagePrice360 sets the "sora_image_price_360" field.
|
||||
func (u *GroupUpsert) SetSoraImagePrice360(v float64) *GroupUpsert {
|
||||
u.Set(group.FieldSoraImagePrice360, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateSoraImagePrice360 sets the "sora_image_price_360" field to the value that was provided on create.
|
||||
func (u *GroupUpsert) UpdateSoraImagePrice360() *GroupUpsert {
|
||||
u.SetExcluded(group.FieldSoraImagePrice360)
|
||||
return u
|
||||
}
|
||||
|
||||
// AddSoraImagePrice360 adds v to the "sora_image_price_360" field.
|
||||
func (u *GroupUpsert) AddSoraImagePrice360(v float64) *GroupUpsert {
|
||||
u.Add(group.FieldSoraImagePrice360, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// ClearSoraImagePrice360 clears the value of the "sora_image_price_360" field.
|
||||
func (u *GroupUpsert) ClearSoraImagePrice360() *GroupUpsert {
|
||||
u.SetNull(group.FieldSoraImagePrice360)
|
||||
return u
|
||||
}
|
||||
|
||||
// SetSoraImagePrice540 sets the "sora_image_price_540" field.
|
||||
func (u *GroupUpsert) SetSoraImagePrice540(v float64) *GroupUpsert {
|
||||
u.Set(group.FieldSoraImagePrice540, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateSoraImagePrice540 sets the "sora_image_price_540" field to the value that was provided on create.
|
||||
func (u *GroupUpsert) UpdateSoraImagePrice540() *GroupUpsert {
|
||||
u.SetExcluded(group.FieldSoraImagePrice540)
|
||||
return u
|
||||
}
|
||||
|
||||
// AddSoraImagePrice540 adds v to the "sora_image_price_540" field.
|
||||
func (u *GroupUpsert) AddSoraImagePrice540(v float64) *GroupUpsert {
|
||||
u.Add(group.FieldSoraImagePrice540, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// ClearSoraImagePrice540 clears the value of the "sora_image_price_540" field.
|
||||
func (u *GroupUpsert) ClearSoraImagePrice540() *GroupUpsert {
|
||||
u.SetNull(group.FieldSoraImagePrice540)
|
||||
return u
|
||||
}
|
||||
|
||||
// SetSoraVideoPricePerRequest sets the "sora_video_price_per_request" field.
|
||||
func (u *GroupUpsert) SetSoraVideoPricePerRequest(v float64) *GroupUpsert {
|
||||
u.Set(group.FieldSoraVideoPricePerRequest, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateSoraVideoPricePerRequest sets the "sora_video_price_per_request" field to the value that was provided on create.
|
||||
func (u *GroupUpsert) UpdateSoraVideoPricePerRequest() *GroupUpsert {
|
||||
u.SetExcluded(group.FieldSoraVideoPricePerRequest)
|
||||
return u
|
||||
}
|
||||
|
||||
// AddSoraVideoPricePerRequest adds v to the "sora_video_price_per_request" field.
|
||||
func (u *GroupUpsert) AddSoraVideoPricePerRequest(v float64) *GroupUpsert {
|
||||
u.Add(group.FieldSoraVideoPricePerRequest, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// ClearSoraVideoPricePerRequest clears the value of the "sora_video_price_per_request" field.
|
||||
func (u *GroupUpsert) ClearSoraVideoPricePerRequest() *GroupUpsert {
|
||||
u.SetNull(group.FieldSoraVideoPricePerRequest)
|
||||
return u
|
||||
}
|
||||
|
||||
// SetSoraVideoPricePerRequestHd sets the "sora_video_price_per_request_hd" field.
|
||||
func (u *GroupUpsert) SetSoraVideoPricePerRequestHd(v float64) *GroupUpsert {
|
||||
u.Set(group.FieldSoraVideoPricePerRequestHd, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateSoraVideoPricePerRequestHd sets the "sora_video_price_per_request_hd" field to the value that was provided on create.
|
||||
func (u *GroupUpsert) UpdateSoraVideoPricePerRequestHd() *GroupUpsert {
|
||||
u.SetExcluded(group.FieldSoraVideoPricePerRequestHd)
|
||||
return u
|
||||
}
|
||||
|
||||
// AddSoraVideoPricePerRequestHd adds v to the "sora_video_price_per_request_hd" field.
|
||||
func (u *GroupUpsert) AddSoraVideoPricePerRequestHd(v float64) *GroupUpsert {
|
||||
u.Add(group.FieldSoraVideoPricePerRequestHd, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// ClearSoraVideoPricePerRequestHd clears the value of the "sora_video_price_per_request_hd" field.
|
||||
func (u *GroupUpsert) ClearSoraVideoPricePerRequestHd() *GroupUpsert {
|
||||
u.SetNull(group.FieldSoraVideoPricePerRequestHd)
|
||||
return u
|
||||
}
|
||||
|
||||
// SetClaudeCodeOnly sets the "claude_code_only" field.
|
||||
func (u *GroupUpsert) SetClaudeCodeOnly(v bool) *GroupUpsert {
|
||||
u.Set(group.FieldClaudeCodeOnly, v)
|
||||
@@ -1539,6 +1707,118 @@ func (u *GroupUpsertOne) ClearImagePrice4k() *GroupUpsertOne {
|
||||
})
|
||||
}
|
||||
|
||||
// SetSoraImagePrice360 sets the "sora_image_price_360" field.
|
||||
func (u *GroupUpsertOne) SetSoraImagePrice360(v float64) *GroupUpsertOne {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.SetSoraImagePrice360(v)
|
||||
})
|
||||
}
|
||||
|
||||
// AddSoraImagePrice360 adds v to the "sora_image_price_360" field.
|
||||
func (u *GroupUpsertOne) AddSoraImagePrice360(v float64) *GroupUpsertOne {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.AddSoraImagePrice360(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateSoraImagePrice360 sets the "sora_image_price_360" field to the value that was provided on create.
|
||||
func (u *GroupUpsertOne) UpdateSoraImagePrice360() *GroupUpsertOne {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.UpdateSoraImagePrice360()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearSoraImagePrice360 clears the value of the "sora_image_price_360" field.
|
||||
func (u *GroupUpsertOne) ClearSoraImagePrice360() *GroupUpsertOne {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.ClearSoraImagePrice360()
|
||||
})
|
||||
}
|
||||
|
||||
// SetSoraImagePrice540 sets the "sora_image_price_540" field.
|
||||
func (u *GroupUpsertOne) SetSoraImagePrice540(v float64) *GroupUpsertOne {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.SetSoraImagePrice540(v)
|
||||
})
|
||||
}
|
||||
|
||||
// AddSoraImagePrice540 adds v to the "sora_image_price_540" field.
|
||||
func (u *GroupUpsertOne) AddSoraImagePrice540(v float64) *GroupUpsertOne {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.AddSoraImagePrice540(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateSoraImagePrice540 sets the "sora_image_price_540" field to the value that was provided on create.
|
||||
func (u *GroupUpsertOne) UpdateSoraImagePrice540() *GroupUpsertOne {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.UpdateSoraImagePrice540()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearSoraImagePrice540 clears the value of the "sora_image_price_540" field.
|
||||
func (u *GroupUpsertOne) ClearSoraImagePrice540() *GroupUpsertOne {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.ClearSoraImagePrice540()
|
||||
})
|
||||
}
|
||||
|
||||
// SetSoraVideoPricePerRequest sets the "sora_video_price_per_request" field.
|
||||
func (u *GroupUpsertOne) SetSoraVideoPricePerRequest(v float64) *GroupUpsertOne {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.SetSoraVideoPricePerRequest(v)
|
||||
})
|
||||
}
|
||||
|
||||
// AddSoraVideoPricePerRequest adds v to the "sora_video_price_per_request" field.
|
||||
func (u *GroupUpsertOne) AddSoraVideoPricePerRequest(v float64) *GroupUpsertOne {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.AddSoraVideoPricePerRequest(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateSoraVideoPricePerRequest sets the "sora_video_price_per_request" field to the value that was provided on create.
|
||||
func (u *GroupUpsertOne) UpdateSoraVideoPricePerRequest() *GroupUpsertOne {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.UpdateSoraVideoPricePerRequest()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearSoraVideoPricePerRequest clears the value of the "sora_video_price_per_request" field.
|
||||
func (u *GroupUpsertOne) ClearSoraVideoPricePerRequest() *GroupUpsertOne {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.ClearSoraVideoPricePerRequest()
|
||||
})
|
||||
}
|
||||
|
||||
// SetSoraVideoPricePerRequestHd sets the "sora_video_price_per_request_hd" field.
|
||||
func (u *GroupUpsertOne) SetSoraVideoPricePerRequestHd(v float64) *GroupUpsertOne {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.SetSoraVideoPricePerRequestHd(v)
|
||||
})
|
||||
}
|
||||
|
||||
// AddSoraVideoPricePerRequestHd adds v to the "sora_video_price_per_request_hd" field.
|
||||
func (u *GroupUpsertOne) AddSoraVideoPricePerRequestHd(v float64) *GroupUpsertOne {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.AddSoraVideoPricePerRequestHd(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateSoraVideoPricePerRequestHd sets the "sora_video_price_per_request_hd" field to the value that was provided on create.
|
||||
func (u *GroupUpsertOne) UpdateSoraVideoPricePerRequestHd() *GroupUpsertOne {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.UpdateSoraVideoPricePerRequestHd()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearSoraVideoPricePerRequestHd clears the value of the "sora_video_price_per_request_hd" field.
|
||||
func (u *GroupUpsertOne) ClearSoraVideoPricePerRequestHd() *GroupUpsertOne {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.ClearSoraVideoPricePerRequestHd()
|
||||
})
|
||||
}
|
||||
|
||||
// SetClaudeCodeOnly sets the "claude_code_only" field.
|
||||
func (u *GroupUpsertOne) SetClaudeCodeOnly(v bool) *GroupUpsertOne {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
@@ -2163,6 +2443,118 @@ func (u *GroupUpsertBulk) ClearImagePrice4k() *GroupUpsertBulk {
|
||||
})
|
||||
}
|
||||
|
||||
// SetSoraImagePrice360 sets the "sora_image_price_360" field.
|
||||
func (u *GroupUpsertBulk) SetSoraImagePrice360(v float64) *GroupUpsertBulk {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.SetSoraImagePrice360(v)
|
||||
})
|
||||
}
|
||||
|
||||
// AddSoraImagePrice360 adds v to the "sora_image_price_360" field.
|
||||
func (u *GroupUpsertBulk) AddSoraImagePrice360(v float64) *GroupUpsertBulk {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.AddSoraImagePrice360(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateSoraImagePrice360 sets the "sora_image_price_360" field to the value that was provided on create.
|
||||
func (u *GroupUpsertBulk) UpdateSoraImagePrice360() *GroupUpsertBulk {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.UpdateSoraImagePrice360()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearSoraImagePrice360 clears the value of the "sora_image_price_360" field.
|
||||
func (u *GroupUpsertBulk) ClearSoraImagePrice360() *GroupUpsertBulk {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.ClearSoraImagePrice360()
|
||||
})
|
||||
}
|
||||
|
||||
// SetSoraImagePrice540 sets the "sora_image_price_540" field.
|
||||
func (u *GroupUpsertBulk) SetSoraImagePrice540(v float64) *GroupUpsertBulk {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.SetSoraImagePrice540(v)
|
||||
})
|
||||
}
|
||||
|
||||
// AddSoraImagePrice540 adds v to the "sora_image_price_540" field.
|
||||
func (u *GroupUpsertBulk) AddSoraImagePrice540(v float64) *GroupUpsertBulk {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.AddSoraImagePrice540(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateSoraImagePrice540 sets the "sora_image_price_540" field to the value that was provided on create.
|
||||
func (u *GroupUpsertBulk) UpdateSoraImagePrice540() *GroupUpsertBulk {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.UpdateSoraImagePrice540()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearSoraImagePrice540 clears the value of the "sora_image_price_540" field.
|
||||
func (u *GroupUpsertBulk) ClearSoraImagePrice540() *GroupUpsertBulk {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.ClearSoraImagePrice540()
|
||||
})
|
||||
}
|
||||
|
||||
// SetSoraVideoPricePerRequest sets the "sora_video_price_per_request" field.
|
||||
func (u *GroupUpsertBulk) SetSoraVideoPricePerRequest(v float64) *GroupUpsertBulk {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.SetSoraVideoPricePerRequest(v)
|
||||
})
|
||||
}
|
||||
|
||||
// AddSoraVideoPricePerRequest adds v to the "sora_video_price_per_request" field.
|
||||
func (u *GroupUpsertBulk) AddSoraVideoPricePerRequest(v float64) *GroupUpsertBulk {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.AddSoraVideoPricePerRequest(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateSoraVideoPricePerRequest sets the "sora_video_price_per_request" field to the value that was provided on create.
|
||||
func (u *GroupUpsertBulk) UpdateSoraVideoPricePerRequest() *GroupUpsertBulk {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.UpdateSoraVideoPricePerRequest()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearSoraVideoPricePerRequest clears the value of the "sora_video_price_per_request" field.
|
||||
func (u *GroupUpsertBulk) ClearSoraVideoPricePerRequest() *GroupUpsertBulk {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.ClearSoraVideoPricePerRequest()
|
||||
})
|
||||
}
|
||||
|
||||
// SetSoraVideoPricePerRequestHd sets the "sora_video_price_per_request_hd" field.
|
||||
func (u *GroupUpsertBulk) SetSoraVideoPricePerRequestHd(v float64) *GroupUpsertBulk {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.SetSoraVideoPricePerRequestHd(v)
|
||||
})
|
||||
}
|
||||
|
||||
// AddSoraVideoPricePerRequestHd adds v to the "sora_video_price_per_request_hd" field.
|
||||
func (u *GroupUpsertBulk) AddSoraVideoPricePerRequestHd(v float64) *GroupUpsertBulk {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.AddSoraVideoPricePerRequestHd(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateSoraVideoPricePerRequestHd sets the "sora_video_price_per_request_hd" field to the value that was provided on create.
|
||||
func (u *GroupUpsertBulk) UpdateSoraVideoPricePerRequestHd() *GroupUpsertBulk {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.UpdateSoraVideoPricePerRequestHd()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearSoraVideoPricePerRequestHd clears the value of the "sora_video_price_per_request_hd" field.
|
||||
func (u *GroupUpsertBulk) ClearSoraVideoPricePerRequestHd() *GroupUpsertBulk {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
s.ClearSoraVideoPricePerRequestHd()
|
||||
})
|
||||
}
|
||||
|
||||
// SetClaudeCodeOnly sets the "claude_code_only" field.
|
||||
func (u *GroupUpsertBulk) SetClaudeCodeOnly(v bool) *GroupUpsertBulk {
|
||||
return u.Update(func(s *GroupUpsert) {
|
||||
|
||||
@@ -354,6 +354,114 @@ func (_u *GroupUpdate) ClearImagePrice4k() *GroupUpdate {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetSoraImagePrice360 sets the "sora_image_price_360" field.
|
||||
func (_u *GroupUpdate) SetSoraImagePrice360(v float64) *GroupUpdate {
|
||||
_u.mutation.ResetSoraImagePrice360()
|
||||
_u.mutation.SetSoraImagePrice360(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableSoraImagePrice360 sets the "sora_image_price_360" field if the given value is not nil.
|
||||
func (_u *GroupUpdate) SetNillableSoraImagePrice360(v *float64) *GroupUpdate {
|
||||
if v != nil {
|
||||
_u.SetSoraImagePrice360(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddSoraImagePrice360 adds value to the "sora_image_price_360" field.
|
||||
func (_u *GroupUpdate) AddSoraImagePrice360(v float64) *GroupUpdate {
|
||||
_u.mutation.AddSoraImagePrice360(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearSoraImagePrice360 clears the value of the "sora_image_price_360" field.
|
||||
func (_u *GroupUpdate) ClearSoraImagePrice360() *GroupUpdate {
|
||||
_u.mutation.ClearSoraImagePrice360()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetSoraImagePrice540 sets the "sora_image_price_540" field.
|
||||
func (_u *GroupUpdate) SetSoraImagePrice540(v float64) *GroupUpdate {
|
||||
_u.mutation.ResetSoraImagePrice540()
|
||||
_u.mutation.SetSoraImagePrice540(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableSoraImagePrice540 sets the "sora_image_price_540" field if the given value is not nil.
|
||||
func (_u *GroupUpdate) SetNillableSoraImagePrice540(v *float64) *GroupUpdate {
|
||||
if v != nil {
|
||||
_u.SetSoraImagePrice540(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddSoraImagePrice540 adds value to the "sora_image_price_540" field.
|
||||
func (_u *GroupUpdate) AddSoraImagePrice540(v float64) *GroupUpdate {
|
||||
_u.mutation.AddSoraImagePrice540(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearSoraImagePrice540 clears the value of the "sora_image_price_540" field.
|
||||
func (_u *GroupUpdate) ClearSoraImagePrice540() *GroupUpdate {
|
||||
_u.mutation.ClearSoraImagePrice540()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetSoraVideoPricePerRequest sets the "sora_video_price_per_request" field.
|
||||
func (_u *GroupUpdate) SetSoraVideoPricePerRequest(v float64) *GroupUpdate {
|
||||
_u.mutation.ResetSoraVideoPricePerRequest()
|
||||
_u.mutation.SetSoraVideoPricePerRequest(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableSoraVideoPricePerRequest sets the "sora_video_price_per_request" field if the given value is not nil.
|
||||
func (_u *GroupUpdate) SetNillableSoraVideoPricePerRequest(v *float64) *GroupUpdate {
|
||||
if v != nil {
|
||||
_u.SetSoraVideoPricePerRequest(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddSoraVideoPricePerRequest adds value to the "sora_video_price_per_request" field.
|
||||
func (_u *GroupUpdate) AddSoraVideoPricePerRequest(v float64) *GroupUpdate {
|
||||
_u.mutation.AddSoraVideoPricePerRequest(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearSoraVideoPricePerRequest clears the value of the "sora_video_price_per_request" field.
|
||||
func (_u *GroupUpdate) ClearSoraVideoPricePerRequest() *GroupUpdate {
|
||||
_u.mutation.ClearSoraVideoPricePerRequest()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetSoraVideoPricePerRequestHd sets the "sora_video_price_per_request_hd" field.
|
||||
func (_u *GroupUpdate) SetSoraVideoPricePerRequestHd(v float64) *GroupUpdate {
|
||||
_u.mutation.ResetSoraVideoPricePerRequestHd()
|
||||
_u.mutation.SetSoraVideoPricePerRequestHd(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableSoraVideoPricePerRequestHd sets the "sora_video_price_per_request_hd" field if the given value is not nil.
|
||||
func (_u *GroupUpdate) SetNillableSoraVideoPricePerRequestHd(v *float64) *GroupUpdate {
|
||||
if v != nil {
|
||||
_u.SetSoraVideoPricePerRequestHd(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddSoraVideoPricePerRequestHd adds value to the "sora_video_price_per_request_hd" field.
|
||||
func (_u *GroupUpdate) AddSoraVideoPricePerRequestHd(v float64) *GroupUpdate {
|
||||
_u.mutation.AddSoraVideoPricePerRequestHd(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearSoraVideoPricePerRequestHd clears the value of the "sora_video_price_per_request_hd" field.
|
||||
func (_u *GroupUpdate) ClearSoraVideoPricePerRequestHd() *GroupUpdate {
|
||||
_u.mutation.ClearSoraVideoPricePerRequestHd()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetClaudeCodeOnly sets the "claude_code_only" field.
|
||||
func (_u *GroupUpdate) SetClaudeCodeOnly(v bool) *GroupUpdate {
|
||||
_u.mutation.SetClaudeCodeOnly(v)
|
||||
@@ -817,6 +925,42 @@ func (_u *GroupUpdate) sqlSave(ctx context.Context) (_node int, err error) {
|
||||
if _u.mutation.ImagePrice4kCleared() {
|
||||
_spec.ClearField(group.FieldImagePrice4k, field.TypeFloat64)
|
||||
}
|
||||
if value, ok := _u.mutation.SoraImagePrice360(); ok {
|
||||
_spec.SetField(group.FieldSoraImagePrice360, field.TypeFloat64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedSoraImagePrice360(); ok {
|
||||
_spec.AddField(group.FieldSoraImagePrice360, field.TypeFloat64, value)
|
||||
}
|
||||
if _u.mutation.SoraImagePrice360Cleared() {
|
||||
_spec.ClearField(group.FieldSoraImagePrice360, field.TypeFloat64)
|
||||
}
|
||||
if value, ok := _u.mutation.SoraImagePrice540(); ok {
|
||||
_spec.SetField(group.FieldSoraImagePrice540, field.TypeFloat64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedSoraImagePrice540(); ok {
|
||||
_spec.AddField(group.FieldSoraImagePrice540, field.TypeFloat64, value)
|
||||
}
|
||||
if _u.mutation.SoraImagePrice540Cleared() {
|
||||
_spec.ClearField(group.FieldSoraImagePrice540, field.TypeFloat64)
|
||||
}
|
||||
if value, ok := _u.mutation.SoraVideoPricePerRequest(); ok {
|
||||
_spec.SetField(group.FieldSoraVideoPricePerRequest, field.TypeFloat64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedSoraVideoPricePerRequest(); ok {
|
||||
_spec.AddField(group.FieldSoraVideoPricePerRequest, field.TypeFloat64, value)
|
||||
}
|
||||
if _u.mutation.SoraVideoPricePerRequestCleared() {
|
||||
_spec.ClearField(group.FieldSoraVideoPricePerRequest, field.TypeFloat64)
|
||||
}
|
||||
if value, ok := _u.mutation.SoraVideoPricePerRequestHd(); ok {
|
||||
_spec.SetField(group.FieldSoraVideoPricePerRequestHd, field.TypeFloat64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedSoraVideoPricePerRequestHd(); ok {
|
||||
_spec.AddField(group.FieldSoraVideoPricePerRequestHd, field.TypeFloat64, value)
|
||||
}
|
||||
if _u.mutation.SoraVideoPricePerRequestHdCleared() {
|
||||
_spec.ClearField(group.FieldSoraVideoPricePerRequestHd, field.TypeFloat64)
|
||||
}
|
||||
if value, ok := _u.mutation.ClaudeCodeOnly(); ok {
|
||||
_spec.SetField(group.FieldClaudeCodeOnly, field.TypeBool, value)
|
||||
}
|
||||
@@ -1472,6 +1616,114 @@ func (_u *GroupUpdateOne) ClearImagePrice4k() *GroupUpdateOne {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetSoraImagePrice360 sets the "sora_image_price_360" field.
|
||||
func (_u *GroupUpdateOne) SetSoraImagePrice360(v float64) *GroupUpdateOne {
|
||||
_u.mutation.ResetSoraImagePrice360()
|
||||
_u.mutation.SetSoraImagePrice360(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableSoraImagePrice360 sets the "sora_image_price_360" field if the given value is not nil.
|
||||
func (_u *GroupUpdateOne) SetNillableSoraImagePrice360(v *float64) *GroupUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetSoraImagePrice360(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddSoraImagePrice360 adds value to the "sora_image_price_360" field.
|
||||
func (_u *GroupUpdateOne) AddSoraImagePrice360(v float64) *GroupUpdateOne {
|
||||
_u.mutation.AddSoraImagePrice360(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearSoraImagePrice360 clears the value of the "sora_image_price_360" field.
|
||||
func (_u *GroupUpdateOne) ClearSoraImagePrice360() *GroupUpdateOne {
|
||||
_u.mutation.ClearSoraImagePrice360()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetSoraImagePrice540 sets the "sora_image_price_540" field.
|
||||
func (_u *GroupUpdateOne) SetSoraImagePrice540(v float64) *GroupUpdateOne {
|
||||
_u.mutation.ResetSoraImagePrice540()
|
||||
_u.mutation.SetSoraImagePrice540(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableSoraImagePrice540 sets the "sora_image_price_540" field if the given value is not nil.
|
||||
func (_u *GroupUpdateOne) SetNillableSoraImagePrice540(v *float64) *GroupUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetSoraImagePrice540(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddSoraImagePrice540 adds value to the "sora_image_price_540" field.
|
||||
func (_u *GroupUpdateOne) AddSoraImagePrice540(v float64) *GroupUpdateOne {
|
||||
_u.mutation.AddSoraImagePrice540(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearSoraImagePrice540 clears the value of the "sora_image_price_540" field.
|
||||
func (_u *GroupUpdateOne) ClearSoraImagePrice540() *GroupUpdateOne {
|
||||
_u.mutation.ClearSoraImagePrice540()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetSoraVideoPricePerRequest sets the "sora_video_price_per_request" field.
|
||||
func (_u *GroupUpdateOne) SetSoraVideoPricePerRequest(v float64) *GroupUpdateOne {
|
||||
_u.mutation.ResetSoraVideoPricePerRequest()
|
||||
_u.mutation.SetSoraVideoPricePerRequest(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableSoraVideoPricePerRequest sets the "sora_video_price_per_request" field if the given value is not nil.
|
||||
func (_u *GroupUpdateOne) SetNillableSoraVideoPricePerRequest(v *float64) *GroupUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetSoraVideoPricePerRequest(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddSoraVideoPricePerRequest adds value to the "sora_video_price_per_request" field.
|
||||
func (_u *GroupUpdateOne) AddSoraVideoPricePerRequest(v float64) *GroupUpdateOne {
|
||||
_u.mutation.AddSoraVideoPricePerRequest(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearSoraVideoPricePerRequest clears the value of the "sora_video_price_per_request" field.
|
||||
func (_u *GroupUpdateOne) ClearSoraVideoPricePerRequest() *GroupUpdateOne {
|
||||
_u.mutation.ClearSoraVideoPricePerRequest()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetSoraVideoPricePerRequestHd sets the "sora_video_price_per_request_hd" field.
|
||||
func (_u *GroupUpdateOne) SetSoraVideoPricePerRequestHd(v float64) *GroupUpdateOne {
|
||||
_u.mutation.ResetSoraVideoPricePerRequestHd()
|
||||
_u.mutation.SetSoraVideoPricePerRequestHd(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableSoraVideoPricePerRequestHd sets the "sora_video_price_per_request_hd" field if the given value is not nil.
|
||||
func (_u *GroupUpdateOne) SetNillableSoraVideoPricePerRequestHd(v *float64) *GroupUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetSoraVideoPricePerRequestHd(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddSoraVideoPricePerRequestHd adds value to the "sora_video_price_per_request_hd" field.
|
||||
func (_u *GroupUpdateOne) AddSoraVideoPricePerRequestHd(v float64) *GroupUpdateOne {
|
||||
_u.mutation.AddSoraVideoPricePerRequestHd(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearSoraVideoPricePerRequestHd clears the value of the "sora_video_price_per_request_hd" field.
|
||||
func (_u *GroupUpdateOne) ClearSoraVideoPricePerRequestHd() *GroupUpdateOne {
|
||||
_u.mutation.ClearSoraVideoPricePerRequestHd()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetClaudeCodeOnly sets the "claude_code_only" field.
|
||||
func (_u *GroupUpdateOne) SetClaudeCodeOnly(v bool) *GroupUpdateOne {
|
||||
_u.mutation.SetClaudeCodeOnly(v)
|
||||
@@ -1965,6 +2217,42 @@ func (_u *GroupUpdateOne) sqlSave(ctx context.Context) (_node *Group, err error)
|
||||
if _u.mutation.ImagePrice4kCleared() {
|
||||
_spec.ClearField(group.FieldImagePrice4k, field.TypeFloat64)
|
||||
}
|
||||
if value, ok := _u.mutation.SoraImagePrice360(); ok {
|
||||
_spec.SetField(group.FieldSoraImagePrice360, field.TypeFloat64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedSoraImagePrice360(); ok {
|
||||
_spec.AddField(group.FieldSoraImagePrice360, field.TypeFloat64, value)
|
||||
}
|
||||
if _u.mutation.SoraImagePrice360Cleared() {
|
||||
_spec.ClearField(group.FieldSoraImagePrice360, field.TypeFloat64)
|
||||
}
|
||||
if value, ok := _u.mutation.SoraImagePrice540(); ok {
|
||||
_spec.SetField(group.FieldSoraImagePrice540, field.TypeFloat64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedSoraImagePrice540(); ok {
|
||||
_spec.AddField(group.FieldSoraImagePrice540, field.TypeFloat64, value)
|
||||
}
|
||||
if _u.mutation.SoraImagePrice540Cleared() {
|
||||
_spec.ClearField(group.FieldSoraImagePrice540, field.TypeFloat64)
|
||||
}
|
||||
if value, ok := _u.mutation.SoraVideoPricePerRequest(); ok {
|
||||
_spec.SetField(group.FieldSoraVideoPricePerRequest, field.TypeFloat64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedSoraVideoPricePerRequest(); ok {
|
||||
_spec.AddField(group.FieldSoraVideoPricePerRequest, field.TypeFloat64, value)
|
||||
}
|
||||
if _u.mutation.SoraVideoPricePerRequestCleared() {
|
||||
_spec.ClearField(group.FieldSoraVideoPricePerRequest, field.TypeFloat64)
|
||||
}
|
||||
if value, ok := _u.mutation.SoraVideoPricePerRequestHd(); ok {
|
||||
_spec.SetField(group.FieldSoraVideoPricePerRequestHd, field.TypeFloat64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedSoraVideoPricePerRequestHd(); ok {
|
||||
_spec.AddField(group.FieldSoraVideoPricePerRequestHd, field.TypeFloat64, value)
|
||||
}
|
||||
if _u.mutation.SoraVideoPricePerRequestHdCleared() {
|
||||
_spec.ClearField(group.FieldSoraVideoPricePerRequestHd, field.TypeFloat64)
|
||||
}
|
||||
if value, ok := _u.mutation.ClaudeCodeOnly(); ok {
|
||||
_spec.SetField(group.FieldClaudeCodeOnly, field.TypeBool, value)
|
||||
}
|
||||
|
||||
@@ -224,6 +224,10 @@ var (
|
||||
{Name: "image_price_1k", Type: field.TypeFloat64, Nullable: true, SchemaType: map[string]string{"postgres": "decimal(20,8)"}},
|
||||
{Name: "image_price_2k", Type: field.TypeFloat64, Nullable: true, SchemaType: map[string]string{"postgres": "decimal(20,8)"}},
|
||||
{Name: "image_price_4k", Type: field.TypeFloat64, Nullable: true, SchemaType: map[string]string{"postgres": "decimal(20,8)"}},
|
||||
{Name: "sora_image_price_360", Type: field.TypeFloat64, Nullable: true, SchemaType: map[string]string{"postgres": "decimal(20,8)"}},
|
||||
{Name: "sora_image_price_540", Type: field.TypeFloat64, Nullable: true, SchemaType: map[string]string{"postgres": "decimal(20,8)"}},
|
||||
{Name: "sora_video_price_per_request", Type: field.TypeFloat64, Nullable: true, SchemaType: map[string]string{"postgres": "decimal(20,8)"}},
|
||||
{Name: "sora_video_price_per_request_hd", Type: field.TypeFloat64, Nullable: true, SchemaType: map[string]string{"postgres": "decimal(20,8)"}},
|
||||
{Name: "claude_code_only", Type: field.TypeBool, Default: false},
|
||||
{Name: "fallback_group_id", Type: field.TypeInt64, Nullable: true},
|
||||
{Name: "model_routing", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}},
|
||||
@@ -499,6 +503,7 @@ var (
|
||||
{Name: "ip_address", Type: field.TypeString, Nullable: true, Size: 45},
|
||||
{Name: "image_count", Type: field.TypeInt, Default: 0},
|
||||
{Name: "image_size", Type: field.TypeString, Nullable: true, Size: 10},
|
||||
{Name: "media_type", Type: field.TypeString, Nullable: true, Size: 16},
|
||||
{Name: "created_at", Type: field.TypeTime, SchemaType: map[string]string{"postgres": "timestamptz"}},
|
||||
{Name: "api_key_id", Type: field.TypeInt64},
|
||||
{Name: "account_id", Type: field.TypeInt64},
|
||||
@@ -514,31 +519,31 @@ var (
|
||||
ForeignKeys: []*schema.ForeignKey{
|
||||
{
|
||||
Symbol: "usage_logs_api_keys_usage_logs",
|
||||
Columns: []*schema.Column{UsageLogsColumns[26]},
|
||||
Columns: []*schema.Column{UsageLogsColumns[27]},
|
||||
RefColumns: []*schema.Column{APIKeysColumns[0]},
|
||||
OnDelete: schema.NoAction,
|
||||
},
|
||||
{
|
||||
Symbol: "usage_logs_accounts_usage_logs",
|
||||
Columns: []*schema.Column{UsageLogsColumns[27]},
|
||||
Columns: []*schema.Column{UsageLogsColumns[28]},
|
||||
RefColumns: []*schema.Column{AccountsColumns[0]},
|
||||
OnDelete: schema.NoAction,
|
||||
},
|
||||
{
|
||||
Symbol: "usage_logs_groups_usage_logs",
|
||||
Columns: []*schema.Column{UsageLogsColumns[28]},
|
||||
Columns: []*schema.Column{UsageLogsColumns[29]},
|
||||
RefColumns: []*schema.Column{GroupsColumns[0]},
|
||||
OnDelete: schema.SetNull,
|
||||
},
|
||||
{
|
||||
Symbol: "usage_logs_users_usage_logs",
|
||||
Columns: []*schema.Column{UsageLogsColumns[29]},
|
||||
Columns: []*schema.Column{UsageLogsColumns[30]},
|
||||
RefColumns: []*schema.Column{UsersColumns[0]},
|
||||
OnDelete: schema.NoAction,
|
||||
},
|
||||
{
|
||||
Symbol: "usage_logs_user_subscriptions_usage_logs",
|
||||
Columns: []*schema.Column{UsageLogsColumns[30]},
|
||||
Columns: []*schema.Column{UsageLogsColumns[31]},
|
||||
RefColumns: []*schema.Column{UserSubscriptionsColumns[0]},
|
||||
OnDelete: schema.SetNull,
|
||||
},
|
||||
@@ -547,32 +552,32 @@ var (
|
||||
{
|
||||
Name: "usagelog_user_id",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{UsageLogsColumns[29]},
|
||||
Columns: []*schema.Column{UsageLogsColumns[30]},
|
||||
},
|
||||
{
|
||||
Name: "usagelog_api_key_id",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{UsageLogsColumns[26]},
|
||||
Columns: []*schema.Column{UsageLogsColumns[27]},
|
||||
},
|
||||
{
|
||||
Name: "usagelog_account_id",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{UsageLogsColumns[27]},
|
||||
Columns: []*schema.Column{UsageLogsColumns[28]},
|
||||
},
|
||||
{
|
||||
Name: "usagelog_group_id",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{UsageLogsColumns[28]},
|
||||
Columns: []*schema.Column{UsageLogsColumns[29]},
|
||||
},
|
||||
{
|
||||
Name: "usagelog_subscription_id",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{UsageLogsColumns[30]},
|
||||
Columns: []*schema.Column{UsageLogsColumns[31]},
|
||||
},
|
||||
{
|
||||
Name: "usagelog_created_at",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{UsageLogsColumns[25]},
|
||||
Columns: []*schema.Column{UsageLogsColumns[26]},
|
||||
},
|
||||
{
|
||||
Name: "usagelog_model",
|
||||
@@ -587,12 +592,12 @@ var (
|
||||
{
|
||||
Name: "usagelog_user_id_created_at",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{UsageLogsColumns[29], UsageLogsColumns[25]},
|
||||
Columns: []*schema.Column{UsageLogsColumns[30], UsageLogsColumns[26]},
|
||||
},
|
||||
{
|
||||
Name: "usagelog_api_key_id_created_at",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{UsageLogsColumns[26], UsageLogsColumns[25]},
|
||||
Columns: []*schema.Column{UsageLogsColumns[27], UsageLogsColumns[26]},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -3836,61 +3836,69 @@ func (m *AccountGroupMutation) ResetEdge(name string) error {
|
||||
// GroupMutation represents an operation that mutates the Group nodes in the graph.
|
||||
type GroupMutation struct {
|
||||
config
|
||||
op Op
|
||||
typ string
|
||||
id *int64
|
||||
created_at *time.Time
|
||||
updated_at *time.Time
|
||||
deleted_at *time.Time
|
||||
name *string
|
||||
description *string
|
||||
rate_multiplier *float64
|
||||
addrate_multiplier *float64
|
||||
is_exclusive *bool
|
||||
status *string
|
||||
platform *string
|
||||
subscription_type *string
|
||||
daily_limit_usd *float64
|
||||
adddaily_limit_usd *float64
|
||||
weekly_limit_usd *float64
|
||||
addweekly_limit_usd *float64
|
||||
monthly_limit_usd *float64
|
||||
addmonthly_limit_usd *float64
|
||||
default_validity_days *int
|
||||
adddefault_validity_days *int
|
||||
image_price_1k *float64
|
||||
addimage_price_1k *float64
|
||||
image_price_2k *float64
|
||||
addimage_price_2k *float64
|
||||
image_price_4k *float64
|
||||
addimage_price_4k *float64
|
||||
claude_code_only *bool
|
||||
fallback_group_id *int64
|
||||
addfallback_group_id *int64
|
||||
model_routing *map[string][]int64
|
||||
model_routing_enabled *bool
|
||||
clearedFields map[string]struct{}
|
||||
api_keys map[int64]struct{}
|
||||
removedapi_keys map[int64]struct{}
|
||||
clearedapi_keys bool
|
||||
redeem_codes map[int64]struct{}
|
||||
removedredeem_codes map[int64]struct{}
|
||||
clearedredeem_codes bool
|
||||
subscriptions map[int64]struct{}
|
||||
removedsubscriptions map[int64]struct{}
|
||||
clearedsubscriptions bool
|
||||
usage_logs map[int64]struct{}
|
||||
removedusage_logs map[int64]struct{}
|
||||
clearedusage_logs bool
|
||||
accounts map[int64]struct{}
|
||||
removedaccounts map[int64]struct{}
|
||||
clearedaccounts bool
|
||||
allowed_users map[int64]struct{}
|
||||
removedallowed_users map[int64]struct{}
|
||||
clearedallowed_users bool
|
||||
done bool
|
||||
oldValue func(context.Context) (*Group, error)
|
||||
predicates []predicate.Group
|
||||
op Op
|
||||
typ string
|
||||
id *int64
|
||||
created_at *time.Time
|
||||
updated_at *time.Time
|
||||
deleted_at *time.Time
|
||||
name *string
|
||||
description *string
|
||||
rate_multiplier *float64
|
||||
addrate_multiplier *float64
|
||||
is_exclusive *bool
|
||||
status *string
|
||||
platform *string
|
||||
subscription_type *string
|
||||
daily_limit_usd *float64
|
||||
adddaily_limit_usd *float64
|
||||
weekly_limit_usd *float64
|
||||
addweekly_limit_usd *float64
|
||||
monthly_limit_usd *float64
|
||||
addmonthly_limit_usd *float64
|
||||
default_validity_days *int
|
||||
adddefault_validity_days *int
|
||||
image_price_1k *float64
|
||||
addimage_price_1k *float64
|
||||
image_price_2k *float64
|
||||
addimage_price_2k *float64
|
||||
image_price_4k *float64
|
||||
addimage_price_4k *float64
|
||||
sora_image_price_360 *float64
|
||||
addsora_image_price_360 *float64
|
||||
sora_image_price_540 *float64
|
||||
addsora_image_price_540 *float64
|
||||
sora_video_price_per_request *float64
|
||||
addsora_video_price_per_request *float64
|
||||
sora_video_price_per_request_hd *float64
|
||||
addsora_video_price_per_request_hd *float64
|
||||
claude_code_only *bool
|
||||
fallback_group_id *int64
|
||||
addfallback_group_id *int64
|
||||
model_routing *map[string][]int64
|
||||
model_routing_enabled *bool
|
||||
clearedFields map[string]struct{}
|
||||
api_keys map[int64]struct{}
|
||||
removedapi_keys map[int64]struct{}
|
||||
clearedapi_keys bool
|
||||
redeem_codes map[int64]struct{}
|
||||
removedredeem_codes map[int64]struct{}
|
||||
clearedredeem_codes bool
|
||||
subscriptions map[int64]struct{}
|
||||
removedsubscriptions map[int64]struct{}
|
||||
clearedsubscriptions bool
|
||||
usage_logs map[int64]struct{}
|
||||
removedusage_logs map[int64]struct{}
|
||||
clearedusage_logs bool
|
||||
accounts map[int64]struct{}
|
||||
removedaccounts map[int64]struct{}
|
||||
clearedaccounts bool
|
||||
allowed_users map[int64]struct{}
|
||||
removedallowed_users map[int64]struct{}
|
||||
clearedallowed_users bool
|
||||
done bool
|
||||
oldValue func(context.Context) (*Group, error)
|
||||
predicates []predicate.Group
|
||||
}
|
||||
|
||||
var _ ent.Mutation = (*GroupMutation)(nil)
|
||||
@@ -4873,6 +4881,286 @@ func (m *GroupMutation) ResetImagePrice4k() {
|
||||
delete(m.clearedFields, group.FieldImagePrice4k)
|
||||
}
|
||||
|
||||
// SetSoraImagePrice360 sets the "sora_image_price_360" field.
|
||||
func (m *GroupMutation) SetSoraImagePrice360(f float64) {
|
||||
m.sora_image_price_360 = &f
|
||||
m.addsora_image_price_360 = nil
|
||||
}
|
||||
|
||||
// SoraImagePrice360 returns the value of the "sora_image_price_360" field in the mutation.
|
||||
func (m *GroupMutation) SoraImagePrice360() (r float64, exists bool) {
|
||||
v := m.sora_image_price_360
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldSoraImagePrice360 returns the old "sora_image_price_360" field's value of the Group entity.
|
||||
// If the Group object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *GroupMutation) OldSoraImagePrice360(ctx context.Context) (v *float64, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldSoraImagePrice360 is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldSoraImagePrice360 requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldSoraImagePrice360: %w", err)
|
||||
}
|
||||
return oldValue.SoraImagePrice360, nil
|
||||
}
|
||||
|
||||
// AddSoraImagePrice360 adds f to the "sora_image_price_360" field.
|
||||
func (m *GroupMutation) AddSoraImagePrice360(f float64) {
|
||||
if m.addsora_image_price_360 != nil {
|
||||
*m.addsora_image_price_360 += f
|
||||
} else {
|
||||
m.addsora_image_price_360 = &f
|
||||
}
|
||||
}
|
||||
|
||||
// AddedSoraImagePrice360 returns the value that was added to the "sora_image_price_360" field in this mutation.
|
||||
func (m *GroupMutation) AddedSoraImagePrice360() (r float64, exists bool) {
|
||||
v := m.addsora_image_price_360
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearSoraImagePrice360 clears the value of the "sora_image_price_360" field.
|
||||
func (m *GroupMutation) ClearSoraImagePrice360() {
|
||||
m.sora_image_price_360 = nil
|
||||
m.addsora_image_price_360 = nil
|
||||
m.clearedFields[group.FieldSoraImagePrice360] = struct{}{}
|
||||
}
|
||||
|
||||
// SoraImagePrice360Cleared returns if the "sora_image_price_360" field was cleared in this mutation.
|
||||
func (m *GroupMutation) SoraImagePrice360Cleared() bool {
|
||||
_, ok := m.clearedFields[group.FieldSoraImagePrice360]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetSoraImagePrice360 resets all changes to the "sora_image_price_360" field.
|
||||
func (m *GroupMutation) ResetSoraImagePrice360() {
|
||||
m.sora_image_price_360 = nil
|
||||
m.addsora_image_price_360 = nil
|
||||
delete(m.clearedFields, group.FieldSoraImagePrice360)
|
||||
}
|
||||
|
||||
// SetSoraImagePrice540 sets the "sora_image_price_540" field.
|
||||
func (m *GroupMutation) SetSoraImagePrice540(f float64) {
|
||||
m.sora_image_price_540 = &f
|
||||
m.addsora_image_price_540 = nil
|
||||
}
|
||||
|
||||
// SoraImagePrice540 returns the value of the "sora_image_price_540" field in the mutation.
|
||||
func (m *GroupMutation) SoraImagePrice540() (r float64, exists bool) {
|
||||
v := m.sora_image_price_540
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldSoraImagePrice540 returns the old "sora_image_price_540" field's value of the Group entity.
|
||||
// If the Group object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *GroupMutation) OldSoraImagePrice540(ctx context.Context) (v *float64, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldSoraImagePrice540 is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldSoraImagePrice540 requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldSoraImagePrice540: %w", err)
|
||||
}
|
||||
return oldValue.SoraImagePrice540, nil
|
||||
}
|
||||
|
||||
// AddSoraImagePrice540 adds f to the "sora_image_price_540" field.
|
||||
func (m *GroupMutation) AddSoraImagePrice540(f float64) {
|
||||
if m.addsora_image_price_540 != nil {
|
||||
*m.addsora_image_price_540 += f
|
||||
} else {
|
||||
m.addsora_image_price_540 = &f
|
||||
}
|
||||
}
|
||||
|
||||
// AddedSoraImagePrice540 returns the value that was added to the "sora_image_price_540" field in this mutation.
|
||||
func (m *GroupMutation) AddedSoraImagePrice540() (r float64, exists bool) {
|
||||
v := m.addsora_image_price_540
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearSoraImagePrice540 clears the value of the "sora_image_price_540" field.
|
||||
func (m *GroupMutation) ClearSoraImagePrice540() {
|
||||
m.sora_image_price_540 = nil
|
||||
m.addsora_image_price_540 = nil
|
||||
m.clearedFields[group.FieldSoraImagePrice540] = struct{}{}
|
||||
}
|
||||
|
||||
// SoraImagePrice540Cleared returns if the "sora_image_price_540" field was cleared in this mutation.
|
||||
func (m *GroupMutation) SoraImagePrice540Cleared() bool {
|
||||
_, ok := m.clearedFields[group.FieldSoraImagePrice540]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetSoraImagePrice540 resets all changes to the "sora_image_price_540" field.
|
||||
func (m *GroupMutation) ResetSoraImagePrice540() {
|
||||
m.sora_image_price_540 = nil
|
||||
m.addsora_image_price_540 = nil
|
||||
delete(m.clearedFields, group.FieldSoraImagePrice540)
|
||||
}
|
||||
|
||||
// SetSoraVideoPricePerRequest sets the "sora_video_price_per_request" field.
|
||||
func (m *GroupMutation) SetSoraVideoPricePerRequest(f float64) {
|
||||
m.sora_video_price_per_request = &f
|
||||
m.addsora_video_price_per_request = nil
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequest returns the value of the "sora_video_price_per_request" field in the mutation.
|
||||
func (m *GroupMutation) SoraVideoPricePerRequest() (r float64, exists bool) {
|
||||
v := m.sora_video_price_per_request
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldSoraVideoPricePerRequest returns the old "sora_video_price_per_request" field's value of the Group entity.
|
||||
// If the Group object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *GroupMutation) OldSoraVideoPricePerRequest(ctx context.Context) (v *float64, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldSoraVideoPricePerRequest is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldSoraVideoPricePerRequest requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldSoraVideoPricePerRequest: %w", err)
|
||||
}
|
||||
return oldValue.SoraVideoPricePerRequest, nil
|
||||
}
|
||||
|
||||
// AddSoraVideoPricePerRequest adds f to the "sora_video_price_per_request" field.
|
||||
func (m *GroupMutation) AddSoraVideoPricePerRequest(f float64) {
|
||||
if m.addsora_video_price_per_request != nil {
|
||||
*m.addsora_video_price_per_request += f
|
||||
} else {
|
||||
m.addsora_video_price_per_request = &f
|
||||
}
|
||||
}
|
||||
|
||||
// AddedSoraVideoPricePerRequest returns the value that was added to the "sora_video_price_per_request" field in this mutation.
|
||||
func (m *GroupMutation) AddedSoraVideoPricePerRequest() (r float64, exists bool) {
|
||||
v := m.addsora_video_price_per_request
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearSoraVideoPricePerRequest clears the value of the "sora_video_price_per_request" field.
|
||||
func (m *GroupMutation) ClearSoraVideoPricePerRequest() {
|
||||
m.sora_video_price_per_request = nil
|
||||
m.addsora_video_price_per_request = nil
|
||||
m.clearedFields[group.FieldSoraVideoPricePerRequest] = struct{}{}
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestCleared returns if the "sora_video_price_per_request" field was cleared in this mutation.
|
||||
func (m *GroupMutation) SoraVideoPricePerRequestCleared() bool {
|
||||
_, ok := m.clearedFields[group.FieldSoraVideoPricePerRequest]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetSoraVideoPricePerRequest resets all changes to the "sora_video_price_per_request" field.
|
||||
func (m *GroupMutation) ResetSoraVideoPricePerRequest() {
|
||||
m.sora_video_price_per_request = nil
|
||||
m.addsora_video_price_per_request = nil
|
||||
delete(m.clearedFields, group.FieldSoraVideoPricePerRequest)
|
||||
}
|
||||
|
||||
// SetSoraVideoPricePerRequestHd sets the "sora_video_price_per_request_hd" field.
|
||||
func (m *GroupMutation) SetSoraVideoPricePerRequestHd(f float64) {
|
||||
m.sora_video_price_per_request_hd = &f
|
||||
m.addsora_video_price_per_request_hd = nil
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestHd returns the value of the "sora_video_price_per_request_hd" field in the mutation.
|
||||
func (m *GroupMutation) SoraVideoPricePerRequestHd() (r float64, exists bool) {
|
||||
v := m.sora_video_price_per_request_hd
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldSoraVideoPricePerRequestHd returns the old "sora_video_price_per_request_hd" field's value of the Group entity.
|
||||
// If the Group object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *GroupMutation) OldSoraVideoPricePerRequestHd(ctx context.Context) (v *float64, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldSoraVideoPricePerRequestHd is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldSoraVideoPricePerRequestHd requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldSoraVideoPricePerRequestHd: %w", err)
|
||||
}
|
||||
return oldValue.SoraVideoPricePerRequestHd, nil
|
||||
}
|
||||
|
||||
// AddSoraVideoPricePerRequestHd adds f to the "sora_video_price_per_request_hd" field.
|
||||
func (m *GroupMutation) AddSoraVideoPricePerRequestHd(f float64) {
|
||||
if m.addsora_video_price_per_request_hd != nil {
|
||||
*m.addsora_video_price_per_request_hd += f
|
||||
} else {
|
||||
m.addsora_video_price_per_request_hd = &f
|
||||
}
|
||||
}
|
||||
|
||||
// AddedSoraVideoPricePerRequestHd returns the value that was added to the "sora_video_price_per_request_hd" field in this mutation.
|
||||
func (m *GroupMutation) AddedSoraVideoPricePerRequestHd() (r float64, exists bool) {
|
||||
v := m.addsora_video_price_per_request_hd
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearSoraVideoPricePerRequestHd clears the value of the "sora_video_price_per_request_hd" field.
|
||||
func (m *GroupMutation) ClearSoraVideoPricePerRequestHd() {
|
||||
m.sora_video_price_per_request_hd = nil
|
||||
m.addsora_video_price_per_request_hd = nil
|
||||
m.clearedFields[group.FieldSoraVideoPricePerRequestHd] = struct{}{}
|
||||
}
|
||||
|
||||
// SoraVideoPricePerRequestHdCleared returns if the "sora_video_price_per_request_hd" field was cleared in this mutation.
|
||||
func (m *GroupMutation) SoraVideoPricePerRequestHdCleared() bool {
|
||||
_, ok := m.clearedFields[group.FieldSoraVideoPricePerRequestHd]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetSoraVideoPricePerRequestHd resets all changes to the "sora_video_price_per_request_hd" field.
|
||||
func (m *GroupMutation) ResetSoraVideoPricePerRequestHd() {
|
||||
m.sora_video_price_per_request_hd = nil
|
||||
m.addsora_video_price_per_request_hd = nil
|
||||
delete(m.clearedFields, group.FieldSoraVideoPricePerRequestHd)
|
||||
}
|
||||
|
||||
// SetClaudeCodeOnly sets the "claude_code_only" field.
|
||||
func (m *GroupMutation) SetClaudeCodeOnly(b bool) {
|
||||
m.claude_code_only = &b
|
||||
@@ -5422,7 +5710,7 @@ func (m *GroupMutation) Type() string {
|
||||
// order to get all numeric fields that were incremented/decremented, call
|
||||
// AddedFields().
|
||||
func (m *GroupMutation) Fields() []string {
|
||||
fields := make([]string, 0, 21)
|
||||
fields := make([]string, 0, 25)
|
||||
if m.created_at != nil {
|
||||
fields = append(fields, group.FieldCreatedAt)
|
||||
}
|
||||
@@ -5474,6 +5762,18 @@ func (m *GroupMutation) Fields() []string {
|
||||
if m.image_price_4k != nil {
|
||||
fields = append(fields, group.FieldImagePrice4k)
|
||||
}
|
||||
if m.sora_image_price_360 != nil {
|
||||
fields = append(fields, group.FieldSoraImagePrice360)
|
||||
}
|
||||
if m.sora_image_price_540 != nil {
|
||||
fields = append(fields, group.FieldSoraImagePrice540)
|
||||
}
|
||||
if m.sora_video_price_per_request != nil {
|
||||
fields = append(fields, group.FieldSoraVideoPricePerRequest)
|
||||
}
|
||||
if m.sora_video_price_per_request_hd != nil {
|
||||
fields = append(fields, group.FieldSoraVideoPricePerRequestHd)
|
||||
}
|
||||
if m.claude_code_only != nil {
|
||||
fields = append(fields, group.FieldClaudeCodeOnly)
|
||||
}
|
||||
@@ -5528,6 +5828,14 @@ func (m *GroupMutation) Field(name string) (ent.Value, bool) {
|
||||
return m.ImagePrice2k()
|
||||
case group.FieldImagePrice4k:
|
||||
return m.ImagePrice4k()
|
||||
case group.FieldSoraImagePrice360:
|
||||
return m.SoraImagePrice360()
|
||||
case group.FieldSoraImagePrice540:
|
||||
return m.SoraImagePrice540()
|
||||
case group.FieldSoraVideoPricePerRequest:
|
||||
return m.SoraVideoPricePerRequest()
|
||||
case group.FieldSoraVideoPricePerRequestHd:
|
||||
return m.SoraVideoPricePerRequestHd()
|
||||
case group.FieldClaudeCodeOnly:
|
||||
return m.ClaudeCodeOnly()
|
||||
case group.FieldFallbackGroupID:
|
||||
@@ -5579,6 +5887,14 @@ func (m *GroupMutation) OldField(ctx context.Context, name string) (ent.Value, e
|
||||
return m.OldImagePrice2k(ctx)
|
||||
case group.FieldImagePrice4k:
|
||||
return m.OldImagePrice4k(ctx)
|
||||
case group.FieldSoraImagePrice360:
|
||||
return m.OldSoraImagePrice360(ctx)
|
||||
case group.FieldSoraImagePrice540:
|
||||
return m.OldSoraImagePrice540(ctx)
|
||||
case group.FieldSoraVideoPricePerRequest:
|
||||
return m.OldSoraVideoPricePerRequest(ctx)
|
||||
case group.FieldSoraVideoPricePerRequestHd:
|
||||
return m.OldSoraVideoPricePerRequestHd(ctx)
|
||||
case group.FieldClaudeCodeOnly:
|
||||
return m.OldClaudeCodeOnly(ctx)
|
||||
case group.FieldFallbackGroupID:
|
||||
@@ -5715,6 +6031,34 @@ func (m *GroupMutation) SetField(name string, value ent.Value) error {
|
||||
}
|
||||
m.SetImagePrice4k(v)
|
||||
return nil
|
||||
case group.FieldSoraImagePrice360:
|
||||
v, ok := value.(float64)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetSoraImagePrice360(v)
|
||||
return nil
|
||||
case group.FieldSoraImagePrice540:
|
||||
v, ok := value.(float64)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetSoraImagePrice540(v)
|
||||
return nil
|
||||
case group.FieldSoraVideoPricePerRequest:
|
||||
v, ok := value.(float64)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetSoraVideoPricePerRequest(v)
|
||||
return nil
|
||||
case group.FieldSoraVideoPricePerRequestHd:
|
||||
v, ok := value.(float64)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetSoraVideoPricePerRequestHd(v)
|
||||
return nil
|
||||
case group.FieldClaudeCodeOnly:
|
||||
v, ok := value.(bool)
|
||||
if !ok {
|
||||
@@ -5775,6 +6119,18 @@ func (m *GroupMutation) AddedFields() []string {
|
||||
if m.addimage_price_4k != nil {
|
||||
fields = append(fields, group.FieldImagePrice4k)
|
||||
}
|
||||
if m.addsora_image_price_360 != nil {
|
||||
fields = append(fields, group.FieldSoraImagePrice360)
|
||||
}
|
||||
if m.addsora_image_price_540 != nil {
|
||||
fields = append(fields, group.FieldSoraImagePrice540)
|
||||
}
|
||||
if m.addsora_video_price_per_request != nil {
|
||||
fields = append(fields, group.FieldSoraVideoPricePerRequest)
|
||||
}
|
||||
if m.addsora_video_price_per_request_hd != nil {
|
||||
fields = append(fields, group.FieldSoraVideoPricePerRequestHd)
|
||||
}
|
||||
if m.addfallback_group_id != nil {
|
||||
fields = append(fields, group.FieldFallbackGroupID)
|
||||
}
|
||||
@@ -5802,6 +6158,14 @@ func (m *GroupMutation) AddedField(name string) (ent.Value, bool) {
|
||||
return m.AddedImagePrice2k()
|
||||
case group.FieldImagePrice4k:
|
||||
return m.AddedImagePrice4k()
|
||||
case group.FieldSoraImagePrice360:
|
||||
return m.AddedSoraImagePrice360()
|
||||
case group.FieldSoraImagePrice540:
|
||||
return m.AddedSoraImagePrice540()
|
||||
case group.FieldSoraVideoPricePerRequest:
|
||||
return m.AddedSoraVideoPricePerRequest()
|
||||
case group.FieldSoraVideoPricePerRequestHd:
|
||||
return m.AddedSoraVideoPricePerRequestHd()
|
||||
case group.FieldFallbackGroupID:
|
||||
return m.AddedFallbackGroupID()
|
||||
}
|
||||
@@ -5869,6 +6233,34 @@ func (m *GroupMutation) AddField(name string, value ent.Value) error {
|
||||
}
|
||||
m.AddImagePrice4k(v)
|
||||
return nil
|
||||
case group.FieldSoraImagePrice360:
|
||||
v, ok := value.(float64)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddSoraImagePrice360(v)
|
||||
return nil
|
||||
case group.FieldSoraImagePrice540:
|
||||
v, ok := value.(float64)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddSoraImagePrice540(v)
|
||||
return nil
|
||||
case group.FieldSoraVideoPricePerRequest:
|
||||
v, ok := value.(float64)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddSoraVideoPricePerRequest(v)
|
||||
return nil
|
||||
case group.FieldSoraVideoPricePerRequestHd:
|
||||
v, ok := value.(float64)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddSoraVideoPricePerRequestHd(v)
|
||||
return nil
|
||||
case group.FieldFallbackGroupID:
|
||||
v, ok := value.(int64)
|
||||
if !ok {
|
||||
@@ -5908,6 +6300,18 @@ func (m *GroupMutation) ClearedFields() []string {
|
||||
if m.FieldCleared(group.FieldImagePrice4k) {
|
||||
fields = append(fields, group.FieldImagePrice4k)
|
||||
}
|
||||
if m.FieldCleared(group.FieldSoraImagePrice360) {
|
||||
fields = append(fields, group.FieldSoraImagePrice360)
|
||||
}
|
||||
if m.FieldCleared(group.FieldSoraImagePrice540) {
|
||||
fields = append(fields, group.FieldSoraImagePrice540)
|
||||
}
|
||||
if m.FieldCleared(group.FieldSoraVideoPricePerRequest) {
|
||||
fields = append(fields, group.FieldSoraVideoPricePerRequest)
|
||||
}
|
||||
if m.FieldCleared(group.FieldSoraVideoPricePerRequestHd) {
|
||||
fields = append(fields, group.FieldSoraVideoPricePerRequestHd)
|
||||
}
|
||||
if m.FieldCleared(group.FieldFallbackGroupID) {
|
||||
fields = append(fields, group.FieldFallbackGroupID)
|
||||
}
|
||||
@@ -5952,6 +6356,18 @@ func (m *GroupMutation) ClearField(name string) error {
|
||||
case group.FieldImagePrice4k:
|
||||
m.ClearImagePrice4k()
|
||||
return nil
|
||||
case group.FieldSoraImagePrice360:
|
||||
m.ClearSoraImagePrice360()
|
||||
return nil
|
||||
case group.FieldSoraImagePrice540:
|
||||
m.ClearSoraImagePrice540()
|
||||
return nil
|
||||
case group.FieldSoraVideoPricePerRequest:
|
||||
m.ClearSoraVideoPricePerRequest()
|
||||
return nil
|
||||
case group.FieldSoraVideoPricePerRequestHd:
|
||||
m.ClearSoraVideoPricePerRequestHd()
|
||||
return nil
|
||||
case group.FieldFallbackGroupID:
|
||||
m.ClearFallbackGroupID()
|
||||
return nil
|
||||
@@ -6017,6 +6433,18 @@ func (m *GroupMutation) ResetField(name string) error {
|
||||
case group.FieldImagePrice4k:
|
||||
m.ResetImagePrice4k()
|
||||
return nil
|
||||
case group.FieldSoraImagePrice360:
|
||||
m.ResetSoraImagePrice360()
|
||||
return nil
|
||||
case group.FieldSoraImagePrice540:
|
||||
m.ResetSoraImagePrice540()
|
||||
return nil
|
||||
case group.FieldSoraVideoPricePerRequest:
|
||||
m.ResetSoraVideoPricePerRequest()
|
||||
return nil
|
||||
case group.FieldSoraVideoPricePerRequestHd:
|
||||
m.ResetSoraVideoPricePerRequestHd()
|
||||
return nil
|
||||
case group.FieldClaudeCodeOnly:
|
||||
m.ResetClaudeCodeOnly()
|
||||
return nil
|
||||
@@ -11504,6 +11932,7 @@ type UsageLogMutation struct {
|
||||
image_count *int
|
||||
addimage_count *int
|
||||
image_size *string
|
||||
media_type *string
|
||||
created_at *time.Time
|
||||
clearedFields map[string]struct{}
|
||||
user *int64
|
||||
@@ -13130,6 +13559,55 @@ func (m *UsageLogMutation) ResetImageSize() {
|
||||
delete(m.clearedFields, usagelog.FieldImageSize)
|
||||
}
|
||||
|
||||
// SetMediaType sets the "media_type" field.
|
||||
func (m *UsageLogMutation) SetMediaType(s string) {
|
||||
m.media_type = &s
|
||||
}
|
||||
|
||||
// MediaType returns the value of the "media_type" field in the mutation.
|
||||
func (m *UsageLogMutation) MediaType() (r string, exists bool) {
|
||||
v := m.media_type
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldMediaType returns the old "media_type" field's value of the UsageLog entity.
|
||||
// If the UsageLog object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *UsageLogMutation) OldMediaType(ctx context.Context) (v *string, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldMediaType is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldMediaType requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldMediaType: %w", err)
|
||||
}
|
||||
return oldValue.MediaType, nil
|
||||
}
|
||||
|
||||
// ClearMediaType clears the value of the "media_type" field.
|
||||
func (m *UsageLogMutation) ClearMediaType() {
|
||||
m.media_type = nil
|
||||
m.clearedFields[usagelog.FieldMediaType] = struct{}{}
|
||||
}
|
||||
|
||||
// MediaTypeCleared returns if the "media_type" field was cleared in this mutation.
|
||||
func (m *UsageLogMutation) MediaTypeCleared() bool {
|
||||
_, ok := m.clearedFields[usagelog.FieldMediaType]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetMediaType resets all changes to the "media_type" field.
|
||||
func (m *UsageLogMutation) ResetMediaType() {
|
||||
m.media_type = nil
|
||||
delete(m.clearedFields, usagelog.FieldMediaType)
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (m *UsageLogMutation) SetCreatedAt(t time.Time) {
|
||||
m.created_at = &t
|
||||
@@ -13335,7 +13813,7 @@ func (m *UsageLogMutation) Type() string {
|
||||
// order to get all numeric fields that were incremented/decremented, call
|
||||
// AddedFields().
|
||||
func (m *UsageLogMutation) Fields() []string {
|
||||
fields := make([]string, 0, 30)
|
||||
fields := make([]string, 0, 31)
|
||||
if m.user != nil {
|
||||
fields = append(fields, usagelog.FieldUserID)
|
||||
}
|
||||
@@ -13423,6 +13901,9 @@ func (m *UsageLogMutation) Fields() []string {
|
||||
if m.image_size != nil {
|
||||
fields = append(fields, usagelog.FieldImageSize)
|
||||
}
|
||||
if m.media_type != nil {
|
||||
fields = append(fields, usagelog.FieldMediaType)
|
||||
}
|
||||
if m.created_at != nil {
|
||||
fields = append(fields, usagelog.FieldCreatedAt)
|
||||
}
|
||||
@@ -13492,6 +13973,8 @@ func (m *UsageLogMutation) Field(name string) (ent.Value, bool) {
|
||||
return m.ImageCount()
|
||||
case usagelog.FieldImageSize:
|
||||
return m.ImageSize()
|
||||
case usagelog.FieldMediaType:
|
||||
return m.MediaType()
|
||||
case usagelog.FieldCreatedAt:
|
||||
return m.CreatedAt()
|
||||
}
|
||||
@@ -13561,6 +14044,8 @@ func (m *UsageLogMutation) OldField(ctx context.Context, name string) (ent.Value
|
||||
return m.OldImageCount(ctx)
|
||||
case usagelog.FieldImageSize:
|
||||
return m.OldImageSize(ctx)
|
||||
case usagelog.FieldMediaType:
|
||||
return m.OldMediaType(ctx)
|
||||
case usagelog.FieldCreatedAt:
|
||||
return m.OldCreatedAt(ctx)
|
||||
}
|
||||
@@ -13775,6 +14260,13 @@ func (m *UsageLogMutation) SetField(name string, value ent.Value) error {
|
||||
}
|
||||
m.SetImageSize(v)
|
||||
return nil
|
||||
case usagelog.FieldMediaType:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetMediaType(v)
|
||||
return nil
|
||||
case usagelog.FieldCreatedAt:
|
||||
v, ok := value.(time.Time)
|
||||
if !ok {
|
||||
@@ -14055,6 +14547,9 @@ func (m *UsageLogMutation) ClearedFields() []string {
|
||||
if m.FieldCleared(usagelog.FieldImageSize) {
|
||||
fields = append(fields, usagelog.FieldImageSize)
|
||||
}
|
||||
if m.FieldCleared(usagelog.FieldMediaType) {
|
||||
fields = append(fields, usagelog.FieldMediaType)
|
||||
}
|
||||
return fields
|
||||
}
|
||||
|
||||
@@ -14093,6 +14588,9 @@ func (m *UsageLogMutation) ClearField(name string) error {
|
||||
case usagelog.FieldImageSize:
|
||||
m.ClearImageSize()
|
||||
return nil
|
||||
case usagelog.FieldMediaType:
|
||||
m.ClearMediaType()
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown UsageLog nullable field %s", name)
|
||||
}
|
||||
@@ -14188,6 +14686,9 @@ func (m *UsageLogMutation) ResetField(name string) error {
|
||||
case usagelog.FieldImageSize:
|
||||
m.ResetImageSize()
|
||||
return nil
|
||||
case usagelog.FieldMediaType:
|
||||
m.ResetMediaType()
|
||||
return nil
|
||||
case usagelog.FieldCreatedAt:
|
||||
m.ResetCreatedAt()
|
||||
return nil
|
||||
|
||||
@@ -278,11 +278,11 @@ func init() {
|
||||
// group.DefaultDefaultValidityDays holds the default value on creation for the default_validity_days field.
|
||||
group.DefaultDefaultValidityDays = groupDescDefaultValidityDays.Default.(int)
|
||||
// groupDescClaudeCodeOnly is the schema descriptor for claude_code_only field.
|
||||
groupDescClaudeCodeOnly := groupFields[14].Descriptor()
|
||||
groupDescClaudeCodeOnly := groupFields[18].Descriptor()
|
||||
// group.DefaultClaudeCodeOnly holds the default value on creation for the claude_code_only field.
|
||||
group.DefaultClaudeCodeOnly = groupDescClaudeCodeOnly.Default.(bool)
|
||||
// groupDescModelRoutingEnabled is the schema descriptor for model_routing_enabled field.
|
||||
groupDescModelRoutingEnabled := groupFields[17].Descriptor()
|
||||
groupDescModelRoutingEnabled := groupFields[21].Descriptor()
|
||||
// group.DefaultModelRoutingEnabled holds the default value on creation for the model_routing_enabled field.
|
||||
group.DefaultModelRoutingEnabled = groupDescModelRoutingEnabled.Default.(bool)
|
||||
promocodeFields := schema.PromoCode{}.Fields()
|
||||
@@ -647,8 +647,12 @@ func init() {
|
||||
usagelogDescImageSize := usagelogFields[28].Descriptor()
|
||||
// usagelog.ImageSizeValidator is a validator for the "image_size" field. It is called by the builders before save.
|
||||
usagelog.ImageSizeValidator = usagelogDescImageSize.Validators[0].(func(string) error)
|
||||
// usagelogDescMediaType is the schema descriptor for media_type field.
|
||||
usagelogDescMediaType := usagelogFields[29].Descriptor()
|
||||
// usagelog.MediaTypeValidator is a validator for the "media_type" field. It is called by the builders before save.
|
||||
usagelog.MediaTypeValidator = usagelogDescMediaType.Validators[0].(func(string) error)
|
||||
// usagelogDescCreatedAt is the schema descriptor for created_at field.
|
||||
usagelogDescCreatedAt := usagelogFields[29].Descriptor()
|
||||
usagelogDescCreatedAt := usagelogFields[30].Descriptor()
|
||||
// usagelog.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
usagelog.DefaultCreatedAt = usagelogDescCreatedAt.Default.(func() time.Time)
|
||||
userMixin := schema.User{}.Mixin()
|
||||
|
||||
@@ -87,6 +87,24 @@ func (Group) Fields() []ent.Field {
|
||||
Nillable().
|
||||
SchemaType(map[string]string{dialect.Postgres: "decimal(20,8)"}),
|
||||
|
||||
// Sora 按次计费配置(阶段 1)
|
||||
field.Float("sora_image_price_360").
|
||||
Optional().
|
||||
Nillable().
|
||||
SchemaType(map[string]string{dialect.Postgres: "decimal(20,8)"}),
|
||||
field.Float("sora_image_price_540").
|
||||
Optional().
|
||||
Nillable().
|
||||
SchemaType(map[string]string{dialect.Postgres: "decimal(20,8)"}),
|
||||
field.Float("sora_video_price_per_request").
|
||||
Optional().
|
||||
Nillable().
|
||||
SchemaType(map[string]string{dialect.Postgres: "decimal(20,8)"}),
|
||||
field.Float("sora_video_price_per_request_hd").
|
||||
Optional().
|
||||
Nillable().
|
||||
SchemaType(map[string]string{dialect.Postgres: "decimal(20,8)"}),
|
||||
|
||||
// Claude Code 客户端限制 (added by migration 029)
|
||||
field.Bool("claude_code_only").
|
||||
Default(false).
|
||||
|
||||
@@ -118,6 +118,11 @@ func (UsageLog) Fields() []ent.Field {
|
||||
MaxLen(10).
|
||||
Optional().
|
||||
Nillable(),
|
||||
// 媒体类型字段(sora 使用)
|
||||
field.String("media_type").
|
||||
MaxLen(16).
|
||||
Optional().
|
||||
Nillable(),
|
||||
|
||||
// 时间戳(只有 created_at,日志不可修改)
|
||||
field.Time("created_at").
|
||||
|
||||
@@ -80,6 +80,8 @@ type UsageLog struct {
|
||||
ImageCount int `json:"image_count,omitempty"`
|
||||
// ImageSize holds the value of the "image_size" field.
|
||||
ImageSize *string `json:"image_size,omitempty"`
|
||||
// MediaType holds the value of the "media_type" field.
|
||||
MediaType *string `json:"media_type,omitempty"`
|
||||
// CreatedAt holds the value of the "created_at" field.
|
||||
CreatedAt time.Time `json:"created_at,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
@@ -171,7 +173,7 @@ func (*UsageLog) scanValues(columns []string) ([]any, error) {
|
||||
values[i] = new(sql.NullFloat64)
|
||||
case usagelog.FieldID, usagelog.FieldUserID, usagelog.FieldAPIKeyID, usagelog.FieldAccountID, usagelog.FieldGroupID, usagelog.FieldSubscriptionID, usagelog.FieldInputTokens, usagelog.FieldOutputTokens, usagelog.FieldCacheCreationTokens, usagelog.FieldCacheReadTokens, usagelog.FieldCacheCreation5mTokens, usagelog.FieldCacheCreation1hTokens, usagelog.FieldBillingType, usagelog.FieldDurationMs, usagelog.FieldFirstTokenMs, usagelog.FieldImageCount:
|
||||
values[i] = new(sql.NullInt64)
|
||||
case usagelog.FieldRequestID, usagelog.FieldModel, usagelog.FieldUserAgent, usagelog.FieldIPAddress, usagelog.FieldImageSize:
|
||||
case usagelog.FieldRequestID, usagelog.FieldModel, usagelog.FieldUserAgent, usagelog.FieldIPAddress, usagelog.FieldImageSize, usagelog.FieldMediaType:
|
||||
values[i] = new(sql.NullString)
|
||||
case usagelog.FieldCreatedAt:
|
||||
values[i] = new(sql.NullTime)
|
||||
@@ -378,6 +380,13 @@ func (_m *UsageLog) assignValues(columns []string, values []any) error {
|
||||
_m.ImageSize = new(string)
|
||||
*_m.ImageSize = value.String
|
||||
}
|
||||
case usagelog.FieldMediaType:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field media_type", values[i])
|
||||
} else if value.Valid {
|
||||
_m.MediaType = new(string)
|
||||
*_m.MediaType = value.String
|
||||
}
|
||||
case usagelog.FieldCreatedAt:
|
||||
if value, ok := values[i].(*sql.NullTime); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field created_at", values[i])
|
||||
@@ -548,6 +557,11 @@ func (_m *UsageLog) String() string {
|
||||
builder.WriteString(*v)
|
||||
}
|
||||
builder.WriteString(", ")
|
||||
if v := _m.MediaType; v != nil {
|
||||
builder.WriteString("media_type=")
|
||||
builder.WriteString(*v)
|
||||
}
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("created_at=")
|
||||
builder.WriteString(_m.CreatedAt.Format(time.ANSIC))
|
||||
builder.WriteByte(')')
|
||||
|
||||
@@ -72,6 +72,8 @@ const (
|
||||
FieldImageCount = "image_count"
|
||||
// FieldImageSize holds the string denoting the image_size field in the database.
|
||||
FieldImageSize = "image_size"
|
||||
// FieldMediaType holds the string denoting the media_type field in the database.
|
||||
FieldMediaType = "media_type"
|
||||
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
||||
FieldCreatedAt = "created_at"
|
||||
// EdgeUser holds the string denoting the user edge name in mutations.
|
||||
@@ -155,6 +157,7 @@ var Columns = []string{
|
||||
FieldIPAddress,
|
||||
FieldImageCount,
|
||||
FieldImageSize,
|
||||
FieldMediaType,
|
||||
FieldCreatedAt,
|
||||
}
|
||||
|
||||
@@ -211,6 +214,8 @@ var (
|
||||
DefaultImageCount int
|
||||
// ImageSizeValidator is a validator for the "image_size" field. It is called by the builders before save.
|
||||
ImageSizeValidator func(string) error
|
||||
// MediaTypeValidator is a validator for the "media_type" field. It is called by the builders before save.
|
||||
MediaTypeValidator func(string) error
|
||||
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
||||
DefaultCreatedAt func() time.Time
|
||||
)
|
||||
@@ -368,6 +373,11 @@ func ByImageSize(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldImageSize, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByMediaType orders the results by the media_type field.
|
||||
func ByMediaType(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldMediaType, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCreatedAt orders the results by the created_at field.
|
||||
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
||||
|
||||
@@ -200,6 +200,11 @@ func ImageSize(v string) predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldEQ(FieldImageSize, v))
|
||||
}
|
||||
|
||||
// MediaType applies equality check predicate on the "media_type" field. It's identical to MediaTypeEQ.
|
||||
func MediaType(v string) predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldEQ(FieldMediaType, v))
|
||||
}
|
||||
|
||||
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
|
||||
func CreatedAt(v time.Time) predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldEQ(FieldCreatedAt, v))
|
||||
@@ -1440,6 +1445,81 @@ func ImageSizeContainsFold(v string) predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldContainsFold(FieldImageSize, v))
|
||||
}
|
||||
|
||||
// MediaTypeEQ applies the EQ predicate on the "media_type" field.
|
||||
func MediaTypeEQ(v string) predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldEQ(FieldMediaType, v))
|
||||
}
|
||||
|
||||
// MediaTypeNEQ applies the NEQ predicate on the "media_type" field.
|
||||
func MediaTypeNEQ(v string) predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldNEQ(FieldMediaType, v))
|
||||
}
|
||||
|
||||
// MediaTypeIn applies the In predicate on the "media_type" field.
|
||||
func MediaTypeIn(vs ...string) predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldIn(FieldMediaType, vs...))
|
||||
}
|
||||
|
||||
// MediaTypeNotIn applies the NotIn predicate on the "media_type" field.
|
||||
func MediaTypeNotIn(vs ...string) predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldNotIn(FieldMediaType, vs...))
|
||||
}
|
||||
|
||||
// MediaTypeGT applies the GT predicate on the "media_type" field.
|
||||
func MediaTypeGT(v string) predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldGT(FieldMediaType, v))
|
||||
}
|
||||
|
||||
// MediaTypeGTE applies the GTE predicate on the "media_type" field.
|
||||
func MediaTypeGTE(v string) predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldGTE(FieldMediaType, v))
|
||||
}
|
||||
|
||||
// MediaTypeLT applies the LT predicate on the "media_type" field.
|
||||
func MediaTypeLT(v string) predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldLT(FieldMediaType, v))
|
||||
}
|
||||
|
||||
// MediaTypeLTE applies the LTE predicate on the "media_type" field.
|
||||
func MediaTypeLTE(v string) predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldLTE(FieldMediaType, v))
|
||||
}
|
||||
|
||||
// MediaTypeContains applies the Contains predicate on the "media_type" field.
|
||||
func MediaTypeContains(v string) predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldContains(FieldMediaType, v))
|
||||
}
|
||||
|
||||
// MediaTypeHasPrefix applies the HasPrefix predicate on the "media_type" field.
|
||||
func MediaTypeHasPrefix(v string) predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldHasPrefix(FieldMediaType, v))
|
||||
}
|
||||
|
||||
// MediaTypeHasSuffix applies the HasSuffix predicate on the "media_type" field.
|
||||
func MediaTypeHasSuffix(v string) predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldHasSuffix(FieldMediaType, v))
|
||||
}
|
||||
|
||||
// MediaTypeIsNil applies the IsNil predicate on the "media_type" field.
|
||||
func MediaTypeIsNil() predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldIsNull(FieldMediaType))
|
||||
}
|
||||
|
||||
// MediaTypeNotNil applies the NotNil predicate on the "media_type" field.
|
||||
func MediaTypeNotNil() predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldNotNull(FieldMediaType))
|
||||
}
|
||||
|
||||
// MediaTypeEqualFold applies the EqualFold predicate on the "media_type" field.
|
||||
func MediaTypeEqualFold(v string) predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldEqualFold(FieldMediaType, v))
|
||||
}
|
||||
|
||||
// MediaTypeContainsFold applies the ContainsFold predicate on the "media_type" field.
|
||||
func MediaTypeContainsFold(v string) predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldContainsFold(FieldMediaType, v))
|
||||
}
|
||||
|
||||
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
|
||||
func CreatedAtEQ(v time.Time) predicate.UsageLog {
|
||||
return predicate.UsageLog(sql.FieldEQ(FieldCreatedAt, v))
|
||||
|
||||
@@ -393,6 +393,20 @@ func (_c *UsageLogCreate) SetNillableImageSize(v *string) *UsageLogCreate {
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetMediaType sets the "media_type" field.
|
||||
func (_c *UsageLogCreate) SetMediaType(v string) *UsageLogCreate {
|
||||
_c.mutation.SetMediaType(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableMediaType sets the "media_type" field if the given value is not nil.
|
||||
func (_c *UsageLogCreate) SetNillableMediaType(v *string) *UsageLogCreate {
|
||||
if v != nil {
|
||||
_c.SetMediaType(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (_c *UsageLogCreate) SetCreatedAt(v time.Time) *UsageLogCreate {
|
||||
_c.mutation.SetCreatedAt(v)
|
||||
@@ -627,6 +641,11 @@ func (_c *UsageLogCreate) check() error {
|
||||
return &ValidationError{Name: "image_size", err: fmt.Errorf(`ent: validator failed for field "UsageLog.image_size": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := _c.mutation.MediaType(); ok {
|
||||
if err := usagelog.MediaTypeValidator(v); err != nil {
|
||||
return &ValidationError{Name: "media_type", err: fmt.Errorf(`ent: validator failed for field "UsageLog.media_type": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _, ok := _c.mutation.CreatedAt(); !ok {
|
||||
return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "UsageLog.created_at"`)}
|
||||
}
|
||||
@@ -762,6 +781,10 @@ func (_c *UsageLogCreate) createSpec() (*UsageLog, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(usagelog.FieldImageSize, field.TypeString, value)
|
||||
_node.ImageSize = &value
|
||||
}
|
||||
if value, ok := _c.mutation.MediaType(); ok {
|
||||
_spec.SetField(usagelog.FieldMediaType, field.TypeString, value)
|
||||
_node.MediaType = &value
|
||||
}
|
||||
if value, ok := _c.mutation.CreatedAt(); ok {
|
||||
_spec.SetField(usagelog.FieldCreatedAt, field.TypeTime, value)
|
||||
_node.CreatedAt = value
|
||||
@@ -1407,6 +1430,24 @@ func (u *UsageLogUpsert) ClearImageSize() *UsageLogUpsert {
|
||||
return u
|
||||
}
|
||||
|
||||
// SetMediaType sets the "media_type" field.
|
||||
func (u *UsageLogUpsert) SetMediaType(v string) *UsageLogUpsert {
|
||||
u.Set(usagelog.FieldMediaType, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateMediaType sets the "media_type" field to the value that was provided on create.
|
||||
func (u *UsageLogUpsert) UpdateMediaType() *UsageLogUpsert {
|
||||
u.SetExcluded(usagelog.FieldMediaType)
|
||||
return u
|
||||
}
|
||||
|
||||
// ClearMediaType clears the value of the "media_type" field.
|
||||
func (u *UsageLogUpsert) ClearMediaType() *UsageLogUpsert {
|
||||
u.SetNull(usagelog.FieldMediaType)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateNewValues updates the mutable fields using the new values that were set on create.
|
||||
// Using this option is equivalent to using:
|
||||
//
|
||||
@@ -2040,6 +2081,27 @@ func (u *UsageLogUpsertOne) ClearImageSize() *UsageLogUpsertOne {
|
||||
})
|
||||
}
|
||||
|
||||
// SetMediaType sets the "media_type" field.
|
||||
func (u *UsageLogUpsertOne) SetMediaType(v string) *UsageLogUpsertOne {
|
||||
return u.Update(func(s *UsageLogUpsert) {
|
||||
s.SetMediaType(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateMediaType sets the "media_type" field to the value that was provided on create.
|
||||
func (u *UsageLogUpsertOne) UpdateMediaType() *UsageLogUpsertOne {
|
||||
return u.Update(func(s *UsageLogUpsert) {
|
||||
s.UpdateMediaType()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearMediaType clears the value of the "media_type" field.
|
||||
func (u *UsageLogUpsertOne) ClearMediaType() *UsageLogUpsertOne {
|
||||
return u.Update(func(s *UsageLogUpsert) {
|
||||
s.ClearMediaType()
|
||||
})
|
||||
}
|
||||
|
||||
// Exec executes the query.
|
||||
func (u *UsageLogUpsertOne) Exec(ctx context.Context) error {
|
||||
if len(u.create.conflict) == 0 {
|
||||
@@ -2839,6 +2901,27 @@ func (u *UsageLogUpsertBulk) ClearImageSize() *UsageLogUpsertBulk {
|
||||
})
|
||||
}
|
||||
|
||||
// SetMediaType sets the "media_type" field.
|
||||
func (u *UsageLogUpsertBulk) SetMediaType(v string) *UsageLogUpsertBulk {
|
||||
return u.Update(func(s *UsageLogUpsert) {
|
||||
s.SetMediaType(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateMediaType sets the "media_type" field to the value that was provided on create.
|
||||
func (u *UsageLogUpsertBulk) UpdateMediaType() *UsageLogUpsertBulk {
|
||||
return u.Update(func(s *UsageLogUpsert) {
|
||||
s.UpdateMediaType()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearMediaType clears the value of the "media_type" field.
|
||||
func (u *UsageLogUpsertBulk) ClearMediaType() *UsageLogUpsertBulk {
|
||||
return u.Update(func(s *UsageLogUpsert) {
|
||||
s.ClearMediaType()
|
||||
})
|
||||
}
|
||||
|
||||
// Exec executes the query.
|
||||
func (u *UsageLogUpsertBulk) Exec(ctx context.Context) error {
|
||||
if u.create.err != nil {
|
||||
|
||||
@@ -612,6 +612,26 @@ func (_u *UsageLogUpdate) ClearImageSize() *UsageLogUpdate {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetMediaType sets the "media_type" field.
|
||||
func (_u *UsageLogUpdate) SetMediaType(v string) *UsageLogUpdate {
|
||||
_u.mutation.SetMediaType(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableMediaType sets the "media_type" field if the given value is not nil.
|
||||
func (_u *UsageLogUpdate) SetNillableMediaType(v *string) *UsageLogUpdate {
|
||||
if v != nil {
|
||||
_u.SetMediaType(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearMediaType clears the value of the "media_type" field.
|
||||
func (_u *UsageLogUpdate) ClearMediaType() *UsageLogUpdate {
|
||||
_u.mutation.ClearMediaType()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetUser sets the "user" edge to the User entity.
|
||||
func (_u *UsageLogUpdate) SetUser(v *User) *UsageLogUpdate {
|
||||
return _u.SetUserID(v.ID)
|
||||
@@ -726,6 +746,11 @@ func (_u *UsageLogUpdate) check() error {
|
||||
return &ValidationError{Name: "image_size", err: fmt.Errorf(`ent: validator failed for field "UsageLog.image_size": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := _u.mutation.MediaType(); ok {
|
||||
if err := usagelog.MediaTypeValidator(v); err != nil {
|
||||
return &ValidationError{Name: "media_type", err: fmt.Errorf(`ent: validator failed for field "UsageLog.media_type": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _u.mutation.UserCleared() && len(_u.mutation.UserIDs()) > 0 {
|
||||
return errors.New(`ent: clearing a required unique edge "UsageLog.user"`)
|
||||
}
|
||||
@@ -894,6 +919,12 @@ func (_u *UsageLogUpdate) sqlSave(ctx context.Context) (_node int, err error) {
|
||||
if _u.mutation.ImageSizeCleared() {
|
||||
_spec.ClearField(usagelog.FieldImageSize, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.MediaType(); ok {
|
||||
_spec.SetField(usagelog.FieldMediaType, field.TypeString, value)
|
||||
}
|
||||
if _u.mutation.MediaTypeCleared() {
|
||||
_spec.ClearField(usagelog.FieldMediaType, field.TypeString)
|
||||
}
|
||||
if _u.mutation.UserCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
Rel: sqlgraph.M2O,
|
||||
@@ -1639,6 +1670,26 @@ func (_u *UsageLogUpdateOne) ClearImageSize() *UsageLogUpdateOne {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetMediaType sets the "media_type" field.
|
||||
func (_u *UsageLogUpdateOne) SetMediaType(v string) *UsageLogUpdateOne {
|
||||
_u.mutation.SetMediaType(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableMediaType sets the "media_type" field if the given value is not nil.
|
||||
func (_u *UsageLogUpdateOne) SetNillableMediaType(v *string) *UsageLogUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetMediaType(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearMediaType clears the value of the "media_type" field.
|
||||
func (_u *UsageLogUpdateOne) ClearMediaType() *UsageLogUpdateOne {
|
||||
_u.mutation.ClearMediaType()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetUser sets the "user" edge to the User entity.
|
||||
func (_u *UsageLogUpdateOne) SetUser(v *User) *UsageLogUpdateOne {
|
||||
return _u.SetUserID(v.ID)
|
||||
@@ -1766,6 +1817,11 @@ func (_u *UsageLogUpdateOne) check() error {
|
||||
return &ValidationError{Name: "image_size", err: fmt.Errorf(`ent: validator failed for field "UsageLog.image_size": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := _u.mutation.MediaType(); ok {
|
||||
if err := usagelog.MediaTypeValidator(v); err != nil {
|
||||
return &ValidationError{Name: "media_type", err: fmt.Errorf(`ent: validator failed for field "UsageLog.media_type": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _u.mutation.UserCleared() && len(_u.mutation.UserIDs()) > 0 {
|
||||
return errors.New(`ent: clearing a required unique edge "UsageLog.user"`)
|
||||
}
|
||||
@@ -1951,6 +2007,12 @@ func (_u *UsageLogUpdateOne) sqlSave(ctx context.Context) (_node *UsageLog, err
|
||||
if _u.mutation.ImageSizeCleared() {
|
||||
_spec.ClearField(usagelog.FieldImageSize, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.MediaType(); ok {
|
||||
_spec.SetField(usagelog.FieldMediaType, field.TypeString, value)
|
||||
}
|
||||
if _u.mutation.MediaTypeCleared() {
|
||||
_spec.ClearField(usagelog.FieldMediaType, field.TypeString)
|
||||
}
|
||||
if _u.mutation.UserCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
Rel: sqlgraph.M2O,
|
||||
|
||||
Reference in New Issue
Block a user