Initial commit
This commit is contained in:
15
controllers/player_controller.go
Normal file
15
controllers/player_controller.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"InfrantrySkillCalculator/models"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// GetAllPlayers GET /player
|
||||
func GetAllPlayers(c *gin.Context) {
|
||||
var players []models.Player
|
||||
models.DB.Find(&players)
|
||||
|
||||
c.JSON(http.StatusOK, players)
|
||||
}
|
||||
Reference in New Issue
Block a user