Car example
This commit is contained in:
parent
d12c334c03
commit
ff3e3b535b
1 changed files with 18 additions and 0 deletions
18
angel_orm_generator/test/example/car_controller.dart
Normal file
18
angel_orm_generator/test/example/car_controller.dart
Normal file
|
@ -0,0 +1,18 @@
|
|||
import 'dart:async';
|
||||
import 'package:angel_framework/angel_framework.dart';
|
||||
import 'package:postgres/postgres.dart';
|
||||
import '../models/car.dart';
|
||||
import '../models/car.orm.g.dart';
|
||||
|
||||
@Expose('/api/cars')
|
||||
class CarController extends Controller {
|
||||
@Expose('/luxury')
|
||||
Stream<Car> getLuxuryCars(PostgreSQLConnection connection) {
|
||||
var query = new CarQuery();
|
||||
query.where
|
||||
..familyFriendly.equals(false)
|
||||
..createdAt.year.greaterThanOrEqualTo(2014)
|
||||
..make.isIn(['Ferrari', 'Lamborghini', 'Mustang', 'Lexus']);
|
||||
return query.get(connection);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue