employee.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  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. // DefaultHireCount holds the default value on creation for the "hire_count" field.
  134. DefaultHireCount int
  135. // HireCountValidator is a validator for the "hire_count" field. It is called by the builders before save.
  136. HireCountValidator func(int) error
  137. // DefaultServiceCount holds the default value on creation for the "service_count" field.
  138. DefaultServiceCount int
  139. // ServiceCountValidator is a validator for the "service_count" field. It is called by the builders before save.
  140. ServiceCountValidator func(int) error
  141. // DefaultAchievementCount holds the default value on creation for the "achievement_count" field.
  142. DefaultAchievementCount int
  143. // AchievementCountValidator is a validator for the "achievement_count" field. It is called by the builders before save.
  144. AchievementCountValidator func(int) error
  145. // DefaultIntro holds the default value on creation for the "intro" field.
  146. DefaultIntro string
  147. // DefaultEstimate holds the default value on creation for the "estimate" field.
  148. DefaultEstimate string
  149. // DefaultSkill holds the default value on creation for the "skill" field.
  150. DefaultSkill string
  151. // DefaultAbilityType holds the default value on creation for the "ability_type" field.
  152. DefaultAbilityType string
  153. // DefaultScene holds the default value on creation for the "scene" field.
  154. DefaultScene string
  155. // DefaultSwitchIn holds the default value on creation for the "switch_in" field.
  156. DefaultSwitchIn string
  157. // DefaultVideoURL holds the default value on creation for the "video_url" field.
  158. DefaultVideoURL string
  159. // OrganizationIDValidator is a validator for the "organization_id" field. It is called by the builders before save.
  160. OrganizationIDValidator func(uint64) error
  161. // CategoryIDValidator is a validator for the "category_id" field. It is called by the builders before save.
  162. CategoryIDValidator func(uint64) error
  163. // DefaultAPIBase holds the default value on creation for the "api_base" field.
  164. DefaultAPIBase string
  165. // DefaultAPIKey holds the default value on creation for the "api_key" field.
  166. DefaultAPIKey string
  167. // DefaultIsVip holds the default value on creation for the "is_vip" field.
  168. DefaultIsVip int
  169. )
  170. // OrderOption defines the ordering options for the Employee queries.
  171. type OrderOption func(*sql.Selector)
  172. // ByID orders the results by the id field.
  173. func ByID(opts ...sql.OrderTermOption) OrderOption {
  174. return sql.OrderByField(FieldID, opts...).ToFunc()
  175. }
  176. // ByCreatedAt orders the results by the created_at field.
  177. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  178. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  179. }
  180. // ByUpdatedAt orders the results by the updated_at field.
  181. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  182. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  183. }
  184. // ByDeletedAt orders the results by the deleted_at field.
  185. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  186. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  187. }
  188. // ByTitle orders the results by the title field.
  189. func ByTitle(opts ...sql.OrderTermOption) OrderOption {
  190. return sql.OrderByField(FieldTitle, opts...).ToFunc()
  191. }
  192. // ByAvatar orders the results by the avatar field.
  193. func ByAvatar(opts ...sql.OrderTermOption) OrderOption {
  194. return sql.OrderByField(FieldAvatar, opts...).ToFunc()
  195. }
  196. // ByTags orders the results by the tags field.
  197. func ByTags(opts ...sql.OrderTermOption) OrderOption {
  198. return sql.OrderByField(FieldTags, opts...).ToFunc()
  199. }
  200. // ByHireCount orders the results by the hire_count field.
  201. func ByHireCount(opts ...sql.OrderTermOption) OrderOption {
  202. return sql.OrderByField(FieldHireCount, opts...).ToFunc()
  203. }
  204. // ByServiceCount orders the results by the service_count field.
  205. func ByServiceCount(opts ...sql.OrderTermOption) OrderOption {
  206. return sql.OrderByField(FieldServiceCount, opts...).ToFunc()
  207. }
  208. // ByAchievementCount orders the results by the achievement_count field.
  209. func ByAchievementCount(opts ...sql.OrderTermOption) OrderOption {
  210. return sql.OrderByField(FieldAchievementCount, opts...).ToFunc()
  211. }
  212. // ByIntro orders the results by the intro field.
  213. func ByIntro(opts ...sql.OrderTermOption) OrderOption {
  214. return sql.OrderByField(FieldIntro, opts...).ToFunc()
  215. }
  216. // ByEstimate orders the results by the estimate field.
  217. func ByEstimate(opts ...sql.OrderTermOption) OrderOption {
  218. return sql.OrderByField(FieldEstimate, opts...).ToFunc()
  219. }
  220. // BySkill orders the results by the skill field.
  221. func BySkill(opts ...sql.OrderTermOption) OrderOption {
  222. return sql.OrderByField(FieldSkill, opts...).ToFunc()
  223. }
  224. // ByAbilityType orders the results by the ability_type field.
  225. func ByAbilityType(opts ...sql.OrderTermOption) OrderOption {
  226. return sql.OrderByField(FieldAbilityType, opts...).ToFunc()
  227. }
  228. // ByScene orders the results by the scene field.
  229. func ByScene(opts ...sql.OrderTermOption) OrderOption {
  230. return sql.OrderByField(FieldScene, opts...).ToFunc()
  231. }
  232. // BySwitchIn orders the results by the switch_in field.
  233. func BySwitchIn(opts ...sql.OrderTermOption) OrderOption {
  234. return sql.OrderByField(FieldSwitchIn, opts...).ToFunc()
  235. }
  236. // ByVideoURL orders the results by the video_url field.
  237. func ByVideoURL(opts ...sql.OrderTermOption) OrderOption {
  238. return sql.OrderByField(FieldVideoURL, opts...).ToFunc()
  239. }
  240. // ByOrganizationID orders the results by the organization_id field.
  241. func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
  242. return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
  243. }
  244. // ByCategoryID orders the results by the category_id field.
  245. func ByCategoryID(opts ...sql.OrderTermOption) OrderOption {
  246. return sql.OrderByField(FieldCategoryID, opts...).ToFunc()
  247. }
  248. // ByAPIBase orders the results by the api_base field.
  249. func ByAPIBase(opts ...sql.OrderTermOption) OrderOption {
  250. return sql.OrderByField(FieldAPIBase, opts...).ToFunc()
  251. }
  252. // ByAPIKey orders the results by the api_key field.
  253. func ByAPIKey(opts ...sql.OrderTermOption) OrderOption {
  254. return sql.OrderByField(FieldAPIKey, opts...).ToFunc()
  255. }
  256. // ByAiInfo orders the results by the ai_info field.
  257. func ByAiInfo(opts ...sql.OrderTermOption) OrderOption {
  258. return sql.OrderByField(FieldAiInfo, opts...).ToFunc()
  259. }
  260. // ByIsVip orders the results by the is_vip field.
  261. func ByIsVip(opts ...sql.OrderTermOption) OrderOption {
  262. return sql.OrderByField(FieldIsVip, opts...).ToFunc()
  263. }
  264. // ByChatURL orders the results by the chat_url field.
  265. func ByChatURL(opts ...sql.OrderTermOption) OrderOption {
  266. return sql.OrderByField(FieldChatURL, opts...).ToFunc()
  267. }
  268. // ByEmWorkExperiencesCount orders the results by em_work_experiences count.
  269. func ByEmWorkExperiencesCount(opts ...sql.OrderTermOption) OrderOption {
  270. return func(s *sql.Selector) {
  271. sqlgraph.OrderByNeighborsCount(s, newEmWorkExperiencesStep(), opts...)
  272. }
  273. }
  274. // ByEmWorkExperiences orders the results by em_work_experiences terms.
  275. func ByEmWorkExperiences(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
  276. return func(s *sql.Selector) {
  277. sqlgraph.OrderByNeighborTerms(s, newEmWorkExperiencesStep(), append([]sql.OrderTerm{term}, terms...)...)
  278. }
  279. }
  280. // ByEmTutorialCount orders the results by em_tutorial count.
  281. func ByEmTutorialCount(opts ...sql.OrderTermOption) OrderOption {
  282. return func(s *sql.Selector) {
  283. sqlgraph.OrderByNeighborsCount(s, newEmTutorialStep(), opts...)
  284. }
  285. }
  286. // ByEmTutorial orders the results by em_tutorial terms.
  287. func ByEmTutorial(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
  288. return func(s *sql.Selector) {
  289. sqlgraph.OrderByNeighborTerms(s, newEmTutorialStep(), append([]sql.OrderTerm{term}, terms...)...)
  290. }
  291. }
  292. func newEmWorkExperiencesStep() *sqlgraph.Step {
  293. return sqlgraph.NewStep(
  294. sqlgraph.From(Table, FieldID),
  295. sqlgraph.To(EmWorkExperiencesInverseTable, FieldID),
  296. sqlgraph.Edge(sqlgraph.O2M, false, EmWorkExperiencesTable, EmWorkExperiencesColumn),
  297. )
  298. }
  299. func newEmTutorialStep() *sqlgraph.Step {
  300. return sqlgraph.NewStep(
  301. sqlgraph.From(Table, FieldID),
  302. sqlgraph.To(EmTutorialInverseTable, FieldID),
  303. sqlgraph.Edge(sqlgraph.O2M, false, EmTutorialTable, EmTutorialColumn),
  304. )
  305. }