employee.go 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. // Code generated by ent, DO NOT EDIT.
  2. package employee
  3. import (
  4. "time"
  5. "entgo.io/ent"
  6. "entgo.io/ent/dialect/sql"
  7. "entgo.io/ent/dialect/sql/sqlgraph"
  8. )
  9. const (
  10. // Label holds the string label denoting the employee type in the database.
  11. Label = "employee"
  12. // FieldID holds the string denoting the id field in the database.
  13. FieldID = "id"
  14. // FieldCreatedAt holds the string denoting the created_at field in the database.
  15. FieldCreatedAt = "created_at"
  16. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  17. FieldUpdatedAt = "updated_at"
  18. // FieldDeletedAt holds the string denoting the deleted_at field in the database.
  19. FieldDeletedAt = "deleted_at"
  20. // FieldTitle holds the string denoting the title field in the database.
  21. FieldTitle = "title"
  22. // FieldAvatar holds the string denoting the avatar field in the database.
  23. FieldAvatar = "avatar"
  24. // FieldTags holds the string denoting the tags field in the database.
  25. FieldTags = "tags"
  26. // FieldHireCount holds the string denoting the hire_count field in the database.
  27. FieldHireCount = "hire_count"
  28. // FieldServiceCount holds the string denoting the service_count field in the database.
  29. FieldServiceCount = "service_count"
  30. // FieldAchievementCount holds the string denoting the achievement_count field in the database.
  31. FieldAchievementCount = "achievement_count"
  32. // FieldIntro holds the string denoting the intro field in the database.
  33. FieldIntro = "intro"
  34. // FieldEstimate holds the string denoting the estimate field in the database.
  35. FieldEstimate = "estimate"
  36. // FieldSkill holds the string denoting the skill field in the database.
  37. FieldSkill = "skill"
  38. // FieldAbilityType holds the string denoting the ability_type field in the database.
  39. FieldAbilityType = "ability_type"
  40. // FieldScene holds the string denoting the scene field in the database.
  41. FieldScene = "scene"
  42. // FieldSwitchIn holds the string denoting the switch_in field in the database.
  43. FieldSwitchIn = "switch_in"
  44. // FieldVideoURL holds the string denoting the video_url field in the database.
  45. FieldVideoURL = "video_url"
  46. // FieldOrganizationID holds the string denoting the organization_id field in the database.
  47. FieldOrganizationID = "organization_id"
  48. // FieldCategoryID holds the string denoting the category_id field in the database.
  49. FieldCategoryID = "category_id"
  50. // FieldAPIBase holds the string denoting the api_base field in the database.
  51. FieldAPIBase = "api_base"
  52. // FieldAPIKey holds the string denoting the api_key field in the database.
  53. FieldAPIKey = "api_key"
  54. // FieldAiInfo holds the string denoting the ai_info field in the database.
  55. FieldAiInfo = "ai_info"
  56. // FieldIsVip holds the string denoting the is_vip field in the database.
  57. FieldIsVip = "is_vip"
  58. // FieldChatURL holds the string denoting the chat_url field in the database.
  59. FieldChatURL = "chat_url"
  60. // EdgeEmWorkExperiences holds the string denoting the em_work_experiences edge name in mutations.
  61. EdgeEmWorkExperiences = "em_work_experiences"
  62. // EdgeEmTutorial holds the string denoting the em_tutorial edge name in mutations.
  63. EdgeEmTutorial = "em_tutorial"
  64. // Table holds the table name of the employee in the database.
  65. Table = "employee"
  66. // EmWorkExperiencesTable is the table that holds the em_work_experiences relation/edge.
  67. EmWorkExperiencesTable = "work_experience"
  68. // EmWorkExperiencesInverseTable is the table name for the WorkExperience entity.
  69. // It exists in this package in order to avoid circular dependency with the "workexperience" package.
  70. EmWorkExperiencesInverseTable = "work_experience"
  71. // EmWorkExperiencesColumn is the table column denoting the em_work_experiences relation/edge.
  72. EmWorkExperiencesColumn = "employee_id"
  73. // EmTutorialTable is the table that holds the em_tutorial relation/edge.
  74. EmTutorialTable = "tutorial"
  75. // EmTutorialInverseTable is the table name for the Tutorial entity.
  76. // It exists in this package in order to avoid circular dependency with the "tutorial" package.
  77. EmTutorialInverseTable = "tutorial"
  78. // EmTutorialColumn is the table column denoting the em_tutorial relation/edge.
  79. EmTutorialColumn = "employee_id"
  80. )
  81. // Columns holds all SQL columns for employee fields.
  82. var Columns = []string{
  83. FieldID,
  84. FieldCreatedAt,
  85. FieldUpdatedAt,
  86. FieldDeletedAt,
  87. FieldTitle,
  88. FieldAvatar,
  89. FieldTags,
  90. FieldHireCount,
  91. FieldServiceCount,
  92. FieldAchievementCount,
  93. FieldIntro,
  94. FieldEstimate,
  95. FieldSkill,
  96. FieldAbilityType,
  97. FieldScene,
  98. FieldSwitchIn,
  99. FieldVideoURL,
  100. FieldOrganizationID,
  101. FieldCategoryID,
  102. FieldAPIBase,
  103. FieldAPIKey,
  104. FieldAiInfo,
  105. FieldIsVip,
  106. FieldChatURL,
  107. }
  108. // ValidColumn reports if the column name is valid (part of the table columns).
  109. func ValidColumn(column string) bool {
  110. for i := range Columns {
  111. if column == Columns[i] {
  112. return true
  113. }
  114. }
  115. return false
  116. }
  117. // Note that the variables below are initialized by the runtime
  118. // package on the initialization of the application. Therefore,
  119. // it should be imported in the main as follows:
  120. //
  121. // import _ "wechat-api/ent/runtime"
  122. var (
  123. Hooks [1]ent.Hook
  124. Interceptors [1]ent.Interceptor
  125. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  126. DefaultCreatedAt func() time.Time
  127. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  128. DefaultUpdatedAt func() time.Time
  129. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  130. UpdateDefaultUpdatedAt func() time.Time
  131. // TitleValidator is a validator for the "title" field. It is called by the builders before save.
  132. TitleValidator func(string) error
  133. // AvatarValidator is a validator for the "avatar" field. It is called by the builders before save.
  134. AvatarValidator func(string) error
  135. // TagsValidator is a validator for the "tags" field. It is called by the builders before save.
  136. TagsValidator func(string) error
  137. // DefaultHireCount holds the default value on creation for the "hire_count" field.
  138. DefaultHireCount int
  139. // HireCountValidator is a validator for the "hire_count" field. It is called by the builders before save.
  140. HireCountValidator func(int) error
  141. // DefaultServiceCount holds the default value on creation for the "service_count" field.
  142. DefaultServiceCount int
  143. // ServiceCountValidator is a validator for the "service_count" field. It is called by the builders before save.
  144. ServiceCountValidator func(int) error
  145. // DefaultAchievementCount holds the default value on creation for the "achievement_count" field.
  146. DefaultAchievementCount int
  147. // AchievementCountValidator is a validator for the "achievement_count" field. It is called by the builders before save.
  148. AchievementCountValidator func(int) error
  149. // DefaultIntro holds the default value on creation for the "intro" field.
  150. DefaultIntro string
  151. // IntroValidator is a validator for the "intro" field. It is called by the builders before save.
  152. IntroValidator func(string) error
  153. // DefaultEstimate holds the default value on creation for the "estimate" field.
  154. DefaultEstimate string
  155. // EstimateValidator is a validator for the "estimate" field. It is called by the builders before save.
  156. EstimateValidator func(string) error
  157. // DefaultSkill holds the default value on creation for the "skill" field.
  158. DefaultSkill string
  159. // SkillValidator is a validator for the "skill" field. It is called by the builders before save.
  160. SkillValidator func(string) error
  161. // DefaultAbilityType holds the default value on creation for the "ability_type" field.
  162. DefaultAbilityType string
  163. // DefaultScene holds the default value on creation for the "scene" field.
  164. DefaultScene string
  165. // DefaultSwitchIn holds the default value on creation for the "switch_in" field.
  166. DefaultSwitchIn string
  167. // DefaultVideoURL holds the default value on creation for the "video_url" field.
  168. DefaultVideoURL string
  169. // VideoURLValidator is a validator for the "video_url" field. It is called by the builders before save.
  170. VideoURLValidator func(string) error
  171. // OrganizationIDValidator is a validator for the "organization_id" field. It is called by the builders before save.
  172. OrganizationIDValidator func(uint64) error
  173. // CategoryIDValidator is a validator for the "category_id" field. It is called by the builders before save.
  174. CategoryIDValidator func(uint64) error
  175. // DefaultAPIBase holds the default value on creation for the "api_base" field.
  176. DefaultAPIBase string
  177. // DefaultAPIKey holds the default value on creation for the "api_key" field.
  178. DefaultAPIKey string
  179. // DefaultIsVip holds the default value on creation for the "is_vip" field.
  180. DefaultIsVip int
  181. )
  182. // OrderOption defines the ordering options for the Employee queries.
  183. type OrderOption func(*sql.Selector)
  184. // ByID orders the results by the id field.
  185. func ByID(opts ...sql.OrderTermOption) OrderOption {
  186. return sql.OrderByField(FieldID, opts...).ToFunc()
  187. }
  188. // ByCreatedAt orders the results by the created_at field.
  189. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  190. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  191. }
  192. // ByUpdatedAt orders the results by the updated_at field.
  193. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  194. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  195. }
  196. // ByDeletedAt orders the results by the deleted_at field.
  197. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  198. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  199. }
  200. // ByTitle orders the results by the title field.
  201. func ByTitle(opts ...sql.OrderTermOption) OrderOption {
  202. return sql.OrderByField(FieldTitle, opts...).ToFunc()
  203. }
  204. // ByAvatar orders the results by the avatar field.
  205. func ByAvatar(opts ...sql.OrderTermOption) OrderOption {
  206. return sql.OrderByField(FieldAvatar, opts...).ToFunc()
  207. }
  208. // ByTags orders the results by the tags field.
  209. func ByTags(opts ...sql.OrderTermOption) OrderOption {
  210. return sql.OrderByField(FieldTags, opts...).ToFunc()
  211. }
  212. // ByHireCount orders the results by the hire_count field.
  213. func ByHireCount(opts ...sql.OrderTermOption) OrderOption {
  214. return sql.OrderByField(FieldHireCount, opts...).ToFunc()
  215. }
  216. // ByServiceCount orders the results by the service_count field.
  217. func ByServiceCount(opts ...sql.OrderTermOption) OrderOption {
  218. return sql.OrderByField(FieldServiceCount, opts...).ToFunc()
  219. }
  220. // ByAchievementCount orders the results by the achievement_count field.
  221. func ByAchievementCount(opts ...sql.OrderTermOption) OrderOption {
  222. return sql.OrderByField(FieldAchievementCount, opts...).ToFunc()
  223. }
  224. // ByIntro orders the results by the intro field.
  225. func ByIntro(opts ...sql.OrderTermOption) OrderOption {
  226. return sql.OrderByField(FieldIntro, opts...).ToFunc()
  227. }
  228. // ByEstimate orders the results by the estimate field.
  229. func ByEstimate(opts ...sql.OrderTermOption) OrderOption {
  230. return sql.OrderByField(FieldEstimate, opts...).ToFunc()
  231. }
  232. // BySkill orders the results by the skill field.
  233. func BySkill(opts ...sql.OrderTermOption) OrderOption {
  234. return sql.OrderByField(FieldSkill, opts...).ToFunc()
  235. }
  236. // ByAbilityType orders the results by the ability_type field.
  237. func ByAbilityType(opts ...sql.OrderTermOption) OrderOption {
  238. return sql.OrderByField(FieldAbilityType, opts...).ToFunc()
  239. }
  240. // ByScene orders the results by the scene field.
  241. func ByScene(opts ...sql.OrderTermOption) OrderOption {
  242. return sql.OrderByField(FieldScene, opts...).ToFunc()
  243. }
  244. // BySwitchIn orders the results by the switch_in field.
  245. func BySwitchIn(opts ...sql.OrderTermOption) OrderOption {
  246. return sql.OrderByField(FieldSwitchIn, opts...).ToFunc()
  247. }
  248. // ByVideoURL orders the results by the video_url field.
  249. func ByVideoURL(opts ...sql.OrderTermOption) OrderOption {
  250. return sql.OrderByField(FieldVideoURL, opts...).ToFunc()
  251. }
  252. // ByOrganizationID orders the results by the organization_id field.
  253. func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
  254. return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
  255. }
  256. // ByCategoryID orders the results by the category_id field.
  257. func ByCategoryID(opts ...sql.OrderTermOption) OrderOption {
  258. return sql.OrderByField(FieldCategoryID, opts...).ToFunc()
  259. }
  260. // ByAPIBase orders the results by the api_base field.
  261. func ByAPIBase(opts ...sql.OrderTermOption) OrderOption {
  262. return sql.OrderByField(FieldAPIBase, opts...).ToFunc()
  263. }
  264. // ByAPIKey orders the results by the api_key field.
  265. func ByAPIKey(opts ...sql.OrderTermOption) OrderOption {
  266. return sql.OrderByField(FieldAPIKey, opts...).ToFunc()
  267. }
  268. // ByAiInfo orders the results by the ai_info field.
  269. func ByAiInfo(opts ...sql.OrderTermOption) OrderOption {
  270. return sql.OrderByField(FieldAiInfo, opts...).ToFunc()
  271. }
  272. // ByIsVip orders the results by the is_vip field.
  273. func ByIsVip(opts ...sql.OrderTermOption) OrderOption {
  274. return sql.OrderByField(FieldIsVip, opts...).ToFunc()
  275. }
  276. // ByChatURL orders the results by the chat_url field.
  277. func ByChatURL(opts ...sql.OrderTermOption) OrderOption {
  278. return sql.OrderByField(FieldChatURL, opts...).ToFunc()
  279. }
  280. // ByEmWorkExperiencesCount orders the results by em_work_experiences count.
  281. func ByEmWorkExperiencesCount(opts ...sql.OrderTermOption) OrderOption {
  282. return func(s *sql.Selector) {
  283. sqlgraph.OrderByNeighborsCount(s, newEmWorkExperiencesStep(), opts...)
  284. }
  285. }
  286. // ByEmWorkExperiences orders the results by em_work_experiences terms.
  287. func ByEmWorkExperiences(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
  288. return func(s *sql.Selector) {
  289. sqlgraph.OrderByNeighborTerms(s, newEmWorkExperiencesStep(), append([]sql.OrderTerm{term}, terms...)...)
  290. }
  291. }
  292. // ByEmTutorialCount orders the results by em_tutorial count.
  293. func ByEmTutorialCount(opts ...sql.OrderTermOption) OrderOption {
  294. return func(s *sql.Selector) {
  295. sqlgraph.OrderByNeighborsCount(s, newEmTutorialStep(), opts...)
  296. }
  297. }
  298. // ByEmTutorial orders the results by em_tutorial terms.
  299. func ByEmTutorial(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
  300. return func(s *sql.Selector) {
  301. sqlgraph.OrderByNeighborTerms(s, newEmTutorialStep(), append([]sql.OrderTerm{term}, terms...)...)
  302. }
  303. }
  304. func newEmWorkExperiencesStep() *sqlgraph.Step {
  305. return sqlgraph.NewStep(
  306. sqlgraph.From(Table, FieldID),
  307. sqlgraph.To(EmWorkExperiencesInverseTable, FieldID),
  308. sqlgraph.Edge(sqlgraph.O2M, false, EmWorkExperiencesTable, EmWorkExperiencesColumn),
  309. )
  310. }
  311. func newEmTutorialStep() *sqlgraph.Step {
  312. return sqlgraph.NewStep(
  313. sqlgraph.From(Table, FieldID),
  314. sqlgraph.To(EmTutorialInverseTable, FieldID),
  315. sqlgraph.Edge(sqlgraph.O2M, false, EmTutorialTable, EmTutorialColumn),
  316. )
  317. }