index.js
4.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import api from "~/utils/request/request.js";
/**
* 模块类型枚举说明:
* - 0: 系统通知
* - 1: 优秀话术
* - 2: 话术预警
* - 3: ai导师(短课程)
* - 4: 学习任务(长课程)
* - 5: 活动中心
* - 6: 学习类策略
* - 7: 优秀案例分享策略
* - 8: 任务型策略
* @typedef {0|1|2|3|4|5|6|7|8} ModuleType
*/
/**
* 业务场景枚举说明:
* - 0: 延保
* - 1: 精品
* - 2: 权益
* @typedef {0|1|2} BusinessType
*/
/**
* @typedef {Object} NewPadMessageBoxDTO
* @property {number} [id]
* @property {ModuleType} [moduleType] 模块分类
* @property {BusinessType} [businessType] 业务场景
* @property {string} [uuid]
* @property {string} [phone]
* @property {string} [name]
* @property {number} [status] 查看状态:0-待查看,1-已查看
* @property {string} [createdBy]
* @property {string} [createdTime]
* @property {string} [updatedBy]
* @property {string} [updatedTime]
* @property {string} [delFlag]
* @property {number} [popupCount]
* @property {string} [readType] 阅读模式:0不强制,1首次强制,2每日强制
* @property {number} [readCount]
* @property {string} [latestReadTime]
* @property {string} [reminderType] 提醒类型:1-首次提醒,2-进度提醒
* @property {string} [msgTitle] 消息标题
* @property {string} [taskStartTime] 任务类型消息-任务开始时间 yyyy-MM-dd HH:mm:ss
* @property {string} [startEndTime] 任务类型消息-任务结束时间 yyyy-MM-dd HH:mm:ss
* @property {Object} [msgDetail] 消息详情-业务方消息详情。根据moduleType返回不同数据结构
*/
/**
* @typedef {Object} RpcPagination
* @property {number} [pageNum]
* @property {number} [pageSize]
* @property {number} [startRow]
* @property {number} [endRow]
* @property {number} [total]
* @property {number} [pages]
* @property {Array<NewPadMessageBoxDTO>} [list]
* @property {NewPadMessageBoxDTO} [condition]
* @property {boolean} [needCount]
*/
/**
* 获取公司公告分页列表
* @param {Object} data - 请求参数
* @param {number} [data.pageNum=1] 当前页码
* @param {number} [data.pageSize=10] 每页条数
* @param {ModuleType} [data.moduleType] 模块分类
* @param {BusinessType} [data.businessType] 业务场景
* @param {string} [data.uuid] 消息接收人uuid
* @param {string} [data.phone] 消息接收人手机号
* @param {string} [data.name] 消息接收人姓名
* @param {number} [data.status] 查看状态:0-待查看,1-已查看
* @returns {Promise<{code: string, errId: string, message?: string, data?: RpcPagination}>} 返回公司公告分页数据
*/
export function getCompanyNoticeList(data = { pageNum: 1, pageSize: 10 }) {
return api.post("dj.pad.api.new.pad.message.box.page", data, [], "/rop-dj-pad/router");
}
/**
* @typedef {Object} RopResponseDetail
* @property {string} code 响应状态(0:成功;1:失败)
* @property {string} errId 错误码
* @property {string} [message] 错误描述
* @property {NewPadMessageBoxDTO} [data] 成功返回数据
*/
/**
* 获取公告详情
* @param {{ id: number }} data - 请求参数,公告ID
* @returns {Promise<RopResponseDetail>} 返回公告详情数据
*/
export function getCompanyNoticeDetail(data) {
return api.post("dj.pad.api.new.pad.message.box.detail", data, [], "/rop-dj-pad/router");
}
/**
* @typedef {Object} ModuleUnreadCountDTO
* @property {ModuleType} [moduleType] 模块类型
* @property {number} [unreadCount] 未读数量
*/
/**
* @typedef {Object} UnreadCountResponse
* @property {string} code 响应状态(0:成功;1:失败)
* @property {string} errId 错误码
* @property {string} [message] 错误描述
* @property {Array<ModuleUnreadCountDTO>} [data] 各模块未读数量列表
*/
/**
* 获取各模块类型的未读数量
* @param {Object} data - 请求参数
* @param {Array<ModuleType>} [data.moduleTypes] 模块类型列表
* @param {BusinessType} [data.businessType] 业务场景
* @param {string} data.sessionId 会话ID(必填)
* @returns {Promise<UnreadCountResponse>} 返回各模块未读数量数据
*/
export function getUnreadCountByType(data) {
return api.post("dj.pad.api.new.pad.message.box.unread.count.by.type", data, [], "/rop-dj-pad/router");
}
export function putRecordStudyStatus(data) {
return api.post("dj.api.strategy.monitor.insertOrUpdateLearningRecord", data, [], "/rop-dj-pad/router");
}