diff --git a/WebStarter/Controllers/ChargeController.cs b/WebStarter/Controllers/ChargeController.cs index f7f3235..815e373 100644 --- a/WebStarter/Controllers/ChargeController.cs +++ b/WebStarter/Controllers/ChargeController.cs @@ -68,8 +68,13 @@ public class ChargeController : ControllerBase /// 发送结果 [HttpGet] [Route("SendPowerRegulation/{code}/{power}")] - public Result SendPowerRegulation(string code,float power) + public Result SendPowerRegulation(string code, float power) { + if (power < 1 || power > 360) + { + return Result.Fail("功率值范围1到360"); + } + ChargerClient? chargerClient = ClientMgr.GetBySn(code); if (chargerClient != null) @@ -79,7 +84,6 @@ public class ChargeController : ControllerBase } return Result.Fail("充电机未连接"); - } ///