tvpl.api

<back to all web services

GetAllPermissionRequest

Tất cả các quyền của role

Requires Authentication
Required role:super-admin
The following routes are available for this service:
GET/roles/all-permission
import 'package:servicestack/servicestack.dart';

class Permission implements IConvertible
{
    // @required()
    // @StringLength(100)
    String? permissionCode;

    // @required()
    // @StringLength(255)
    String? permissionName;

    // @StringLength(255)
    String? description;

    Permission({this.permissionCode,this.permissionName,this.description});
    Permission.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'permissionCode': permissionCode,
        'permissionName': permissionName,
        'description': description
    };

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

class GetAllPermissionResponse implements IResponseRequest, IConvertible
{
    List<Permission>? permissionList;
    int? code;
    String? message;

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

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

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

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

/**
* Tất cả các quyền của role
*/
class GetAllPermissionRequest implements IGet, IConvertible
{
    GetAllPermissionRequest();
    GetAllPermissionRequest.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

    Map<String, dynamic> toJson() => {};
    getTypeName() => "GetAllPermissionRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
    'Permission': TypeInfo(TypeOf.Class, create:() => Permission()),
    'GetAllPermissionResponse': TypeInfo(TypeOf.Class, create:() => GetAllPermissionResponse()),
    'List<Permission>': TypeInfo(TypeOf.Class, create:() => <Permission>[]),
    'GetAllPermissionRequest': TypeInfo(TypeOf.Class, create:() => GetAllPermissionRequest()),
});

Dart GetAllPermissionRequest DTOs

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

HTTP + CSV

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

GET /roles/all-permission HTTP/1.1 
Host: etc-api.vsmlab.vn 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"permissionList":[{"permissionCode":"String","permissionName":"String","description":"String"}],"code":0,"message":"String"}