七月迭代短暂完结,还有很多后端的关键东西没有弄,这是一版赶时间做的东西
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m26s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m26s
This commit is contained in:
@@ -35,6 +35,20 @@ func (h *DeviceHandler) List(c *fiber.Ctx) error {
|
||||
return response.SuccessWithPagination(c, result.List, result.Total, result.Page, result.PageSize)
|
||||
}
|
||||
|
||||
// BatchUpdateRealnamePolicy 批量更新设备实名认证策略。
|
||||
// POST /api/admin/devices/batch-update-realname-policy
|
||||
func (h *DeviceHandler) BatchUpdateRealnamePolicy(c *fiber.Ctx) error {
|
||||
var req dto.BatchUpdateAssetRealnamePolicyRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam)
|
||||
}
|
||||
result, err := h.service.BatchUpdateRealnamePolicy(c.UserContext(), &req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return response.Success(c, result)
|
||||
}
|
||||
|
||||
func (h *DeviceHandler) Delete(c *fiber.Ctx) error {
|
||||
userType := middleware.GetUserTypeFromContext(c.UserContext())
|
||||
if userType != constants.UserTypeSuperAdmin && userType != constants.UserTypePlatform {
|
||||
@@ -226,26 +240,6 @@ func (h *DeviceHandler) GetGatewaySlots(c *fiber.Ctx) error {
|
||||
return response.Success(c, resp)
|
||||
}
|
||||
|
||||
// SetSpeedLimit 设置设备限速
|
||||
// PUT /api/admin/devices/by-identifier/:identifier/speed-limit
|
||||
func (h *DeviceHandler) SetSpeedLimit(c *fiber.Ctx) error {
|
||||
identifier := c.Params("identifier")
|
||||
if identifier == "" {
|
||||
return errors.New(errors.CodeInvalidParam, "设备标识符不能为空")
|
||||
}
|
||||
|
||||
var req dto.SetSpeedLimitRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
|
||||
if err := h.service.GatewaySetSpeedLimit(c.UserContext(), identifier, &req); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return response.Success(c, nil)
|
||||
}
|
||||
|
||||
// SetWiFi 设置设备 WiFi
|
||||
// PUT /api/admin/devices/by-identifier/:identifier/wifi
|
||||
func (h *DeviceHandler) SetWiFi(c *fiber.Ctx) error {
|
||||
|
||||
Reference in New Issue
Block a user