1
0

fix comment system

This commit is contained in:
2024-04-12 01:54:12 +09:00
parent 336827433e
commit b3df3250bb
17 changed files with 4503 additions and 174 deletions

View File

@@ -216,6 +216,66 @@ func (mu *MaUpdate) ClearURI() *MaUpdate {
return mu
}
// SetCidRoot sets the "cid_root" field.
func (mu *MaUpdate) SetCidRoot(s string) *MaUpdate {
mu.mutation.SetCidRoot(s)
return mu
}
// SetNillableCidRoot sets the "cid_root" field if the given value is not nil.
func (mu *MaUpdate) SetNillableCidRoot(s *string) *MaUpdate {
if s != nil {
mu.SetCidRoot(*s)
}
return mu
}
// ClearCidRoot clears the value of the "cid_root" field.
func (mu *MaUpdate) ClearCidRoot() *MaUpdate {
mu.mutation.ClearCidRoot()
return mu
}
// SetURIRoot sets the "uri_root" field.
func (mu *MaUpdate) SetURIRoot(s string) *MaUpdate {
mu.mutation.SetURIRoot(s)
return mu
}
// SetNillableURIRoot sets the "uri_root" field if the given value is not nil.
func (mu *MaUpdate) SetNillableURIRoot(s *string) *MaUpdate {
if s != nil {
mu.SetURIRoot(*s)
}
return mu
}
// ClearURIRoot clears the value of the "uri_root" field.
func (mu *MaUpdate) ClearURIRoot() *MaUpdate {
mu.mutation.ClearURIRoot()
return mu
}
// SetRoot sets the "root" field.
func (mu *MaUpdate) SetRoot(s string) *MaUpdate {
mu.mutation.SetRoot(s)
return mu
}
// SetNillableRoot sets the "root" field if the given value is not nil.
func (mu *MaUpdate) SetNillableRoot(s *string) *MaUpdate {
if s != nil {
mu.SetRoot(*s)
}
return mu
}
// ClearRoot clears the value of the "root" field.
func (mu *MaUpdate) ClearRoot() *MaUpdate {
mu.mutation.ClearRoot()
return mu
}
// SetRkey sets the "rkey" field.
func (mu *MaUpdate) SetRkey(s string) *MaUpdate {
mu.mutation.SetRkey(s)
@@ -256,6 +316,126 @@ func (mu *MaUpdate) ClearBskyURL() *MaUpdate {
return mu
}
// SetComment sets the "comment" field.
func (mu *MaUpdate) SetComment(s string) *MaUpdate {
mu.mutation.SetComment(s)
return mu
}
// SetNillableComment sets the "comment" field if the given value is not nil.
func (mu *MaUpdate) SetNillableComment(s *string) *MaUpdate {
if s != nil {
mu.SetComment(*s)
}
return mu
}
// ClearComment clears the value of the "comment" field.
func (mu *MaUpdate) ClearComment() *MaUpdate {
mu.mutation.ClearComment()
return mu
}
// SetBlog sets the "blog" field.
func (mu *MaUpdate) SetBlog(s string) *MaUpdate {
mu.mutation.SetBlog(s)
return mu
}
// SetNillableBlog sets the "blog" field if the given value is not nil.
func (mu *MaUpdate) SetNillableBlog(s *string) *MaUpdate {
if s != nil {
mu.SetBlog(*s)
}
return mu
}
// ClearBlog clears the value of the "blog" field.
func (mu *MaUpdate) ClearBlog() *MaUpdate {
mu.mutation.ClearBlog()
return mu
}
// SetBlogURL sets the "blog_url" field.
func (mu *MaUpdate) SetBlogURL(s string) *MaUpdate {
mu.mutation.SetBlogURL(s)
return mu
}
// SetNillableBlogURL sets the "blog_url" field if the given value is not nil.
func (mu *MaUpdate) SetNillableBlogURL(s *string) *MaUpdate {
if s != nil {
mu.SetBlogURL(*s)
}
return mu
}
// ClearBlogURL clears the value of the "blog_url" field.
func (mu *MaUpdate) ClearBlogURL() *MaUpdate {
mu.mutation.ClearBlogURL()
return mu
}
// SetDomain sets the "domain" field.
func (mu *MaUpdate) SetDomain(s string) *MaUpdate {
mu.mutation.SetDomain(s)
return mu
}
// SetNillableDomain sets the "domain" field if the given value is not nil.
func (mu *MaUpdate) SetNillableDomain(s *string) *MaUpdate {
if s != nil {
mu.SetDomain(*s)
}
return mu
}
// ClearDomain clears the value of the "domain" field.
func (mu *MaUpdate) ClearDomain() *MaUpdate {
mu.mutation.ClearDomain()
return mu
}
// SetHost sets the "host" field.
func (mu *MaUpdate) SetHost(s string) *MaUpdate {
mu.mutation.SetHost(s)
return mu
}
// SetNillableHost sets the "host" field if the given value is not nil.
func (mu *MaUpdate) SetNillableHost(s *string) *MaUpdate {
if s != nil {
mu.SetHost(*s)
}
return mu
}
// ClearHost clears the value of the "host" field.
func (mu *MaUpdate) ClearHost() *MaUpdate {
mu.mutation.ClearHost()
return mu
}
// SetFeed sets the "feed" field.
func (mu *MaUpdate) SetFeed(s string) *MaUpdate {
mu.mutation.SetFeed(s)
return mu
}
// SetNillableFeed sets the "feed" field if the given value is not nil.
func (mu *MaUpdate) SetNillableFeed(s *string) *MaUpdate {
if s != nil {
mu.SetFeed(*s)
}
return mu
}
// ClearFeed clears the value of the "feed" field.
func (mu *MaUpdate) ClearFeed() *MaUpdate {
mu.mutation.ClearFeed()
return mu
}
// SetUpdatedAt sets the "updated_at" field.
func (mu *MaUpdate) SetUpdatedAt(t time.Time) *MaUpdate {
mu.mutation.SetUpdatedAt(t)
@@ -402,6 +582,24 @@ func (mu *MaUpdate) sqlSave(ctx context.Context) (n int, err error) {
if mu.mutation.URICleared() {
_spec.ClearField(ma.FieldURI, field.TypeString)
}
if value, ok := mu.mutation.CidRoot(); ok {
_spec.SetField(ma.FieldCidRoot, field.TypeString, value)
}
if mu.mutation.CidRootCleared() {
_spec.ClearField(ma.FieldCidRoot, field.TypeString)
}
if value, ok := mu.mutation.URIRoot(); ok {
_spec.SetField(ma.FieldURIRoot, field.TypeString, value)
}
if mu.mutation.URIRootCleared() {
_spec.ClearField(ma.FieldURIRoot, field.TypeString)
}
if value, ok := mu.mutation.Root(); ok {
_spec.SetField(ma.FieldRoot, field.TypeString, value)
}
if mu.mutation.RootCleared() {
_spec.ClearField(ma.FieldRoot, field.TypeString)
}
if value, ok := mu.mutation.Rkey(); ok {
_spec.SetField(ma.FieldRkey, field.TypeString, value)
}
@@ -414,6 +612,42 @@ func (mu *MaUpdate) sqlSave(ctx context.Context) (n int, err error) {
if mu.mutation.BskyURLCleared() {
_spec.ClearField(ma.FieldBskyURL, field.TypeString)
}
if value, ok := mu.mutation.Comment(); ok {
_spec.SetField(ma.FieldComment, field.TypeString, value)
}
if mu.mutation.CommentCleared() {
_spec.ClearField(ma.FieldComment, field.TypeString)
}
if value, ok := mu.mutation.Blog(); ok {
_spec.SetField(ma.FieldBlog, field.TypeString, value)
}
if mu.mutation.BlogCleared() {
_spec.ClearField(ma.FieldBlog, field.TypeString)
}
if value, ok := mu.mutation.BlogURL(); ok {
_spec.SetField(ma.FieldBlogURL, field.TypeString, value)
}
if mu.mutation.BlogURLCleared() {
_spec.ClearField(ma.FieldBlogURL, field.TypeString)
}
if value, ok := mu.mutation.Domain(); ok {
_spec.SetField(ma.FieldDomain, field.TypeString, value)
}
if mu.mutation.DomainCleared() {
_spec.ClearField(ma.FieldDomain, field.TypeString)
}
if value, ok := mu.mutation.Host(); ok {
_spec.SetField(ma.FieldHost, field.TypeString, value)
}
if mu.mutation.HostCleared() {
_spec.ClearField(ma.FieldHost, field.TypeString)
}
if value, ok := mu.mutation.Feed(); ok {
_spec.SetField(ma.FieldFeed, field.TypeString, value)
}
if mu.mutation.FeedCleared() {
_spec.ClearField(ma.FieldFeed, field.TypeString)
}
if value, ok := mu.mutation.UpdatedAt(); ok {
_spec.SetField(ma.FieldUpdatedAt, field.TypeTime, value)
}
@@ -659,6 +893,66 @@ func (muo *MaUpdateOne) ClearURI() *MaUpdateOne {
return muo
}
// SetCidRoot sets the "cid_root" field.
func (muo *MaUpdateOne) SetCidRoot(s string) *MaUpdateOne {
muo.mutation.SetCidRoot(s)
return muo
}
// SetNillableCidRoot sets the "cid_root" field if the given value is not nil.
func (muo *MaUpdateOne) SetNillableCidRoot(s *string) *MaUpdateOne {
if s != nil {
muo.SetCidRoot(*s)
}
return muo
}
// ClearCidRoot clears the value of the "cid_root" field.
func (muo *MaUpdateOne) ClearCidRoot() *MaUpdateOne {
muo.mutation.ClearCidRoot()
return muo
}
// SetURIRoot sets the "uri_root" field.
func (muo *MaUpdateOne) SetURIRoot(s string) *MaUpdateOne {
muo.mutation.SetURIRoot(s)
return muo
}
// SetNillableURIRoot sets the "uri_root" field if the given value is not nil.
func (muo *MaUpdateOne) SetNillableURIRoot(s *string) *MaUpdateOne {
if s != nil {
muo.SetURIRoot(*s)
}
return muo
}
// ClearURIRoot clears the value of the "uri_root" field.
func (muo *MaUpdateOne) ClearURIRoot() *MaUpdateOne {
muo.mutation.ClearURIRoot()
return muo
}
// SetRoot sets the "root" field.
func (muo *MaUpdateOne) SetRoot(s string) *MaUpdateOne {
muo.mutation.SetRoot(s)
return muo
}
// SetNillableRoot sets the "root" field if the given value is not nil.
func (muo *MaUpdateOne) SetNillableRoot(s *string) *MaUpdateOne {
if s != nil {
muo.SetRoot(*s)
}
return muo
}
// ClearRoot clears the value of the "root" field.
func (muo *MaUpdateOne) ClearRoot() *MaUpdateOne {
muo.mutation.ClearRoot()
return muo
}
// SetRkey sets the "rkey" field.
func (muo *MaUpdateOne) SetRkey(s string) *MaUpdateOne {
muo.mutation.SetRkey(s)
@@ -699,6 +993,126 @@ func (muo *MaUpdateOne) ClearBskyURL() *MaUpdateOne {
return muo
}
// SetComment sets the "comment" field.
func (muo *MaUpdateOne) SetComment(s string) *MaUpdateOne {
muo.mutation.SetComment(s)
return muo
}
// SetNillableComment sets the "comment" field if the given value is not nil.
func (muo *MaUpdateOne) SetNillableComment(s *string) *MaUpdateOne {
if s != nil {
muo.SetComment(*s)
}
return muo
}
// ClearComment clears the value of the "comment" field.
func (muo *MaUpdateOne) ClearComment() *MaUpdateOne {
muo.mutation.ClearComment()
return muo
}
// SetBlog sets the "blog" field.
func (muo *MaUpdateOne) SetBlog(s string) *MaUpdateOne {
muo.mutation.SetBlog(s)
return muo
}
// SetNillableBlog sets the "blog" field if the given value is not nil.
func (muo *MaUpdateOne) SetNillableBlog(s *string) *MaUpdateOne {
if s != nil {
muo.SetBlog(*s)
}
return muo
}
// ClearBlog clears the value of the "blog" field.
func (muo *MaUpdateOne) ClearBlog() *MaUpdateOne {
muo.mutation.ClearBlog()
return muo
}
// SetBlogURL sets the "blog_url" field.
func (muo *MaUpdateOne) SetBlogURL(s string) *MaUpdateOne {
muo.mutation.SetBlogURL(s)
return muo
}
// SetNillableBlogURL sets the "blog_url" field if the given value is not nil.
func (muo *MaUpdateOne) SetNillableBlogURL(s *string) *MaUpdateOne {
if s != nil {
muo.SetBlogURL(*s)
}
return muo
}
// ClearBlogURL clears the value of the "blog_url" field.
func (muo *MaUpdateOne) ClearBlogURL() *MaUpdateOne {
muo.mutation.ClearBlogURL()
return muo
}
// SetDomain sets the "domain" field.
func (muo *MaUpdateOne) SetDomain(s string) *MaUpdateOne {
muo.mutation.SetDomain(s)
return muo
}
// SetNillableDomain sets the "domain" field if the given value is not nil.
func (muo *MaUpdateOne) SetNillableDomain(s *string) *MaUpdateOne {
if s != nil {
muo.SetDomain(*s)
}
return muo
}
// ClearDomain clears the value of the "domain" field.
func (muo *MaUpdateOne) ClearDomain() *MaUpdateOne {
muo.mutation.ClearDomain()
return muo
}
// SetHost sets the "host" field.
func (muo *MaUpdateOne) SetHost(s string) *MaUpdateOne {
muo.mutation.SetHost(s)
return muo
}
// SetNillableHost sets the "host" field if the given value is not nil.
func (muo *MaUpdateOne) SetNillableHost(s *string) *MaUpdateOne {
if s != nil {
muo.SetHost(*s)
}
return muo
}
// ClearHost clears the value of the "host" field.
func (muo *MaUpdateOne) ClearHost() *MaUpdateOne {
muo.mutation.ClearHost()
return muo
}
// SetFeed sets the "feed" field.
func (muo *MaUpdateOne) SetFeed(s string) *MaUpdateOne {
muo.mutation.SetFeed(s)
return muo
}
// SetNillableFeed sets the "feed" field if the given value is not nil.
func (muo *MaUpdateOne) SetNillableFeed(s *string) *MaUpdateOne {
if s != nil {
muo.SetFeed(*s)
}
return muo
}
// ClearFeed clears the value of the "feed" field.
func (muo *MaUpdateOne) ClearFeed() *MaUpdateOne {
muo.mutation.ClearFeed()
return muo
}
// SetUpdatedAt sets the "updated_at" field.
func (muo *MaUpdateOne) SetUpdatedAt(t time.Time) *MaUpdateOne {
muo.mutation.SetUpdatedAt(t)
@@ -875,6 +1289,24 @@ func (muo *MaUpdateOne) sqlSave(ctx context.Context) (_node *Ma, err error) {
if muo.mutation.URICleared() {
_spec.ClearField(ma.FieldURI, field.TypeString)
}
if value, ok := muo.mutation.CidRoot(); ok {
_spec.SetField(ma.FieldCidRoot, field.TypeString, value)
}
if muo.mutation.CidRootCleared() {
_spec.ClearField(ma.FieldCidRoot, field.TypeString)
}
if value, ok := muo.mutation.URIRoot(); ok {
_spec.SetField(ma.FieldURIRoot, field.TypeString, value)
}
if muo.mutation.URIRootCleared() {
_spec.ClearField(ma.FieldURIRoot, field.TypeString)
}
if value, ok := muo.mutation.Root(); ok {
_spec.SetField(ma.FieldRoot, field.TypeString, value)
}
if muo.mutation.RootCleared() {
_spec.ClearField(ma.FieldRoot, field.TypeString)
}
if value, ok := muo.mutation.Rkey(); ok {
_spec.SetField(ma.FieldRkey, field.TypeString, value)
}
@@ -887,6 +1319,42 @@ func (muo *MaUpdateOne) sqlSave(ctx context.Context) (_node *Ma, err error) {
if muo.mutation.BskyURLCleared() {
_spec.ClearField(ma.FieldBskyURL, field.TypeString)
}
if value, ok := muo.mutation.Comment(); ok {
_spec.SetField(ma.FieldComment, field.TypeString, value)
}
if muo.mutation.CommentCleared() {
_spec.ClearField(ma.FieldComment, field.TypeString)
}
if value, ok := muo.mutation.Blog(); ok {
_spec.SetField(ma.FieldBlog, field.TypeString, value)
}
if muo.mutation.BlogCleared() {
_spec.ClearField(ma.FieldBlog, field.TypeString)
}
if value, ok := muo.mutation.BlogURL(); ok {
_spec.SetField(ma.FieldBlogURL, field.TypeString, value)
}
if muo.mutation.BlogURLCleared() {
_spec.ClearField(ma.FieldBlogURL, field.TypeString)
}
if value, ok := muo.mutation.Domain(); ok {
_spec.SetField(ma.FieldDomain, field.TypeString, value)
}
if muo.mutation.DomainCleared() {
_spec.ClearField(ma.FieldDomain, field.TypeString)
}
if value, ok := muo.mutation.Host(); ok {
_spec.SetField(ma.FieldHost, field.TypeString, value)
}
if muo.mutation.HostCleared() {
_spec.ClearField(ma.FieldHost, field.TypeString)
}
if value, ok := muo.mutation.Feed(); ok {
_spec.SetField(ma.FieldFeed, field.TypeString, value)
}
if muo.mutation.FeedCleared() {
_spec.ClearField(ma.FieldFeed, field.TypeString)
}
if value, ok := muo.mutation.UpdatedAt(); ok {
_spec.SetField(ma.FieldUpdatedAt, field.TypeTime, value)
}