Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
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
吴迪
gs1-office-web-sit
Commits
dbc859d3
Commit
dbc859d3
authored
Dec 11, 2021
by
rongkailun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】资讯排行top10
parent
fa1e12e9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
0 deletions
+27
-0
NewsController.java
...a/io/office/modules/manage/controller/NewsController.java
+9
-0
NewsDao.java
src/main/java/io/office/modules/manage/dao/NewsDao.java
+3
-0
NewsService.java
...in/java/io/office/modules/manage/service/NewsService.java
+3
-0
NewsServiceImpl.java
...o/office/modules/manage/service/impl/NewsServiceImpl.java
+6
-0
NewsDao.xml
src/main/resources/mapper/manage/NewsDao.xml
+6
-0
No files found.
src/main/java/io/office/modules/manage/controller/NewsController.java
View file @
dbc859d3
...
...
@@ -383,4 +383,13 @@ public class NewsController extends AbstractController {
KnowledgeinfoEntity
retMap
=
this
.
knowledgeinfoService
.
getById
(
id
);
return
R
.
ok
().
put
(
"data"
,
retMap
);
}
/**资讯排行TOP10*/
@Login
@GetMapping
(
"/api/newsTop10"
)
public
R
newsTop10
()
{
List
<
NewsEntity
>
list
=
this
.
newsService
.
newsTop10
();
return
R
.
ok
().
put
(
"data"
,
list
);
}
}
src/main/java/io/office/modules/manage/dao/NewsDao.java
View file @
dbc859d3
...
...
@@ -71,4 +71,7 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
List
<
Map
<
String
,
Object
>>
searchKnowledgeInfoList
();
List
<
Map
<
String
,
Object
>>
hotList
();
List
<
NewsEntity
>
newsTop10
();
}
src/main/java/io/office/modules/manage/service/NewsService.java
View file @
dbc859d3
...
...
@@ -70,5 +70,8 @@ public interface NewsService extends IService<NewsEntity> {
List
<
Map
<
String
,
Object
>>
searchKnowledgeInfoList
();
List
<
Map
<
String
,
Object
>>
hotList
();
List
<
NewsEntity
>
newsTop10
();
}
src/main/java/io/office/modules/manage/service/impl/NewsServiceImpl.java
View file @
dbc859d3
...
...
@@ -353,6 +353,12 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
return
list
;
}
@Override
public
List
<
NewsEntity
>
newsTop10
()
{
List
<
NewsEntity
>
list
=
this
.
newsDao
.
newsTop10
();
return
list
;
}
private
List
<
Map
<
String
,
Object
>>
getDataList
(
Map
<
String
,
Object
>
map
)
{
List
<
Map
<
String
,
Object
>>
list
=
this
.
newsDao
.
searchKnowledgeInfo
(
map
);
return
list
;
...
...
src/main/resources/mapper/manage/NewsDao.xml
View file @
dbc859d3
...
...
@@ -31,6 +31,12 @@
<result
property=
"showtime"
column=
"showtime"
/>
<result
property=
"checkdate"
column=
"checkdate"
/>
</resultMap>
<select
id=
"newsTop10"
resultMap=
"newsMap"
>
select top 10 title,id from news where 1=1 and levels > 0
and status = '1'
and datediff(month, releasedate,getdate())=0
order by hits desc
</select>
<!--查询新闻列表-->
<select
id=
"selectNewsList"
resultMap=
"newsMap"
parameterType=
"io.office.modules.manage.entity.dto.NewsParams"
>
...
...
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