talent_get_api.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package talentapi
  2. import (
  3. "github.com/gogf/gf/net/ghttp"
  4. "youngmini_server/app/service/talent_service"
  5. )
  6. var TalentGetApi = talentGetApi{}
  7. type talentGetApi struct {
  8. }
  9. // GetInfoTables 获取所有信息表
  10. func (*talentGetApi)GetInfoTables(r *ghttp.Request) {
  11. res := talent_service.GetInfoTables()
  12. err := r.Response.WriteJson(res)
  13. if err != nil {
  14. panic("write response error")
  15. }
  16. }
  17. // GetRegionInfo 根据行政区域获取下去内所有下级行政区域
  18. func (*talentGetApi)GetRegionInfo(r *ghttp.Request) {
  19. res := talent_service.GetRegionInfo(r)
  20. err := r.Response.WriteJson(res)
  21. if err != nil {
  22. panic("write response error")
  23. }
  24. }
  25. // GetTaskList 获取任务信息列表
  26. func (*talentGetApi)GetTaskList(r *ghttp.Request) {
  27. res := talent_service.GetTaskInfoList(r)
  28. err := r.Response.WriteJson(res)
  29. if err != nil {
  30. panic("write response error")
  31. }
  32. }
  33. // TaskDetail 获取单个任务详情
  34. func (*talentGetApi)TaskDetail(r *ghttp.Request) {
  35. res := talent_service.GetTaskDetailInfo(r)
  36. err := r.Response.WriteJson(res)
  37. if err != nil {
  38. panic("write response error")
  39. }
  40. }
  41. func (*talentGetApi)SearchByTaskName(r *ghttp.Request) {
  42. res := talent_service.SearchByTaskName(r)
  43. err := r.Response.WriteJson(res)
  44. if err != nil {
  45. panic("write response error")
  46. }
  47. }