employee.api 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. // intro | 个人介绍
  22. Intro *string `json:"intro,optional"`
  23. // estimate | 自我评价
  24. Estimate *string `json:"estimate,optional"`
  25. // skill | 技能卡
  26. Skill *string `json:"skill,optional"`
  27. // ability_type | 能力类型
  28. AbilityType *string `json:"abilityType,optional"`
  29. // scene | 使用场景
  30. Scene *string `json:"scene,optional"`
  31. SceneList []EmployeeConfigInfo `json:"sceneList,optional"`
  32. // switch_in | 支持介入
  33. SwitchIn *string `json:"switchIn,optional"`
  34. SwitchInList []EmployeeConfigInfo `json:"switchInList,optional"`
  35. Tutorial []TutorialInfo `json:"tutorial,optional"`
  36. // video_url | 视频地址
  37. VideoUrl *string `json:"videoUrl,optional"`
  38. // work_experience | 工作经验
  39. WorkExperience []WorkExperienceInfo `json:"workExperience,optional"`
  40. }
  41. // The response data of employee list | Employee列表数据
  42. EmployeeListResp {
  43. BaseDataInfo
  44. // Employee list data | Employee列表数据
  45. Data EmployeeListInfo `json:"data"`
  46. }
  47. // Employee list data | Employee列表数据
  48. EmployeeListInfo {
  49. BaseListInfo
  50. // The API list data | Employee列表数据
  51. Data []EmployeeInfo `json:"data"`
  52. }
  53. // Get employee list request params | Employee列表请求参数
  54. EmployeeListReq {
  55. PageInfo
  56. // title | 标题
  57. Title *string `json:"title,optional"`
  58. // tags | 个人标签
  59. Tags *string `json:"tags,optional"`
  60. }
  61. // Employee information response | Employee信息返回体
  62. EmployeeInfoResp {
  63. BaseDataInfo
  64. // Employee information | Employee数据
  65. Data EmployeeInfo `json:"data"`
  66. }
  67. )
  68. @server(
  69. jwt: Auth
  70. group: employee
  71. middleware: Authority
  72. )
  73. service Wechat {
  74. // Create employee information | 创建Employee
  75. @handler createEmployee
  76. post /employee/create (EmployeeInfo) returns (BaseMsgResp)
  77. // Update employee information | 更新Employee
  78. @handler updateEmployee
  79. post /employee/update (EmployeeInfo) returns (BaseMsgResp)
  80. // Delete employee information | 删除Employee信息
  81. @handler deleteEmployee
  82. post /employee/delete (IDsReq) returns (BaseMsgResp)
  83. // Get employee list | 获取Employee列表
  84. @handler getEmployeeList
  85. post /employee/list (EmployeeListReq) returns (EmployeeListResp)
  86. // Get employee by ID | 通过ID获取Employee
  87. @handler getEmployeeById
  88. post /employee (IDReq) returns (EmployeeInfoResp)
  89. }