Example #1
0
func (p *PlanetHandler) Routes() {
	p.RouterGroup.Use(middleware.PlayerMiddleware(p.GE.PlayerData))
	p.RouterGroup.Use(middleware.PlanetMiddleware())

	p.RouterGroup.GET("/:id", p.Get)
	p.RouterGroup.POST("/:id/rename", gin.Bind(PlanetRenameForm{}), p.Rename)
	p.RouterGroup.POST("/:id/building/build/:type", p.BuildBuilding)
	p.RouterGroup.POST("/:id/building/cancel", p.CancelBuilding)
}
Example #2
0
func (u *AccountHandler) Routes() {
	u.RouterGroup.POST("/login", gin.Bind(ge.LoginStruct{}), u.LoginHandler)
	u.RouterGroup.POST("/register", gin.Bind(ge.PlayerStruct{}), u.RegisterHandler)
}