增加定时任务 处理异常
This commit is contained in:
@@ -41,7 +41,7 @@ func (r *PeakValley) UpdatePeakValleyQuarter(c *gin.Context) {
|
||||
func (r *PeakValley) PeakValleyQuarterEditDetail(c *gin.Context) {
|
||||
var req form.PeakValleyQuarterEditDetailReq
|
||||
id, err := strconv.Atoi(c.Param("id"))
|
||||
exception.PanicMsgBool(err != nil, "参数有误")
|
||||
exception.PBM(err != nil, "参数有误")
|
||||
req.Id = id
|
||||
respData := service.GroupServices.PeakValley.PeakValleyQuarterEditDetail(&req)
|
||||
response.SuccessData(respData, c)
|
||||
@@ -81,7 +81,7 @@ func (r *PeakValley) UpdatePeakValleyRule(c *gin.Context) {
|
||||
func (r *PeakValley) PeakValleyRuleDetail(c *gin.Context) {
|
||||
var req form.PeakValleyRuleDetailReq
|
||||
id, err := strconv.Atoi(c.Param("id"))
|
||||
exception.PanicMsgBool(err != nil, "参数有误")
|
||||
exception.PBM(err != nil, "参数有误")
|
||||
req.RuleId = id
|
||||
respData := service.GroupServices.PeakValley.PeakValleyRuleDetail(&req)
|
||||
response.SuccessData(respData, c)
|
||||
@@ -90,7 +90,7 @@ func (r *PeakValley) PeakValleyRuleDetail(c *gin.Context) {
|
||||
func (r *PeakValley) PeakValleyRuleEditDetail(c *gin.Context) {
|
||||
var req form.PeakValleyRuleEditDetailReq
|
||||
id, err := strconv.Atoi(c.Param("id"))
|
||||
exception.PanicMsgBool(err != nil, "参数有误")
|
||||
exception.PBM(err != nil, "参数有误")
|
||||
req.RuleId = id
|
||||
respData := service.GroupServices.PeakValley.PeakValleyRuleEditDetail(&req)
|
||||
response.SuccessData(respData, c)
|
||||
|
||||
@@ -2,6 +2,8 @@ package v1
|
||||
|
||||
import (
|
||||
"energy-management-system/response"
|
||||
"energy-management-system/utils"
|
||||
"fmt"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -13,6 +15,8 @@ func (r *TestApi) Test(c *gin.Context) {
|
||||
}
|
||||
|
||||
func (r *TestApi) TestData(c *gin.Context) {
|
||||
x, y, z, e := utils.GetMinutesFromTimeRange("00:00", "05:01")
|
||||
fmt.Println(x, y, z, e)
|
||||
response.SuccessData(gin.H{"userName": "iuu"}, c)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user