[feature] migrate to monorepo
This commit is contained in:
commit
05ddc1f783
267 changed files with 75165 additions and 0 deletions
121
backend/ent/dailycontent/dailycontent.go
Normal file
121
backend/ent/dailycontent/dailycontent.go
Normal file
|
@ -0,0 +1,121 @@
|
|||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package dailycontent
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the dailycontent type in the database.
|
||||
Label = "daily_content"
|
||||
// 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"
|
||||
// FieldQuote holds the string denoting the quote field in the database.
|
||||
FieldQuote = "quote"
|
||||
// EdgeDaily holds the string denoting the daily edge name in mutations.
|
||||
EdgeDaily = "daily"
|
||||
// Table holds the table name of the dailycontent in the database.
|
||||
Table = "daily_contents"
|
||||
// DailyTable is the table that holds the daily relation/edge.
|
||||
DailyTable = "daily_contents"
|
||||
// DailyInverseTable is the table name for the Daily entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "daily" package.
|
||||
DailyInverseTable = "dailies"
|
||||
// DailyColumn is the table column denoting the daily relation/edge.
|
||||
DailyColumn = "daily_contents"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for dailycontent fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldLanguageCode,
|
||||
FieldQuote,
|
||||
}
|
||||
|
||||
// ForeignKeys holds the SQL foreign-keys that are owned by the "daily_contents"
|
||||
// table and are not defined as standalone fields in the schema.
|
||||
var ForeignKeys = []string{
|
||||
"daily_contents",
|
||||
}
|
||||
|
||||
// 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 (
|
||||
// QuoteValidator is a validator for the "quote" field. It is called by the builders before save.
|
||||
QuoteValidator func(string) error
|
||||
)
|
||||
|
||||
// LanguageCode defines the type for the "language_code" enum field.
|
||||
type LanguageCode string
|
||||
|
||||
// LanguageCode values.
|
||||
const (
|
||||
LanguageCodeEN LanguageCode = "en"
|
||||
LanguageCodeZH_HANS LanguageCode = "zh-Hans"
|
||||
LanguageCodeZH_HANT 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, LanguageCodeZH_HANS, LanguageCodeZH_HANT:
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("dailycontent: invalid enum value for language_code field: %q", lc)
|
||||
}
|
||||
}
|
||||
|
||||
// OrderOption defines the ordering options for the DailyContent 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()
|
||||
}
|
||||
|
||||
// ByQuote orders the results by the quote field.
|
||||
func ByQuote(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldQuote, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByDailyField orders the results by daily field.
|
||||
func ByDailyField(field string, opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newDailyStep(), sql.OrderByField(field, opts...))
|
||||
}
|
||||
}
|
||||
func newDailyStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(DailyInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, DailyTable, DailyColumn),
|
||||
)
|
||||
}
|
183
backend/ent/dailycontent/where.go
Normal file
183
backend/ent/dailycontent/where.go
Normal file
|
@ -0,0 +1,183 @@
|
|||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package dailycontent
|
||||
|
||||
import (
|
||||
"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.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id int) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id int) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldNEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldNotIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDGT applies the GT predicate on the ID field.
|
||||
func IDGT(id int) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldGT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id int) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldGTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id int) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldLT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id int) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// Quote applies equality check predicate on the "quote" field. It's identical to QuoteEQ.
|
||||
func Quote(v string) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldEQ(FieldQuote, v))
|
||||
}
|
||||
|
||||
// LanguageCodeEQ applies the EQ predicate on the "language_code" field.
|
||||
func LanguageCodeEQ(v LanguageCode) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldEQ(FieldLanguageCode, v))
|
||||
}
|
||||
|
||||
// LanguageCodeNEQ applies the NEQ predicate on the "language_code" field.
|
||||
func LanguageCodeNEQ(v LanguageCode) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldNEQ(FieldLanguageCode, v))
|
||||
}
|
||||
|
||||
// LanguageCodeIn applies the In predicate on the "language_code" field.
|
||||
func LanguageCodeIn(vs ...LanguageCode) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldIn(FieldLanguageCode, vs...))
|
||||
}
|
||||
|
||||
// LanguageCodeNotIn applies the NotIn predicate on the "language_code" field.
|
||||
func LanguageCodeNotIn(vs ...LanguageCode) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldNotIn(FieldLanguageCode, vs...))
|
||||
}
|
||||
|
||||
// QuoteEQ applies the EQ predicate on the "quote" field.
|
||||
func QuoteEQ(v string) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldEQ(FieldQuote, v))
|
||||
}
|
||||
|
||||
// QuoteNEQ applies the NEQ predicate on the "quote" field.
|
||||
func QuoteNEQ(v string) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldNEQ(FieldQuote, v))
|
||||
}
|
||||
|
||||
// QuoteIn applies the In predicate on the "quote" field.
|
||||
func QuoteIn(vs ...string) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldIn(FieldQuote, vs...))
|
||||
}
|
||||
|
||||
// QuoteNotIn applies the NotIn predicate on the "quote" field.
|
||||
func QuoteNotIn(vs ...string) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldNotIn(FieldQuote, vs...))
|
||||
}
|
||||
|
||||
// QuoteGT applies the GT predicate on the "quote" field.
|
||||
func QuoteGT(v string) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldGT(FieldQuote, v))
|
||||
}
|
||||
|
||||
// QuoteGTE applies the GTE predicate on the "quote" field.
|
||||
func QuoteGTE(v string) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldGTE(FieldQuote, v))
|
||||
}
|
||||
|
||||
// QuoteLT applies the LT predicate on the "quote" field.
|
||||
func QuoteLT(v string) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldLT(FieldQuote, v))
|
||||
}
|
||||
|
||||
// QuoteLTE applies the LTE predicate on the "quote" field.
|
||||
func QuoteLTE(v string) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldLTE(FieldQuote, v))
|
||||
}
|
||||
|
||||
// QuoteContains applies the Contains predicate on the "quote" field.
|
||||
func QuoteContains(v string) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldContains(FieldQuote, v))
|
||||
}
|
||||
|
||||
// QuoteHasPrefix applies the HasPrefix predicate on the "quote" field.
|
||||
func QuoteHasPrefix(v string) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldHasPrefix(FieldQuote, v))
|
||||
}
|
||||
|
||||
// QuoteHasSuffix applies the HasSuffix predicate on the "quote" field.
|
||||
func QuoteHasSuffix(v string) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldHasSuffix(FieldQuote, v))
|
||||
}
|
||||
|
||||
// QuoteEqualFold applies the EqualFold predicate on the "quote" field.
|
||||
func QuoteEqualFold(v string) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldEqualFold(FieldQuote, v))
|
||||
}
|
||||
|
||||
// QuoteContainsFold applies the ContainsFold predicate on the "quote" field.
|
||||
func QuoteContainsFold(v string) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.FieldContainsFold(FieldQuote, v))
|
||||
}
|
||||
|
||||
// HasDaily applies the HasEdge predicate on the "daily" edge.
|
||||
func HasDaily() predicate.DailyContent {
|
||||
return predicate.DailyContent(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, DailyTable, DailyColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasDailyWith applies the HasEdge predicate on the "daily" edge with a given conditions (other predicates).
|
||||
func HasDailyWith(preds ...predicate.Daily) predicate.DailyContent {
|
||||
return predicate.DailyContent(func(s *sql.Selector) {
|
||||
step := newDailyStep()
|
||||
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.DailyContent) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.AndPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Or groups predicates with the OR operator between them.
|
||||
func Or(predicates ...predicate.DailyContent) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.OrPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Not applies the not operator on the given predicate.
|
||||
func Not(p predicate.DailyContent) predicate.DailyContent {
|
||||
return predicate.DailyContent(sql.NotPredicates(p))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue