は私のコントローラでは、私は、ステータスの変更を可能にするエンドポイントを作りましたDeviceStatus
と入力してステータスを変更する方法:@RequestBody
public void updateStatus(final List<Integer> ids, final String status) {
getByIds(ids).forEach(device -> {
device.setStatus(status);
update(device);
});
}
しかし、device.setStatus(status);
に問題があります。私はparseWithValidation
を使うことができますが、それは既に行われているので意味がありません。誰かが私に与える{"status":"INACTIVE"}
この列挙をどのように解析すればよいですか?
;) –