-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrouter.go
More file actions
56 lines (48 loc) · 1.16 KB
/
Copy pathrouter.go
File metadata and controls
56 lines (48 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package main
import (
"github.com/gin-gonic/gin"
)
func SetRouter() *gin.Engine {
router := gin.Default()
customer := router.Group("/customer")
{
customer.GET("/list", customerList)
customer.GET("/without_orders", customerWithoutOrders)
customer.GET("/last_orders", customerLastOrders)
}
order := router.Group("/order")
{
order.POST("/", orderCreate)
order.GET("/details")
order.GET("/without_details", orderWithoutDetails)
order.GET("/without_invoices", orderWithoutInvoices)
}
invoice := router.Group("/invoice")
{
invoice.GET("/expired", invoiceExpired)
invoice.GET("/wrong_date", invoiceWrongDate)
invoice.GET("/overpaid", invoiceOverpaid)
}
payment := router.Group("/payment")
{
payment.GET("/", paymentCreate)
payment.GET("/details", paymentDetails)
payment.GET("/wrong_date", paymentWrongDate)
}
product := router.Group("/product")
{
product.GET("/")
product.GET("/list")
product.GET("/details")
product.GET("/high_demand")
product.GET("/bulk")
product.GET("/number_in_year")
}
category := router.Group("/category")
{
category.GET("/list")
category.GET("/details")
category.GET("/wrong_date")
}
return router
}