"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const MsClient = require("cn.keytop.midend.microservice.Client");
/**
 * 使用示例：
 * import * as userAdminMsClient from 'stc.ms.UserAdmin'
 *
 * const userAdminMsClient = new userAdminMsClient.UserAdmin()
 *  userAdminMsClient.fun1('aaa','bbb','ccc')
 * .catch(error => {console.log(error)})
 * .then(value => {console.log(value)})
 *
 *
 * @author 微服务平台自动生成
 * @desc [演示-用户基本信息管理]接口定义
 * @date 2020-03-28 18:14:14
 **/
class UserAdmin {
    constructor(serviceClientConfig = new MsClient.ServiceClientConfig()) {
        this.pid = 'stc.ms.UserAdmin';
        this.version = '1.0';
        this.authType = MsClient.AuthType.BASE;
        this.serviceClient = new MsClient.ServiceClientImpl(serviceClientConfig);
    }
    get(id) {
        return __awaiter(this, void 0, void 0, function* () {
            let sid = `${this.pid}.get`;
            let tags = '';
            let header = { 'uri': 'user/get', 'pid': `${this.pid}` };
            let paramMap = {};
            paramMap = { 'id': id };
            let response = yield this.serviceClient.get(sid, this.version, tags, header, paramMap, this.authType);
            if (!response) {
                return response;
            }
            else {
                return new Get$Models.ApiResult(response);
            }
        });
    }
    add(addUserInfo) {
        return __awaiter(this, void 0, void 0, function* () {
            let sid = `${this.pid}.add`;
            let tags = '';
            let header = { 'uri': 'user/add', 'pid': `${this.pid}` };
            let paramMap = {};
            let bodyObj = addUserInfo;
            let response = yield this.serviceClient.call(MsClient.HttpMethodType.POST, sid, this.version, tags, header, paramMap, bodyObj, this.authType, MsClient.RequestBodyType.RAW_JSON);
            if (!response) {
                return response;
            }
            else {
                return new Add$Models.ApiResult(response);
            }
        });
    }
    update(userInfo) {
        return __awaiter(this, void 0, void 0, function* () {
            let sid = `${this.pid}.update`;
            let tags = '';
            let header = { 'uri': 'user/update', 'pid': `${this.pid}` };
            let paramMap = {};
            let bodyObj = userInfo;
            let response = yield this.serviceClient.call(MsClient.HttpMethodType.POST, sid, this.version, tags, header, paramMap, bodyObj, this.authType, MsClient.RequestBodyType.RAW_JSON);
            if (!response) {
                return response;
            }
            else {
                return new Update$Models.ApiResult(response);
            }
        });
    }
    delete(id) {
        return __awaiter(this, void 0, void 0, function* () {
            let sid = `${this.pid}.delete`;
            let tags = '';
            let header = { 'uri': 'user/delete', 'pid': `${this.pid}` };
            let paramMap = {};
            paramMap = { 'id': id };
            let response = yield this.serviceClient.call(MsClient.HttpMethodType.POST, sid, this.version, tags, header, paramMap, {}, this.authType, MsClient.RequestBodyType.WWW_FORM);
            if (!response) {
                return response;
            }
            else {
                return new Delete$Models.ApiResult(response);
            }
        });
    }
}
exports.UserAdmin = UserAdmin;
var Get$Models;
(function (Get$Models) {
    class Map {
        constructor(value) {
            this._ms_response_data$$$ = value;
        }
    }
    Get$Models.Map = Map;
    class UserInfo {
        constructor(value) {
            this._ms_response_data$$$ = value;
            this._extattr = new Map(value.extattr);
        }
        get id() {
            return this._ms_response_data$$$.id;
        }
        set id(value) {
            this._ms_response_data$$$.id = value;
        }
        get name() {
            return this._ms_response_data$$$.name;
        }
        set name(value) {
            this._ms_response_data$$$.name = value;
        }
        get alias() {
            return this._ms_response_data$$$.alias;
        }
        set alias(value) {
            this._ms_response_data$$$.alias = value;
        }
        get email() {
            return this._ms_response_data$$$.email;
        }
        set email(value) {
            this._ms_response_data$$$.email = value;
        }
        get mobile() {
            return this._ms_response_data$$$.mobile;
        }
        set mobile(value) {
            this._ms_response_data$$$.mobile = value;
        }
        get avatar() {
            return this._ms_response_data$$$.avatar;
        }
        set avatar(value) {
            this._ms_response_data$$$.avatar = value;
        }
        get extattr() {
            return this._extattr;
        }
        set extattr(value) {
            this._extattr = value;
        }
        get entryTime() {
            if (this._ms_response_data$$$.entryTime) {
                return new Date(this._ms_response_data$$$.entryTime);
            }
            else {
                return undefined;
            }
        }
        set entryTime(value) {
            if (value) {
                this._ms_response_data$$$.entryTime = value.getTime();
            }
        }
    }
    Get$Models.UserInfo = UserInfo;
    class ApiResult$Companion {
        constructor(value) {
            this._ms_response_data$$$ = value;
        }
    }
    Get$Models.ApiResult$Companion = ApiResult$Companion;
    class ApiResult {
        constructor(value) {
            this._ms_response_data$$$ = value;
            this._data = new UserInfo(value.data);
            this._companion = new ApiResult$Companion(value.Companion);
        }
        get data() {
            return this._data;
        }
        set data(value) {
            this._data = value;
        }
        get code() {
            return this._ms_response_data$$$.code;
        }
        set code(value) {
            this._ms_response_data$$$.code = value;
        }
        get message() {
            return this._ms_response_data$$$.message;
        }
        set message(value) {
            this._ms_response_data$$$.message = value;
        }
        get SUCCESS_CODE() {
            return this._ms_response_data$$$.SUCCESS_CODE;
        }
        set SUCCESS_CODE(value) {
            this._ms_response_data$$$.SUCCESS_CODE = value;
        }
        get FAIL_CODE() {
            return this._ms_response_data$$$.FAIL_CODE;
        }
        set FAIL_CODE(value) {
            this._ms_response_data$$$.FAIL_CODE = value;
        }
        get Companion() {
            return this._companion;
        }
        set Companion(value) {
            this._companion = value;
        }
    }
    Get$Models.ApiResult = ApiResult;
})(Get$Models = exports.Get$Models || (exports.Get$Models = {}));
var Add$Models;
(function (Add$Models) {
    class Map {
    }
    Add$Models.Map = Map;
    class AddUserInfo {
    }
    Add$Models.AddUserInfo = AddUserInfo;
    class ApiResult$Companion {
        constructor(value) {
            this._ms_response_data$$$ = value;
        }
    }
    Add$Models.ApiResult$Companion = ApiResult$Companion;
    class ApiResult {
        constructor(value) {
            this._ms_response_data$$$ = value;
            this._companion = new ApiResult$Companion(value.Companion);
        }
        get data() {
            return this._ms_response_data$$$.data;
        }
        set data(value) {
            this._ms_response_data$$$.data = value;
        }
        get code() {
            return this._ms_response_data$$$.code;
        }
        set code(value) {
            this._ms_response_data$$$.code = value;
        }
        get message() {
            return this._ms_response_data$$$.message;
        }
        set message(value) {
            this._ms_response_data$$$.message = value;
        }
        get SUCCESS_CODE() {
            return this._ms_response_data$$$.SUCCESS_CODE;
        }
        set SUCCESS_CODE(value) {
            this._ms_response_data$$$.SUCCESS_CODE = value;
        }
        get FAIL_CODE() {
            return this._ms_response_data$$$.FAIL_CODE;
        }
        set FAIL_CODE(value) {
            this._ms_response_data$$$.FAIL_CODE = value;
        }
        get Companion() {
            return this._companion;
        }
        set Companion(value) {
            this._companion = value;
        }
    }
    Add$Models.ApiResult = ApiResult;
})(Add$Models = exports.Add$Models || (exports.Add$Models = {}));
var Update$Models;
(function (Update$Models) {
    class Map {
    }
    Update$Models.Map = Map;
    class UserInfo {
    }
    Update$Models.UserInfo = UserInfo;
    class Object {
        constructor(value) {
            this._ms_response_data$$$ = value;
        }
    }
    Update$Models.Object = Object;
    class ApiResult$Companion {
        constructor(value) {
            this._ms_response_data$$$ = value;
        }
    }
    Update$Models.ApiResult$Companion = ApiResult$Companion;
    class ApiResult {
        constructor(value) {
            this._ms_response_data$$$ = value;
            this._data = new Object(value.data);
            this._companion = new ApiResult$Companion(value.Companion);
        }
        get data() {
            return this._data;
        }
        set data(value) {
            this._data = value;
        }
        get code() {
            return this._ms_response_data$$$.code;
        }
        set code(value) {
            this._ms_response_data$$$.code = value;
        }
        get message() {
            return this._ms_response_data$$$.message;
        }
        set message(value) {
            this._ms_response_data$$$.message = value;
        }
        get SUCCESS_CODE() {
            return this._ms_response_data$$$.SUCCESS_CODE;
        }
        set SUCCESS_CODE(value) {
            this._ms_response_data$$$.SUCCESS_CODE = value;
        }
        get FAIL_CODE() {
            return this._ms_response_data$$$.FAIL_CODE;
        }
        set FAIL_CODE(value) {
            this._ms_response_data$$$.FAIL_CODE = value;
        }
        get Companion() {
            return this._companion;
        }
        set Companion(value) {
            this._companion = value;
        }
    }
    Update$Models.ApiResult = ApiResult;
})(Update$Models = exports.Update$Models || (exports.Update$Models = {}));
var Delete$Models;
(function (Delete$Models) {
    class Object {
        constructor(value) {
            this._ms_response_data$$$ = value;
        }
    }
    Delete$Models.Object = Object;
    class ApiResult$Companion {
        constructor(value) {
            this._ms_response_data$$$ = value;
        }
    }
    Delete$Models.ApiResult$Companion = ApiResult$Companion;
    class ApiResult {
        constructor(value) {
            this._ms_response_data$$$ = value;
            this._data = new Object(value.data);
            this._companion = new ApiResult$Companion(value.Companion);
        }
        get data() {
            return this._data;
        }
        set data(value) {
            this._data = value;
        }
        get code() {
            return this._ms_response_data$$$.code;
        }
        set code(value) {
            this._ms_response_data$$$.code = value;
        }
        get message() {
            return this._ms_response_data$$$.message;
        }
        set message(value) {
            this._ms_response_data$$$.message = value;
        }
        get SUCCESS_CODE() {
            return this._ms_response_data$$$.SUCCESS_CODE;
        }
        set SUCCESS_CODE(value) {
            this._ms_response_data$$$.SUCCESS_CODE = value;
        }
        get FAIL_CODE() {
            return this._ms_response_data$$$.FAIL_CODE;
        }
        set FAIL_CODE(value) {
            this._ms_response_data$$$.FAIL_CODE = value;
        }
        get Companion() {
            return this._companion;
        }
        set Companion(value) {
            this._companion = value;
        }
    }
    Delete$Models.ApiResult = ApiResult;
})(Delete$Models = exports.Delete$Models || (exports.Delete$Models = {}));
//# sourceMappingURL=index.js.map