add v1 GET endpoints
This commit is contained in:
16
router/v1/image.go
Normal file
16
router/v1/image.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"gractwo-api/database"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func GetImages(c *gin.Context){
|
||||
var ImageList []database.Image
|
||||
err :=database.DB.Find(&ImageList).Error
|
||||
if err != nil {
|
||||
c.JSON(404, "Not found")
|
||||
}
|
||||
c.JSON(200, ImageList)
|
||||
}
|
||||
Reference in New Issue
Block a user