tvpl.api

<back to all web services

CreateDocumentRequest

Tạo văn bản

Requires Authentication
The following routes are available for this service:
POST/document/create
import 'package:servicestack/servicestack.dart';

class CreateDocumentResponse implements IResponseRequest, IConvertible
{
    int? id;
    int? code;
    String? message;

    CreateDocumentResponse({this.id,this.code,this.message});
    CreateDocumentResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        code = json['code'];
        message = json['message'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'code': code,
        'message': message
    };

    getTypeName() => "CreateDocumentResponse";
    TypeContext? context = _ctx;
}

/**
* Tạo văn bản
*/
class CreateDocumentRequest implements IConvertible
{
    String? title;
    String? documentCode;
    String? description;
    int? documentPolicyId;
    int? mainId;
    int? scopeType;

    CreateDocumentRequest({this.title,this.documentCode,this.description,this.documentPolicyId,this.mainId,this.scopeType});
    CreateDocumentRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        title = json['title'];
        documentCode = json['documentCode'];
        description = json['description'];
        documentPolicyId = json['documentPolicyId'];
        mainId = json['mainId'];
        scopeType = json['scopeType'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'title': title,
        'documentCode': documentCode,
        'description': description,
        'documentPolicyId': documentPolicyId,
        'mainId': mainId,
        'scopeType': scopeType
    };

    getTypeName() => "CreateDocumentRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
    'CreateDocumentResponse': TypeInfo(TypeOf.Class, create:() => CreateDocumentResponse()),
    'CreateDocumentRequest': TypeInfo(TypeOf.Class, create:() => CreateDocumentRequest()),
});

Dart CreateDocumentRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /document/create HTTP/1.1 
Host: etc-api.vsmlab.vn 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CreateDocumentRequest 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>
  <DocumentPolicyId>0</DocumentPolicyId>
  <MainId>0</MainId>
  <ScopeType>0</ScopeType>
  <Title>String</Title>
</CreateDocumentRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CreateDocumentResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/tvpl.api.ServiceModel">
  <Code>0</Code>
  <Id>0</Id>
  <Message>String</Message>
</CreateDocumentResponse>