调整swag
This commit is contained in:
@@ -355,8 +355,13 @@ func (c *Controller) ManualControl(ctx *gin.Context) {
|
||||
}
|
||||
} else {
|
||||
action := device.DeviceActionStart
|
||||
if *req.Action == "off" {
|
||||
switch *req.Action {
|
||||
case "off":
|
||||
action = device.DeviceActionStop
|
||||
case "on":
|
||||
default:
|
||||
c.logger.Errorf("%s: 无效的动作: %s, 设备ID: %s", actionType, *req.Action, deviceID)
|
||||
controller.SendErrorWithAudit(ctx, controller.CodeBadRequest, "无效的动作: "+*req.Action, actionType, "无效的动作", req.Action)
|
||||
}
|
||||
err = c.deviceService.Switch(dev, action)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user