@ginstone/nga-api
Version:
63 lines (62 loc) • 1.88 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RecommendNotice = exports.MessageNotice = exports.ReplyNotice = exports.NoticeBody = void 0;
const StrUtils_1 = require("@ginstone/common-utils/dist/src/utils/StrUtils");
/**
* 提醒消息响应
*/
class NoticeBody {
constructor(raw) {
this.replyNotices = raw["0"] ? raw["0"].map(i => new ReplyNotice(i)) : undefined;
this.msgNotices = raw["1"] ? raw["1"].map(i => new MessageNotice(i)) : undefined;
this.recommendNotices = raw["2"] ? raw["2"].map(i => new RecommendNotice(i)) : undefined;
}
}
exports.NoticeBody = NoticeBody;
/**
* 回复提醒
*/
class ReplyNotice {
constructor(raw) {
this.type = raw["0"];
this.authorId = raw["1"];
this.authorName = raw["2"];
this.repliedUid = raw["3"];
this.repliedName = raw["4"];
this.topicTitle = (0, StrUtils_1.unEscape)(raw["5"]);
this.topicId = raw["6"];
this.replyId = raw["7"];
this.repliedId = raw["8"];
this.page = raw["10"];
this.timestamp = new Date(raw["9"] * 1000);
}
}
exports.ReplyNotice = ReplyNotice;
/**
* 私信提醒
*/
class MessageNotice {
constructor(raw) {
this.type = raw["0"];
this.authorId = raw["1"];
this.authorName = raw["2"];
this.messageId = raw["6"];
this.timestamp = new Date(raw["9"] * 1000);
}
}
exports.MessageNotice = MessageNotice;
/**
* 赞踩提醒
*/
class RecommendNotice {
constructor(raw) {
this.type = raw["0"];
this.repliedUid = raw["3"];
this.topicTitle = (0, StrUtils_1.unEscape)(raw["5"]);
this.topicId = raw["6"];
this.replyId = raw["7"];
this.page = raw["10"];
this.timestamp = new Date(raw["9"] * 1000);
}
}
exports.RecommendNotice = RecommendNotice;