fix comment system
This commit is contained in:
659
ent/mutation.go
659
ent/mutation.go
@@ -1685,8 +1685,17 @@ type MaMutation struct {
|
||||
avatar *string
|
||||
cid *string
|
||||
uri *string
|
||||
cid_root *string
|
||||
uri_root *string
|
||||
root *string
|
||||
rkey *string
|
||||
bsky_url *string
|
||||
comment *string
|
||||
blog *string
|
||||
blog_url *string
|
||||
domain *string
|
||||
host *string
|
||||
feed *string
|
||||
updated_at *time.Time
|
||||
created_at *time.Time
|
||||
clearedFields map[string]struct{}
|
||||
@@ -2293,6 +2302,153 @@ func (m *MaMutation) ResetURI() {
|
||||
delete(m.clearedFields, ma.FieldURI)
|
||||
}
|
||||
|
||||
// SetCidRoot sets the "cid_root" field.
|
||||
func (m *MaMutation) SetCidRoot(s string) {
|
||||
m.cid_root = &s
|
||||
}
|
||||
|
||||
// CidRoot returns the value of the "cid_root" field in the mutation.
|
||||
func (m *MaMutation) CidRoot() (r string, exists bool) {
|
||||
v := m.cid_root
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldCidRoot returns the old "cid_root" field's value of the Ma entity.
|
||||
// If the Ma 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 *MaMutation) OldCidRoot(ctx context.Context) (v string, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldCidRoot is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldCidRoot requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldCidRoot: %w", err)
|
||||
}
|
||||
return oldValue.CidRoot, nil
|
||||
}
|
||||
|
||||
// ClearCidRoot clears the value of the "cid_root" field.
|
||||
func (m *MaMutation) ClearCidRoot() {
|
||||
m.cid_root = nil
|
||||
m.clearedFields[ma.FieldCidRoot] = struct{}{}
|
||||
}
|
||||
|
||||
// CidRootCleared returns if the "cid_root" field was cleared in this mutation.
|
||||
func (m *MaMutation) CidRootCleared() bool {
|
||||
_, ok := m.clearedFields[ma.FieldCidRoot]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetCidRoot resets all changes to the "cid_root" field.
|
||||
func (m *MaMutation) ResetCidRoot() {
|
||||
m.cid_root = nil
|
||||
delete(m.clearedFields, ma.FieldCidRoot)
|
||||
}
|
||||
|
||||
// SetURIRoot sets the "uri_root" field.
|
||||
func (m *MaMutation) SetURIRoot(s string) {
|
||||
m.uri_root = &s
|
||||
}
|
||||
|
||||
// URIRoot returns the value of the "uri_root" field in the mutation.
|
||||
func (m *MaMutation) URIRoot() (r string, exists bool) {
|
||||
v := m.uri_root
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldURIRoot returns the old "uri_root" field's value of the Ma entity.
|
||||
// If the Ma 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 *MaMutation) OldURIRoot(ctx context.Context) (v string, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldURIRoot is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldURIRoot requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldURIRoot: %w", err)
|
||||
}
|
||||
return oldValue.URIRoot, nil
|
||||
}
|
||||
|
||||
// ClearURIRoot clears the value of the "uri_root" field.
|
||||
func (m *MaMutation) ClearURIRoot() {
|
||||
m.uri_root = nil
|
||||
m.clearedFields[ma.FieldURIRoot] = struct{}{}
|
||||
}
|
||||
|
||||
// URIRootCleared returns if the "uri_root" field was cleared in this mutation.
|
||||
func (m *MaMutation) URIRootCleared() bool {
|
||||
_, ok := m.clearedFields[ma.FieldURIRoot]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetURIRoot resets all changes to the "uri_root" field.
|
||||
func (m *MaMutation) ResetURIRoot() {
|
||||
m.uri_root = nil
|
||||
delete(m.clearedFields, ma.FieldURIRoot)
|
||||
}
|
||||
|
||||
// SetRoot sets the "root" field.
|
||||
func (m *MaMutation) SetRoot(s string) {
|
||||
m.root = &s
|
||||
}
|
||||
|
||||
// Root returns the value of the "root" field in the mutation.
|
||||
func (m *MaMutation) Root() (r string, exists bool) {
|
||||
v := m.root
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldRoot returns the old "root" field's value of the Ma entity.
|
||||
// If the Ma 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 *MaMutation) OldRoot(ctx context.Context) (v string, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldRoot is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldRoot requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldRoot: %w", err)
|
||||
}
|
||||
return oldValue.Root, nil
|
||||
}
|
||||
|
||||
// ClearRoot clears the value of the "root" field.
|
||||
func (m *MaMutation) ClearRoot() {
|
||||
m.root = nil
|
||||
m.clearedFields[ma.FieldRoot] = struct{}{}
|
||||
}
|
||||
|
||||
// RootCleared returns if the "root" field was cleared in this mutation.
|
||||
func (m *MaMutation) RootCleared() bool {
|
||||
_, ok := m.clearedFields[ma.FieldRoot]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetRoot resets all changes to the "root" field.
|
||||
func (m *MaMutation) ResetRoot() {
|
||||
m.root = nil
|
||||
delete(m.clearedFields, ma.FieldRoot)
|
||||
}
|
||||
|
||||
// SetRkey sets the "rkey" field.
|
||||
func (m *MaMutation) SetRkey(s string) {
|
||||
m.rkey = &s
|
||||
@@ -2391,6 +2547,300 @@ func (m *MaMutation) ResetBskyURL() {
|
||||
delete(m.clearedFields, ma.FieldBskyURL)
|
||||
}
|
||||
|
||||
// SetComment sets the "comment" field.
|
||||
func (m *MaMutation) SetComment(s string) {
|
||||
m.comment = &s
|
||||
}
|
||||
|
||||
// Comment returns the value of the "comment" field in the mutation.
|
||||
func (m *MaMutation) Comment() (r string, exists bool) {
|
||||
v := m.comment
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldComment returns the old "comment" field's value of the Ma entity.
|
||||
// If the Ma 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 *MaMutation) OldComment(ctx context.Context) (v string, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldComment is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldComment requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldComment: %w", err)
|
||||
}
|
||||
return oldValue.Comment, nil
|
||||
}
|
||||
|
||||
// ClearComment clears the value of the "comment" field.
|
||||
func (m *MaMutation) ClearComment() {
|
||||
m.comment = nil
|
||||
m.clearedFields[ma.FieldComment] = struct{}{}
|
||||
}
|
||||
|
||||
// CommentCleared returns if the "comment" field was cleared in this mutation.
|
||||
func (m *MaMutation) CommentCleared() bool {
|
||||
_, ok := m.clearedFields[ma.FieldComment]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetComment resets all changes to the "comment" field.
|
||||
func (m *MaMutation) ResetComment() {
|
||||
m.comment = nil
|
||||
delete(m.clearedFields, ma.FieldComment)
|
||||
}
|
||||
|
||||
// SetBlog sets the "blog" field.
|
||||
func (m *MaMutation) SetBlog(s string) {
|
||||
m.blog = &s
|
||||
}
|
||||
|
||||
// Blog returns the value of the "blog" field in the mutation.
|
||||
func (m *MaMutation) Blog() (r string, exists bool) {
|
||||
v := m.blog
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldBlog returns the old "blog" field's value of the Ma entity.
|
||||
// If the Ma 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 *MaMutation) OldBlog(ctx context.Context) (v string, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldBlog is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldBlog requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldBlog: %w", err)
|
||||
}
|
||||
return oldValue.Blog, nil
|
||||
}
|
||||
|
||||
// ClearBlog clears the value of the "blog" field.
|
||||
func (m *MaMutation) ClearBlog() {
|
||||
m.blog = nil
|
||||
m.clearedFields[ma.FieldBlog] = struct{}{}
|
||||
}
|
||||
|
||||
// BlogCleared returns if the "blog" field was cleared in this mutation.
|
||||
func (m *MaMutation) BlogCleared() bool {
|
||||
_, ok := m.clearedFields[ma.FieldBlog]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetBlog resets all changes to the "blog" field.
|
||||
func (m *MaMutation) ResetBlog() {
|
||||
m.blog = nil
|
||||
delete(m.clearedFields, ma.FieldBlog)
|
||||
}
|
||||
|
||||
// SetBlogURL sets the "blog_url" field.
|
||||
func (m *MaMutation) SetBlogURL(s string) {
|
||||
m.blog_url = &s
|
||||
}
|
||||
|
||||
// BlogURL returns the value of the "blog_url" field in the mutation.
|
||||
func (m *MaMutation) BlogURL() (r string, exists bool) {
|
||||
v := m.blog_url
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldBlogURL returns the old "blog_url" field's value of the Ma entity.
|
||||
// If the Ma 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 *MaMutation) OldBlogURL(ctx context.Context) (v string, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldBlogURL is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldBlogURL requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldBlogURL: %w", err)
|
||||
}
|
||||
return oldValue.BlogURL, nil
|
||||
}
|
||||
|
||||
// ClearBlogURL clears the value of the "blog_url" field.
|
||||
func (m *MaMutation) ClearBlogURL() {
|
||||
m.blog_url = nil
|
||||
m.clearedFields[ma.FieldBlogURL] = struct{}{}
|
||||
}
|
||||
|
||||
// BlogURLCleared returns if the "blog_url" field was cleared in this mutation.
|
||||
func (m *MaMutation) BlogURLCleared() bool {
|
||||
_, ok := m.clearedFields[ma.FieldBlogURL]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetBlogURL resets all changes to the "blog_url" field.
|
||||
func (m *MaMutation) ResetBlogURL() {
|
||||
m.blog_url = nil
|
||||
delete(m.clearedFields, ma.FieldBlogURL)
|
||||
}
|
||||
|
||||
// SetDomain sets the "domain" field.
|
||||
func (m *MaMutation) SetDomain(s string) {
|
||||
m.domain = &s
|
||||
}
|
||||
|
||||
// Domain returns the value of the "domain" field in the mutation.
|
||||
func (m *MaMutation) Domain() (r string, exists bool) {
|
||||
v := m.domain
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldDomain returns the old "domain" field's value of the Ma entity.
|
||||
// If the Ma 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 *MaMutation) OldDomain(ctx context.Context) (v string, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldDomain is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldDomain requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldDomain: %w", err)
|
||||
}
|
||||
return oldValue.Domain, nil
|
||||
}
|
||||
|
||||
// ClearDomain clears the value of the "domain" field.
|
||||
func (m *MaMutation) ClearDomain() {
|
||||
m.domain = nil
|
||||
m.clearedFields[ma.FieldDomain] = struct{}{}
|
||||
}
|
||||
|
||||
// DomainCleared returns if the "domain" field was cleared in this mutation.
|
||||
func (m *MaMutation) DomainCleared() bool {
|
||||
_, ok := m.clearedFields[ma.FieldDomain]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetDomain resets all changes to the "domain" field.
|
||||
func (m *MaMutation) ResetDomain() {
|
||||
m.domain = nil
|
||||
delete(m.clearedFields, ma.FieldDomain)
|
||||
}
|
||||
|
||||
// SetHost sets the "host" field.
|
||||
func (m *MaMutation) SetHost(s string) {
|
||||
m.host = &s
|
||||
}
|
||||
|
||||
// Host returns the value of the "host" field in the mutation.
|
||||
func (m *MaMutation) Host() (r string, exists bool) {
|
||||
v := m.host
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldHost returns the old "host" field's value of the Ma entity.
|
||||
// If the Ma 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 *MaMutation) OldHost(ctx context.Context) (v string, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldHost is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldHost requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldHost: %w", err)
|
||||
}
|
||||
return oldValue.Host, nil
|
||||
}
|
||||
|
||||
// ClearHost clears the value of the "host" field.
|
||||
func (m *MaMutation) ClearHost() {
|
||||
m.host = nil
|
||||
m.clearedFields[ma.FieldHost] = struct{}{}
|
||||
}
|
||||
|
||||
// HostCleared returns if the "host" field was cleared in this mutation.
|
||||
func (m *MaMutation) HostCleared() bool {
|
||||
_, ok := m.clearedFields[ma.FieldHost]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetHost resets all changes to the "host" field.
|
||||
func (m *MaMutation) ResetHost() {
|
||||
m.host = nil
|
||||
delete(m.clearedFields, ma.FieldHost)
|
||||
}
|
||||
|
||||
// SetFeed sets the "feed" field.
|
||||
func (m *MaMutation) SetFeed(s string) {
|
||||
m.feed = &s
|
||||
}
|
||||
|
||||
// Feed returns the value of the "feed" field in the mutation.
|
||||
func (m *MaMutation) Feed() (r string, exists bool) {
|
||||
v := m.feed
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldFeed returns the old "feed" field's value of the Ma entity.
|
||||
// If the Ma 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 *MaMutation) OldFeed(ctx context.Context) (v string, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldFeed is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldFeed requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldFeed: %w", err)
|
||||
}
|
||||
return oldValue.Feed, nil
|
||||
}
|
||||
|
||||
// ClearFeed clears the value of the "feed" field.
|
||||
func (m *MaMutation) ClearFeed() {
|
||||
m.feed = nil
|
||||
m.clearedFields[ma.FieldFeed] = struct{}{}
|
||||
}
|
||||
|
||||
// FeedCleared returns if the "feed" field was cleared in this mutation.
|
||||
func (m *MaMutation) FeedCleared() bool {
|
||||
_, ok := m.clearedFields[ma.FieldFeed]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetFeed resets all changes to the "feed" field.
|
||||
func (m *MaMutation) ResetFeed() {
|
||||
m.feed = nil
|
||||
delete(m.clearedFields, ma.FieldFeed)
|
||||
}
|
||||
|
||||
// SetUpdatedAt sets the "updated_at" field.
|
||||
func (m *MaMutation) SetUpdatedAt(t time.Time) {
|
||||
m.updated_at = &t
|
||||
@@ -2562,7 +3012,7 @@ func (m *MaMutation) Type() string {
|
||||
// order to get all numeric fields that were incremented/decremented, call
|
||||
// AddedFields().
|
||||
func (m *MaMutation) Fields() []string {
|
||||
fields := make([]string, 0, 14)
|
||||
fields := make([]string, 0, 23)
|
||||
if m.password != nil {
|
||||
fields = append(fields, ma.FieldPassword)
|
||||
}
|
||||
@@ -2593,12 +3043,39 @@ func (m *MaMutation) Fields() []string {
|
||||
if m.uri != nil {
|
||||
fields = append(fields, ma.FieldURI)
|
||||
}
|
||||
if m.cid_root != nil {
|
||||
fields = append(fields, ma.FieldCidRoot)
|
||||
}
|
||||
if m.uri_root != nil {
|
||||
fields = append(fields, ma.FieldURIRoot)
|
||||
}
|
||||
if m.root != nil {
|
||||
fields = append(fields, ma.FieldRoot)
|
||||
}
|
||||
if m.rkey != nil {
|
||||
fields = append(fields, ma.FieldRkey)
|
||||
}
|
||||
if m.bsky_url != nil {
|
||||
fields = append(fields, ma.FieldBskyURL)
|
||||
}
|
||||
if m.comment != nil {
|
||||
fields = append(fields, ma.FieldComment)
|
||||
}
|
||||
if m.blog != nil {
|
||||
fields = append(fields, ma.FieldBlog)
|
||||
}
|
||||
if m.blog_url != nil {
|
||||
fields = append(fields, ma.FieldBlogURL)
|
||||
}
|
||||
if m.domain != nil {
|
||||
fields = append(fields, ma.FieldDomain)
|
||||
}
|
||||
if m.host != nil {
|
||||
fields = append(fields, ma.FieldHost)
|
||||
}
|
||||
if m.feed != nil {
|
||||
fields = append(fields, ma.FieldFeed)
|
||||
}
|
||||
if m.updated_at != nil {
|
||||
fields = append(fields, ma.FieldUpdatedAt)
|
||||
}
|
||||
@@ -2633,10 +3110,28 @@ func (m *MaMutation) Field(name string) (ent.Value, bool) {
|
||||
return m.Cid()
|
||||
case ma.FieldURI:
|
||||
return m.URI()
|
||||
case ma.FieldCidRoot:
|
||||
return m.CidRoot()
|
||||
case ma.FieldURIRoot:
|
||||
return m.URIRoot()
|
||||
case ma.FieldRoot:
|
||||
return m.Root()
|
||||
case ma.FieldRkey:
|
||||
return m.Rkey()
|
||||
case ma.FieldBskyURL:
|
||||
return m.BskyURL()
|
||||
case ma.FieldComment:
|
||||
return m.Comment()
|
||||
case ma.FieldBlog:
|
||||
return m.Blog()
|
||||
case ma.FieldBlogURL:
|
||||
return m.BlogURL()
|
||||
case ma.FieldDomain:
|
||||
return m.Domain()
|
||||
case ma.FieldHost:
|
||||
return m.Host()
|
||||
case ma.FieldFeed:
|
||||
return m.Feed()
|
||||
case ma.FieldUpdatedAt:
|
||||
return m.UpdatedAt()
|
||||
case ma.FieldCreatedAt:
|
||||
@@ -2670,10 +3165,28 @@ func (m *MaMutation) OldField(ctx context.Context, name string) (ent.Value, erro
|
||||
return m.OldCid(ctx)
|
||||
case ma.FieldURI:
|
||||
return m.OldURI(ctx)
|
||||
case ma.FieldCidRoot:
|
||||
return m.OldCidRoot(ctx)
|
||||
case ma.FieldURIRoot:
|
||||
return m.OldURIRoot(ctx)
|
||||
case ma.FieldRoot:
|
||||
return m.OldRoot(ctx)
|
||||
case ma.FieldRkey:
|
||||
return m.OldRkey(ctx)
|
||||
case ma.FieldBskyURL:
|
||||
return m.OldBskyURL(ctx)
|
||||
case ma.FieldComment:
|
||||
return m.OldComment(ctx)
|
||||
case ma.FieldBlog:
|
||||
return m.OldBlog(ctx)
|
||||
case ma.FieldBlogURL:
|
||||
return m.OldBlogURL(ctx)
|
||||
case ma.FieldDomain:
|
||||
return m.OldDomain(ctx)
|
||||
case ma.FieldHost:
|
||||
return m.OldHost(ctx)
|
||||
case ma.FieldFeed:
|
||||
return m.OldFeed(ctx)
|
||||
case ma.FieldUpdatedAt:
|
||||
return m.OldUpdatedAt(ctx)
|
||||
case ma.FieldCreatedAt:
|
||||
@@ -2757,6 +3270,27 @@ func (m *MaMutation) SetField(name string, value ent.Value) error {
|
||||
}
|
||||
m.SetURI(v)
|
||||
return nil
|
||||
case ma.FieldCidRoot:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetCidRoot(v)
|
||||
return nil
|
||||
case ma.FieldURIRoot:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetURIRoot(v)
|
||||
return nil
|
||||
case ma.FieldRoot:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetRoot(v)
|
||||
return nil
|
||||
case ma.FieldRkey:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
@@ -2771,6 +3305,48 @@ func (m *MaMutation) SetField(name string, value ent.Value) error {
|
||||
}
|
||||
m.SetBskyURL(v)
|
||||
return nil
|
||||
case ma.FieldComment:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetComment(v)
|
||||
return nil
|
||||
case ma.FieldBlog:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetBlog(v)
|
||||
return nil
|
||||
case ma.FieldBlogURL:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetBlogURL(v)
|
||||
return nil
|
||||
case ma.FieldDomain:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetDomain(v)
|
||||
return nil
|
||||
case ma.FieldHost:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetHost(v)
|
||||
return nil
|
||||
case ma.FieldFeed:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetFeed(v)
|
||||
return nil
|
||||
case ma.FieldUpdatedAt:
|
||||
v, ok := value.(time.Time)
|
||||
if !ok {
|
||||
@@ -2857,12 +3433,39 @@ func (m *MaMutation) ClearedFields() []string {
|
||||
if m.FieldCleared(ma.FieldURI) {
|
||||
fields = append(fields, ma.FieldURI)
|
||||
}
|
||||
if m.FieldCleared(ma.FieldCidRoot) {
|
||||
fields = append(fields, ma.FieldCidRoot)
|
||||
}
|
||||
if m.FieldCleared(ma.FieldURIRoot) {
|
||||
fields = append(fields, ma.FieldURIRoot)
|
||||
}
|
||||
if m.FieldCleared(ma.FieldRoot) {
|
||||
fields = append(fields, ma.FieldRoot)
|
||||
}
|
||||
if m.FieldCleared(ma.FieldRkey) {
|
||||
fields = append(fields, ma.FieldRkey)
|
||||
}
|
||||
if m.FieldCleared(ma.FieldBskyURL) {
|
||||
fields = append(fields, ma.FieldBskyURL)
|
||||
}
|
||||
if m.FieldCleared(ma.FieldComment) {
|
||||
fields = append(fields, ma.FieldComment)
|
||||
}
|
||||
if m.FieldCleared(ma.FieldBlog) {
|
||||
fields = append(fields, ma.FieldBlog)
|
||||
}
|
||||
if m.FieldCleared(ma.FieldBlogURL) {
|
||||
fields = append(fields, ma.FieldBlogURL)
|
||||
}
|
||||
if m.FieldCleared(ma.FieldDomain) {
|
||||
fields = append(fields, ma.FieldDomain)
|
||||
}
|
||||
if m.FieldCleared(ma.FieldHost) {
|
||||
fields = append(fields, ma.FieldHost)
|
||||
}
|
||||
if m.FieldCleared(ma.FieldFeed) {
|
||||
fields = append(fields, ma.FieldFeed)
|
||||
}
|
||||
if m.FieldCleared(ma.FieldUpdatedAt) {
|
||||
fields = append(fields, ma.FieldUpdatedAt)
|
||||
}
|
||||
@@ -2910,12 +3513,39 @@ func (m *MaMutation) ClearField(name string) error {
|
||||
case ma.FieldURI:
|
||||
m.ClearURI()
|
||||
return nil
|
||||
case ma.FieldCidRoot:
|
||||
m.ClearCidRoot()
|
||||
return nil
|
||||
case ma.FieldURIRoot:
|
||||
m.ClearURIRoot()
|
||||
return nil
|
||||
case ma.FieldRoot:
|
||||
m.ClearRoot()
|
||||
return nil
|
||||
case ma.FieldRkey:
|
||||
m.ClearRkey()
|
||||
return nil
|
||||
case ma.FieldBskyURL:
|
||||
m.ClearBskyURL()
|
||||
return nil
|
||||
case ma.FieldComment:
|
||||
m.ClearComment()
|
||||
return nil
|
||||
case ma.FieldBlog:
|
||||
m.ClearBlog()
|
||||
return nil
|
||||
case ma.FieldBlogURL:
|
||||
m.ClearBlogURL()
|
||||
return nil
|
||||
case ma.FieldDomain:
|
||||
m.ClearDomain()
|
||||
return nil
|
||||
case ma.FieldHost:
|
||||
m.ClearHost()
|
||||
return nil
|
||||
case ma.FieldFeed:
|
||||
m.ClearFeed()
|
||||
return nil
|
||||
case ma.FieldUpdatedAt:
|
||||
m.ClearUpdatedAt()
|
||||
return nil
|
||||
@@ -2960,12 +3590,39 @@ func (m *MaMutation) ResetField(name string) error {
|
||||
case ma.FieldURI:
|
||||
m.ResetURI()
|
||||
return nil
|
||||
case ma.FieldCidRoot:
|
||||
m.ResetCidRoot()
|
||||
return nil
|
||||
case ma.FieldURIRoot:
|
||||
m.ResetURIRoot()
|
||||
return nil
|
||||
case ma.FieldRoot:
|
||||
m.ResetRoot()
|
||||
return nil
|
||||
case ma.FieldRkey:
|
||||
m.ResetRkey()
|
||||
return nil
|
||||
case ma.FieldBskyURL:
|
||||
m.ResetBskyURL()
|
||||
return nil
|
||||
case ma.FieldComment:
|
||||
m.ResetComment()
|
||||
return nil
|
||||
case ma.FieldBlog:
|
||||
m.ResetBlog()
|
||||
return nil
|
||||
case ma.FieldBlogURL:
|
||||
m.ResetBlogURL()
|
||||
return nil
|
||||
case ma.FieldDomain:
|
||||
m.ResetDomain()
|
||||
return nil
|
||||
case ma.FieldHost:
|
||||
m.ResetHost()
|
||||
return nil
|
||||
case ma.FieldFeed:
|
||||
m.ResetFeed()
|
||||
return nil
|
||||
case ma.FieldUpdatedAt:
|
||||
m.ResetUpdatedAt()
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user