File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -6,17 +6,17 @@ import (
66 "api-go/middleware"
77 "api-go/repository"
88 "api-go/usecase"
9-
109 "github.com/gin-gonic/gin"
1110)
1211
1312func main () {
14-
1513 server := gin .Default ()
1614
1715 dbConnection , err := db .ConnectDb ()
16+
1817 if err != nil {
1918 panic (err )
19+ return err
2020 }
2121
2222 ProductRepository := repository .NewProductRepository (dbConnection )
@@ -25,12 +25,17 @@ func main() {
2525
2626 ProductController := controller .NewProductController (* ProductUseCase )
2727
28- server .GET ("/ping" , func (ctx * gin.Context ) {
28+ server .GET ("/ping-dev " , func (ctx * gin.Context ) {
2929 ctx .JSON (200 , gin.H {
30- "message" : "primeiros testes " ,
30+ "message" : "Servidor Está ativo! " ,
3131 })
3232 })
3333
34+ /*
35+ routes server
36+ products
37+ */
38+
3439 protected := server .Group ("/" )
3540 protected .Use (middleware .AuthMiddleware ())
3641 {
Original file line number Diff line number Diff line change 11package model
22
3+ /*
4+ Product Struct
5+ */
6+
37type Product struct {
48 ID int `json:"id"`
59 Name string `json:"name"`
610 Price float64 `json:"price"`
7- }
11+ }
You can’t perform that action at this time.
0 commit comments