Files
juwan-backend/app/community/rpc/internal/models/runtime.go
T

75 lines
4.3 KiB
Go

// Code generated by ent, DO NOT EDIT.
package models
import (
"juwan-backend/app/community/rpc/internal/models/commentlikes"
"juwan-backend/app/community/rpc/internal/models/comments"
"juwan-backend/app/community/rpc/internal/models/postlikes"
"juwan-backend/app/community/rpc/internal/models/posts"
"juwan-backend/app/community/rpc/internal/models/schema"
"time"
)
// The init function reads all schema descriptors with runtime code
// (default values, validators, hooks and policies) and stitches it
// to their package variables.
func init() {
commentlikesFields := schema.CommentLikes{}.Fields()
_ = commentlikesFields
// commentlikesDescCreatedAt is the schema descriptor for created_at field.
commentlikesDescCreatedAt := commentlikesFields[3].Descriptor()
// commentlikes.DefaultCreatedAt holds the default value on creation for the created_at field.
commentlikes.DefaultCreatedAt = commentlikesDescCreatedAt.Default.(func() time.Time)
commentsFields := schema.Comments{}.Fields()
_ = commentsFields
// commentsDescLikeCount is the schema descriptor for like_count field.
commentsDescLikeCount := commentsFields[4].Descriptor()
// comments.DefaultLikeCount holds the default value on creation for the like_count field.
comments.DefaultLikeCount = commentsDescLikeCount.Default.(int)
// commentsDescCreatedAt is the schema descriptor for created_at field.
commentsDescCreatedAt := commentsFields[5].Descriptor()
// comments.DefaultCreatedAt holds the default value on creation for the created_at field.
comments.DefaultCreatedAt = commentsDescCreatedAt.Default.(func() time.Time)
postlikesFields := schema.PostLikes{}.Fields()
_ = postlikesFields
// postlikesDescCreatedAt is the schema descriptor for created_at field.
postlikesDescCreatedAt := postlikesFields[3].Descriptor()
// postlikes.DefaultCreatedAt holds the default value on creation for the created_at field.
postlikes.DefaultCreatedAt = postlikesDescCreatedAt.Default.(func() time.Time)
postsFields := schema.Posts{}.Fields()
_ = postsFields
// postsDescAuthorRole is the schema descriptor for author_role field.
postsDescAuthorRole := postsFields[2].Descriptor()
// posts.DefaultAuthorRole holds the default value on creation for the author_role field.
posts.DefaultAuthorRole = postsDescAuthorRole.Default.(string)
// posts.AuthorRoleValidator is a validator for the "author_role" field. It is called by the builders before save.
posts.AuthorRoleValidator = postsDescAuthorRole.Validators[0].(func(string) error)
// postsDescTitle is the schema descriptor for title field.
postsDescTitle := postsFields[3].Descriptor()
// posts.TitleValidator is a validator for the "title" field. It is called by the builders before save.
posts.TitleValidator = postsDescTitle.Validators[0].(func(string) error)
// postsDescLikeCount is the schema descriptor for like_count field.
postsDescLikeCount := postsFields[9].Descriptor()
// posts.DefaultLikeCount holds the default value on creation for the like_count field.
posts.DefaultLikeCount = postsDescLikeCount.Default.(int)
// postsDescCommentCount is the schema descriptor for comment_count field.
postsDescCommentCount := postsFields[10].Descriptor()
// posts.DefaultCommentCount holds the default value on creation for the comment_count field.
posts.DefaultCommentCount = postsDescCommentCount.Default.(int)
// postsDescPinned is the schema descriptor for pinned field.
postsDescPinned := postsFields[11].Descriptor()
// posts.DefaultPinned holds the default value on creation for the pinned field.
posts.DefaultPinned = postsDescPinned.Default.(bool)
// postsDescCreatedAt is the schema descriptor for created_at field.
postsDescCreatedAt := postsFields[12].Descriptor()
// posts.DefaultCreatedAt holds the default value on creation for the created_at field.
posts.DefaultCreatedAt = postsDescCreatedAt.Default.(func() time.Time)
// postsDescUpdatedAt is the schema descriptor for updated_at field.
postsDescUpdatedAt := postsFields[13].Descriptor()
// posts.DefaultUpdatedAt holds the default value on creation for the updated_at field.
posts.DefaultUpdatedAt = postsDescUpdatedAt.Default.(func() time.Time)
// posts.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
posts.UpdateDefaultUpdatedAt = postsDescUpdatedAt.UpdateDefault.(func() time.Time)
}