获取未读公告 - GetUnreadAnnouncements
函数简介
获取当前客户端的未读公告列表。
返回数据格式:
{
"Code": 1,
"Message": "",
"TotalCount": 1,
"Items": [
{
"Guid": "a0b1c2d3",
"Title": "公告标题",
"Content": "公告正文",
"AnnouncementType": 1,
"AnnouncementTypeText": "系统公告",
"Priority": 1,
"PriorityText": "普通",
"IsPopup": true,
"IsTop": false,
"SortOrder": 10,
"PublishTime": "2026-04-20 08:00:00",
"ExpireTime": "2026-05-20 08:00:00",
"TargetUrl": "",
"IsRead": false
}
]
}
| 字段名 | 说明 |
|---|---|
| Code | 结果状态码。 |
| Message | 提示信息。 |
| TotalCount | 公告数量。 |
| Items | 公告列表。 |
接口名称
GetUnreadAnnouncements
DLL调用
long GetUnreadAnnouncements(string userCode, string softCode, string softVersion, string dealerCode);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| userCode | 字符串 | 用户码。 |
| softCode | 字符串 | 软件码。 |
| softVersion | 字符串 | 软件版本。 |
| dealerCode | 字符串 | 经销商码。 |
示例
C++
long instance = CreateCOLAPlugInterFace();
long result = GetUnreadAnnouncements(instance, "userCode", "softCode", "1.0.0", "dealerCode");
if (result != 0) {
char* json = GetStringFromPtr(result);
printf("未读公告: %s\n", json);
FreeStringPtr(result);
}
Python
# 待补充
返回值
成功返回 JSON 字符串格式的公告结果;失败返回 0。
注意事项
- 返回的字符串指针需要调用 FreeStringPtr 接口释放内存。
