forked from loafle/openapi-generator-original
Add Dart support
This commit is contained in:
21
samples/client/petstore/dart/lib/model/category.dart
Normal file
21
samples/client/petstore/dart/lib/model/category.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
part of api;
|
||||
|
||||
|
||||
@Entity()
|
||||
class Category {
|
||||
|
||||
int id = null;
|
||||
|
||||
|
||||
String name = null;
|
||||
|
||||
|
||||
Category();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Category[id=$id, name=$name, ]';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
33
samples/client/petstore/dart/lib/model/order.dart
Normal file
33
samples/client/petstore/dart/lib/model/order.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
part of api;
|
||||
|
||||
|
||||
@Entity()
|
||||
class Order {
|
||||
|
||||
int id = null;
|
||||
|
||||
|
||||
int petId = null;
|
||||
|
||||
|
||||
int quantity = null;
|
||||
|
||||
|
||||
DateTime shipDate = null;
|
||||
|
||||
/* Order Status */
|
||||
String status = null;
|
||||
//enum statusEnum { placed, approved, delivered, };
|
||||
|
||||
bool complete = null;
|
||||
|
||||
|
||||
Order();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Order[id=$id, petId=$petId, quantity=$quantity, shipDate=$shipDate, status=$status, complete=$complete, ]';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
33
samples/client/petstore/dart/lib/model/pet.dart
Normal file
33
samples/client/petstore/dart/lib/model/pet.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
part of api;
|
||||
|
||||
|
||||
@Entity()
|
||||
class Pet {
|
||||
|
||||
int id = null;
|
||||
|
||||
|
||||
Category category = null;
|
||||
|
||||
|
||||
String name = null;
|
||||
|
||||
|
||||
List<String> photoUrls = [];
|
||||
|
||||
|
||||
List<Tag> tags = [];
|
||||
|
||||
/* pet status in the store */
|
||||
String status = null;
|
||||
//enum statusEnum { available, pending, sold, };
|
||||
|
||||
Pet();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Pet[id=$id, category=$category, name=$name, photoUrls=$photoUrls, tags=$tags, status=$status, ]';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
21
samples/client/petstore/dart/lib/model/tag.dart
Normal file
21
samples/client/petstore/dart/lib/model/tag.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
part of api;
|
||||
|
||||
|
||||
@Entity()
|
||||
class Tag {
|
||||
|
||||
int id = null;
|
||||
|
||||
|
||||
String name = null;
|
||||
|
||||
|
||||
Tag();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Tag[id=$id, name=$name, ]';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
39
samples/client/petstore/dart/lib/model/user.dart
Normal file
39
samples/client/petstore/dart/lib/model/user.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
part of api;
|
||||
|
||||
|
||||
@Entity()
|
||||
class User {
|
||||
|
||||
int id = null;
|
||||
|
||||
|
||||
String username = null;
|
||||
|
||||
|
||||
String firstName = null;
|
||||
|
||||
|
||||
String lastName = null;
|
||||
|
||||
|
||||
String email = null;
|
||||
|
||||
|
||||
String password = null;
|
||||
|
||||
|
||||
String phone = null;
|
||||
|
||||
/* User Status */
|
||||
int userStatus = null;
|
||||
|
||||
|
||||
User();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'User[id=$id, username=$username, firstName=$firstName, lastName=$lastName, email=$email, password=$password, phone=$phone, userStatus=$userStatus, ]';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user