限流,支持客户端ID修改、删除.
This commit is contained in:
@@ -5,10 +5,7 @@ import com.xuxd.kafka.console.beans.dto.AlterClientQuotaDTO;
|
||||
import com.xuxd.kafka.console.beans.dto.QueryClientQuotaDTO;
|
||||
import com.xuxd.kafka.console.service.ClientQuotaService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @author: xuxd
|
||||
@@ -38,4 +35,14 @@ public class ClientQuotaController {
|
||||
}
|
||||
return clientQuotaService.alterClientQuotaConfigs(request);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
public Object deleteClientQuotaConfigs(@RequestBody AlterClientQuotaDTO request) {
|
||||
if (CollectionUtils.isEmpty(request.getTypes())
|
||||
|| CollectionUtils.isEmpty(request.getNames())
|
||||
|| request.getTypes().size() != request.getNames().size()) {
|
||||
return ResponseData.create().failed("types length and names length is invalid.");
|
||||
}
|
||||
return clientQuotaService.deleteClientQuotaConfigs(request);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user