employee.api 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. import "../base.api"
  2. import "./work_experience.api"
  3. import "./tutorial.api"
  4. import "./employee_config.api"
  5. type (
  6. // The data of employee information | Employee信息
  7. EmployeeInfo {
  8. BaseIDInfo
  9. // title | 标题
  10. Title *string `json:"title,optional"`
  11. // avatar | 头像
  12. Avatar *string `json:"avatar,optional"`
  13. // tags | 个人标签
  14. Tags *string `json:"tags,optional"`
  15. // hire_count | 被雇佣次数
  16. HireCount *int `json:"hireCount,optional"`
  17. // service_count | 已服务次数
  18. ServiceCount *int `json:"serviceCount,optional"`
  19. // achievement_count | 业绩单数
  20. AchievementCount *int `json:"achievementCount,optional"`
  21. // category_id | 分类ID
  22. CategoryId *uint64 `json:"categoryId,optional"`
  23. // intro | 个人介绍
  24. Intro *string `json:"intro,optional"`
  25. // estimate | 自我评价
  26. Estimate *string `json:"estimate,optional"`
  27. // skill | 技能卡
  28. Skill *string `json:"skill,optional"`
  29. // ability_type | 能力类型
  30. AbilityType *string `json:"abilityType,optional"`
  31. // scene | 使用场景
  32. Scene *string `json:"scene,optional"`
  33. SceneList []EmployeeConfigInfo `json:"sceneList,optional"`
  34. // switch_in | 支持介入
  35. SwitchIn *string `json:"switchIn,optional"`
  36. SwitchInList []EmployeeConfigInfo `json:"switchInList,optional"`
  37. Tutorial []TutorialInfo `json:"tutorial,optional"`
  38. // video_url | 视频地址
  39. VideoUrl *string `json:"videoUrl,optional"`
  40. // work_experience | 工作经验
  41. WorkExperience []WorkExperienceInfo `json:"workExperience,optional"`
  42. ApiBase *string `json:"apiBase,optional"`
  43. ApiKey *string `json:"apiKey,optional"`
  44. }
  45. // The response data of employee list | Employee列表数据
  46. EmployeeListResp {
  47. BaseDataInfo
  48. // Employee list data | Employee列表数据
  49. Data EmployeeListInfo `json:"data"`
  50. }
  51. // Employee list data | Employee列表数据
  52. EmployeeListInfo {
  53. BaseListInfo
  54. // The API list data | Employee列表数据
  55. Data []EmployeeInfo `json:"data"`
  56. }
  57. // Get employee list request params | Employee列表请求参数
  58. EmployeeListReq {
  59. PageInfo
  60. // title | 标题
  61. Title *string `json:"title,optional"`
  62. // tags | 个人标签
  63. Tags *string `json:"tags,optional"`
  64. // category_id | 分类ID
  65. CategoryId *uint64 `json:"categoryId,optional"`
  66. }
  67. // Employee information response | Employee信息返回体
  68. EmployeeInfoResp {
  69. BaseDataInfo
  70. // Employee information | Employee数据
  71. Data EmployeeInfo `json:"data"`
  72. }
  73. AuthReq {
  74. Token *string `json:"token,optional"`
  75. Data uint64 `json:"data,optional"`
  76. }
  77. AuthResp {
  78. Token *string `json:"token,optional"`
  79. Data *uint64 `json:"data,optional"`
  80. Original interface{} `json:"original,optional"`
  81. OK interface{} `json:"ok,optional"`
  82. SecretKey string `json:"secretKey,optional"`
  83. }
  84. )
  85. @server(
  86. // jwt: Auth
  87. group: employee
  88. // middleware: Miniprogram
  89. )
  90. service Wechat {
  91. // Get employee list | 获取Employee列表
  92. @handler getApiEmployeeList
  93. post /api/employee/list (EmployeeListReq) returns (EmployeeListResp)
  94. // Get employee by ID | 通过ID获取Employee
  95. @handler getApiEmployeeDetail
  96. post /api/employee/detail (IDReq) returns (EmployeeInfoResp)
  97. }
  98. @server(
  99. group: employee
  100. )
  101. service Wechat {
  102. // Get employee list | 获取Employee列表
  103. @handler getEmployeeSearch
  104. post /employee/search (EmployeeListReq) returns (EmployeeListResp)
  105. // Get employee list | 获取Employee列表
  106. @handler getEmployeeSearchTest
  107. post /employee/search/test (AuthReq) returns (AuthResp)
  108. // Get employee by ID | 通过ID获取Employee
  109. @handler getEmployeeDetail
  110. post /employee/detail (IDReq) returns (EmployeeInfoResp)
  111. }
  112. @server(
  113. jwt: Auth
  114. group: employee
  115. middleware: Authority
  116. )
  117. service Wechat {
  118. // Create employee information | 创建Employee
  119. @handler createEmployee
  120. post /employee/create (EmployeeInfo) returns (BaseMsgResp)
  121. // Update employee information | 更新Employee
  122. @handler updateEmployee
  123. post /employee/update (EmployeeInfo) returns (BaseMsgResp)
  124. // Delete employee information | 删除Employee信息
  125. @handler deleteEmployee
  126. post /employee/delete (IDsReq) returns (BaseMsgResp)
  127. // Get employee list | 获取Employee列表
  128. @handler getEmployeeList
  129. post /employee/list (EmployeeListReq) returns (EmployeeListResp)
  130. // Get employee by ID | 通过ID获取Employee
  131. @handler getEmployeeById
  132. post /employee (IDReq) returns (EmployeeInfoResp)
  133. }