File tree 4 files changed +15
-4
lines changed
4 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 161
161
"correct_ans" : {" image_url" }
162
162
},
163
163
{
164
- "id" : 1 ,
164
+ "id" : 2 ,
165
165
"level" : 1 ,
166
166
"questions_image" : {" image_url" },
167
167
"questions" : " Gambar diatas merepresentasikan huruf alfabet apa?" ,
172
172
"correct_ans" : " A"
173
173
},
174
174
{
175
- "id" : 1 ,
175
+ "id" : 3 ,
176
176
"level" : 1 ,
177
177
"questions_image" : null ,
178
178
"questions" : " Gambar yang benar untuk huruf \" C\" pada bahasa isyarat adalah..." ,
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ type User struct {
8
8
Username string ` gorm:"type:varchar(255)"` ` json:username`
9
9
Email string ` gorm:"unique:type:varchar(255)"` ` json:email`
10
10
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`
12
12
Level int ` gorm:"default:1:type:int"` ` json:level`
13
13
Leveling []models.Leveling ` gorm:"manytomany"`
14
14
Experience int ` gorm:"type:int"` ` json:experience`
Original file line number Diff line number Diff line change 6
6
"github.com/gin-gonic/gin"
7
7
8
8
middleware "github.com/AkbarFikri/signconnect_backend/routers/Middleware"
9
+
9
10
)
10
11
11
12
func SetupRoute () * gin.Engine {
@@ -14,7 +15,7 @@ func SetupRoute() *gin.Engine {
14
15
router .NoRoute (func (ctx * gin.Context ) {
15
16
ctx .JSON (http .StatusNotFound , gin.H {"status" : http .StatusNotFound , "message" : "Route Not Found" })
16
17
})
17
-
18
+ // api.signconnect.tech --> api.signconnect.tech/auth/signup
18
19
router .Use (gin .Logger ())
19
20
router .Use (gin .Recovery ())
20
21
router .Use (middleware .CORSMiddleware ())
@@ -26,6 +27,9 @@ func SetupRoute() *gin.Engine {
26
27
user := router .Group ("/user" , middleware .AuthJWTToken )
27
28
UserRoutes (user )
28
29
30
+ leaderboard := router .Group ("/leaderboard" )
31
+ LeaderboardRoutes (leaderboard )
32
+
29
33
HomeRoutes (router ) //routes register
30
34
return router
31
35
}
Original file line number Diff line number Diff line change 6
6
"github.com/gin-gonic/gin"
7
7
8
8
controller "github.com/AkbarFikri/signconnect_backend/Controller"
9
+
9
10
)
10
11
11
12
func UserRoutes (route * gin.RouterGroup ) {
@@ -25,6 +26,12 @@ func AuthRoutes(route *gin.RouterGroup) {
25
26
route .POST ("/signin" , controller .Signin )
26
27
}
27
28
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
+
28
35
func HomeRoutes (route * gin.Engine ) {
29
36
route .GET ("/" , controller .HomeAPI )
30
37
}
You can’t perform that action at this time.
0 commit comments