func (this PlayersController) Authenticate(ginContext *gin.Context) { _, err := models.Player{}.Find(this.Context.AeContext, this.Context.AccessToken) if err.Any() { this.RespondWith.Error(http.StatusForbidden, api.UserError("Invalid Access Token")) ginContext.Abort() } }
func (this PlayersController) Create(ginContext *gin.Context) { player, err := models.Player{}.Create(this.Context.AeContext) if err.Any() { this.RespondWith.UnexpectedError(err) return } this.RespondWith.JSON(http.StatusCreated, player) }