init.go 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package route
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "youngee_m_api/handler"
  5. "youngee_m_api/handler/operate"
  6. "youngee_m_api/model/http_model"
  7. )
  8. func InitRoute(r *gin.Engine) {
  9. r.POST("/login", handler.WrapCodeLoginHandler)
  10. r.GET("/getLoginUser", handler.WrapGetLoginUserHandler)
  11. r.POST("/userInfo", handler.WrapGetUserInfoHandler)
  12. r.GET("/test/ping", func(c *gin.Context) {
  13. resp := http_model.CommonResponse{
  14. Status: 0,
  15. Message: "",
  16. Data: "ping",
  17. }
  18. c.JSON(200, resp)
  19. })
  20. m := r.Group("/youngee/m")
  21. {
  22. m.POST("/test", func(c *gin.Context) {
  23. resp := http_model.CommonResponse{
  24. Status: 0,
  25. Message: "",
  26. Data: "ping",
  27. }
  28. c.JSON(200, resp)
  29. })
  30. m.POST("/product/list", handler.WrapFullProjectListHandler)
  31. m.POST("/project/show", handler.WrapShowProjectHandler)
  32. m.POST("/project/handle", handler.WrapProjectHandleHandler)
  33. m.POST("/product/findall", handler.WrapFindAllProductHandler)
  34. m.POST("/project/create", handler.WrapCreateProjectHandler)
  35. m.POST("/product/create", handler.WrapCreateProductHandler)
  36. m.POST("/product/find", handler.WrapFindProductHandler)
  37. m.POST("/pay/paysum", handler.WrapPaySumHandler)
  38. m.POST("/project/update", handler.WrapUpdateProjectHandler)
  39. m.POST("/project/approve", handler.WrapApproveProjectHandler)
  40. m.POST("/project/all", handler.WrapGetAllProjectHandler)
  41. m.POST("/project/taskList", handler.WrapProjectTaskListHandler)
  42. }
  43. u := r.Group("/youngee/m/user")
  44. {
  45. u.POST("/getUserList", handler.WrapGetUserListHandler)
  46. u.POST("/updateUserInfo", handler.WrapUpdateUserInfoHandler)
  47. u.POST("/createUser", handler.WrapCreateUserHandler)
  48. u.POST("/disabledUser", handler.WrapDisabledUserHandler)
  49. u.POST("/enterpriseUser", handler.WrapEnterpriseUserHandler)
  50. u.POST("/creatorList", handler.WrapCreatorListHandler)
  51. u.POST("/platformAccInfo", handler.WrapPlatformAccInfoHandler)
  52. u.POST("/talentInfo", handler.WrapTalentInfoHandler)
  53. u.POST("/accountInfo", handler.WrapAccountInfoHandler)
  54. u.POST("/deleteAccount", handler.WrapDeleteAccountHandler)
  55. u.POST("/getTaskRecord", handler.WrapGetTaskRecordHandler)
  56. }
  57. o := r.Group("/youngee/m/operate")
  58. {
  59. o.POST("/addPricing", operate.WrapAddPricingHandler)
  60. o.POST("/searchPricing", operate.WrapSearchPricingHandler)
  61. o.POST("/modifyPricing", operate.WrapModifyPricingHandler)
  62. }
  63. }