|
@@ -5,6 +5,7 @@ import com.platform2easy.genesis.domain.service.OrderbookService;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
+import org.springframework.web.server.ResponseStatusException;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
@@ -51,4 +52,14 @@ public class OrderbookController {
|
|
|
public void delete(@PathVariable Long id) {
|
|
public void delete(@PathVariable Long id) {
|
|
|
service.deletarPorId(id);
|
|
service.deletarPorId(id);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping(params = "isToken")
|
|
|
|
|
+ @ResponseStatus(HttpStatus.OK)
|
|
|
|
|
+ public List<Orderbook> listByIsToken(@RequestParam("isToken") Integer isToken) {
|
|
|
|
|
+ if (isToken == null || (isToken != 0 && isToken != 1)) {
|
|
|
|
|
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "isToken must be 0 or 1");
|
|
|
|
|
+ }
|
|
|
|
|
+ return service.listarPorIsToken(isToken == 1);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+
|