26 lines
740 B
Go
26 lines
740 B
Go
package example
|
|
|
|
import (
|
|
handler "kra/internal/server/handler/example"
|
|
"kra/internal/server/middleware"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type CustomerRouter struct{}
|
|
|
|
func (r *CustomerRouter) InitCustomerRouter(Router *gin.RouterGroup) {
|
|
customerRouter := Router.Group("customer").Use(middleware.OperationRecordMiddleware())
|
|
customerRouterWithoutRecord := Router.Group("customer")
|
|
var api handler.CustomerApi
|
|
{
|
|
customerRouter.POST("customer", api.CreateExaCustomer)
|
|
customerRouter.PUT("customer", api.UpdateExaCustomer)
|
|
customerRouter.DELETE("customer", api.DeleteExaCustomer)
|
|
}
|
|
{
|
|
customerRouterWithoutRecord.GET("customer", api.GetExaCustomer)
|
|
customerRouterWithoutRecord.GET("customerList", api.GetExaCustomerList)
|
|
}
|
|
}
|