切卡模式更新
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m58s

This commit is contained in:
2026-04-29 10:18:15 +08:00
parent 37b4483183
commit 74c7b27327
6 changed files with 218 additions and 7 deletions

View File

@@ -298,6 +298,15 @@ func (h *DeviceHandler) SetSwitchMode(c *fiber.Ctx) error {
if err := c.BodyParser(&req); err != nil {
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
}
if req.SwitchMode == nil {
return errors.New(errors.CodeInvalidParam, "切卡模式不能为空")
}
if *req.SwitchMode != 0 && *req.SwitchMode != 1 {
return errors.New(errors.CodeInvalidParam, "切卡模式仅支持0或1")
}
if req.IotCardID == 0 {
return errors.New(errors.CodeInvalidParam, "目标卡资产ID不能为空")
}
if err := h.service.GatewaySwitchMode(c.UserContext(), identifier, &req); err != nil {
return err