api.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package myself
  2. import (
  3. "Cold_Logistic/internal/server/adapter/http/middleware"
  4. "github.com/gin-gonic/gin"
  5. )
  6. func Register(r *gin.RouterGroup) {
  7. api := NewApi()
  8. myself := r.Group("/myself")
  9. myself.Use(middleware.Auth())
  10. myself.GET("/info", api.myselfInfo) // 个人信息
  11. myself.POST("/update", api.updateMyselfInfo) // 修改个人信息
  12. myself.POST("/refreshToken", api.refreshToken) // 刷新token
  13. myself.POST("/address/page", api.addressPage) // 寄件/收件人列表
  14. myself.POST("/address/add", api.addAddress) // 添加寄件/收件人
  15. myself.POST("/address/update", api.updateAddress) // 修改寄件/收件人
  16. myself.POST("/address/delete", api.deleteAddress) // 删除寄件/收件人
  17. myself.POST("/logisticCompany/page", api.logisticPage) // 物流公司列表
  18. myself.POST("/logisticCompany/add", api.addLogistic) // 物流公司添加
  19. myself.POST("/logisticCompany/delete", api.deleteLogistic) // 物流公司删除
  20. myself.POST("/placeOrder", api.placeOrder) // 下单
  21. myself.POST("/orderPage", api.orderPage) // 订单列表
  22. myself.POST("/orderDetail", api.orderDetail) // 订单详情
  23. myself.POST("/orderSubNo", api.orderSubNo) // 订单揽件码
  24. return
  25. }
  26. type Api struct{}
  27. func NewApi() Api {
  28. return Api{}
  29. }