Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
_milo
Great Teamwork
提交
6863b951
Great Teamwork
项目概览
_milo
/
Great Teamwork
通知
13
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Great Teamwork
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
6863b951
编写于
5月 25, 2023
作者:
0
052004122温宸杰
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化后台管理系统,完成消息通知后端接口
上级
af9c2ab2
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
134 addition
and
15 deletion
+134
-15
alpha/admin/js_sdk/validator/mustgo-school-activity.js
alpha/admin/js_sdk/validator/mustgo-school-activity.js
+3
-3
alpha/admin/pages/content/mustgo-activity/school/edit.vue
alpha/admin/pages/content/mustgo-activity/school/edit.vue
+18
-4
alpha/admin/pages/content/mustgo-activity/team/edit.vue
alpha/admin/pages/content/mustgo-activity/team/edit.vue
+14
-5
alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-commentPost/index.js
...oud-aliyun/cloudfunctions/fe-college-commentPost/index.js
+11
-0
alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-likePost/index.js
...iCloud-aliyun/cloudfunctions/fe-college-likePost/index.js
+34
-1
alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-myPostList/index.js
...loud-aliyun/cloudfunctions/fe-college-myPostList/index.js
+9
-1
alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-postList/index.js
...iCloud-aliyun/cloudfunctions/fe-college-postList/index.js
+11
-1
alpha/admin/uniCloud-aliyun/cloudfunctions/fe-message-checkMessage/index.js
...ud-aliyun/cloudfunctions/fe-message-checkMessage/index.js
+26
-0
alpha/admin/uniCloud-aliyun/cloudfunctions/fe-message-checkMessage/package.json
...liyun/cloudfunctions/fe-message-checkMessage/package.json
+7
-0
alpha/admin/uniCloud-aliyun/database/mustgo-message.schema.json
...admin/uniCloud-aliyun/database/mustgo-message.schema.json
+1
-0
未找到文件。
alpha/admin/js_sdk/validator/mustgo-school-activity.js
浏览文件 @
6863b951
...
...
@@ -23,7 +23,7 @@ const validator = {
"
start_date
"
:
{
"
rules
"
:
[
{
"
format
"
:
"
string
"
"
format
"
:
"
datetime
"
}
],
"
title
"
:
"
开始时间
"
,
...
...
@@ -32,7 +32,7 @@ const validator = {
"
end_date
"
:
{
"
rules
"
:
[
{
"
format
"
:
"
string
"
"
format
"
:
"
datetime
"
}
],
"
title
"
:
"
结束时间
"
,
...
...
@@ -77,7 +77,7 @@ const validator = {
"
contact
"
:
{
"
rules
"
:
[
{
"
format
"
:
"
string
"
"
format
"
:
"
/^1[3|4|5|7|8][0-9]
\
d{8}$/
"
}
],
"
title
"
:
"
联系方式
"
,
...
...
alpha/admin/pages/content/mustgo-activity/school/edit.vue
浏览文件 @
6863b951
...
...
@@ -8,20 +8,31 @@
<uni-easyinput
placeholder=
"校园活动内容"
v-model=
"formData.content"
></uni-easyinput>
</uni-forms-item>
<uni-forms-item
name=
"start_date"
label=
"开始时间"
>
<uni-easyinput
placeholder=
"校园活动开始时间"
v-model=
"formData.start_date"
></uni-easyinput>
<!--
<uni-easyinput
placeholder=
"校园活动开始时间"
v-model=
"formData.start_date"
></uni-easyinput>
-->
<uni-datetime-picker
type=
"datetime"
v-model=
"formData.start_date"
/>
</uni-forms-item>
<uni-forms-item
name=
"end_date"
label=
"结束时间"
>
<uni-easyinput
placeholder=
"校园活动结束时间"
v-model=
"formData.end_date"
></uni-easyinput>
<!--
<uni-easyinput
placeholder=
"校园活动结束时间"
v-model=
"formData.end_date"
></uni-easyinput>
-->
<uni-datetime-picker
type=
"datetime"
v-model=
"formData.end_date"
/>
</uni-forms-item>
<uni-forms-item
name=
"owner_id"
label=
"发布者id"
>
<uni-easyinput
placeholder=
"校园活动发布者id"
v-model=
"formData.owner_id"
></uni-easyinput>
<uni-easyinput
placeholder=
"校园活动发布者id"
v-model=
"formData.owner_id"
disabled
></uni-easyinput>
</uni-forms-item>
<uni-forms-item
name=
"background_picture"
label=
"背景图片"
@
click=
"avatarChoose"
>
<image
:src=
"formData.background_picture"
style=
"width: 120px; height: 80px;"
></image>
<!--
<uni-easyinput
placeholder=
"校园活动背景图片"
v-model=
"formData.background_picture"
></uni-easyinput>
-->
</uni-forms-item>
<uni-forms-item
name=
"place"
label=
"地点"
>
<uni-easyinput
placeholder=
"校园活动地点"
v-model=
"formData.place"
></uni-easyinput>
<!--
<uni-easyinput
placeholder=
"校园活动地点"
v-model=
"formData.place"
></uni-easyinput>
-->
<uni-data-select
v-model=
"formData.place"
:localdata=
"place"
>
</uni-data-select>
</uni-forms-item>
<!--
<uni-forms-item
name=
"status"
label=
"活动状态"
>
<uni-easyinput
placeholder=
"校园活动状态"
type=
"number"
v-model=
"formData.status"
></uni-easyinput>
...
...
@@ -78,6 +89,9 @@
return
{
formData
,
formOptions
:
{},
place
:
[
{
value
:
'
福州大学
'
,
text
:
'
福州大学
'
},
],
rules
:
{
...
getValidator
(
Object
.
keys
(
formData
))
}
...
...
alpha/admin/pages/content/mustgo-activity/team/edit.vue
浏览文件 @
6863b951
...
...
@@ -8,13 +8,21 @@
<uni-easyinput
placeholder=
"小队活动内容"
v-model=
"formData.content"
></uni-easyinput>
</uni-forms-item>
<uni-forms-item
name=
"start_date"
label=
"开始时间"
>
<uni-easyinput
placeholder=
"小队活动开始时间"
v-model=
"formData.start_date"
></uni-easyinput>
<!--
<uni-easyinput
placeholder=
"小队活动开始时间"
v-model=
"formData.start_date"
></uni-easyinput>
-->
<uni-datetime-picker
type=
"datetime"
v-model=
"formData.start_date"
/>
</uni-forms-item>
<uni-forms-item
name=
"end_date"
label=
"结束时间"
>
<uni-easyinput
placeholder=
"小队活动结束时间"
v-model=
"formData.end_date"
></uni-easyinput>
<!--
<uni-easyinput
placeholder=
"小队活动结束时间"
v-model=
"formData.end_date"
></uni-easyinput>
-->
<uni-datetime-picker
type=
"datetime"
v-model=
"formData.end_date"
/>
</uni-forms-item>
<uni-forms-item
name=
"owner_id"
label=
"发布者id"
>
<uni-easyinput
placeholder=
"小队活动发布者id"
v-model=
"formData.owner_id"
></uni-easyinput>
<uni-easyinput
placeholder=
"小队活动发布者id"
v-model=
"formData.owner_id"
disabled
></uni-easyinput>
</uni-forms-item>
<uni-forms-item
name=
"place"
label=
"地点"
>
<uni-easyinput
placeholder=
"小队活动地点"
v-model=
"formData.place"
></uni-easyinput>
...
...
@@ -23,13 +31,14 @@
<uni-easyinput
placeholder=
"小队活动状态"
type=
"number"
v-model=
"formData.status"
></uni-easyinput>
</uni-forms-item>
-->
<uni-forms-item
name=
"participants"
label=
"参与人数"
>
<uni-easyinput
placeholder=
"小队活动参与人数"
type=
"number"
v-model=
"formData.participants"
></uni-easyinput>
<!--
<uni-easyinput
placeholder=
"小队活动参与人数"
type=
"number"
v-model=
"formData.participants"
></uni-easyinput>
-->
<uni-number-box
:value=
"0"
:step=
"1"
max=
"100000"
value=
"100000"
v-model=
"formData.participants"
/>
</uni-forms-item>
<uni-forms-item
name=
"contact"
label=
"联系方式"
>
<uni-easyinput
placeholder=
"小队活动发布者联系方式"
v-model=
"formData.contact"
></uni-easyinput>
</uni-forms-item>
<uni-forms-item
name=
"team_id"
label=
"小队id"
>
<uni-easyinput
placeholder=
"活动所属小队id"
v-model=
"formData.team_id"
></uni-easyinput>
<uni-easyinput
placeholder=
"活动所属小队id"
v-model=
"formData.team_id"
disabled
></uni-easyinput>
</uni-forms-item>
<view
class=
"uni-button-group"
>
<button
type=
"primary"
class=
"uni-button"
style=
"width: 100px;"
@
click=
"submit"
>
提交
</button>
...
...
alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-commentPost/index.js
浏览文件 @
6863b951
...
...
@@ -4,6 +4,7 @@ exports.main = async (event, context) => {
const
user_table
=
db
.
collection
(
"
mustgo-user
"
)
const
comment_table
=
db
.
collection
(
"
mustgo-post-comment
"
)
const
post_table
=
db
.
collection
(
"
mustgo-post
"
)
const
message_table
=
db
.
collection
(
"
mustgo-message
"
)
const
res
=
await
user_table
.
where
({
_id
:
event
.
userId
...
...
@@ -30,6 +31,16 @@ exports.main = async (event, context) => {
content
:
event
.
content
})
const
res5
=
await
message_table
.
add
({
state
:
false
,
types
:
"
评论
"
,
content
:
event
.
content
,
time
:
getSystemTime
(),
from_id
:
event
.
userId
,
to_id
:
res2
.
data
[
0
][
"
owner_id
"
],
post_id
:
event
.
postId
})
return
{
code
:
200
,
message
:
"
评论帖子成功
"
,
...
...
alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-likePost/index.js
浏览文件 @
6863b951
...
...
@@ -4,6 +4,7 @@ exports.main = async (event, context) => {
const
db
=
uniCloud
.
database
();
const
post_table
=
db
.
collection
(
"
mustgo-post
"
)
const
like_table
=
db
.
collection
(
"
mustgo-post-like
"
)
const
message_table
=
db
.
collection
(
"
mustgo-message
"
)
const
res
=
await
post_table
.
where
({
_id
:
event
.
postId
}).
get
()
...
...
@@ -23,6 +24,16 @@ exports.main = async (event, context) => {
owner_id
:
event
.
userId
})
const
res4
=
await
message_table
.
add
({
state
:
false
,
types
:
"
点赞
"
,
content
:
""
,
time
:
getSystemTime
(),
from_id
:
event
.
userId
,
to_id
:
res
.
data
[
0
][
"
owner_id
"
],
post_id
:
event
.
postId
})
return
{
code
:
200
,
message
:
"
点赞帖子成功
"
,
...
...
@@ -56,4 +67,26 @@ exports.main = async (event, context) => {
message
:
"
服务器错误
"
,
data
:
{}
}
};
\ No newline at end of file
};
function
getSystemTime
()
{
// 实例化日期类
var
time
=
new
Date
();
// 获取完整的年份(4位)
var
year
=
time
.
getFullYear
();
// 获取月份(0-11,0代表1月)
var
month
=
time
.
getMonth
()
+
1
;
// 获取日期(1-31)
var
date
=
time
.
getDate
();
// 获取小时
var
h
=
time
.
getHours
()
+
8
;
h
=
h
<
10
?
'
0
'
+
h
:
h
;
// 获取分钟
var
m
=
time
.
getMinutes
();
m
=
m
<
10
?
'
0
'
+
m
:
m
;
// 获取秒钟
var
s
=
time
.
getSeconds
();
s
=
s
<
10
?
'
0
'
+
s
:
s
;
// 合并返回
return
(
year
+
"
-
"
+
month
+
"
-
"
+
date
+
"
"
+
h
+
"
:
"
+
m
+
"
:
"
+
s
)
;
}
\ No newline at end of file
alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-myPostList/index.js
浏览文件 @
6863b951
...
...
@@ -4,6 +4,7 @@ exports.main = async (event, context) => {
const
post_table
=
db
.
collection
(
"
mustgo-post
"
)
const
user_table
=
db
.
collection
(
"
mustgo-user
"
)
const
like_table
=
db
.
collection
(
"
mustgo-post-like
"
)
const
message_table
=
db
.
collection
(
"
mustgo-message
"
)
const
res
=
await
post_table
.
orderBy
(
"
date
"
,
"
desc
"
).
where
({
owner_id
:
event
.
userId
}).
get
()
...
...
@@ -22,6 +23,12 @@ exports.main = async (event, context) => {
owner_id
:
event
.
userId
,
post_id
:
arr
[
i
][
"
_id
"
]
}).
get
()
const
res4
=
await
message_table
.
where
({
to_id
:
event
.
userId
,
state
:
false
}).
get
()
if
(
res3
.
affectedDocs
==
1
)
like
=
1
if
(
res2
.
affectedDocs
==
1
){
...
...
@@ -43,7 +50,8 @@ exports.main = async (event, context) => {
code
:
200
,
message
:
"
成功返回我的帖子列表
"
,
data
:{
postList
:
list
postList
:
list
,
messageNum
:
res4
.
affectedDocs
}
}
}
...
...
alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-postList/index.js
浏览文件 @
6863b951
...
...
@@ -5,6 +5,7 @@ exports.main = async (event, context) => {
const
post_table
=
db
.
collection
(
"
mustgo-post
"
)
const
user_table
=
db
.
collection
(
"
mustgo-user
"
)
const
like_table
=
db
.
collection
(
"
mustgo-post-like
"
)
const
message_table
=
db
.
collection
(
"
mustgo-message
"
)
const
res
=
await
post_table
.
orderBy
(
"
date
"
,
"
desc
"
).
get
();
var
list
=
new
Array
var
arr
=
new
Array
;
...
...
@@ -19,6 +20,7 @@ exports.main = async (event, context) => {
owner_id
:
event
.
uid
,
post_id
:
arr
[
i
][
"
_id
"
]
}).
get
()
var
like
=
0
if
(
res3
.
affectedDocs
==
1
)
like
=
1
...
...
@@ -37,11 +39,19 @@ exports.main = async (event, context) => {
list
.
push
(
post
);
}
}
const
res4
=
await
message_table
.
where
({
to_id
:
event
.
uid
,
state
:
false
}).
get
()
var
num
=
res4
.
affectedDocs
return
{
code
:
200
,
message
:
"
成功返回帖子列表
"
,
data
:
{
postList
:
list
postList
:
list
,
messageNum
:
num
}
}
}
...
...
alpha/admin/uniCloud-aliyun/cloudfunctions/fe-message-checkMessage/index.js
0 → 100644
浏览文件 @
6863b951
'
use strict
'
;
exports
.
main
=
async
(
event
,
context
)
=>
{
const
db
=
uniCloud
.
database
();
const
message_table
=
db
.
collection
(
"
mustgo-message
"
)
var
res
=
await
message_table
.
where
({
to_id
:
event
.
userId
,
state
:
false
}).
update
({
state
:
true
})
if
(
res
.
affectedDocs
<
0
){
return
{
code
:
400
,
message
:
"
查看信息列表失败
"
,
data
:{}
}
}
return
{
code
:
200
,
message
:
"
查看信息列表成功
"
,
data
:
{
}
}
};
alpha/admin/uniCloud-aliyun/cloudfunctions/fe-message-checkMessage/package.json
0 → 100644
浏览文件 @
6863b951
{
"name"
:
"fe-message-checkMessage"
,
"dependencies"
:
{},
"extensions"
:
{
"uni-cloud-jql"
:
{}
}
}
\ No newline at end of file
alpha/admin/uniCloud-aliyun/database/mustgo-message.schema.json
0 → 100644
浏览文件 @
6863b951
{
"bsonType"
:
"object"
,
"required"
:[],
"permission"
:{
"read"
:
false
,
"create"
:
false
,
"update"
:
false
,
"delete"
:
false
},
"properties"
:{
"_id"
:{
"description"
:
"消息id"
,
"title"
:
"id"
},
"state"
:{
"bsonType"
:
"bool"
,
"title"
:
"状态"
,
"description"
:
"消息状态"
},
"types"
:{
"bsonType"
:
"string"
,
"title"
:
"类型"
,
"description"
:
"消息类型"
},
"content"
:{
"bsonType"
:
"string"
,
"title"
:
"内容"
,
"description"
:
"消息内容"
},
"time"
:{
"bsonType"
:
"string"
,
"title"
:
"时间"
,
"description"
:
"消息时间"
},
"from_id"
:{
"bsonType"
:
"string"
,
"title"
:
"发起人id"
,
"description"
:
"发起人id"
,
"foreignKey"
:
"mustgo-user._id"
},
"to_id"
:{
"bsonType"
:
"string"
,
"title"
:
"接收者id"
,
"description"
:
"接收者id"
,
"foreignKey"
:
"mustgo-user._id"
},
"post_id"
:{
"bsonType"
:
"string"
,
"title"
:
"帖子id"
,
"description"
:
"帖子id"
,
"foreignKey"
:
"mustgo-post._id"
}}}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录