This commit is contained in:
2025-07-19 02:03:24 +08:00
commit ac6eeff8c9
44 changed files with 10305 additions and 0 deletions

View File

@ -0,0 +1,34 @@
package schema
import (
"entgo.io/ent"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
"time"
)
// CloudflareAccounts holds the schema definition for the CloudflareAccounts entity.
type CloudflareAccounts struct {
ent.Schema
}
// Fields of the CloudflareAccounts.
func (CloudflareAccounts) Fields() []ent.Field {
return []ent.Field{
field.String("name").NotEmpty().Comment("账户名称"),
field.String("account_id").NotEmpty().Comment("Cloudflare Account ID"),
field.Text("api_token").Sensitive().Comment("Cloudflare API Token"),
field.String("email").Optional().Comment("Cloudflare 邮箱(可选)"),
field.Int8("status").Default(1).Comment("状态 1=启用, 0=禁用"),
field.Text("remark").Optional().Comment("备注"),
field.Time("created_at").Default(time.Now).Immutable(),
field.Time("updated_at").Default(time.Now).UpdateDefault(time.Now),
}
}
// Edges of the CloudflareAccounts.
func (CloudflareAccounts) Edges() []ent.Edge {
return []ent.Edge{
edge.To("cloudflare_buckets", CloudflareR2.Type),
}
}