import { StringTypeSchema } from "tsbuffer-schema";

/**
 * 告知类相关服务
 */
export type Reqnotification = {
    /**publish 发布全服邮件/个人邮件/公告板/跑马灯  offline 下线全服邮件/公告板/跑马灯 */
    action: "publish" | "offline",
    /**server_mail 全服邮件   player_mail 个人邮件  bulletin    游戏公告板   news_ticker 游戏跑马灯 */
    template: "server_mail" | "player_mail" | "bulletin" | "news_ticker"
    /**富文本语法枚举 */
    richTextType?: string
    data?: any
};


export type Resnotification = {
    /**
     * 如果发送成功 将返回
     */
    code: number
    message: "success";
};


export type GongGaoBan_info = {
    /**公告内容 */
    content: string;
    /**展示结束时间 */
    etime: string;
    /**展示结束时间 */
    stime: string;
    /**排序 */
    sort: string;
    /**公告标题 */
    title: string;
    /**其他 */
    otherData?: { [id: string]: any }
};





// 构造请求参数 发布全服邮件 
export type canshuwurenhedifangdiaoyongnotificationargs1 = {
    "action": "publish",
    "template": "server_mail",
    "data": {
        "id": 123,
        "serverIds": [],
        "startTime": 1694403109,
        "endTime": 1696995109,
        "levelMin": 10,
        "levelMax": 100,
        "registeredBefore": 1694403109,
        "registeredAfter": 1694403109,
        "extends": {},
        "mail": [
            {
                "language": "zh",
                "header": "测试邮件标题 server_mail publish 1",
                "content": "测试邮件内容 server_mail publish 1",
                "bannerLink": "url"
            },
            {
                "language": "zh",
                "header": "测试邮件标题 server_mail publish 2",
                "content": "测试邮件内容 server_mail publish 2",
                "bannerLink": "url"
            }
        ],
        "assets": [
            {
                "itemId": "1",
                "num": 10
            },
            {
                "itemId": "2",
                "num": 10
            }
        ]

    }
};

// 构造请求参数 下线全服邮件 
export type canshuwurenhedifangdiaoyongnotificationargs3 = {
    "action": "offline",
    "template": "server_mail",
    "data": [123]
};

// 构造请求参数 发布个人邮件 playerIds 放url
export type canshuwurenhedifangdiaoyongnotificationargs2 = {
    "action": "publish",
    "template": "player_mail",
    "data": {
        "id": 123,
        "playerIds": [],
        "sendTime": 1694403109,
        "extends": {},
        "mail": [
            {
                "language": "zh",
                "header": "测试邮件标题 player_mail publish 100",
                "content": "测试邮件内容 player_mail publish 100",
                "bannerLink": "url"
            },
            {
                "language": "zh",
                "header": "测试邮件标题 player_mail publish 200",
                "content": "测试邮件内容 player_mail publish 200",
                "bannerLink": "url"
            }
        ],
        "assets": [
            {
                "itemId": "1",
                "num": 10
            },
            {
                "itemId": "2",
                "num": 10
            }
        ]

    }
};

// 构造请求参数 跑马灯
export type canshuwurenhedifangdiaoyongnotificationargspmd1 = {
    "action": "publish",
    "template": "news_ticker",
    "data": {
        "id": 123456,     // G123生成的告知唯一ID
        "serverIds": [1],     // 服务器ID列表
        "startTime": 1694403109,  // 开始时间 13位时间戳
        "endTime": 1696995109,    // 结束时间 13位时间戳
        "levelMin": 10,    // 玩家最小等级
        "levelMax": 70,    // 玩家最大等级
        "interval": 3,     // 播放间隔，单位分钟，为0时仅播放 frequency 次
        "frequency": 1,    // 每回播放频次，单位条数
        "newsTicker": [    // 告知内容
            {
                "language": "zh",
                "content": "测试跑马灯 1"
            },
            {
                "language": "zh",
                "content": "测试跑马灯 2"
            }
        ]
    }
};

// 构造请求参数 删除（下线）跑马灯
export type canshuwurenhedifangdiaoyongnotificationargspmd2 = {
    "action": "offline",
    "template": "news_ticker",
    "data": [123456]
};

// 构造请求参数 增加/编辑公告
export type canshuwurenhedifangdiaoyongnotificationargsgonggao1 = {
    "action": "publish",
    "template": "bulletin",
    "data": {
        "id": 1,
        "serverIds": [],     // 为空时默任展现给所有区服
        "startTime": 1694403109,        // 开始时间
        "endTime": 1726025509,          // 结束时间
        "levelMin": 10,                // 玩家最小等级
        "levelMax": 70,                // 玩家最大等级
        "bulletin": [
            {
                "language": "zh",
                "header": "新服公告新服公告新服公告新服公告",
                "content": "新服火热开启！各种福利来袭，任何游戏问题欢迎咨询官方客服，祝您游戏愉快！",
                "tag": "",     // 公告板标签
                "bannerLink": ""       // 背景图片
            },
            {
                "language": "zh",
                "header": "新服公告新服公告新服公告新服公告",
                "content": "新服火热开启！各种福利来袭，任何游戏问题欢迎咨询官方客服，祝您游戏愉快！",
                "tag": "",     // 公告板标签
                "bannerLink": ""       // 背景图片
            }
        ]

    }
};

// 构造请求参数 增加/编辑公告
export type canshuwurenhedifangdiaoyongnotificationargsgonggao2 = {
    "action": "offline",
    "template": "bulletin",
    "data": [1]
};




