employee.api 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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. // AI信息
  45. AiInfo *string `json:"aiInfo,optional"`
  46. ShowChat *bool `json:"showChat,optional"`
  47. IsVip *bool `json:"isVip,optional"`
  48. }
  49. // The response data of employee list | Employee列表数据
  50. EmployeeListResp {
  51. BaseDataInfo
  52. // Employee list data | Employee列表数据
  53. Data EmployeeListInfo `json:"data"`
  54. }
  55. // Employee list data | Employee列表数据
  56. EmployeeListInfo {
  57. BaseListInfo
  58. // The API list data | Employee列表数据
  59. Data []EmployeeInfo `json:"data"`
  60. }
  61. // Get employee list request params | Employee列表请求参数
  62. EmployeeListReq {
  63. PageInfo
  64. // title | 标题
  65. Title *string `json:"title,optional"`
  66. // tags | 个人标签
  67. Tags *string `json:"tags,optional"`
  68. // category_id | 分类ID
  69. CategoryId *uint64 `json:"categoryId,optional"`
  70. }
  71. // Employee information response | Employee信息返回体
  72. EmployeeInfoResp {
  73. BaseDataInfo
  74. // Employee information | Employee数据
  75. Data EmployeeInfo `json:"data"`
  76. }
  77. AuthReq {
  78. Token *string `json:"token,optional"`
  79. Data uint64 `json:"data,optional"`
  80. }
  81. AuthResp {
  82. Token *string `json:"token,optional"`
  83. Data *uint64 `json:"data,optional"`
  84. Original interface{} `json:"original,optional"`
  85. OK interface{} `json:"ok,optional"`
  86. SecretKey string `json:"secretKey,optional"`
  87. }
  88. )
  89. @server(
  90. group: employee
  91. )
  92. service Wechat {
  93. // Get employee list | 获取Employee列表
  94. @handler getApiEmployeeList
  95. post /api/employee/list (EmployeeListReq) returns (EmployeeListResp)
  96. // Get employee by ID | 通过ID获取Employee
  97. @handler getApiEmployeeDetail
  98. post /api/employee/detail (IDReq) returns (EmployeeInfoResp)
  99. }
  100. @server(
  101. group: employee
  102. )
  103. service Wechat {
  104. // Get employee list | 获取Employee列表
  105. @handler getEmployeeSearch
  106. post /employee/search (EmployeeListReq) returns (EmployeeListResp)
  107. // Get employee list | 获取Employee列表
  108. @handler getEmployeeSearchTest
  109. post /employee/search/test (AuthReq) returns (AuthResp)
  110. // Get employee by ID | 通过ID获取Employee
  111. @handler getEmployeeDetail
  112. post /employee/detail (IDReq) returns (EmployeeInfoResp)
  113. }
  114. @server(
  115. jwt: Auth
  116. group: employee
  117. middleware: Authority
  118. )
  119. service Wechat {
  120. // Create employee information | 创建Employee
  121. @handler createEmployee
  122. post /employee/create (EmployeeInfo) returns (BaseMsgResp)
  123. // Update employee information | 更新Employee
  124. @handler updateEmployee
  125. post /employee/update (EmployeeInfo) returns (BaseMsgResp)
  126. // Delete employee information | 删除Employee信息
  127. @handler deleteEmployee
  128. post /employee/delete (IDsReq) returns (BaseMsgResp)
  129. // Get employee list | 获取Employee列表
  130. @handler getEmployeeList
  131. post /employee/list (EmployeeListReq) returns (EmployeeListResp)
  132. // Get employee by ID | 通过ID获取Employee
  133. @handler getEmployeeById
  134. post /employee (IDReq) returns (EmployeeInfoResp)
  135. }