employee.api 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. import "../base.api"
  2. import "./work_experience.api"
  3. import "./tutorial.api"
  4. type (
  5. // The data of employee information | Employee信息
  6. EmployeeInfo {
  7. BaseIDInfo
  8. // title | 标题
  9. Title *string `json:"title,optional"`
  10. // avatar | 头像
  11. Avatar *string `json:"avatar,optional"`
  12. // tags | 个人标签
  13. Tags *string `json:"tags,optional"`
  14. // hire_count | 被雇佣次数
  15. HireCount *int `json:"hireCount,optional"`
  16. // service_count | 已服务次数
  17. ServiceCount *int `json:"serviceCount,optional"`
  18. // achievement_count | 业绩单数
  19. AchievementCount *int `json:"achievementCount,optional"`
  20. // intro | 个人介绍
  21. Intro *string `json:"intro,optional"`
  22. // estimate | 自我评价
  23. Estimate *string `json:"estimate,optional"`
  24. // skill | 技能卡
  25. Skill *string `json:"skill,optional"`
  26. // ability_type | 能力类型
  27. AbilityType *string `json:"abilityType,optional"`
  28. // scene | 使用场景
  29. Scene *string `json:"scene,optional"`
  30. // switch_in | 支持介入
  31. SwitchIn *string `json:"switchIn,optional"`
  32. Tutorial []TutorialInfo `json:"tutorial,optional"`
  33. // video_url | 视频地址
  34. VideoUrl *string `json:"videoUrl,optional"`
  35. // work_experience | 工作经验
  36. WorkExperience []WorkExperienceInfo `json:"workExperience,optional"`
  37. }
  38. // The response data of employee list | Employee列表数据
  39. EmployeeListResp {
  40. BaseDataInfo
  41. // Employee list data | Employee列表数据
  42. Data EmployeeListInfo `json:"data"`
  43. }
  44. // Employee list data | Employee列表数据
  45. EmployeeListInfo {
  46. BaseListInfo
  47. // The API list data | Employee列表数据
  48. Data []EmployeeInfo `json:"data"`
  49. }
  50. // Get employee list request params | Employee列表请求参数
  51. EmployeeListReq {
  52. PageInfo
  53. // title | 标题
  54. Title *string `json:"title,optional"`
  55. // tags | 个人标签
  56. Tags *string `json:"tags,optional"`
  57. }
  58. // Employee information response | Employee信息返回体
  59. EmployeeInfoResp {
  60. BaseDataInfo
  61. // Employee information | Employee数据
  62. Data EmployeeInfo `json:"data"`
  63. }
  64. )
  65. @server(
  66. jwt: Auth
  67. group: employee
  68. middleware: Authority
  69. )
  70. service Wechat {
  71. // Create employee information | 创建Employee
  72. @handler createEmployee
  73. post /employee/create (EmployeeInfo) returns (BaseMsgResp)
  74. // Update employee information | 更新Employee
  75. @handler updateEmployee
  76. post /employee/update (EmployeeInfo) returns (BaseMsgResp)
  77. // Delete employee information | 删除Employee信息
  78. @handler deleteEmployee
  79. post /employee/delete (IDsReq) returns (BaseMsgResp)
  80. // Get employee list | 获取Employee列表
  81. @handler getEmployeeList
  82. post /employee/list (EmployeeListReq) returns (EmployeeListResp)
  83. // Get employee by ID | 通过ID获取Employee
  84. @handler getEmployeeById
  85. post /employee (IDReq) returns (EmployeeInfoResp)
  86. }