1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- package schema
- import (
- "wechat-api/ent/custom_types"
- "entgo.io/ent"
- "entgo.io/ent/dialect/entsql"
- "entgo.io/ent/schema"
- "entgo.io/ent/schema/field"
- "entgo.io/ent/schema/index"
- "github.com/suyuan32/simple-admin-common/orm/ent/mixins"
- )
- // CompapiJob holds the schema definition for the CompapiJob entity.
- type CompapiJob struct {
- ent.Schema
- }
- // Fields of the CompapiJob.
- func (CompapiJob) Fields() []ent.Field {
- return []ent.Field{
- field.Time("dist_at").Optional().Annotations(entsql.WithComments(true)).Comment("Dist Time | 分发时间"),
- field.Int8("dist_status").Optional().Default(0).Annotations(entsql.WithComments(true)).Comment("dist status | 分发状态 0 未 1 已"),
- field.Int8("callback_status").Optional().Default(10).Annotations(entsql.WithComments(true)).Comment("callback_status | 回调状态 10 准备回调 20 "),
- field.String("callback_url").Annotations(entsql.WithComments(true)).Comment("异步执行回调地址"),
- field.JSON("request_json", custom_types.OriginalData{}).Annotations(entsql.WithComments(true)).Comment("请求参数结构JSON"),
- field.String("auth_token").Default("").Annotations(entsql.WithComments(true)).Comment("发起请求者的授权token"),
- field.String("event_type").Default("").Annotations(entsql.WithComments(true)).Comment("发起请求者的类型"),
- field.Int8("workid_idx").Optional().Default(0).Annotations(entsql.WithComments(true)).Comment("workId在字典中的索引"),
- field.String("chat_id").Optional().Default("").Annotations(entsql.WithComments(true)).Comment("会话ID"),
- field.Int8("retry_count").Optional().Default(0).Annotations(entsql.WithComments(true)).Comment("retry count | 重试次数"),
- }
- }
- func (CompapiJob) Mixin() []ent.Mixin {
- return []ent.Mixin{
- mixins.IDMixin{},
- }
- }
- func (CompapiJob) Indexes() []ent.Index {
- return []ent.Index{
- index.Fields("dist_status"),
- index.Fields("callback_status"),
- }
- }
- func (CompapiJob) Edges() []ent.Edge { return []ent.Edge{} }
- func (CompapiJob) Annotations() []schema.Annotation {
- return []schema.Annotation{
- entsql.WithComments(true),
- entsql.Annotation{Table: "compapi_job"},
- }
- }
|