1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const messageTypes = [
  { id: 0, value: '0', label: '心跳机制', name: 'heartbeat' },
  { id: 1, value: '1', label: '后台任务', name: 'background_task' },
  { id: 2, value: '2', label: '业务日志', name: 'business_log' }
];
/**
 * 根据socket消息类型字段得到这个类型对象
 * @param {*} value socket消息类型
 * @returns 对应的消息类型对象
 */
function getByValue(value) {
  return messageTypes.find((v) => v.value == value);
}
function isHeartbeatMessageByType(type) {
  return type == '0';
}
export { messageTypes, getByValue, isHeartbeatMessageByType };