1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- package server
- import (
- "city_chips/internal/handler"
- "city_chips/internal/middleware"
- "city_chips/pkg/log"
- "github.com/gin-gonic/gin"
- )
- func NewServerHTTP(
- logger *log.Logger,
- accessHandler *handler.AccessControlHandler,
- hikvision *handler.HikvisionHandler,
- conference *handler.ConferenceHandler,
- home *handler.HomeHandler,
- elevator *handler.ElevatorHandler,
- broadcast *handler.BroadcastHandler,
- property *handler.PropertyHandler,
- information *handler.InformationHandler,
- illuminating *handler.IlluminatingHandler,
- energy *handler.EnergyHandler,
- ) *gin.Engine {
- gin.SetMode(gin.ReleaseMode)
- r := gin.Default()
- r.Use(
- middleware.CORSMiddleware(),
- )
- //出入口控制系统
- Access := r.Group("/Access")
- {
- Access.GET("/test", accessHandler.GetAccessControl)
- }
- //海康威视
- Hikvision := r.Group("/Hikvision")
- {
- Hikvision.GET("/getMonitoring", hikvision.GetHikvisionMonitoring)
- Hikvision.GET("/controlling", hikvision.Gimbalcontrol)
- Hikvision.GET("/visitorInfo", hikvision.VisitorInfoCount)
- }
- //会议系统
- Conference := r.Group("/Conference")
- {
- Conference.GET("/roomOps", conference.RoomOps)
- Conference.GET("/dataAnalysis", conference.DataAnalysis)
- Conference.GET("/getRoomsByLocationId", conference.GetRoomsByLocationId)
- Conference.POST("/getRoomsByLocation", conference.GetRoomsByLocation)
- Conference.GET("/meetingRoomById", conference.MeetingRoomById)
- Conference.GET("/location", conference.Location)
- }
- //首页数据
- h := r.Group("/Home")
- {
- h.GET("/count", home.GetHome)
- }
- //电梯控制系统
- el := r.Group("/elevator")
- {
- el.GET("/count", elevator.GetElevator)
- }
- //广播控制系统
- bro := r.Group("/broadcast")
- {
- bro.GET("/count", broadcast.GetBroadcast)
- }
- //物业管理系统
- pro := r.Group("/property")
- {
- pro.GET("/count", property.GetProperty)
- }
- //信息发布管理平台
- info := r.Group("/information")
- {
- info.GET("/count", information.GetInformation)
- }
- //照明系统
- ill := r.Group("/illuminating")
- {
- ill.GET("/count", illuminating.GetIlluminating)
- }
- //能源系统
- ener := r.Group("/energy")
- {
- ener.GET("/count", energy.GetEnergy)
- }
- return r
- }
|