| GET | /workflow/search |
|---|
import 'package:servicestack/servicestack.dart';
class PagingRequest implements IConvertible
{
int? page;
int? limit;
PagingRequest({this.page,this.limit});
PagingRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
page = json['page'];
limit = json['limit'];
return this;
}
Map<String, dynamic> toJson() => {
'page': page,
'limit': limit
};
getTypeName() => "PagingRequest";
TypeContext? context = _ctx;
}
class SearchWorkflowRequest extends PagingRequest implements IConvertible
{
String? keyword;
bool? isInstance;
bool? isActive;
int? documentTypeId;
int? mainId;
int? accountId;
int? departmentId;
SearchWorkflowRequest({this.keyword,this.isInstance,this.isActive,this.documentTypeId,this.mainId,this.accountId,this.departmentId});
SearchWorkflowRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
keyword = json['keyword'];
isInstance = json['isInstance'];
isActive = json['isActive'];
documentTypeId = json['documentTypeId'];
mainId = json['mainId'];
accountId = json['accountId'];
departmentId = json['departmentId'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'keyword': keyword,
'isInstance': isInstance,
'isActive': isActive,
'documentTypeId': documentTypeId,
'mainId': mainId,
'accountId': accountId,
'departmentId': departmentId
});
getTypeName() => "SearchWorkflowRequest";
TypeContext? context = _ctx;
}
class MongoObject implements IMongoModel, IConvertible
{
String? id;
MongoObject({this.id});
MongoObject.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = JsonConverters.fromJson(json['id'],'String',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': JsonConverters.toJson(id,'String',context!)
};
getTypeName() => "MongoObject";
TypeContext? context = _ctx;
}
class AuditLog extends MongoObject implements IEntityId, ICreated, IUpdate, IConvertible
{
String? userName;
int? userId;
int? documentId;
String? action;
String? description;
DateTime? createdDate;
DateTime? updatedDate;
String? ipAddress;
String? userAgent;
AuditLog({this.userName,this.userId,this.documentId,this.action,this.description,this.createdDate,this.updatedDate,this.ipAddress,this.userAgent});
AuditLog.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
userName = json['userName'];
userId = json['userId'];
documentId = json['documentId'];
action = json['action'];
description = json['description'];
createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!);
updatedDate = JsonConverters.fromJson(json['updatedDate'],'DateTime',context!);
ipAddress = json['ipAddress'];
userAgent = json['userAgent'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'userName': userName,
'userId': userId,
'documentId': documentId,
'action': action,
'description': description,
'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!),
'updatedDate': JsonConverters.toJson(updatedDate,'DateTime',context!),
'ipAddress': ipAddress,
'userAgent': userAgent
});
getTypeName() => "AuditLog";
TypeContext? context = _ctx;
}
class Pagination implements IConvertible
{
int? total;
int? pages;
int? offset;
int? limit;
int? currentPage;
Pagination({this.total,this.pages,this.offset,this.limit,this.currentPage});
Pagination.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
total = json['total'];
pages = json['pages'];
offset = json['offset'];
limit = json['limit'];
currentPage = json['currentPage'];
return this;
}
Map<String, dynamic> toJson() => {
'total': total,
'pages': pages,
'offset': offset,
'limit': limit,
'currentPage': currentPage
};
getTypeName() => "Pagination";
TypeContext? context = _ctx;
}
class PageResponse<AuditLog> implements IResponseRequest, IConvertible
{
int? code;
String? message;
List<AuditLog>? data;
Pagination? pagination;
PageResponse({this.code,this.message,this.data,this.pagination});
PageResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
code = json['code'];
message = json['message'];
data = JsonConverters.fromJson(json['data'],'List<${runtimeGenericTypeDefs(this,[0]).join(",")}>',context!);
pagination = JsonConverters.fromJson(json['pagination'],'Pagination',context!);
return this;
}
Map<String, dynamic> toJson() => {
'code': code,
'message': message,
'data': JsonConverters.toJson(data,'List<AuditLog>',context!),
'pagination': JsonConverters.toJson(pagination,'Pagination',context!)
};
getTypeName() => "PageResponse<$AuditLog>";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'qlcn_api.vsmlab.vn', types: <String, TypeInfo> {
'PagingRequest': TypeInfo(TypeOf.Class, create:() => PagingRequest()),
'SearchWorkflowRequest': TypeInfo(TypeOf.Class, create:() => SearchWorkflowRequest()),
'MongoObject': TypeInfo(TypeOf.Class, create:() => MongoObject()),
'AuditLog': TypeInfo(TypeOf.Class, create:() => AuditLog()),
'Pagination': TypeInfo(TypeOf.Class, create:() => Pagination()),
'PageResponse<AuditLog>': TypeInfo(TypeOf.Class, create:() => PageResponse<AuditLog>()),
});
Dart SearchWorkflowRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /workflow/search HTTP/1.1 Host: qlcn-api.vsmlab.vn Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"code":0,"message":"String","data":[{"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","createdAt":"0001-01-01T00:00:00.0000000+07:06","updatedBy":"String","updatedAt":"0001-01-01T00:00:00.0000000+07:06"}],"pagination":null}