FrameAppWS

<back to all web services

GetNewsRQ

The following routes are available for this service:
All Verbs/mobile/maps/news
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class NewsData implements IConvertible
{
    int? code;
    DateTime? datenews;
    String? category;
    String? title;
    String? intro;
    String? author;
    String? image;
    String? news;

    NewsData({this.code,this.datenews,this.category,this.title,this.intro,this.author,this.image,this.news});
    NewsData.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        code = json['code'];
        datenews = JsonConverters.fromJson(json['datenews'],'DateTime',context!);
        category = json['category'];
        title = json['title'];
        intro = json['intro'];
        author = json['author'];
        image = json['image'];
        news = json['news'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'code': code,
        'datenews': JsonConverters.toJson(datenews,'DateTime',context!),
        'category': category,
        'title': title,
        'intro': intro,
        'author': author,
        'image': image,
        'news': news
    };

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

class GetNewsRS implements IConvertible
{
    String? Code;
    String? ErrorMessage;
    List<NewsData>? Data;

    GetNewsRS({this.Code,this.ErrorMessage,this.Data});
    GetNewsRS.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Code = json['Code'];
        ErrorMessage = json['ErrorMessage'];
        Data = JsonConverters.fromJson(json['Data'],'List<NewsData>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Code': Code,
        'ErrorMessage': ErrorMessage,
        'Data': JsonConverters.toJson(Data,'List<NewsData>',context!)
    };

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

class GetNewsRQ implements IConvertible
{
    String? Category;
    DateTime? Dateini;
    DateTime? Datefin;

    GetNewsRQ({this.Category,this.Dateini,this.Datefin});
    GetNewsRQ.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Category = json['Category'];
        Dateini = JsonConverters.fromJson(json['Dateini'],'DateTime',context!);
        Datefin = JsonConverters.fromJson(json['Datefin'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Category': Category,
        'Dateini': JsonConverters.toJson(Dateini,'DateTime',context!),
        'Datefin': JsonConverters.toJson(Datefin,'DateTime',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'ws.jimsnwa.com', types: <String, TypeInfo> {
    'NewsData': TypeInfo(TypeOf.Class, create:() => NewsData()),
    'GetNewsRS': TypeInfo(TypeOf.Class, create:() => GetNewsRS()),
    'List<NewsData>': TypeInfo(TypeOf.Class, create:() => <NewsData>[]),
    'GetNewsRQ': TypeInfo(TypeOf.Class, create:() => GetNewsRQ()),
});

Dart GetNewsRQ 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.

POST /mobile/maps/news HTTP/1.1 
Host: ws.jimsnwa.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Category: String,
	Dateini: 0001-01-01,
	Datefin: 0001-01-01
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Code: String,
	ErrorMessage: String,
	Data: 
	[
		{
			code: 0,
			datenews: 0001-01-01,
			category: String,
			title: String,
			intro: String,
			author: String,
			image: String,
			news: String
		}
	]
}