Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wenHuaBu_adminServer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
node_server
wenHuaBu_adminServer
Commits
1fa89991
Commit
1fa89991
authored
Aug 02, 2024
by
chenjinjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
ad6dddee
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
153 additions
and
21 deletions
+153
-21
msgActivity.ts
src/biz/member/msgActivity.ts
+0
-0
public.ts
src/biz/public.ts
+21
-4
enum.ts
src/config/enum.ts
+22
-7
model.ts
src/data/models/model.ts
+13
-1
main.ts
src/main.ts
+2
-0
router.ts
src/routers/msgActivity/router.ts
+59
-4
router.ts
src/routers/public/router.ts
+22
-1
router.ts
src/routers/router.ts
+3
-3
reqResult.ts
src/tools/reqResult.ts
+1
-1
system.ts
src/tools/system.ts
+10
-0
No files found.
src/biz/member/msgActivity.ts
View file @
1fa89991
This diff is collapsed.
Click to expand it.
src/biz/public.ts
View file @
1fa89991
import
moment
=
require
(
"moment"
);
import
moment
=
require
(
"moment"
);
import
{
ARTICLEPOSITION
,
CLIENTMSGLABLE
,
DONGTAIZIXUNSUBTYPE
,
PARTYBUILDSUBTYPEENUM
,
PARTYBUILDTYPEENUM
}
from
"../config/enum"
;
import
{
ARTICLEPOSITION
,
CLIENT
ACTIVITYLABLE
,
CLIENT
MSGLABLE
,
DONGTAIZIXUNSUBTYPE
,
PARTYBUILDSUBTYPEENUM
,
PARTYBUILDTYPEENUM
}
from
"../config/enum"
;
import
{
TABLEENUM
}
from
"../data/models/model"
;
import
{
TABLEENUM
}
from
"../data/models/model"
;
import
{
find
}
from
"../data/select"
;
import
{
find
}
from
"../data/select"
;
import
{
getEdition
}
from
"../tools/system"
;
import
{
getEdition
}
from
"../tools/system"
;
...
@@ -115,17 +115,34 @@ export async function getSession() {
...
@@ -115,17 +115,34 @@ export async function getSession() {
/**
/**
* 获取通知对象
* 获取通知对象
*/
*/
export
async
function
getMsgNoticeObject
()
{
let
lableData
=
setEnumInterface
({
defaultParam
:
CLIENTMSGLABLE
});
let
lableInfo
=
await
find
(
TABLEENUM
.
标签表
,
{},
[
"lableId"
,
"lableName"
]);
lableInfo
.
forEach
(
info
=>
{
let
item
=
{
key
:
info
.
lableName
,
value
:
info
.
lableId
}
lableData
.
dataList
.
push
(
item
);
})
return
{
lableData
};
}
/**
* 获取通知对象
*/
export
async
function
getNoticeObject
()
{
export
async
function
getNoticeObject
()
{
let
msgLable
=
setEnumInterface
({
defaultParam
:
CLIENTMSG
LABLE
});
let
lableData
=
setEnumInterface
({
defaultParam
:
CLIENTACTIVITY
LABLE
});
let
lableInfo
=
await
find
(
TABLEENUM
.
标签表
,
{},
[
"lableId"
,
"lableName"
]);
let
lableInfo
=
await
find
(
TABLEENUM
.
标签表
,
{},
[
"lableId"
,
"lableName"
]);
lableInfo
.
forEach
(
info
=>
{
lableInfo
.
forEach
(
info
=>
{
let
item
=
{
key
:
info
.
lableName
,
value
:
info
.
lableId
}
let
item
=
{
key
:
info
.
lableName
,
value
:
info
.
lableId
}
msgLable
.
dataList
.
push
(
item
);
lableData
.
dataList
.
push
(
item
);
})
})
return
{
msgLable
};
return
{
lableData
};
}
}
src/config/enum.ts
View file @
1fa89991
...
@@ -670,7 +670,8 @@ export enum OOSCODE {
...
@@ -670,7 +670,8 @@ export enum OOSCODE {
会费发票
,
会费发票
,
个人会员详情
=
15
,
个人会员详情
=
15
,
单位会员详情
,
单位会员详情
,
注册信息
注册信息
,
退款凭证
=
18
,
}
}
...
@@ -678,9 +679,23 @@ export enum OOSCODE {
...
@@ -678,9 +679,23 @@ export enum OOSCODE {
* 消息通知-除标签外固定通知类型
* 消息通知-除标签外固定通知类型
*/
*/
export
enum
CLIENTMSGLABLE
{
export
enum
CLIENTMSGLABLE
{
所有人
=
"0"
,
所有人
=
"所有人(包括游客)"
,
//所有人(包括游客)
个人会员
=
"1"
,
个人会员
=
"个人会员"
,
单位会员
=
"2"
单位会员
=
"单位会员"
,
理事
=
"理事会员"
,
常务理事
=
"常务理事会员"
,
}
/**
* 活动通知-除标签外固定通知类型
*/
export
enum
CLIENTACTIVITYLABLE
{
个人会员
=
"个人会员"
,
单位会员
=
"单位会员"
,
理事
=
"理事会员"
,
常务理事
=
"常务理事会员"
,
}
}
...
@@ -707,8 +722,8 @@ export enum ACTIVITYSTATE {
...
@@ -707,8 +722,8 @@ export enum ACTIVITYSTATE {
* 前端参数
* 前端参数
*/
*/
export
enum
CLIENTACTIVITYSTATE
{
export
enum
CLIENTACTIVITYSTATE
{
已开始
=
1
,
全部
=
0
,
已结束
,
已结束
=
2
,
已参加
已参加
,
}
}
src/data/models/model.ts
View file @
1fa89991
...
@@ -91,6 +91,7 @@ enum TABLEENUM {
...
@@ -91,6 +91,7 @@ enum TABLEENUM {
订单审批历史表
=
"orderApprovalHistory"
,
订单审批历史表
=
"orderApprovalHistory"
,
标签表
=
"lable"
,
标签表
=
"lable"
,
消息通知表
=
"massageNotice"
,
消息通知表
=
"massageNotice"
,
消息已读状态表
=
"massageReads"
,
活动通知表
=
"activityNotice"
,
活动通知表
=
"activityNotice"
,
活动报名表
=
"sctivityEnroll"
活动报名表
=
"sctivityEnroll"
}
}
...
@@ -528,7 +529,18 @@ const ModelArray = [
...
@@ -528,7 +529,18 @@ const ModelArray = [
effectiveTime
:
'Number'
,
//有效时间
effectiveTime
:
'Number'
,
//有效时间
msgContent
:
'String'
,
//消息内容
msgContent
:
'String'
,
//消息内容
lableId
:{
type
:
'[String]'
,
default
:[]},
//消息对象 标签id 外键
lableId
:{
type
:
'[String]'
,
default
:[]},
//消息对象 标签id 外键
isPop
:{
type
:
'Number'
,
default
:
STATE
.
否
}
isPop
:{
type
:
'Number'
,
default
:
STATE
.
否
}
//是否弹窗
}
},
{
tableName
:
TABLEENUM
.
消息已读状态表
,
source
:
TABLESOURCEENUM
.
mongo
,
schema
:{
readId
:{
type
:
'String'
,
index
:
true
},
//消息已读id
msgId
:
'String'
,
//消息id
userId
:
'String'
,
//用户id
readTime
:
'Number'
,
//阅读时间
isRead
:{
type
:
'Number'
,
default
:
STATE
.
否
}
//是否已读
}
}
},
},
{
{
...
...
src/main.ts
View file @
1fa89991
import
{
initActivity
}
from
"./biz/member/msgActivity"
;
import
{
initAdmin
}
from
"./biz/member/rightsMgmt"
;
import
{
initAdmin
}
from
"./biz/member/rightsMgmt"
;
import
{
t
}
from
"./biz/provide"
;
import
{
t
}
from
"./biz/provide"
;
import
{
initSMS
}
from
"./biz/sms"
;
import
{
initSMS
}
from
"./biz/sms"
;
...
@@ -18,6 +19,7 @@ async function lanuch() {
...
@@ -18,6 +19,7 @@ async function lanuch() {
await
initSMS
();
await
initSMS
();
await
initAdmin
();
await
initAdmin
();
await
initSystemTask
();
await
initSystemTask
();
await
initActivity
();
// await test1();
// await test1();
// await inputData(); 20240520日导入数据
// await inputData(); 20240520日导入数据
...
...
src/routers/msgActivity/router.ts
View file @
1fa89991
...
@@ -66,7 +66,29 @@ export const Config = {
...
@@ -66,7 +66,29 @@ export const Config = {
{
key
:
"msgId"
,
type
:
"String"
,
desc
:
"消息Id"
},
{
key
:
"msgId"
,
type
:
"String"
,
desc
:
"消息Id"
},
],
],
bindBiz
:
msgActivityBiz
.
delMessage
bindBiz
:
msgActivityBiz
.
delMessage
}
},
{
apiName
:
"消息通知"
,
subUrl
:
'/msgdb/noticemessage'
,
param
:[],
bindBiz
:
msgActivityBiz
.
noticeMessage
},
{
apiName
:
"全部已读"
,
subUrl
:
'/msgdb/allmsgread'
,
param
:[
{
key
:
"msgId"
,
type
:
"String"
,
desc
:
"消息Id"
},
],
bindBiz
:
msgActivityBiz
.
allMsgRead
},
{
apiName
:
"修改消息为已读"
,
subUrl
:
'/msgdb/allmsgread'
,
param
:[
{
key
:
"readId"
,
type
:
"String"
,
desc
:
"消息已读Id"
},
],
bindBiz
:
msgActivityBiz
.
updateMsgRead
},
],
],
"活动通知"
:[
"活动通知"
:[
{
{
...
@@ -93,7 +115,7 @@ export const Config = {
...
@@ -93,7 +115,7 @@ export const Config = {
activityAdd
:{
type
:
'String'
,
desc
:
'活动地点'
},
activityAdd
:{
type
:
'String'
,
desc
:
'活动地点'
},
activityStartTime
:{
type
:
'Number'
,
desc
:
'活动开始时间'
,
notMustHave
:
true
},
activityStartTime
:{
type
:
'Number'
,
desc
:
'活动开始时间'
,
notMustHave
:
true
},
activityEndTime
:{
type
:
'Number'
,
desc
:
'活动结束时间'
,
notMustHave
:
true
},
activityEndTime
:{
type
:
'Number'
,
desc
:
'活动结束时间'
,
notMustHave
:
true
},
lableId
:{
type
:
'
String
'
,
desc
:
'活动对象(标签Id)'
},
lableId
:{
type
:
'
[String]
'
,
desc
:
'活动对象(标签Id)'
},
enrollStartTime
:{
type
:
'Number'
,
desc
:
'报名开始时间'
},
enrollStartTime
:{
type
:
'Number'
,
desc
:
'报名开始时间'
},
enrollEndTime
:{
type
:
'Number'
,
desc
:
'报名结束时间'
},
enrollEndTime
:{
type
:
'Number'
,
desc
:
'报名结束时间'
},
activityContent
:{
type
:
'String'
,
desc
:
'详细内容'
},
activityContent
:{
type
:
'String'
,
desc
:
'详细内容'
},
...
@@ -115,7 +137,7 @@ export const Config = {
...
@@ -115,7 +137,7 @@ export const Config = {
activityAdd
:{
type
:
'String'
,
desc
:
'活动地点'
},
activityAdd
:{
type
:
'String'
,
desc
:
'活动地点'
},
activityStartTime
:{
type
:
'Number'
,
desc
:
'活动开始时间'
},
activityStartTime
:{
type
:
'Number'
,
desc
:
'活动开始时间'
},
activityEndTime
:{
type
:
'Number'
,
desc
:
'活动结束时间'
},
activityEndTime
:{
type
:
'Number'
,
desc
:
'活动结束时间'
},
lableId
:{
type
:
'
String
'
,
desc
:
'活动对象(标签Id)'
},
lableId
:{
type
:
'
[String]
'
,
desc
:
'活动对象(标签Id)'
},
enrollStartTime
:{
type
:
'Number'
,
desc
:
'报名开始时间'
},
enrollStartTime
:{
type
:
'Number'
,
desc
:
'报名开始时间'
},
enrollEndTime
:{
type
:
'Number'
,
desc
:
'报名结束时间'
},
enrollEndTime
:{
type
:
'Number'
,
desc
:
'报名结束时间'
},
activityContent
:{
type
:
'String'
,
desc
:
'详细内容'
},
activityContent
:{
type
:
'String'
,
desc
:
'详细内容'
},
...
@@ -125,6 +147,14 @@ export const Config = {
...
@@ -125,6 +147,14 @@ export const Config = {
bindBiz
:
msgActivityBiz
.
addActivity
bindBiz
:
msgActivityBiz
.
addActivity
},
},
{
{
apiName
:
"获取活动详细-修改回显"
,
subUrl
:
'/activitydb/activitydetailed'
,
param
:[
{
key
:
"activityId"
,
type
:
"String"
,
desc
:
"活动Id"
},
],
bindBiz
:
msgActivityBiz
.
getActivityDetailed
},
{
apiName
:
"修改活动"
,
apiName
:
"修改活动"
,
subUrl
:
'/activitydb/updateactivity'
,
subUrl
:
'/activitydb/updateactivity'
,
param
:[
param
:[
...
@@ -136,7 +166,7 @@ export const Config = {
...
@@ -136,7 +166,7 @@ export const Config = {
activityAdd
:{
type
:
'String'
,
desc
:
'活动地点'
},
activityAdd
:{
type
:
'String'
,
desc
:
'活动地点'
},
activityStartTime
:{
type
:
'Number'
,
desc
:
'活动开始时间'
,
notMustHave
:
true
},
activityStartTime
:{
type
:
'Number'
,
desc
:
'活动开始时间'
,
notMustHave
:
true
},
activityEndTime
:{
type
:
'Number'
,
desc
:
'活动结束时间'
,
notMustHave
:
true
},
activityEndTime
:{
type
:
'Number'
,
desc
:
'活动结束时间'
,
notMustHave
:
true
},
lableId
:{
type
:
'
String
'
,
desc
:
'活动对象(标签Id)'
},
lableId
:{
type
:
'
[String]
'
,
desc
:
'活动对象(标签Id)'
},
enrollStartTime
:{
type
:
'Number'
,
desc
:
'报名开始时间'
},
enrollStartTime
:{
type
:
'Number'
,
desc
:
'报名开始时间'
},
enrollEndTime
:{
type
:
'Number'
,
desc
:
'报名结束时间'
},
enrollEndTime
:{
type
:
'Number'
,
desc
:
'报名结束时间'
},
activityContent
:{
type
:
'String'
,
desc
:
'详细内容'
},
activityContent
:{
type
:
'String'
,
desc
:
'详细内容'
},
...
@@ -172,10 +202,26 @@ export const Config = {
...
@@ -172,10 +202,26 @@ export const Config = {
{
key
:
"activityId"
,
type
:
"String"
,
desc
:
"活动Id"
},
{
key
:
"activityId"
,
type
:
"String"
,
desc
:
"活动Id"
},
],
],
bindBiz
:
msgActivityBiz
.
enrollList
bindBiz
:
msgActivityBiz
.
enrollList
},
{
apiName
:
"根据选择的会员下载报名表"
,
subUrl
:
'/activitydb/enrollurl'
,
param
:[
{
key
:
"id"
,
type
:
"String"
,
desc
:
"用户id"
}
],
bindBiz
:
msgActivityBiz
.
getEnrollUrl
}
}
],
],
"会员个人页活动通知"
:[
"会员个人页活动通知"
:[
{
{
apiName
:
"下载报名表"
,
subUrl
:
'/homepage/activityenrollform'
,
param
:[
{
key
:
"activityId"
,
type
:
"String"
,
desc
:
"活动Id"
},
],
bindBiz
:
msgActivityBiz
.
activityEnrollForm
},
{
apiName
:
"申请报名表"
,
apiName
:
"申请报名表"
,
subUrl
:
'/homepage/activityenroll'
,
subUrl
:
'/homepage/activityenroll'
,
param
:[
param
:[
...
@@ -195,9 +241,18 @@ export const Config = {
...
@@ -195,9 +241,18 @@ export const Config = {
subUrl
:
'/homepage/activitylist'
,
subUrl
:
'/homepage/activitylist'
,
param
:[
param
:[
{
key
:
"activityState"
,
type
:
"Number"
,
desc
:
"活动状态"
},
{
key
:
"activityState"
,
type
:
"Number"
,
desc
:
"活动状态"
},
{
key
:
"pageNumber"
,
type
:
"Number"
,
desc
:
"当前页"
}
],
],
bindBiz
:
msgActivityBiz
.
homeActivityList
bindBiz
:
msgActivityBiz
.
homeActivityList
},
},
{
apiName
:
"查看更多活动列表-详情"
,
subUrl
:
'/homepage/activitydetailed'
,
param
:[
{
key
:
"activityId"
,
type
:
"String"
,
desc
:
"活动Id"
},
],
bindBiz
:
msgActivityBiz
.
homeActivityDetailed
},
]
]
}
}
...
...
src/routers/public/router.ts
View file @
1fa89991
...
@@ -258,6 +258,12 @@ export const Config = {
...
@@ -258,6 +258,12 @@ export const Config = {
apiName
:
"消息对象固定类型"
,
apiName
:
"消息对象固定类型"
,
subUrl
:
'/msglabletype'
,
subUrl
:
'/msglabletype'
,
param
:[],
param
:[],
bindBiz
:
publicBiz
.
getMsgNoticeObject
},
{
apiName
:
"活动对象固定类型"
,
subUrl
:
'/activitylabletype'
,
param
:[],
bindBiz
:
publicBiz
.
getNoticeObject
bindBiz
:
publicBiz
.
getNoticeObject
},
},
{
{
...
@@ -273,6 +279,21 @@ export const Config = {
...
@@ -273,6 +279,21 @@ export const Config = {
param
:[],
param
:[],
defaultParam
:
enumConfig
.
STATE
,
defaultParam
:
enumConfig
.
STATE
,
bindBiz
:
publicBiz
.
setEnumInterface
bindBiz
:
publicBiz
.
setEnumInterface
}
},
{
apiName
:
"活动状态"
,
subUrl
:
'/activitystate'
,
param
:[],
defaultParam
:
enumConfig
.
CLIENTACTIVITYSTATE
,
bindBiz
:
publicBiz
.
setEnumInterface
},
{
apiName
:
"活动类型"
,
subUrl
:
'/activitytype'
,
param
:[],
defaultParam
:
enumConfig
.
ACTIVITYTYPE
,
bindBiz
:
publicBiz
.
setEnumInterface
},
],
],
}
}
src/routers/router.ts
View file @
1fa89991
...
@@ -22,15 +22,15 @@ import * as asyncHandler from 'express-async-handler';
...
@@ -22,15 +22,15 @@ import * as asyncHandler from 'express-async-handler';
import
{
payCallback
}
from
"../biz/member/cost"
;
import
{
payCallback
}
from
"../biz/member/cost"
;
import
{
checkUser
}
from
"../middleware/user"
;
import
{
checkUser
}
from
"../middleware/user"
;
const
Look
=
fals
e
;
//true更新文档
const
Look
=
tru
e
;
//true更新文档
export
async
function
setRouter
(
httpServer
){
export
async
function
setRouter
(
httpServer
){
if
(
Look
)
{
if
(
Look
)
{
await
getDoc
();
await
getDoc
();
await
initDoc
(
portalRouter
.
FirstName
,
portalRouter
.
Config
,
portalRouter
.
FirstRouter
);
//网站编辑
//
await initDoc(portalRouter.FirstName, portalRouter.Config, portalRouter.FirstRouter);//网站编辑
await
initDoc
(
publicRouter
.
FirstName
,
publicRouter
.
Config
,
publicRouter
.
FirstRouter
);
//公用组件
await
initDoc
(
publicRouter
.
FirstName
,
publicRouter
.
Config
,
publicRouter
.
FirstRouter
);
//公用组件
// await initDoc(memberRouter.FirstName, memberRouter.Config, memberRouter.FirstRouter);//用户路由
// await initDoc(memberRouter.FirstName, memberRouter.Config, memberRouter.FirstRouter);//用户路由
await
initDoc
(
officalWebsiteRouter
.
FirstName
,
officalWebsiteRouter
.
Config
,
officalWebsiteRouter
.
FirstRouter
);
//官网路由
//
await initDoc(officalWebsiteRouter.FirstName, officalWebsiteRouter.Config, officalWebsiteRouter.FirstRouter);//官网路由
// await initDoc(orderRouter.FirstName, orderRouter.Config, orderRouter.FirstRouter);//会费相关
// await initDoc(orderRouter.FirstName, orderRouter.Config, orderRouter.FirstRouter);//会费相关
// await initDoc(costRouter.FirstName, costRouter.Config, costRouter.FirstRouter);//支付
// await initDoc(costRouter.FirstName, costRouter.Config, costRouter.FirstRouter);//支付
// await initDoc(outPutRouter.FirstName, outPutRouter.Config, outPutRouter.FirstRouter);//导出路由
// await initDoc(outPutRouter.FirstName, outPutRouter.Config, outPutRouter.FirstRouter);//导出路由
...
...
src/tools/reqResult.ts
View file @
1fa89991
...
@@ -143,7 +143,7 @@ export async function initDoc(firstName, apiConfig, apiFirstRouter) {
...
@@ -143,7 +143,7 @@ export async function initDoc(firstName, apiConfig, apiFirstRouter) {
itemStr
+=
`|:---- |:----- |:----- |----- |\n`
;
itemStr
+=
`|:---- |:----- |:----- |----- |\n`
;
itemStr
+=
`|401 |身份验证失败 |headers中的userid错误 |强制跳转到登陆页面 |\n`
;
itemStr
+=
`|401 |身份验证失败 |headers中的userid错误 |强制跳转到登陆页面 |\n`
;
itemStr
+=
`|402 |非法登录 |headers中没有token或者userid |强制跳转到登陆页面 |\n`
;
itemStr
+=
`|402 |非法登录 |headers中没有token或者userid |强制跳转到登陆页面 |\n`
;
itemStr
+=
`|403 |身份验证过期 |token过期 |
+
强制跳转到登陆页面 |\n`
;
itemStr
+=
`|403 |身份验证过期 |token过期 |强制跳转到登陆页面 |\n`
;
itemStr
+=
``
;
itemStr
+=
``
;
...
...
src/tools/system.ts
View file @
1fa89991
...
@@ -17,6 +17,16 @@ export function successResult() {
...
@@ -17,6 +17,16 @@ export function successResult() {
return
{
success
:
true
}
return
{
success
:
true
}
}
}
/**
* 抛出错误信息
* @returns
*/
export
function
successErrorResult
(
msg
)
{
return
{
code
:
500
,
success
:
false
,
msg
};
}
/**
/**
* 生成系统id
* 生成系统id
* @param tableName
* @param tableName
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment