File tree Expand file tree Collapse file tree 5 files changed +11
-1
lines changed Expand file tree Collapse file tree 5 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ require (
66 github.com/bytedance/sonic v1.10.2 // indirect
77 github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
88 github.com/chenzhuoyu/iasm v0.9.1 // indirect
9+ github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
910 github.com/gabriel-vasile/mimetype v1.4.3 // indirect
1011 github.com/gin-contrib/sse v0.1.0 // indirect
1112 github.com/gin-gonic/gin v1.9.1 // indirect
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ github.com/chenzhuoyu/iasm v0.9.1 h1:tUHQJXo3NhBqw6s33wkGn9SP3bvrWLdlVIJ3hQBL7P0
1111github.com/chenzhuoyu/iasm v0.9.1 /go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog =
1212github.com/davecgh/go-spew v1.1.0 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
1313github.com/davecgh/go-spew v1.1.1 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
14+ github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM =
15+ github.com/dgrijalva/jwt-go v3.2.0+incompatible /go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ =
1416github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0 =
1517github.com/gabriel-vasile/mimetype v1.4.3 /go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk =
1618github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE =
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ package main
22
33import (
44 "gin-mongo-api/src/database"
5- "github.com/gin-gonic/gin"
65 "gin-mongo-api/src/routes"
6+ "github.com/gin-gonic/gin"
77)
88
99func main () {
Original file line number Diff line number Diff line change @@ -72,6 +72,12 @@ func Register() gin.HandlerFunc {
7272 }
7373}
7474
75+ func Greeting () gin.HandlerFunc {
76+ return func (c * gin.Context ) {
77+ c .JSON (http .StatusCreated , res.UserResponse {Status : http .StatusAccepted , Data : map [string ]interface {}{"success" : true }})
78+ }
79+ }
80+
7581func Login () gin.HandlerFunc {
7682 return func (c * gin.Context ) {
7783 ctx , cancel := context .WithTimeout (context .Background (), 10 * time .Second )
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import ("github.com/gin-gonic/gin"
44 "gin-mongo-api/src/controllers" )
55
66func UserRoute (router * gin.Engine ) {
7+ router .GET ("/" ,controllers .Greeting ())
78 router .POST ("/register" , controllers .Register ());
89 router .POST ("/login" ,controllers .Login ())
910};
You can’t perform that action at this time.
0 commit comments