22 lines
399 B
Go
22 lines
399 B
Go
package routes
|
||
|
||
import (
|
||
"github.com/gin-gonic/gin"
|
||
"hr_receiver/controllers"
|
||
)
|
||
|
||
func SetupRouter() *gin.Engine {
|
||
r := gin.Default()
|
||
trainingController := controllers.NewTrainingController()
|
||
|
||
v1 := r.Group("/api/v1")
|
||
{
|
||
records := v1.Group("/train-records")
|
||
{
|
||
records.POST("", trainingController.CreateTrainingRecord)
|
||
// 可扩展其他路由:GET, PUT, DELETE等
|
||
}
|
||
}
|
||
return r
|
||
}
|