Skip to content

Commit a69d519

Browse files
committed
update
1 parent fdafcd9 commit a69d519

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

Docs/API-Specification.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
"correct_ans" : {"image_url"}
162162
},
163163
{
164-
"id" : 1,
164+
"id" : 2,
165165
"level" : 1,
166166
"questions_image" : {"image_url"},
167167
"questions" : "Gambar diatas merepresentasikan huruf alfabet apa?",
@@ -172,7 +172,7 @@
172172
"correct_ans" : "A"
173173
},
174174
{
175-
"id" : 1,
175+
"id" : 3,
176176
"level" : 1,
177177
"questions_image" : null,
178178
"questions" : "Gambar yang benar untuk huruf \"C\" pada bahasa isyarat adalah...",

Docs/Database-Specification.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type User struct {
88
Username string `gorm:"type:varchar(255)"` `json:username`
99
Email string `gorm:"unique:type:varchar(255)"` `json:email`
1010
Password string `gorm:"type:text"` `json:password`
11-
Role string `gorm:"type:varchar(20)"` `json:role`
11+
Role string `gorm:"default:"user":type:varchar(20)"` `json:role`
1212
Level int `gorm:"default:1:type:int"``json:level`
1313
Leveling []models.Leveling `gorm:"manytomany"`
1414
Experience int `gorm:"type:int"` `json:experience`

routers/index.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/gin-gonic/gin"
77

88
middleware "github.com/AkbarFikri/signconnect_backend/routers/Middleware"
9+
910
)
1011

1112
func SetupRoute() *gin.Engine {
@@ -14,7 +15,7 @@ func SetupRoute() *gin.Engine {
1415
router.NoRoute(func(ctx *gin.Context) {
1516
ctx.JSON(http.StatusNotFound, gin.H{"status": http.StatusNotFound, "message": "Route Not Found"})
1617
})
17-
18+
// api.signconnect.tech --> api.signconnect.tech/auth/signup
1819
router.Use(gin.Logger())
1920
router.Use(gin.Recovery())
2021
router.Use(middleware.CORSMiddleware())
@@ -26,6 +27,9 @@ func SetupRoute() *gin.Engine {
2627
user := router.Group("/user", middleware.AuthJWTToken)
2728
UserRoutes(user)
2829

30+
leaderboard := router.Group("/leaderboard")
31+
LeaderboardRoutes(leaderboard)
32+
2933
HomeRoutes(router) //routes register
3034
return router
3135
}

routers/router.go

+7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/gin-gonic/gin"
77

88
controller "github.com/AkbarFikri/signconnect_backend/Controller"
9+
910
)
1011

1112
func UserRoutes(route *gin.RouterGroup) {
@@ -25,6 +26,12 @@ func AuthRoutes(route *gin.RouterGroup) {
2526
route.POST("/signin", controller.Signin)
2627
}
2728

29+
func LeaderboardRoutes(route *gin.RouterGroup) {
30+
route.GET("/", func(ctx *gin.Context) {
31+
ctx.JSON(http.StatusOK, gin.H{"status": http.StatusOK, "message": "Gooddd"})
32+
})
33+
}
34+
2835
func HomeRoutes(route *gin.Engine) {
2936
route.GET("/", controller.HomeAPI)
3037
}

0 commit comments

Comments
 (0)