| Required role: | super-admin |
| POST | /roles/create |
|---|
import 'package:servicestack/servicestack.dart';
class UpdateRoleResponse implements IResponseRequest, IConvertible
{
int? insertedId;
int? code;
String? message;
UpdateRoleResponse({this.insertedId,this.code,this.message});
UpdateRoleResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
insertedId = json['insertedId'];
code = json['code'];
message = json['message'];
return this;
}
Map<String, dynamic> toJson() => {
'insertedId': insertedId,
'code': code,
'message': message
};
getTypeName() => "UpdateRoleResponse";
TypeContext? context = _ctx;
}
/**
* Cập nhật role
*/
class CreateRoleRequest implements IPost, IConvertible
{
String? name;
CreateRoleRequest({this.name});
CreateRoleRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
name = json['name'];
return this;
}
Map<String, dynamic> toJson() => {
'name': name
};
getTypeName() => "CreateRoleRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
'UpdateRoleResponse': TypeInfo(TypeOf.Class, create:() => UpdateRoleResponse()),
'CreateRoleRequest': TypeInfo(TypeOf.Class, create:() => CreateRoleRequest()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /roles/create HTTP/1.1
Host: etc-api.vsmlab.vn
Accept: application/json
Content-Type: application/json
Content-Length: length
{"name":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"insertedId":0,"code":0,"message":"String"}