| Required role: | super-admin |
| 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 .xml suffix or ?format=xml
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: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetAllPermissionResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/tvpl.api.ServiceModel">
<Code>0</Code>
<Message>String</Message>
<PermissionList xmlns:d2p1="http://schemas.datacontract.org/2004/07/tvpl.data.Models">
<d2p1:Permission>
<d2p1:Description>String</d2p1:Description>
<d2p1:Id>0</d2p1:Id>
<d2p1:PermissionCode>String</d2p1:PermissionCode>
<d2p1:PermissionName>String</d2p1:PermissionName>
</d2p1:Permission>
</PermissionList>
</GetAllPermissionResponse>