| POST | /report/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 DocumentSearchResultItem implements IConvertible
{
String? title;
String? description;
String? owner;
int? documentPolicyId;
int? updateDocumentId;
DateTime? effectBeginDate;
DateTime? effectEndDate;
int? issuingAgencyId;
int? subjectId;
String? signBy;
DateTime? signDate;
DateTime? updatedAt;
int? statusId;
bool? isInternal;
String? documentNumber;
String? documentCode;
bool? isUrgent;
int? id;
String? reasonReturn;
int? accountId;
int? approverId;
// @StringLength(500)
String? updatedBy;
// @StringLength(500)
String? createdBy;
bool? isParty;
bool? isRevisionRequested;
bool? isPrivate;
int? departmentId;
DateTime? publicationDate;
int? processStatusId;
int? documentTypeId;
int? documentGroupId;
String? accountName;
String? acceptAccountName;
String? documentGroupText;
String? processStatusText;
String? documentTypeText;
String? departmentText;
String? statusText;
String? issuingAgencyText;
String? subjectText;
String? comment;
String? submitComment;
String? fullFile;
String? parthFile;
bool? isActive;
int? stepOrder;
int? stepCount;
DocumentSearchResultItem({this.title,this.description,this.owner,this.documentPolicyId,this.updateDocumentId,this.effectBeginDate,this.effectEndDate,this.issuingAgencyId,this.subjectId,this.signBy,this.signDate,this.updatedAt,this.statusId,this.isInternal,this.documentNumber,this.documentCode,this.isUrgent,this.id,this.reasonReturn,this.accountId,this.approverId,this.updatedBy,this.createdBy,this.isParty,this.isRevisionRequested,this.isPrivate,this.departmentId,this.publicationDate,this.processStatusId,this.documentTypeId,this.documentGroupId,this.accountName,this.acceptAccountName,this.documentGroupText,this.processStatusText,this.documentTypeText,this.departmentText,this.statusText,this.issuingAgencyText,this.subjectText,this.comment,this.submitComment,this.fullFile,this.parthFile,this.isActive,this.stepOrder,this.stepCount});
DocumentSearchResultItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
title = json['title'];
description = json['description'];
owner = json['owner'];
documentPolicyId = json['documentPolicyId'];
updateDocumentId = json['updateDocumentId'];
effectBeginDate = JsonConverters.fromJson(json['effectBeginDate'],'DateTime',context!);
effectEndDate = JsonConverters.fromJson(json['effectEndDate'],'DateTime',context!);
issuingAgencyId = json['issuingAgencyId'];
subjectId = json['subjectId'];
signBy = json['signBy'];
signDate = JsonConverters.fromJson(json['signDate'],'DateTime',context!);
updatedAt = JsonConverters.fromJson(json['updatedAt'],'DateTime',context!);
statusId = json['statusId'];
isInternal = json['isInternal'];
documentNumber = json['documentNumber'];
documentCode = json['documentCode'];
isUrgent = json['isUrgent'];
id = json['id'];
reasonReturn = json['reasonReturn'];
accountId = json['accountId'];
approverId = json['approverId'];
updatedBy = json['updatedBy'];
createdBy = json['createdBy'];
isParty = json['isParty'];
isRevisionRequested = json['isRevisionRequested'];
isPrivate = json['isPrivate'];
departmentId = json['departmentId'];
publicationDate = JsonConverters.fromJson(json['publicationDate'],'DateTime',context!);
processStatusId = json['processStatusId'];
documentTypeId = json['documentTypeId'];
documentGroupId = json['documentGroupId'];
accountName = json['accountName'];
acceptAccountName = json['acceptAccountName'];
documentGroupText = json['documentGroupText'];
processStatusText = json['processStatusText'];
documentTypeText = json['documentTypeText'];
departmentText = json['departmentText'];
statusText = json['statusText'];
issuingAgencyText = json['issuingAgencyText'];
subjectText = json['subjectText'];
comment = json['comment'];
submitComment = json['submitComment'];
fullFile = json['fullFile'];
parthFile = json['parthFile'];
isActive = json['isActive'];
stepOrder = json['stepOrder'];
stepCount = json['stepCount'];
return this;
}
Map<String, dynamic> toJson() => {
'title': title,
'description': description,
'owner': owner,
'documentPolicyId': documentPolicyId,
'updateDocumentId': updateDocumentId,
'effectBeginDate': JsonConverters.toJson(effectBeginDate,'DateTime',context!),
'effectEndDate': JsonConverters.toJson(effectEndDate,'DateTime',context!),
'issuingAgencyId': issuingAgencyId,
'subjectId': subjectId,
'signBy': signBy,
'signDate': JsonConverters.toJson(signDate,'DateTime',context!),
'updatedAt': JsonConverters.toJson(updatedAt,'DateTime',context!),
'statusId': statusId,
'isInternal': isInternal,
'documentNumber': documentNumber,
'documentCode': documentCode,
'isUrgent': isUrgent,
'id': id,
'reasonReturn': reasonReturn,
'accountId': accountId,
'approverId': approverId,
'updatedBy': updatedBy,
'createdBy': createdBy,
'isParty': isParty,
'isRevisionRequested': isRevisionRequested,
'isPrivate': isPrivate,
'departmentId': departmentId,
'publicationDate': JsonConverters.toJson(publicationDate,'DateTime',context!),
'processStatusId': processStatusId,
'documentTypeId': documentTypeId,
'documentGroupId': documentGroupId,
'accountName': accountName,
'acceptAccountName': acceptAccountName,
'documentGroupText': documentGroupText,
'processStatusText': processStatusText,
'documentTypeText': documentTypeText,
'departmentText': departmentText,
'statusText': statusText,
'issuingAgencyText': issuingAgencyText,
'subjectText': subjectText,
'comment': comment,
'submitComment': submitComment,
'fullFile': fullFile,
'parthFile': parthFile,
'isActive': isActive,
'stepOrder': stepOrder,
'stepCount': stepCount
};
getTypeName() => "DocumentSearchResultItem";
TypeContext? context = _ctx;
}
class SearchResponse implements IResponseRequest, IConvertible
{
int? totalCount;
int? code;
List<DocumentSearchResultItem>? data;
String? message;
SearchResponse({this.totalCount,this.code,this.data,this.message});
SearchResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
totalCount = json['totalCount'];
code = json['code'];
data = JsonConverters.fromJson(json['data'],'List<DocumentSearchResultItem>',context!);
message = json['message'];
return this;
}
Map<String, dynamic> toJson() => {
'totalCount': totalCount,
'code': code,
'data': JsonConverters.toJson(data,'List<DocumentSearchResultItem>',context!),
'message': message
};
getTypeName() => "SearchResponse";
TypeContext? context = _ctx;
}
enum DocumentSearchStage
{
All,
AllProcessing,
Draft,
PendingApproval,
IsRevisionRequested,
PendingCompilation,
PendingReport,
Published,
Active,
InActive,
}
enum SearchOrderBy
{
UpdatedDateDesc,
PublishDateDesc,
}
class ReportSearch extends PagingRequest implements IConvertible
{
List<String>? columns;
String? title;
int? typeId;
int? groupId;
int? subjectId;
bool? isUrgent;
DocumentSearchStage? documentSearchStage;
bool? isInternal;
DateTime? fromDate;
DateTime? toDate;
int? statusId;
int? issuingAgencyId;
SearchOrderBy? orderBy;
bool? isParty;
ReportSearch({this.columns,this.title,this.typeId,this.groupId,this.subjectId,this.isUrgent,this.documentSearchStage,this.isInternal,this.fromDate,this.toDate,this.statusId,this.issuingAgencyId,this.orderBy,this.isParty});
ReportSearch.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
columns = JsonConverters.fromJson(json['columns'],'List<String>',context!);
title = json['title'];
typeId = json['typeId'];
groupId = json['groupId'];
subjectId = json['subjectId'];
isUrgent = json['isUrgent'];
documentSearchStage = JsonConverters.fromJson(json['documentSearchStage'],'DocumentSearchStage',context!);
isInternal = json['isInternal'];
fromDate = JsonConverters.fromJson(json['fromDate'],'DateTime',context!);
toDate = JsonConverters.fromJson(json['toDate'],'DateTime',context!);
statusId = json['statusId'];
issuingAgencyId = json['issuingAgencyId'];
orderBy = JsonConverters.fromJson(json['orderBy'],'SearchOrderBy',context!);
isParty = json['isParty'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'columns': JsonConverters.toJson(columns,'List<String>',context!),
'title': title,
'typeId': typeId,
'groupId': groupId,
'subjectId': subjectId,
'isUrgent': isUrgent,
'documentSearchStage': JsonConverters.toJson(documentSearchStage,'DocumentSearchStage',context!),
'isInternal': isInternal,
'fromDate': JsonConverters.toJson(fromDate,'DateTime',context!),
'toDate': JsonConverters.toJson(toDate,'DateTime',context!),
'statusId': statusId,
'issuingAgencyId': issuingAgencyId,
'orderBy': JsonConverters.toJson(orderBy,'SearchOrderBy',context!),
'isParty': isParty
});
getTypeName() => "ReportSearch";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
'PagingRequest': TypeInfo(TypeOf.Class, create:() => PagingRequest()),
'DocumentSearchResultItem': TypeInfo(TypeOf.Class, create:() => DocumentSearchResultItem()),
'SearchResponse': TypeInfo(TypeOf.Class, create:() => SearchResponse()),
'List<DocumentSearchResultItem>': TypeInfo(TypeOf.Class, create:() => <DocumentSearchResultItem>[]),
'DocumentSearchStage': TypeInfo(TypeOf.Enum, enumValues:DocumentSearchStage.values),
'SearchOrderBy': TypeInfo(TypeOf.Enum, enumValues:SearchOrderBy.values),
'ReportSearch': TypeInfo(TypeOf.Class, create:() => ReportSearch()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /report/search HTTP/1.1
Host: etc-api.vsmlab.vn
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"columns":["String"],"title":"String","typeId":0,"groupId":0,"subjectId":0,"isUrgent":false,"documentSearchStage":"All","isInternal":false,"fromDate":"0001-01-01T00:00:00.0000000+07:06","toDate":"0001-01-01T00:00:00.0000000+07:06","statusId":0,"issuingAgencyId":0,"orderBy":"UpdatedDateDesc","isParty":false,"page":1,"limit":10}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"totalCount":0,"code":0,"data":[{"title":"String","description":"String","owner":"String","documentPolicyId":0,"updateDocumentId":0,"effectBeginDate":"0001-01-01T00:00:00.0000000+07:06","effectEndDate":"0001-01-01T00:00:00.0000000+07:06","issuingAgencyId":0,"subjectId":0,"signBy":"String","signDate":"0001-01-01T00:00:00.0000000+07:06","updatedAt":"0001-01-01T00:00:00.0000000+07:06","statusId":0,"isInternal":false,"documentNumber":"String","documentCode":"String","isUrgent":false,"id":0,"reasonReturn":"String","accountId":0,"approverId":0,"updatedBy":"String","createdBy":"String","isParty":false,"isRevisionRequested":false,"isPrivate":false,"departmentId":0,"publicationDate":"0001-01-01T00:00:00.0000000+07:06","processStatusId":0,"documentTypeId":0,"documentGroupId":0,"accountName":"String","acceptAccountName":"String","documentGroupText":"String","processStatusText":"String","documentTypeText":"String","departmentText":"String","statusText":"String","issuingAgencyText":"String","subjectText":"String","comment":"String","submitComment":"String","fullFile":"String","parthFile":"String","isActive":false,"stepOrder":0,"stepCount":0}],"message":"String"}