This repository has been archived on 2026-03-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
api/router/v1/splash.go
2022-12-25 23:14:45 +01:00

18 lines
311 B
Go

package v1
import (
"gractwo-api/database"
"math/rand"
"github.com/gin-gonic/gin"
)
func GetSplash(c *gin.Context) {
var SplashList []database.Splash
err := database.DB.Find(&SplashList).Error
if err != nil {
c.JSON(404, "Not found")
}
c.JSON(200, SplashList[rand.Intn(len(SplashList)-1-0+1)+0])
}