[feature] migrate to monorepo
This commit is contained in:
commit
05ddc1f783
267 changed files with 75165 additions and 0 deletions
170
backend/ent/postcontributor/postcontributor.go
Normal file
170
backend/ent/postcontributor/postcontributor.go
Normal file
|
@ -0,0 +1,170 @@
|
|||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package postcontributor
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the postcontributor type in the database.
|
||||
Label = "post_contributor"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldLanguageCode holds the string denoting the language_code field in the database.
|
||||
FieldLanguageCode = "language_code"
|
||||
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
||||
FieldCreatedAt = "created_at"
|
||||
// EdgePost holds the string denoting the post edge name in mutations.
|
||||
EdgePost = "post"
|
||||
// EdgeContributor holds the string denoting the contributor edge name in mutations.
|
||||
EdgeContributor = "contributor"
|
||||
// EdgeRole holds the string denoting the role edge name in mutations.
|
||||
EdgeRole = "role"
|
||||
// Table holds the table name of the postcontributor in the database.
|
||||
Table = "post_contributors"
|
||||
// PostTable is the table that holds the post relation/edge.
|
||||
PostTable = "post_contributors"
|
||||
// PostInverseTable is the table name for the Post entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "post" package.
|
||||
PostInverseTable = "posts"
|
||||
// PostColumn is the table column denoting the post relation/edge.
|
||||
PostColumn = "post_contributors"
|
||||
// ContributorTable is the table that holds the contributor relation/edge.
|
||||
ContributorTable = "post_contributors"
|
||||
// ContributorInverseTable is the table name for the Contributor entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "contributor" package.
|
||||
ContributorInverseTable = "contributors"
|
||||
// ContributorColumn is the table column denoting the contributor relation/edge.
|
||||
ContributorColumn = "contributor_posts"
|
||||
// RoleTable is the table that holds the role relation/edge.
|
||||
RoleTable = "post_contributors"
|
||||
// RoleInverseTable is the table name for the ContributorRole entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "contributorrole" package.
|
||||
RoleInverseTable = "contributor_roles"
|
||||
// RoleColumn is the table column denoting the role relation/edge.
|
||||
RoleColumn = "contributor_role_post_contributors"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for postcontributor fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldLanguageCode,
|
||||
FieldCreatedAt,
|
||||
}
|
||||
|
||||
// ForeignKeys holds the SQL foreign-keys that are owned by the "post_contributors"
|
||||
// table and are not defined as standalone fields in the schema.
|
||||
var ForeignKeys = []string{
|
||||
"contributor_posts",
|
||||
"contributor_role_post_contributors",
|
||||
"post_contributors",
|
||||
}
|
||||
|
||||
// ValidColumn reports if the column name is valid (part of the table columns).
|
||||
func ValidColumn(column string) bool {
|
||||
for i := range Columns {
|
||||
if column == Columns[i] {
|
||||
return true
|
||||
}
|
||||
}
|
||||
for i := range ForeignKeys {
|
||||
if column == ForeignKeys[i] {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var (
|
||||
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
||||
DefaultCreatedAt func() time.Time
|
||||
)
|
||||
|
||||
// LanguageCode defines the type for the "language_code" enum field.
|
||||
type LanguageCode string
|
||||
|
||||
// LanguageCode values.
|
||||
const (
|
||||
LanguageCodeEn LanguageCode = "en"
|
||||
LanguageCodeZhHans LanguageCode = "zh-Hans"
|
||||
LanguageCodeZhHant LanguageCode = "zh-Hant"
|
||||
)
|
||||
|
||||
func (lc LanguageCode) String() string {
|
||||
return string(lc)
|
||||
}
|
||||
|
||||
// LanguageCodeValidator is a validator for the "language_code" field enum values. It is called by the builders before save.
|
||||
func LanguageCodeValidator(lc LanguageCode) error {
|
||||
switch lc {
|
||||
case LanguageCodeEn, LanguageCodeZhHans, LanguageCodeZhHant:
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("postcontributor: invalid enum value for language_code field: %q", lc)
|
||||
}
|
||||
}
|
||||
|
||||
// OrderOption defines the ordering options for the PostContributor queries.
|
||||
type OrderOption func(*sql.Selector)
|
||||
|
||||
// ByID orders the results by the id field.
|
||||
func ByID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByLanguageCode orders the results by the language_code field.
|
||||
func ByLanguageCode(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldLanguageCode, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCreatedAt orders the results by the created_at field.
|
||||
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByPostField orders the results by post field.
|
||||
func ByPostField(field string, opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newPostStep(), sql.OrderByField(field, opts...))
|
||||
}
|
||||
}
|
||||
|
||||
// ByContributorField orders the results by contributor field.
|
||||
func ByContributorField(field string, opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newContributorStep(), sql.OrderByField(field, opts...))
|
||||
}
|
||||
}
|
||||
|
||||
// ByRoleField orders the results by role field.
|
||||
func ByRoleField(field string, opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newRoleStep(), sql.OrderByField(field, opts...))
|
||||
}
|
||||
}
|
||||
func newPostStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(PostInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, PostTable, PostColumn),
|
||||
)
|
||||
}
|
||||
func newContributorStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(ContributorInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, ContributorTable, ContributorColumn),
|
||||
)
|
||||
}
|
||||
func newRoleStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(RoleInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, RoleTable, RoleColumn),
|
||||
)
|
||||
}
|
215
backend/ent/postcontributor/where.go
Normal file
215
backend/ent/postcontributor/where.go
Normal file
|
@ -0,0 +1,215 @@
|
|||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package postcontributor
|
||||
|
||||
import (
|
||||
"time"
|
||||
"tss-rocks-be/ent/predicate"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
)
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id int) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id int) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id int) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldNEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldNotIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDGT applies the GT predicate on the ID field.
|
||||
func IDGT(id int) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldGT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id int) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldGTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id int) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldLT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id int) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
|
||||
func CreatedAt(v time.Time) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// LanguageCodeEQ applies the EQ predicate on the "language_code" field.
|
||||
func LanguageCodeEQ(v LanguageCode) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldEQ(FieldLanguageCode, v))
|
||||
}
|
||||
|
||||
// LanguageCodeNEQ applies the NEQ predicate on the "language_code" field.
|
||||
func LanguageCodeNEQ(v LanguageCode) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldNEQ(FieldLanguageCode, v))
|
||||
}
|
||||
|
||||
// LanguageCodeIn applies the In predicate on the "language_code" field.
|
||||
func LanguageCodeIn(vs ...LanguageCode) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldIn(FieldLanguageCode, vs...))
|
||||
}
|
||||
|
||||
// LanguageCodeNotIn applies the NotIn predicate on the "language_code" field.
|
||||
func LanguageCodeNotIn(vs ...LanguageCode) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldNotIn(FieldLanguageCode, vs...))
|
||||
}
|
||||
|
||||
// LanguageCodeIsNil applies the IsNil predicate on the "language_code" field.
|
||||
func LanguageCodeIsNil() predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldIsNull(FieldLanguageCode))
|
||||
}
|
||||
|
||||
// LanguageCodeNotNil applies the NotNil predicate on the "language_code" field.
|
||||
func LanguageCodeNotNil() predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldNotNull(FieldLanguageCode))
|
||||
}
|
||||
|
||||
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
|
||||
func CreatedAtEQ(v time.Time) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
|
||||
func CreatedAtNEQ(v time.Time) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldNEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtIn applies the In predicate on the "created_at" field.
|
||||
func CreatedAtIn(vs ...time.Time) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
|
||||
func CreatedAtNotIn(vs ...time.Time) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldNotIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtGT applies the GT predicate on the "created_at" field.
|
||||
func CreatedAtGT(v time.Time) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldGT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtGTE applies the GTE predicate on the "created_at" field.
|
||||
func CreatedAtGTE(v time.Time) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldGTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLT applies the LT predicate on the "created_at" field.
|
||||
func CreatedAtLT(v time.Time) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldLT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLTE applies the LTE predicate on the "created_at" field.
|
||||
func CreatedAtLTE(v time.Time) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.FieldLTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// HasPost applies the HasEdge predicate on the "post" edge.
|
||||
func HasPost() predicate.PostContributor {
|
||||
return predicate.PostContributor(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, PostTable, PostColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasPostWith applies the HasEdge predicate on the "post" edge with a given conditions (other predicates).
|
||||
func HasPostWith(preds ...predicate.Post) predicate.PostContributor {
|
||||
return predicate.PostContributor(func(s *sql.Selector) {
|
||||
step := newPostStep()
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// HasContributor applies the HasEdge predicate on the "contributor" edge.
|
||||
func HasContributor() predicate.PostContributor {
|
||||
return predicate.PostContributor(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, ContributorTable, ContributorColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasContributorWith applies the HasEdge predicate on the "contributor" edge with a given conditions (other predicates).
|
||||
func HasContributorWith(preds ...predicate.Contributor) predicate.PostContributor {
|
||||
return predicate.PostContributor(func(s *sql.Selector) {
|
||||
step := newContributorStep()
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// HasRole applies the HasEdge predicate on the "role" edge.
|
||||
func HasRole() predicate.PostContributor {
|
||||
return predicate.PostContributor(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, RoleTable, RoleColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasRoleWith applies the HasEdge predicate on the "role" edge with a given conditions (other predicates).
|
||||
func HasRoleWith(preds ...predicate.ContributorRole) predicate.PostContributor {
|
||||
return predicate.PostContributor(func(s *sql.Selector) {
|
||||
step := newRoleStep()
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.PostContributor) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.AndPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Or groups predicates with the OR operator between them.
|
||||
func Or(predicates ...predicate.PostContributor) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.OrPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Not applies the not operator on the given predicate.
|
||||
func Not(p predicate.PostContributor) predicate.PostContributor {
|
||||
return predicate.PostContributor(sql.NotPredicates(p))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue