123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- package router
- import (
- apiv1 "auth-server/api/v1"
- "github.com/gin-gonic/gin"
- )
- func InitRouter() *gin.Engine {
- r := gin.New()
- InitMiddleware(r)
- r.StaticFile("/dr/", "./dist/index.html")
- r.Static("/dr/front/", "./dist/")
- // 注册路由
- v1 := r.Group("/dr/api/v1/")
- pubV1 := v1.Group("/pub")
- {
- pubV1.GET("/ping", apiv1.Ping)
- pubV1.GET("software_info", apiv1.SoftwareInfo)
- pubV1.Static("Image", "../Image")
- pubV1.POST("login", apiv1.Login)
- }
- authV1 := v1.Group("/auth")
- {
- configV1 := authV1.Group("/configs")
- {
- //configV1.GET("items", apiv1.GetConfigs)
- configV1.GET("options", apiv1.GetConfigOptions)
- configV1.POST("items", apiv1.UpdateConfigItems)
- }
- protocolV1 := authV1.Group("/protocol")
- {
- protocolV1.GET("patient_type", apiv1.GetPatientTypeList)
- protocolV1.GET("body_part", apiv1.GetBodyPartList)
- protocolV1.GET("procedure", apiv1.GetProcedureList)
- protocolV1.GET("view", apiv1.GetViewList)
- }
- studyV1 := authV1.Group("/study")
- {
- studyV1.POST("", apiv1.CreateStudy)
- }
- dicomV1 := authV1.Group("/dicom")
- {
- dicomV1.GET("generate/instance_uid", apiv1.GenerateUniqueIdentifier)
- }
- }
- return r
- }
|