| 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 .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<CreateWorkflowRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/tvpl.api.ServiceModel">
<Description>String</Description>
<DocumentCode>String</DocumentCode>
<DocumentTypeId>0</DocumentTypeId>
<IsInstance>false</IsInstance>
<MainId>0</MainId>
<Title>String</Title>
</CreateWorkflowRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <Workflow xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models"> <AccountId>0</AccountId> <CreatedAt>0001-01-01T00:00:00</CreatedAt> <CreatedBy>String</CreatedBy> <DeletedAt>0001-01-01T00:00:00</DeletedAt> <DeletedBy>String</DeletedBy> <DepartmentId>0</DepartmentId> <Description>String</Description> <DocumentCode>String</DocumentCode> <DocumentTypeId>0</DocumentTypeId> <Id>0</Id> <IsActive>false</IsActive> <IsDeleted>false</IsDeleted> <IsInstance>false</IsInstance> <MainId>0</MainId> <StatusId>0</StatusId> <Title>String</Title> <UpdatedAt>0001-01-01T00:00:00</UpdatedAt> <UpdatedBy>String</UpdatedBy> </Workflow>