Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pisns-forum-api
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
scrmGroup
pisns-forum-api
Commits
a3b4d615
Commit
a3b4d615
authored
Jul 28, 2016
by
陈志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加子帖子缓存
parent
3eab2e24
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
forumThreadService.js
app/service/forumThreadService.js
+2
-2
util.js
app/utils/util.js
+2
-2
No files found.
app/service/forumThreadService.js
View file @
a3b4d615
...
...
@@ -473,11 +473,11 @@ exports.getThreadById = function(tid, callback) {
var
subThreads
=
results
[
1
]
||
[];
//话题子文章列表
// var latestPhotos = results[2] || []; //最新照片墙列表
// var hotPhotos = results[3] || []; //最热照片墙列表
var
canyuPeopleCount
=
results
[
1
]
||
0
;
//参与人数
var
canyuPeopleCount
=
results
[
2
]
||
0
;
//参与人数
var
threadObj
=
thread
&&
thread
.
toObject
()
||
{};
threadObj
.
comments
=
comments
;
//
threadObj.subThreads = subThreads;
threadObj
.
subThreads
=
subThreads
;
// threadObj.latestPhotos = latestPhotos;
// threadObj.hotPhotos = hotPhotos;
threadObj
.
canyuPeopleCount
=
canyuPeopleCount
;
...
...
app/utils/util.js
View file @
a3b4d615
...
...
@@ -130,7 +130,7 @@ function loadLevelFromAPI(ent_code,open_id,callback){
var
key
=
'pisns-forum-thread:'
+
ent_code
+
':'
+
open_id
+
':exp'
;
redis
.
get
(
key
,
function
(
err
,
value
){
if
(
value
)
{
return
callback
&&
callback
(
null
,
Number
(
value
)
||
null
);
return
callback
&&
callback
(
null
,
JSON
.
parse
(
value
)
||
null
);
}
else
{
var
url
=
API_ADDRESS
+
'/v1.0/internal/member/exp/byopenid?openId='
+
open_id
+
'&entCode='
+
ent_code
;
request
.
get
({
...
...
@@ -141,7 +141,7 @@ function loadLevelFromAPI(ent_code,open_id,callback){
console
.
log
(
e
)
}
if
(
body
&&
body
.
data
){
redis
.
set
(
key
,
body
.
data
);
redis
.
set
(
key
,
JSON
.
stringify
(
body
.
data
)
);
redis
.
expire
(
key
,
2
*
60
);
}
return
callback
&&
callback
(
null
,(
body
&&
body
.
data
)
||
null
);
...
...
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