@ginstone/nga-api
Version:
31 lines (30 loc) • 1.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserInfoRead = void 0;
const BaseUserInfo_1 = require("./BaseUserInfo");
/**
* read.php接口返回的用户详细信息
*/
class UserInfoRead extends BaseUserInfo_1.BaseUserInfo {
constructor(raw) {
super(raw);
this.bitData = raw.bit_data;
this.credit = raw.bit_data;
this.accountStatus = raw.yz;
if (raw.nickname)
this.nickname = raw.nickname;
if (raw.site)
this.userForum = raw.site;
if (raw.reputation) {
this.reputation = new Map();
raw.reputation.split(",").forEach(pair => {
var _a;
const split = pair.split("_");
(_a = this.reputation) === null || _a === void 0 ? void 0 : _a.set(Number(split[0]), Number(split[1]));
});
}
if (raw.thisvisit)
this.latestVisit = new Date(raw.thisvisit * 1000);
}
}
exports.UserInfoRead = UserInfoRead;