新增测点配置
This commit is contained in:
@@ -50,7 +50,9 @@ func InitRouter() *gin.Engine {
|
||||
//apiV1.Use(middleware.CasbinRBAC())
|
||||
|
||||
{
|
||||
routes.GroupRoutes.Common.InitCommon(apiV1)
|
||||
routes.GroupRoutes.PeakValley.InitPeakValley(apiV1)
|
||||
routes.GroupRoutes.DevicePoint.InitDevicePoint(apiV1)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
17
router/routes/common.go
Normal file
17
router/routes/common.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
v1 "energy-management-system/api/v1"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type Common struct{}
|
||||
|
||||
func (r *Common) InitCommon(Router *gin.RouterGroup) {
|
||||
commonApi := Router.Group("common")
|
||||
{
|
||||
|
||||
commonApi.GET("energyTypes", v1.Controllers.Common.GetEnergyTypeMap)
|
||||
|
||||
}
|
||||
}
|
||||
17
router/routes/device_point.go
Normal file
17
router/routes/device_point.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
v1 "energy-management-system/api/v1"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type DevicePoint struct{}
|
||||
|
||||
func (r *DevicePoint) InitDevicePoint(Router *gin.RouterGroup) {
|
||||
devicePointApi := Router.Group("devicePoint")
|
||||
{
|
||||
|
||||
devicePointApi.GET("pointNameSelect", v1.Controllers.DevicePoint.PointNameSelect)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
package routes
|
||||
|
||||
type groupRoutes struct {
|
||||
Common
|
||||
PeakValley
|
||||
DevicePoint
|
||||
}
|
||||
|
||||
var GroupRoutes = new(groupRoutes)
|
||||
|
||||
@@ -15,13 +15,13 @@ func (r *PeakValley) InitPeakValley(Router *gin.RouterGroup) {
|
||||
peakValleyApi.GET("rulePage", v1.Controllers.PeakValley.GetPeakValleyRulePage)
|
||||
peakValleyApi.POST("createRule", v1.Controllers.PeakValley.CreatePeakValleyRule)
|
||||
peakValleyApi.PUT("updateRule", v1.Controllers.PeakValley.UpdatePeakValleyRule)
|
||||
peakValleyApi.GET("ruleDetail/:id", v1.Controllers.PeakValley.PeakValleyRuleDetail)
|
||||
peakValleyApi.GET("ruleEditDetail/:id", v1.Controllers.PeakValley.PeakValleyRuleEditDetail)
|
||||
peakValleyApi.GET("ruleDetail", v1.Controllers.PeakValley.PeakValleyRuleDetail)
|
||||
peakValleyApi.GET("ruleEditDetail", v1.Controllers.PeakValley.PeakValleyRuleEditDetail)
|
||||
|
||||
peakValleyApi.GET("quarterPage", v1.Controllers.PeakValley.PeakValleyQuarterPage)
|
||||
peakValleyApi.POST("createQuarter", v1.Controllers.PeakValley.CreatePeakValleyQuarter)
|
||||
peakValleyApi.PUT("updateQuarter", v1.Controllers.PeakValley.UpdatePeakValleyQuarter)
|
||||
peakValleyApi.GET("quarterEditDetail/:id", v1.Controllers.PeakValley.PeakValleyQuarterEditDetail)
|
||||
peakValleyApi.GET("quarterEditDetail", v1.Controllers.PeakValley.PeakValleyQuarterEditDetail)
|
||||
|
||||
//userapi.DELETE(":id", api.Controllers.UserApi.DeleteUser)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user