init: create project

This commit is contained in:
kallydev
2020-11-28 18:32:36 +08:00
commit a970ad7653
83 changed files with 24196 additions and 0 deletions

View File

@ -0,0 +1,37 @@
// Code generated by entc, DO NOT EDIT.
package sfmodel
const (
// Label holds the string label denoting the sfmodel type in the database.
Label = "sf_model"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// FieldPhoneNumber holds the string denoting the phone_number field in the database.
FieldPhoneNumber = "phone_number"
// FieldAddress holds the string denoting the address field in the database.
FieldAddress = "address"
// Table holds the table name of the sfmodel in the database.
Table = "sf"
)
// Columns holds all SQL columns for sfmodel fields.
var Columns = []string{
FieldID,
FieldName,
FieldPhoneNumber,
FieldAddress,
}
// 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
}
}
return false
}

442
server/ent/sfmodel/where.go Normal file
View File

@ -0,0 +1,442 @@
// Code generated by entc, DO NOT EDIT.
package sfmodel
import (
"github.com/facebook/ent/dialect/sql"
"github.com/kallydev/privacy/ent/predicate"
)
// ID filters vertices based on their identifier.
func ID(id int) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldID), id))
})
}
// IDEQ applies the EQ predicate on the ID field.
func IDEQ(id int) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldID), id))
})
}
// IDNEQ applies the NEQ predicate on the ID field.
func IDNEQ(id int) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldID), id))
})
}
// IDIn applies the In predicate on the ID field.
func IDIn(ids ...int) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(ids) == 0 {
s.Where(sql.False())
return
}
v := make([]interface{}, len(ids))
for i := range v {
v[i] = ids[i]
}
s.Where(sql.In(s.C(FieldID), v...))
})
}
// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...int) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(ids) == 0 {
s.Where(sql.False())
return
}
v := make([]interface{}, len(ids))
for i := range v {
v[i] = ids[i]
}
s.Where(sql.NotIn(s.C(FieldID), v...))
})
}
// IDGT applies the GT predicate on the ID field.
func IDGT(id int) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldID), id))
})
}
// IDGTE applies the GTE predicate on the ID field.
func IDGTE(id int) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldID), id))
})
}
// IDLT applies the LT predicate on the ID field.
func IDLT(id int) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldID), id))
})
}
// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id int) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldID), id))
})
}
// Name applies equality check predicate on the "name" field. It's identical to NameEQ.
func Name(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldName), v))
})
}
// PhoneNumber applies equality check predicate on the "phone_number" field. It's identical to PhoneNumberEQ.
func PhoneNumber(v int64) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldPhoneNumber), v))
})
}
// Address applies equality check predicate on the "address" field. It's identical to AddressEQ.
func Address(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldAddress), v))
})
}
// NameEQ applies the EQ predicate on the "name" field.
func NameEQ(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldName), v))
})
}
// NameNEQ applies the NEQ predicate on the "name" field.
func NameNEQ(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldName), v))
})
}
// NameIn applies the In predicate on the "name" field.
func NameIn(vs ...string) predicate.SFModel {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.SFModel(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldName), v...))
})
}
// NameNotIn applies the NotIn predicate on the "name" field.
func NameNotIn(vs ...string) predicate.SFModel {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.SFModel(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldName), v...))
})
}
// NameGT applies the GT predicate on the "name" field.
func NameGT(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldName), v))
})
}
// NameGTE applies the GTE predicate on the "name" field.
func NameGTE(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldName), v))
})
}
// NameLT applies the LT predicate on the "name" field.
func NameLT(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldName), v))
})
}
// NameLTE applies the LTE predicate on the "name" field.
func NameLTE(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldName), v))
})
}
// NameContains applies the Contains predicate on the "name" field.
func NameContains(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.Contains(s.C(FieldName), v))
})
}
// NameHasPrefix applies the HasPrefix predicate on the "name" field.
func NameHasPrefix(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.HasPrefix(s.C(FieldName), v))
})
}
// NameHasSuffix applies the HasSuffix predicate on the "name" field.
func NameHasSuffix(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.HasSuffix(s.C(FieldName), v))
})
}
// NameEqualFold applies the EqualFold predicate on the "name" field.
func NameEqualFold(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.EqualFold(s.C(FieldName), v))
})
}
// NameContainsFold applies the ContainsFold predicate on the "name" field.
func NameContainsFold(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.ContainsFold(s.C(FieldName), v))
})
}
// PhoneNumberEQ applies the EQ predicate on the "phone_number" field.
func PhoneNumberEQ(v int64) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldPhoneNumber), v))
})
}
// PhoneNumberNEQ applies the NEQ predicate on the "phone_number" field.
func PhoneNumberNEQ(v int64) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldPhoneNumber), v))
})
}
// PhoneNumberIn applies the In predicate on the "phone_number" field.
func PhoneNumberIn(vs ...int64) predicate.SFModel {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.SFModel(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldPhoneNumber), v...))
})
}
// PhoneNumberNotIn applies the NotIn predicate on the "phone_number" field.
func PhoneNumberNotIn(vs ...int64) predicate.SFModel {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.SFModel(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldPhoneNumber), v...))
})
}
// PhoneNumberGT applies the GT predicate on the "phone_number" field.
func PhoneNumberGT(v int64) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldPhoneNumber), v))
})
}
// PhoneNumberGTE applies the GTE predicate on the "phone_number" field.
func PhoneNumberGTE(v int64) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldPhoneNumber), v))
})
}
// PhoneNumberLT applies the LT predicate on the "phone_number" field.
func PhoneNumberLT(v int64) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldPhoneNumber), v))
})
}
// PhoneNumberLTE applies the LTE predicate on the "phone_number" field.
func PhoneNumberLTE(v int64) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldPhoneNumber), v))
})
}
// AddressEQ applies the EQ predicate on the "address" field.
func AddressEQ(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldAddress), v))
})
}
// AddressNEQ applies the NEQ predicate on the "address" field.
func AddressNEQ(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldAddress), v))
})
}
// AddressIn applies the In predicate on the "address" field.
func AddressIn(vs ...string) predicate.SFModel {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.SFModel(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldAddress), v...))
})
}
// AddressNotIn applies the NotIn predicate on the "address" field.
func AddressNotIn(vs ...string) predicate.SFModel {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.SFModel(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldAddress), v...))
})
}
// AddressGT applies the GT predicate on the "address" field.
func AddressGT(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldAddress), v))
})
}
// AddressGTE applies the GTE predicate on the "address" field.
func AddressGTE(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldAddress), v))
})
}
// AddressLT applies the LT predicate on the "address" field.
func AddressLT(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldAddress), v))
})
}
// AddressLTE applies the LTE predicate on the "address" field.
func AddressLTE(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldAddress), v))
})
}
// AddressContains applies the Contains predicate on the "address" field.
func AddressContains(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.Contains(s.C(FieldAddress), v))
})
}
// AddressHasPrefix applies the HasPrefix predicate on the "address" field.
func AddressHasPrefix(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.HasPrefix(s.C(FieldAddress), v))
})
}
// AddressHasSuffix applies the HasSuffix predicate on the "address" field.
func AddressHasSuffix(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.HasSuffix(s.C(FieldAddress), v))
})
}
// AddressEqualFold applies the EqualFold predicate on the "address" field.
func AddressEqualFold(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.EqualFold(s.C(FieldAddress), v))
})
}
// AddressContainsFold applies the ContainsFold predicate on the "address" field.
func AddressContainsFold(v string) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s.Where(sql.ContainsFold(s.C(FieldAddress), v))
})
}
// And groups list of predicates with the AND operator between them.
func And(predicates ...predicate.SFModel) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s1 := s.Clone().SetP(nil)
for _, p := range predicates {
p(s1)
}
s.Where(s1.P())
})
}
// Or groups list of predicates with the OR operator between them.
func Or(predicates ...predicate.SFModel) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
s1 := s.Clone().SetP(nil)
for i, p := range predicates {
if i > 0 {
s1.Or()
}
p(s1)
}
s.Where(s1.P())
})
}
// Not applies the not operator on the given predicate.
func Not(p predicate.SFModel) predicate.SFModel {
return predicate.SFModel(func(s *sql.Selector) {
p(s.Not())
})
}