Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beyond-clouds
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
段启岩
beyond-clouds
Commits
bde9afa6
Commit
bde9afa6
authored
Feb 07, 2020
by
胡学良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
热门问答
parent
92c0430f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
1 deletions
+26
-1
src/main/java/cn/meteor/beyondclouds/modules/question/api/QuestionApi.java
+9
-0
src/main/java/cn/meteor/beyondclouds/modules/question/service/IQuestionService.java
+8
-0
src/main/java/cn/meteor/beyondclouds/modules/question/service/impl/QuestionServiceImpl.java
+8
-0
src/main/resources/application.yml
+1
-1
No files found.
src/main/java/cn/meteor/beyondclouds/modules/question/api/QuestionApi.java
View file @
bde9afa6
...
...
@@ -246,5 +246,14 @@ public class QuestionApi {
return
Response
.
success
(
questionReplyPageVO
);
}
@Anonymous
@ApiOperation
(
"热门回答"
)
@GetMapping
(
"/question/hots"
)
public
Response
<
PageVO
<
Question
>>
getHotsQuestions
(
@Valid
PageForm
pageForm
)
{
IPage
<
Question
>
questionPage
=
questionService
.
getHotsQuestionsPage
(
pageForm
.
getPage
(),
pageForm
.
getSize
());
PageVO
<
Question
>
questionPageVO
=
new
PageVO
<>(
questionPage
);
return
Response
.
success
(
questionPageVO
);
}
}
src/main/java/cn/meteor/beyondclouds/modules/question/service/IQuestionService.java
View file @
bde9afa6
...
...
@@ -85,4 +85,12 @@ public interface IQuestionService extends IService<Question> {
*/
IPage
<
Question
>
getUserParticipatePage
(
Integer
pageNumber
,
Integer
pageSize
,
String
userId
);
/**
* 获取热门回答列表
* @param pageNumber 页数
* @param pageSize 页面大小
* @return 分页对象
*/
IPage
<
Question
>
getHotsQuestionsPage
(
Integer
pageNumber
,
Integer
pageSize
);
}
src/main/java/cn/meteor/beyondclouds/modules/question/service/impl/QuestionServiceImpl.java
View file @
bde9afa6
...
...
@@ -368,4 +368,12 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
}
return
questionPage
;
}
@Override
public
IPage
<
Question
>
getHotsQuestionsPage
(
Integer
pageNumber
,
Integer
pageSize
)
{
IPage
<
Question
>
page
=
new
Page
<>(
pageNumber
,
pageSize
);
QueryWrapper
<
Question
>
questionQueryWrapper
=
new
QueryWrapper
<>();
questionQueryWrapper
.
orderByDesc
(
"q.view_number"
);
return
questionMapper
.
selectPageWithTags
(
page
,
questionQueryWrapper
);
}
}
src/main/resources/application.yml
View file @
bde9afa6
...
...
@@ -3,7 +3,7 @@ spring:
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://127.0.0.1:3306/beyond_clouds?useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true
username
:
root
password
:
1
00Centa30821%mysql
password
:
1
97442
swagger
:
enable
:
true
...
...
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