employee.api 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. }
  43. // The response data of employee list | Employee列表数据
  44. EmployeeListResp {
  45. BaseDataInfo
  46. // Employee list data | Employee列表数据
  47. Data EmployeeListInfo `json:"data"`
  48. }
  49. // Employee list data | Employee列表数据
  50. EmployeeListInfo {
  51. BaseListInfo
  52. // The API list data | Employee列表数据
  53. Data []EmployeeInfo `json:"data"`
  54. }
  55. // Get employee list request params | Employee列表请求参数
  56. EmployeeListReq {
  57. PageInfo
  58. // title | 标题
  59. Title *string `json:"title,optional"`
  60. // tags | 个人标签
  61. Tags *string `json:"tags,optional"`
  62. // category_id | 分类ID
  63. CategoryId *uint64 `json:"categoryId,optional"`
  64. }
  65. // Employee information response | Employee信息返回体
  66. EmployeeInfoResp {
  67. BaseDataInfo
  68. // Employee information | Employee数据
  69. Data EmployeeInfo `json:"data"`
  70. }
  71. )
  72. @server(
  73. group: employee
  74. )
  75. service Wechat {
  76. // Get employee list | 获取Employee列表
  77. @handler getEmployeeSearch
  78. post /employee/search (EmployeeListReq) returns (EmployeeListResp)
  79. // Get employee by ID | 通过ID获取Employee
  80. @handler getEmployeeDetail
  81. post /employee/detail (IDReq) returns (EmployeeInfoResp)
  82. }
  83. @server(
  84. jwt: Auth
  85. group: employee
  86. middleware: Authority
  87. )
  88. service Wechat {
  89. // Create employee information | 创建Employee
  90. @handler createEmployee
  91. post /employee/create (EmployeeInfo) returns (BaseMsgResp)
  92. // Update employee information | 更新Employee
  93. @handler updateEmployee
  94. post /employee/update (EmployeeInfo) returns (BaseMsgResp)
  95. // Delete employee information | 删除Employee信息
  96. @handler deleteEmployee
  97. post /employee/delete (IDsReq) returns (BaseMsgResp)
  98. // Get employee list | 获取Employee列表
  99. @handler getEmployeeList
  100. post /employee/list (EmployeeListReq) returns (EmployeeListResp)
  101. // Get employee by ID | 通过ID获取Employee
  102. @handler getEmployeeById
  103. post /employee (IDReq) returns (EmployeeInfoResp)
  104. }