employee.api 4.8 KB

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