30 lines
896 B
Go
30 lines
896 B
Go
package system
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
v1 "miniapp/api/v1"
|
|
"miniapp/middleware"
|
|
)
|
|
|
|
type HospitalRouter struct {
|
|
}
|
|
|
|
// InitHospitalRouter 注册医院路由
|
|
func (s *RouterGroup) InitHospitalRouter(Router *gin.RouterGroup) {
|
|
hospitalRouter := Router.Group("hospital").Use(middleware.OperationRecord()).Use(middleware.JWTAuth())
|
|
publicRouter := Router.Group("hospital")
|
|
hospitalApi := v1.ApiGroupApp.SystemApiGroup.HospitalApi
|
|
|
|
{
|
|
hospitalRouter.POST("", hospitalApi.CreateHospital) // 创建医院
|
|
hospitalRouter.DELETE("", hospitalApi.DeleteHospital) // 删除医院
|
|
hospitalRouter.PUT("", hospitalApi.UpdateHospital) // 更新医院
|
|
|
|
}
|
|
{
|
|
publicRouter.GET("list", hospitalApi.GetHospitalList) // 获取医院列表
|
|
publicRouter.GET(":id", hospitalApi.GetHospitalById) // 获取单条医院消息
|
|
publicRouter.GET("notes", hospitalApi.GetHospitalNotes)
|
|
}
|
|
}
|