23 lines
348 B
Go
23 lines
348 B
Go
package handler
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"galaxy/model/rest"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func BanishHandler(c *gin.Context, executor CommandExecutor) {
|
|
var req rest.BanishRequest
|
|
if errorResponse(c, c.ShouldBindJSON(&req)) {
|
|
return
|
|
}
|
|
|
|
if errorResponse(c, executor.BanishRace(req.RaceName)) {
|
|
return
|
|
}
|
|
|
|
c.Status(http.StatusNoContent)
|
|
}
|