midway-fatcms 0.0.1-beta.4 → 0.0.1-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/controller/manage/UserAccountManageApi.d.ts +1 -1
- package/dist/index.d.ts +26 -4
- package/dist/index.js +26 -4
- package/package.json +1 -1
- package/src/index.ts +32 -4
- package/dist/controller/medstatistic/MedAdminController.d.ts +0 -35
- package/dist/controller/medstatistic/MedAdminController.js +0 -205
- package/dist/controller/medstatistic/MedClientController.d.ts +0 -28
- package/dist/controller/medstatistic/MedClientController.js +0 -188
- package/dist/controller/medstatistic/MedMessageService.d.ts +0 -19
- package/dist/controller/medstatistic/MedMessageService.js +0 -95
- package/dist/controller/medstatistic/MedScoreService.d.ts +0 -21
- package/dist/controller/medstatistic/MedScoreService.js +0 -107
- package/dist/controller/medstatistic/constants.d.ts +0 -32
- package/dist/controller/medstatistic/constants.js +0 -43
- package/src/controller/medstatistic/MedAdminController.ts +0 -221
- package/src/controller/medstatistic/MedClientController.ts +0 -188
- package/src/controller/medstatistic/MedMessageService.ts +0 -89
- package/src/controller/medstatistic/MedScoreService.ts +0 -108
- package/src/controller/medstatistic/constants.ts +0 -63
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { Controller, Inject, Post } from '@midwayjs/core';
|
|
2
|
-
import { Context } from '@midwayjs/koa';
|
|
3
|
-
import { BaseApiController } from '../base/BaseApiController';
|
|
4
|
-
import { AuthService } from '../../service/AuthService';
|
|
5
|
-
import { CommonResult } from '../../libs/utils/common-dto';
|
|
6
|
-
import {WorkbenchService} from "../../service/WorkbenchService";
|
|
7
|
-
import {KeysOfSimpleSQL} from "../../libs/crud-pro/models/keys";
|
|
8
|
-
import {MedMessageService} from "./MedMessageService";
|
|
9
|
-
import {CurdProService} from "../../service/curd/CurdProService";
|
|
10
|
-
import {ISendUserReceivedMsg, MsgType, TARGET_OBJECT_TYPE_BBS_REPLY, TARGET_OBJECT_TYPE_BBS_TOPIC} from "./constants";
|
|
11
|
-
import {checkLogin} from "../../middleware/permission.middleware";
|
|
12
|
-
const MED_STATISTIC_DB = "medstatistic";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* medstatistic 用户端
|
|
16
|
-
*/
|
|
17
|
-
@Controller('/ns/api/medclient' , {middleware: [checkLogin()]})
|
|
18
|
-
export class MedClientController extends BaseApiController {
|
|
19
|
-
@Inject()
|
|
20
|
-
protected ctx: Context;
|
|
21
|
-
|
|
22
|
-
@Inject()
|
|
23
|
-
protected authService: AuthService;
|
|
24
|
-
|
|
25
|
-
@Inject()
|
|
26
|
-
protected workbenchService: WorkbenchService;
|
|
27
|
-
|
|
28
|
-
@Inject()
|
|
29
|
-
protected curdProService: CurdProService;
|
|
30
|
-
|
|
31
|
-
@Inject()
|
|
32
|
-
protected medMessageService: MedMessageService;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* 充值
|
|
36
|
-
*/
|
|
37
|
-
@Post('/recharge')
|
|
38
|
-
async recharge(): Promise<CommonResult> {
|
|
39
|
-
// const body = this.ctx.request.body as any; // {user_id}
|
|
40
|
-
// const pay_type = body.pay_type; // 类型:1=微信,2=支付宝,3=授权
|
|
41
|
-
// const recharge_type = body.recharge_type; // 充值方式:1=套餐,2=自定义积分
|
|
42
|
-
// const package_price = body.package_price; // 套餐充值 package_price 元人民币
|
|
43
|
-
// const custom_score = body.custom_score; // 自定义充值 custom_score 元人民币
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* 获取用户收到的消息。只需要登录即可
|
|
53
|
-
*/
|
|
54
|
-
@Post('/send_user_received_message')
|
|
55
|
-
async send_user_received_message(): Promise<CommonResult> {
|
|
56
|
-
const msgObj = this.ctx.request.body as any as ISendUserReceivedMsg; // {user_id}
|
|
57
|
-
const { msg_type , target_object_id, target_object_type} = msgObj || {}
|
|
58
|
-
|
|
59
|
-
// title:string, content: string, received_by: string | number, msgObj: ISendUserReceivedMsg
|
|
60
|
-
|
|
61
|
-
if (target_object_type === TARGET_OBJECT_TYPE_BBS_TOPIC) {
|
|
62
|
-
const topicObj = await this.getBBSTopic(target_object_id)
|
|
63
|
-
// 点赞了一篇帖子,发送消息 给作者
|
|
64
|
-
if ( msg_type === MsgType.bbs_post_be_like) {
|
|
65
|
-
const title = "您的帖子收到了点赞"
|
|
66
|
-
const content = `《${topicObj.title}》`
|
|
67
|
-
await this.medMessageService.insertMessage(title,content,topicObj.created_by, msgObj);
|
|
68
|
-
return CommonResult.successRes("OK");
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// 回复了一篇帖子,发送消息 给作者
|
|
72
|
-
if ( msg_type === MsgType.bbs_post_be_reply) {
|
|
73
|
-
const title = "您的帖子收到了回复"
|
|
74
|
-
const content = `《${topicObj.title}》`
|
|
75
|
-
await this.medMessageService.insertMessage(title,content,topicObj.created_by, msgObj);
|
|
76
|
-
return CommonResult.successRes("OK");
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// 回复帖子被判定为违规
|
|
80
|
-
if ( msg_type === MsgType.bbs_post_be_violation) {
|
|
81
|
-
const title = "您的帖子被判定为违规"
|
|
82
|
-
const content = `《${topicObj.title}》`
|
|
83
|
-
await this.medMessageService.insertMessage(title,content,topicObj.created_by, msgObj);
|
|
84
|
-
return CommonResult.successRes("OK");
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// 您的帖子被收藏
|
|
88
|
-
if ( msg_type === MsgType.bbs_post_be_favorite) {
|
|
89
|
-
const title = "您的帖子被收藏"
|
|
90
|
-
const content = `《${topicObj.title}》`
|
|
91
|
-
await this.medMessageService.insertMessage(title,content,topicObj.created_by, msgObj);
|
|
92
|
-
return CommonResult.successRes("OK");
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if (target_object_type === TARGET_OBJECT_TYPE_BBS_REPLY) {
|
|
98
|
-
const topicObj = await this.getBBSReply(target_object_id)
|
|
99
|
-
// 点赞了一篇帖子,发送消息 给作者
|
|
100
|
-
if ( msg_type === MsgType.bbs_reply_be_like) {
|
|
101
|
-
const title = "您的评论收到了点赞"
|
|
102
|
-
const content = `《${topicObj.title}》`
|
|
103
|
-
await this.medMessageService.insertMessage(title,content,topicObj.created_by, msgObj);
|
|
104
|
-
return CommonResult.successRes("OK");
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// 回复了一篇帖子,发送消息 给作者
|
|
108
|
-
if ( msg_type === MsgType.bbs_reply_be_reply) {
|
|
109
|
-
const title = "您的评论收到了回复"
|
|
110
|
-
const content = `《${topicObj.title}》`
|
|
111
|
-
await this.medMessageService.insertMessage(title,content,topicObj.created_by, msgObj);
|
|
112
|
-
return CommonResult.successRes("OK");
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// 回复帖子被判定为违规
|
|
116
|
-
if ( msg_type === MsgType.bbs_reply_be_violation) {
|
|
117
|
-
const title = "您的评论被判定为违规"
|
|
118
|
-
const content = `《${topicObj.title}》`
|
|
119
|
-
await this.medMessageService.insertMessage(title,content,topicObj.created_by, msgObj);
|
|
120
|
-
return CommonResult.successRes("OK");
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
// 联系我们 收到了回复
|
|
127
|
-
if (msg_type === MsgType.contact_us_be_reply) {
|
|
128
|
-
const contactObj = await this.get_fa_contact(target_object_id);
|
|
129
|
-
this.logInfo("contact_us_be_reply==> " + JSON.stringify(contactObj));
|
|
130
|
-
if (contactObj && contactObj.created_by) {
|
|
131
|
-
const title = "您的主动联系收到了回复"
|
|
132
|
-
const content = contactObj.mark || "";
|
|
133
|
-
await this.medMessageService.insertMessage(title,content,contactObj.created_by, msgObj);
|
|
134
|
-
return CommonResult.successRes("OK");
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
return CommonResult.successRes("NULL");
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
private async get_fa_contact(fa_contact_id: number){
|
|
144
|
-
const topicRes = await this.curdMixService.executeCrudByCfg({
|
|
145
|
-
condition: {
|
|
146
|
-
id: fa_contact_id,
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
sqlSimpleName: KeysOfSimpleSQL.SIMPLE_QUERY_ONE,
|
|
151
|
-
sqlTable: "fa_contact",
|
|
152
|
-
sqlDatabase: MED_STATISTIC_DB,
|
|
153
|
-
});
|
|
154
|
-
return topicRes.getOneObj();
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
private async getBBSTopic(topicId: number){
|
|
158
|
-
const topicRes = await this.curdMixService.executeCrudByCfg({
|
|
159
|
-
condition: {
|
|
160
|
-
id: topicId,
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
sqlSimpleName: KeysOfSimpleSQL.SIMPLE_QUERY_ONE,
|
|
165
|
-
sqlTable: "fatbiz_bbs_topic",
|
|
166
|
-
sqlDatabase: MED_STATISTIC_DB,
|
|
167
|
-
});
|
|
168
|
-
return topicRes.getOneObj();
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
private async getBBSReply(replyId: number){
|
|
173
|
-
const topicRes = await this.curdMixService.executeCrudByCfg({
|
|
174
|
-
condition: {
|
|
175
|
-
id: replyId,
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
sqlSimpleName: KeysOfSimpleSQL.SIMPLE_QUERY_ONE,
|
|
180
|
-
sqlTable: "fatbiz_bbs_replies",
|
|
181
|
-
sqlDatabase: MED_STATISTIC_DB,
|
|
182
|
-
});
|
|
183
|
-
return topicRes.getOneObj();
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import {Inject,Provide} from '@midwayjs/core';
|
|
2
|
-
import {Context} from '@midwayjs/koa';
|
|
3
|
-
import {AuthService} from '../../service/AuthService';
|
|
4
|
-
import {WorkbenchService} from "../../service/WorkbenchService";
|
|
5
|
-
import {SysConfigService} from "../../service/SysConfigService";
|
|
6
|
-
import {KeysOfSimpleSQL} from "../../libs/crud-pro/models/keys";
|
|
7
|
-
import {BaseService} from "../../service/base/BaseService";
|
|
8
|
-
import {CurdProService} from "../../service/curd/CurdProService";
|
|
9
|
-
import * as md5 from 'md5';
|
|
10
|
-
import {CommonException} from "../../libs/crud-pro/exceptions";
|
|
11
|
-
import {ISendUserReceivedMsg, isMsgType, MED_STATISTIC_DB, MsgStatus} from "./constants";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* medstatistic 管理端
|
|
16
|
-
*/
|
|
17
|
-
@Provide()
|
|
18
|
-
export class MedMessageService extends BaseService {
|
|
19
|
-
@Inject()
|
|
20
|
-
protected ctx: Context;
|
|
21
|
-
|
|
22
|
-
@Inject()
|
|
23
|
-
protected authService: AuthService;
|
|
24
|
-
|
|
25
|
-
@Inject()
|
|
26
|
-
protected workbenchService: WorkbenchService;
|
|
27
|
-
|
|
28
|
-
@Inject()
|
|
29
|
-
protected sysConfigService: SysConfigService;
|
|
30
|
-
|
|
31
|
-
@Inject()
|
|
32
|
-
protected curdProService: CurdProService;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
async insertMessage(title:string, content: string, received_by: string | number, msgObj: ISendUserReceivedMsg): Promise<any> {
|
|
36
|
-
try {
|
|
37
|
-
return this.insertMessageInner(title,content,received_by,msgObj);
|
|
38
|
-
} catch (e) {
|
|
39
|
-
this.logWarn("[MedMessageService]insertMessageInner失败",e)
|
|
40
|
-
return Promise.resolve(e);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
private async insertMessageInner(title:string, content: string, received_by: string | number, msgObj: ISendUserReceivedMsg): Promise<any> {
|
|
45
|
-
|
|
46
|
-
if (!isMsgType(msgObj.msg_type)) {
|
|
47
|
-
throw new CommonException("PARAM_IS_NOT_VALID","msg_type 不正确");
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const msg_type = msgObj.msg_type;
|
|
51
|
-
|
|
52
|
-
const userInfo = this.ctx.userSession.getSessionInfo();
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const msg_key = md5(`${userInfo.accountId}_${userInfo.accountType}_${received_by}_${msg_type}_${msgObj.target_object_type}_${msgObj.target_object_id}`);
|
|
56
|
-
|
|
57
|
-
// 插入日志
|
|
58
|
-
const insertMessageRes = await this.curdProService.executeCrudByCfg({
|
|
59
|
-
data: {
|
|
60
|
-
title: title,
|
|
61
|
-
content: content,
|
|
62
|
-
content_length: content.length,
|
|
63
|
-
msg_status: MsgStatus.unread,
|
|
64
|
-
msg_type: msg_type,
|
|
65
|
-
msg_key: msg_key,
|
|
66
|
-
status: 1,
|
|
67
|
-
target_object_type: msgObj.target_object_type,
|
|
68
|
-
target_object_id: msgObj.target_object_id,
|
|
69
|
-
received_by: received_by,
|
|
70
|
-
received_account_type: 'medstatistic', // 接收用户只能是
|
|
71
|
-
created_by: userInfo.accountId,
|
|
72
|
-
created_account_type: userInfo.accountType,
|
|
73
|
-
created_nickname: userInfo.nickName,
|
|
74
|
-
created_avatar: userInfo.avatar,
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
sqlSimpleName: KeysOfSimpleSQL.SIMPLE_INSERT,
|
|
79
|
-
sqlTable: "fatbiz_bbs_message",
|
|
80
|
-
sqlDatabase: MED_STATISTIC_DB,
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return {
|
|
85
|
-
insertMessageRes,
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import {Inject,Provide} from '@midwayjs/core';
|
|
2
|
-
import {Context} from '@midwayjs/koa';
|
|
3
|
-
import {AuthService} from '../../service/AuthService';
|
|
4
|
-
import {WorkbenchService} from "../../service/WorkbenchService";
|
|
5
|
-
import {SysConfigService} from "../../service/SysConfigService";
|
|
6
|
-
import {CommonException} from "../../libs/crud-pro/exceptions";
|
|
7
|
-
import {KeysOfSimpleSQL} from "../../libs/crud-pro/models/keys";
|
|
8
|
-
import {BaseService} from "../../service/base/BaseService";
|
|
9
|
-
import {CurdProService} from "../../service/curd/CurdProService";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const MED_STATISTIC_DB = "medstatistic";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// 类型:1=增加,0=减少
|
|
17
|
-
export enum UpdateScorePM {
|
|
18
|
-
decrease = 0, // 减少
|
|
19
|
-
increase = 1 // 增加
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* medstatistic 管理端
|
|
25
|
-
*/
|
|
26
|
-
@Provide()
|
|
27
|
-
export class MedScoreService extends BaseService {
|
|
28
|
-
@Inject()
|
|
29
|
-
protected ctx: Context;
|
|
30
|
-
|
|
31
|
-
@Inject()
|
|
32
|
-
protected authService: AuthService;
|
|
33
|
-
|
|
34
|
-
@Inject()
|
|
35
|
-
protected workbenchService: WorkbenchService;
|
|
36
|
-
|
|
37
|
-
@Inject()
|
|
38
|
-
protected sysConfigService: SysConfigService;
|
|
39
|
-
|
|
40
|
-
@Inject()
|
|
41
|
-
protected curdProService: CurdProService;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
async updateScore(user_id:number, pm: UpdateScorePM, score: number, memo: string): Promise<any> {
|
|
46
|
-
|
|
47
|
-
// 查询用户信息
|
|
48
|
-
const userRes = await this.curdProService.executeCrudByCfg({
|
|
49
|
-
condition: {
|
|
50
|
-
id: user_id,
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
sqlSimpleName: KeysOfSimpleSQL.SIMPLE_QUERY_ONE,
|
|
55
|
-
sqlTable: "fa_user",
|
|
56
|
-
sqlDatabase: MED_STATISTIC_DB,
|
|
57
|
-
});
|
|
58
|
-
const userOne = userRes.getOneObj();
|
|
59
|
-
|
|
60
|
-
if (!userOne) {
|
|
61
|
-
throw new CommonException('USER_NOT_EXIST',"用户信息没有查询到")
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const beforeScore = Math.max(0, parseInt(userOne.score) || 0);
|
|
65
|
-
|
|
66
|
-
const afterScore = pm === UpdateScorePM.decrease ? (beforeScore - score): (beforeScore + score);
|
|
67
|
-
|
|
68
|
-
// 插入日志
|
|
69
|
-
const insertLogRes = await this.curdProService.executeCrudByCfg({
|
|
70
|
-
data: {
|
|
71
|
-
user_id: user_id,
|
|
72
|
-
pm: pm,
|
|
73
|
-
score: score,
|
|
74
|
-
before: beforeScore,
|
|
75
|
-
after: afterScore,
|
|
76
|
-
memo: memo,
|
|
77
|
-
createtime: Math.floor(Date.now() / 1000),
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
sqlSimpleName: KeysOfSimpleSQL.SIMPLE_INSERT,
|
|
82
|
-
sqlTable: "fa_user_score_log",
|
|
83
|
-
sqlDatabase: MED_STATISTIC_DB,
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
// 更新User余额
|
|
87
|
-
const updateUserRes = await this.curdProService.executeCrudByCfg({
|
|
88
|
-
condition: {
|
|
89
|
-
id: user_id,
|
|
90
|
-
},
|
|
91
|
-
data: {
|
|
92
|
-
score: afterScore,
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
sqlSimpleName: KeysOfSimpleSQL.SIMPLE_UPDATE,
|
|
97
|
-
sqlTable: "fa_user",
|
|
98
|
-
sqlDatabase: MED_STATISTIC_DB,
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return {
|
|
103
|
-
insertLogRes,
|
|
104
|
-
updateUserRes
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const DEFAULT_SECTION_ID = 10002;
|
|
2
|
-
|
|
3
|
-
const TARGET_OBJECT_TYPE_BBS_TOPIC = 1; // bbs_topic (1)
|
|
4
|
-
const TARGET_OBJECT_TYPE_BBS_REPLY = 2; // bbs_reply (2)
|
|
5
|
-
const TARGET_OBJECT_TYPE_BBS_GUIDE = 3; // bbs_reply (3) // 教程
|
|
6
|
-
const TARGET_OBJECT_TYPE_CONTACT_US = 4; // // 联系我们
|
|
7
|
-
const TARGET_OBJECT_TYPE_USER_AUTHENTICATION = 5; // // 用户身份认证
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
DEFAULT_SECTION_ID,
|
|
13
|
-
TARGET_OBJECT_TYPE_BBS_TOPIC,
|
|
14
|
-
TARGET_OBJECT_TYPE_BBS_REPLY,
|
|
15
|
-
TARGET_OBJECT_TYPE_BBS_GUIDE,
|
|
16
|
-
TARGET_OBJECT_TYPE_CONTACT_US,
|
|
17
|
-
TARGET_OBJECT_TYPE_USER_AUTHENTICATION
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export const MED_STATISTIC_DB = "medstatistic";
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// 状态;0 未读, 1 已读
|
|
26
|
-
export enum MsgStatus {
|
|
27
|
-
unread = 0, // 减少
|
|
28
|
-
read = 1 // 增加
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// 状态;0 未读, 1 已读
|
|
32
|
-
export enum MsgType {
|
|
33
|
-
unknown = 0, //
|
|
34
|
-
user_auth_pass = 1, // 用户认证审批通过
|
|
35
|
-
bbs_post_be_like = 2, // 帖子被点赞。(forum前端埋点发消息)
|
|
36
|
-
bbs_post_be_reply = 3, // 帖子被回复。(forum前端埋点发消息)
|
|
37
|
-
bbs_post_be_violation = 4, // 帖子被发现违规(ext前端埋点发消息)
|
|
38
|
-
bbs_reply_be_like = 5, // 帖子被点赞。(forum前端埋点发消息)
|
|
39
|
-
bbs_reply_be_reply = 6, // 帖子被回复。(forum前端埋点发消息)
|
|
40
|
-
bbs_reply_be_violation = 7, // 帖子被发现违规(ext前端埋点发消息)
|
|
41
|
-
contact_us_be_reply = 8, // “联系我们”被回复 (ext前端埋点发消息)
|
|
42
|
-
bbs_post_be_favorite = 9, // 帖子被收藏
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function isMsgType(value: number): boolean {
|
|
46
|
-
if (typeof value === "undefined") {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
return Object.values(MsgType).includes(value as MsgType);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
export interface IMedTargetObj {
|
|
54
|
-
target_object_id: number,
|
|
55
|
-
target_object_type: number
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
export interface ISendUserReceivedMsg extends IMedTargetObj {
|
|
62
|
-
msg_type: MsgType
|
|
63
|
-
}
|