adnx.tanchinhdo.api

<back to all web services

GetPostPreviewRequest

The following routes are available for this service:
GET/post/{slug}/preview
import 'package:servicestack/servicestack.dart';

class GetPostPreviewRequest implements IConvertible
{
    String? slug;

    GetPostPreviewRequest({this.slug});
    GetPostPreviewRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'slug': slug
    };

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

class GameResponse implements IConvertible
{
    int? id;
    String? name;
    String? identifier;
    String? linkHomePage;
    String? linkDownload;
    String? linkFanPage;
    String? icon;

    GameResponse({this.id,this.name,this.identifier,this.linkHomePage,this.linkDownload,this.linkFanPage,this.icon});
    GameResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        name = json['name'];
        identifier = json['identifier'];
        linkHomePage = json['linkHomePage'];
        linkDownload = json['linkDownload'];
        linkFanPage = json['linkFanPage'];
        icon = json['icon'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name,
        'identifier': identifier,
        'linkHomePage': linkHomePage,
        'linkDownload': linkDownload,
        'linkFanPage': linkFanPage,
        'icon': icon
    };

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

class BaseResponse<List> implements IResponseRequest, IConvertible
{
    int? code;
    String? message;
    List<GameResponse>? data;

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

    fromMap(Map<String, dynamic> json) {
        code = json['code'];
        message = json['message'];
        data = JsonConverters.fromJson(json['data'],'List<GameResponse>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'code': code,
        'message': message,
        'data': JsonConverters.toJson(data,'List<GameResponse>',context!)
    };

    getTypeName() => "BaseResponse<$List`1>";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'tanchinhdo_api_sandbox.adnx.vn', types: <String, TypeInfo> {
    'GetPostPreviewRequest': TypeInfo(TypeOf.Class, create:() => GetPostPreviewRequest()),
    'GameResponse': TypeInfo(TypeOf.Class, create:() => GameResponse()),
    'BaseResponse<List>': TypeInfo(TypeOf.Class, create:() => BaseResponse<List>()),
    'List<GameResponse>': TypeInfo(TypeOf.Class, create:() => <GameResponse>[]),
});

Dart GetPostPreviewRequest DTOs

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

HTTP + JSV

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

GET /post/{slug}/preview HTTP/1.1 
Host: tanchinhdo-api-sandbox.adnx.vn 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	code: 0,
	message: String,
	data: 
	{
		id: 0,
		title: String,
		slug: String,
		description: String,
		body: String,
		categoryId: 0,
		category: 
		{
			id: 0,
			name: String,
			slug: String
		},
		imageUrl: String,
		viewCount: 0,
		isPublished: False
	}
}