mirror of
https://github.com/supanadit/geo-smart-system.git
synced 2024-11-21 16:16:22 +00:00
Endpoint Change
This commit is contained in:
parent
f5d2feaa09
commit
e7a3a34114
4
.gitignore
vendored
4
.gitignore
vendored
@ -2,5 +2,7 @@
|
||||
.vscode
|
||||
|
||||
/public
|
||||
/assets
|
||||
|
||||
!/public/.gitkeep
|
||||
!/public/.gitkeep
|
||||
!/assets/.gitkeep
|
0
assets/.gitkeep
Normal file
0
assets/.gitkeep
Normal file
10
main.go
10
main.go
@ -16,7 +16,14 @@ func main() {
|
||||
})
|
||||
r := gin.Default()
|
||||
r.Use(cors.Default())
|
||||
r.POST("/set-points", func(c *gin.Context) {
|
||||
r.GET("/get/unique/id", func(c *gin.Context) {
|
||||
var location model.Location
|
||||
_ = c.BindJSON(&location)
|
||||
c.Writer.Header().Set("Content-Type", "application/json")
|
||||
client.Do("SET", location.Type, location.Id, "POINT", location.Lat, location.Lng)
|
||||
c.JSON(200, gin.H{"status": "ok"})
|
||||
})
|
||||
r.POST("/set/point", func(c *gin.Context) {
|
||||
var location model.Location
|
||||
_ = c.BindJSON(&location)
|
||||
c.Writer.Header().Set("Content-Type", "application/json")
|
||||
@ -41,5 +48,6 @@ func main() {
|
||||
}
|
||||
})
|
||||
r.Static("/public", "./public")
|
||||
r.Static("/assets", "./assets")
|
||||
_ = r.Run()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user