router.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package router
  2. import (
  3. apiv1 "auth-server/api/v1"
  4. "github.com/gin-gonic/gin"
  5. )
  6. func InitRouter() *gin.Engine {
  7. r := gin.New()
  8. InitMiddleware(r)
  9. r.StaticFile("/dr/", "./dist/index.html")
  10. r.Static("/dr/front/", "./dist/")
  11. // 注册路由
  12. v1 := r.Group("/dr/api/v1/")
  13. pubV1 := v1.Group("/pub")
  14. {
  15. pubV1.GET("/ping", apiv1.Ping)
  16. pubV1.GET("software_info", apiv1.SoftwareInfo)
  17. pubV1.Static("Image", "../Image")
  18. pubV1.POST("login", apiv1.Login)
  19. }
  20. authV1 := v1.Group("/auth")
  21. {
  22. configV1 := authV1.Group("/configs")
  23. {
  24. //configV1.GET("items", apiv1.GetConfigs)
  25. configV1.GET("options", apiv1.GetConfigOptions)
  26. configV1.POST("items", apiv1.UpdateConfigItems)
  27. }
  28. protocolV1 := authV1.Group("/protocol")
  29. {
  30. protocolV1.GET("patient_type", apiv1.GetPatientType)
  31. protocolV1.GET("body_part", apiv1.GetBodyPart)
  32. protocolV1.GET("procedure", apiv1.GetProcedure)
  33. protocolV1.GET("view", apiv1.GetView)
  34. }
  35. dicomV1 := authV1.Group("/dicom")
  36. {
  37. dicomV1.GET("generate/instance_uid", apiv1.GenerateUniqueIdentifier)
  38. }
  39. }
  40. return r
  41. }