123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307 |
- package employee
- import (
- "time"
- "entgo.io/ent"
- "entgo.io/ent/dialect/sql"
- "entgo.io/ent/dialect/sql/sqlgraph"
- )
- const (
-
- Label = "employee"
-
- FieldID = "id"
-
- FieldCreatedAt = "created_at"
-
- FieldUpdatedAt = "updated_at"
-
- FieldDeletedAt = "deleted_at"
-
- FieldTitle = "title"
-
- FieldAvatar = "avatar"
-
- FieldTags = "tags"
-
- FieldHireCount = "hire_count"
-
- FieldServiceCount = "service_count"
-
- FieldAchievementCount = "achievement_count"
-
- FieldIntro = "intro"
-
- FieldEstimate = "estimate"
-
- FieldSkill = "skill"
-
- FieldAbilityType = "ability_type"
-
- FieldScene = "scene"
-
- FieldSwitchIn = "switch_in"
-
- FieldVideoURL = "video_url"
-
- FieldOrganizationID = "organization_id"
-
- FieldCategoryID = "category_id"
-
- EdgeEmWorkExperiences = "em_work_experiences"
-
- EdgeEmTutorial = "em_tutorial"
-
- Table = "employee"
-
- EmWorkExperiencesTable = "work_experience"
-
-
- EmWorkExperiencesInverseTable = "work_experience"
-
- EmWorkExperiencesColumn = "employee_id"
-
- EmTutorialTable = "tutorial"
-
-
- EmTutorialInverseTable = "tutorial"
-
- EmTutorialColumn = "employee_id"
- )
- var Columns = []string{
- FieldID,
- FieldCreatedAt,
- FieldUpdatedAt,
- FieldDeletedAt,
- FieldTitle,
- FieldAvatar,
- FieldTags,
- FieldHireCount,
- FieldServiceCount,
- FieldAchievementCount,
- FieldIntro,
- FieldEstimate,
- FieldSkill,
- FieldAbilityType,
- FieldScene,
- FieldSwitchIn,
- FieldVideoURL,
- FieldOrganizationID,
- FieldCategoryID,
- }
- func ValidColumn(column string) bool {
- for i := range Columns {
- if column == Columns[i] {
- return true
- }
- }
- return false
- }
- var (
- Hooks [1]ent.Hook
- Interceptors [1]ent.Interceptor
-
- DefaultCreatedAt func() time.Time
-
- DefaultUpdatedAt func() time.Time
-
- UpdateDefaultUpdatedAt func() time.Time
-
- TitleValidator func(string) error
-
- AvatarValidator func(string) error
-
- TagsValidator func(string) error
-
- DefaultHireCount int
-
- HireCountValidator func(int) error
-
- DefaultServiceCount int
-
- ServiceCountValidator func(int) error
-
- DefaultAchievementCount int
-
- AchievementCountValidator func(int) error
-
- DefaultIntro string
-
- IntroValidator func(string) error
-
- DefaultEstimate string
-
- EstimateValidator func(string) error
-
- DefaultSkill string
-
- SkillValidator func(string) error
-
- DefaultAbilityType string
-
- DefaultScene string
-
- DefaultSwitchIn string
-
- DefaultVideoURL string
-
- VideoURLValidator func(string) error
-
- OrganizationIDValidator func(uint64) error
-
- CategoryIDValidator func(uint64) error
- )
- type OrderOption func(*sql.Selector)
- func ByID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldID, opts...).ToFunc()
- }
- func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
- }
- func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
- }
- func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
- }
- func ByTitle(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldTitle, opts...).ToFunc()
- }
- func ByAvatar(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldAvatar, opts...).ToFunc()
- }
- func ByTags(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldTags, opts...).ToFunc()
- }
- func ByHireCount(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldHireCount, opts...).ToFunc()
- }
- func ByServiceCount(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldServiceCount, opts...).ToFunc()
- }
- func ByAchievementCount(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldAchievementCount, opts...).ToFunc()
- }
- func ByIntro(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldIntro, opts...).ToFunc()
- }
- func ByEstimate(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldEstimate, opts...).ToFunc()
- }
- func BySkill(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldSkill, opts...).ToFunc()
- }
- func ByAbilityType(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldAbilityType, opts...).ToFunc()
- }
- func ByScene(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldScene, opts...).ToFunc()
- }
- func BySwitchIn(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldSwitchIn, opts...).ToFunc()
- }
- func ByVideoURL(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldVideoURL, opts...).ToFunc()
- }
- func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
- }
- func ByCategoryID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCategoryID, opts...).ToFunc()
- }
- func ByEmWorkExperiencesCount(opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborsCount(s, newEmWorkExperiencesStep(), opts...)
- }
- }
- func ByEmWorkExperiences(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newEmWorkExperiencesStep(), append([]sql.OrderTerm{term}, terms...)...)
- }
- }
- func ByEmTutorialCount(opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborsCount(s, newEmTutorialStep(), opts...)
- }
- }
- func ByEmTutorial(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newEmTutorialStep(), append([]sql.OrderTerm{term}, terms...)...)
- }
- }
- func newEmWorkExperiencesStep() *sqlgraph.Step {
- return sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(EmWorkExperiencesInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.O2M, false, EmWorkExperiencesTable, EmWorkExperiencesColumn),
- )
- }
- func newEmTutorialStep() *sqlgraph.Step {
- return sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(EmTutorialInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.O2M, false, EmTutorialTable, EmTutorialColumn),
- )
- }
|