| POST | /workflow |
|---|
import 'package:servicestack/servicestack.dart';
class Workflow implements IConvertible
{
int? id;
// @required()
// @StringLength(500)
String? title;
// @StringLength(4000)
String? description;
// @StringLength(100)
String? documentCode;
int? documentTypeId;
bool? isInstance;
int? mainId;
bool? isActive;
int? statusId;
int? accountId;
int? departmentId;
// @ignore()
int? scopeType;
// @StringLength(500)
String? createdBy;
DateTime? createdAt;
// @StringLength(500)
String? updatedBy;
DateTime? updatedAt;
Workflow({this.id,this.title,this.description,this.documentCode,this.documentTypeId,this.isInstance,this.mainId,this.isActive,this.statusId,this.accountId,this.departmentId,this.scopeType,this.createdBy,this.createdAt,this.updatedBy,this.updatedAt});
Workflow.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
title = json['title'];
description = json['description'];
documentCode = json['documentCode'];
documentTypeId = json['documentTypeId'];
isInstance = json['isInstance'];
mainId = json['mainId'];
isActive = json['isActive'];
statusId = json['statusId'];
accountId = json['accountId'];
departmentId = json['departmentId'];
scopeType = json['scopeType'];
createdBy = json['createdBy'];
createdAt = JsonConverters.fromJson(json['createdAt'],'DateTime',context!);
updatedBy = json['updatedBy'];
updatedAt = JsonConverters.fromJson(json['updatedAt'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'title': title,
'description': description,
'documentCode': documentCode,
'documentTypeId': documentTypeId,
'isInstance': isInstance,
'mainId': mainId,
'isActive': isActive,
'statusId': statusId,
'accountId': accountId,
'departmentId': departmentId,
'scopeType': scopeType,
'createdBy': createdBy,
'createdAt': JsonConverters.toJson(createdAt,'DateTime',context!),
'updatedBy': updatedBy,
'updatedAt': JsonConverters.toJson(updatedAt,'DateTime',context!)
};
getTypeName() => "Workflow";
TypeContext? context = _ctx;
}
class CreateWorkflowRequest implements IConvertible
{
String? title;
String? description;
String? documentCode;
int? documentTypeId;
bool? isInstance;
int? mainId;
CreateWorkflowRequest({this.title,this.description,this.documentCode,this.documentTypeId,this.isInstance,this.mainId});
CreateWorkflowRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
title = json['title'];
description = json['description'];
documentCode = json['documentCode'];
documentTypeId = json['documentTypeId'];
isInstance = json['isInstance'];
mainId = json['mainId'];
return this;
}
Map<String, dynamic> toJson() => {
'title': title,
'description': description,
'documentCode': documentCode,
'documentTypeId': documentTypeId,
'isInstance': isInstance,
'mainId': mainId
};
getTypeName() => "CreateWorkflowRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'qlcn_api.vsmlab.vn', types: <String, TypeInfo> {
'Workflow': TypeInfo(TypeOf.Class, create:() => Workflow()),
'CreateWorkflowRequest': TypeInfo(TypeOf.Class, create:() => CreateWorkflowRequest()),
});
Dart CreateWorkflowRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /workflow HTTP/1.1
Host: qlcn-api.vsmlab.vn
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
title: String,
description: String,
documentCode: String,
documentTypeId: 0,
isInstance: False,
mainId: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
id: 0,
title: String,
description: String,
documentCode: String,
documentTypeId: 0,
isInstance: False,
mainId: 0,
isActive: False,
statusId: 0,
accountId: 0,
departmentId: 0,
scopeType: 2,
createdBy: String,
updatedBy: String,
updatedAt: "0001-01-01T00:00:00.0000000+07:06"
}