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
440c8ca9
Commit
440c8ca9
authored
Dec 13, 2021
by
rongkailun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】相关链接接口
parent
beeb48fa
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
0 deletions
+32
-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
+2
-0
NewsService.java
...in/java/io/office/modules/manage/service/NewsService.java
+2
-0
NewsServiceImpl.java
...o/office/modules/manage/service/impl/NewsServiceImpl.java
+6
-0
NewsDao.xml
src/main/resources/mapper/manage/NewsDao.xml
+13
-0
No files found.
src/main/java/io/office/modules/manage/controller/NewsController.java
View file @
440c8ca9
...
...
@@ -463,4 +463,13 @@ public class NewsController extends AbstractController {
NewtopicEntity
newtopic
=
newtopicService
.
getById
(
id
);
return
R
.
ok
().
put
(
"data"
,
newtopic
);
}
/**相关链接*/
@Login
@GetMapping
(
"/api/relatedLinks"
)
public
R
relatedLinks
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
List
<
NewsEntity
>
list
=
this
.
newsService
.
relatedLinks
(
params
);
return
R
.
ok
().
put
(
"data"
,
list
);
}
}
src/main/java/io/office/modules/manage/dao/NewsDao.java
View file @
440c8ca9
...
...
@@ -90,4 +90,6 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
List
<
NewsEntity
>
syzxphList
();
List
<
NewtopicEntity
>
zttjList
();
List
<
NewsEntity
>
relatedLinks
(
Map
<
String
,
Object
>
params
);
}
src/main/java/io/office/modules/manage/service/NewsService.java
View file @
440c8ca9
...
...
@@ -88,5 +88,7 @@ public interface NewsService extends IService<NewsEntity> {
List
<
NewsEntity
>
syzxphList
();
List
<
NewtopicEntity
>
zttjList
();
List
<
NewsEntity
>
relatedLinks
(
Map
<
String
,
Object
>
params
);
}
src/main/java/io/office/modules/manage/service/impl/NewsServiceImpl.java
View file @
440c8ca9
...
...
@@ -501,6 +501,12 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
return
list
;
}
@Override
public
List
<
NewsEntity
>
relatedLinks
(
Map
<
String
,
Object
>
params
)
{
List
<
NewsEntity
>
list
=
this
.
newsDao
.
relatedLinks
(
params
);
return
list
;
}
private
List
<
Map
<
String
,
Object
>>
getDataListNew
(
Map
<
String
,
Object
>
map
,
Page
page
)
{
List
<
Map
<
String
,
Object
>>
list
=
this
.
newsDao
.
searchKnowledgeInfoNewList
(
map
,
page
);
return
list
;
...
...
src/main/resources/mapper/manage/NewsDao.xml
View file @
440c8ca9
...
...
@@ -593,4 +593,16 @@ ORDER BY
<select
id=
"zttjList"
resultType=
"io.office.modules.manage.entity.NewtopicEntity"
>
select top 10 * from NewTopic where levels>0 and parentid=0 and checkflag=1 order by levels desc,classid desc
</select>
<select
id=
"relatedLinks"
resultType=
"io.office.modules.manage.entity.NewsEntity"
>
SELECT
TOP 10 *
FROM
news
WHERE
levels > 0
AND status = 1
AND Id != #{id}
AND keyword LIKE concat ('%', #{keyword}, '%')
order by releasedate desc
</select>
</mapper>
\ No newline at end of file
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