tvpl.api

<back to all web services

UpdateRoleRequest

Cập nhật role

Requires Authentication
Required role:super-admin
The following routes are available for this service:
POST/roles/update
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 UpdateRoleRequest implements IPost, IConvertible
{
    int? id;
    String? name;
    bool? isDelete;

    UpdateRoleRequest({this.id,this.name,this.isDelete});
    UpdateRoleRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name,
        'isDelete': isDelete
    };

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

TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
    'UpdateRoleResponse': TypeInfo(TypeOf.Class, create:() => UpdateRoleResponse()),
    'UpdateRoleRequest': TypeInfo(TypeOf.Class, create:() => UpdateRoleRequest()),
});

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

POST /roles/update HTTP/1.1 
Host: etc-api.vsmlab.vn 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"id":0,"name":"String","isDelete":false}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"insertedId":0,"code":0,"message":"String"}