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
1e8c9bec
Commit
1e8c9bec
authored
Nov 04, 2021
by
rongkailun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】热点关注、规章制度、中央和总局精神
parent
fd0b17b8
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
354 additions
and
5 deletions
+354
-5
CenterController.java
...io/office/modules/manage/controller/CenterController.java
+116
-0
HotFollowController.java
...office/modules/manage/controller/HotFollowController.java
+114
-0
RulesAndRegulationsController.java
...ules/manage/controller/RulesAndRegulationsController.java
+116
-0
NewsEntity.java
...main/java/io/office/modules/manage/entity/NewsEntity.java
+2
-1
NewsParams.java
.../java/io/office/modules/manage/entity/dto/NewsParams.java
+1
-0
TopicnewsServiceImpl.java
...ice/modules/manage/service/impl/TopicnewsServiceImpl.java
+4
-3
TopicnewsDao.xml
src/main/resources/mapper/manage/TopicnewsDao.xml
+1
-1
No files found.
src/main/java/io/office/modules/manage/controller/CenterController.java
0 → 100644
View file @
1e8c9bec
package
io
.
office
.
modules
.
manage
.
controller
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.TopicnewsEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.service.TopicnewsService
;
import
io.office.modules.sys.controller.AbstractController
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* @author rkl
* @description 中央和总局精神
* @date 2021/11/04
*/
@RestController
@RequestMapping
(
"/center"
)
@Slf4j
public
class
CenterController
extends
AbstractController
{
@Autowired
private
TopicnewsService
topicnewsService
;
/**
* 列表
*/
@RequestMapping
(
"/list"
)
// @RequiresPermissions("generator:topicnews:list")
public
R
list
(
@RequestBody
NewsParams
newsParams
){
newsParams
.
setClassId
(
429
);
Page
<
NewsEntity
>
page
=
this
.
topicnewsService
.
selectTopicList
(
newsParams
,
new
Page
(
newsParams
.
getPage
(),
newsParams
.
getLimit
()));
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"page"
,
pageUtils
);
}
/**
* 信息
*/
@RequestMapping
(
"/info/{id}"
)
// @RequiresPermissions("generator:topicnews:info")
public
R
info
(
@PathVariable
(
"id"
)
Integer
id
){
TopicnewsEntity
topicnews
=
topicnewsService
.
getById
(
id
);
return
R
.
ok
().
put
(
"topicnews"
,
topicnews
);
}
/**
* 保存
*/
@RequestMapping
(
"/save"
)
// @RequiresPermissions("generator:topicnews:save")
public
R
save
(
@RequestBody
NewsEntity
news
){
try
{
news
.
setClassid
(
429
);
R
r
=
this
.
topicnewsService
.
insertHdbd
(
news
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"insertHdbd error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
/**
* 修改
*/
@RequestMapping
(
"/update"
)
// @RequiresPermissions("generator:topicnews:update")
public
R
update
(
@RequestBody
NewsEntity
news
){
try
{
R
r
=
this
.
topicnewsService
.
updateHdbd
(
news
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"update error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
/**
* 删除
*/
@RequestMapping
(
"/delete"
)
// @RequiresPermissions("generator:topicnews:delete")
public
R
delete
(
@RequestBody
List
<
Long
>
ids
){
try
{
R
r
=
this
.
topicnewsService
.
deleteHdbd
(
ids
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"delete error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
/**
* 审核
*/
@PostMapping
(
"/verifyTopic"
)
// @RequiresPermissions("manage:news:verify")
public
R
verify
(
@RequestBody
NewsEntity
news
)
{
try
{
R
r
=
this
.
topicnewsService
.
verifyTopic
(
news
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"verifyTopic error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
}
src/main/java/io/office/modules/manage/controller/HotFollowController.java
0 → 100644
View file @
1e8c9bec
package
io
.
office
.
modules
.
manage
.
controller
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.TopicnewsEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.service.TopicnewsService
;
import
io.office.modules.sys.controller.AbstractController
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* @author rkl
* @description 热点关注
* @date 2021/11/04
*/
@RestController
@RequestMapping
(
"/hotFlow"
)
@Slf4j
public
class
HotFollowController
extends
AbstractController
{
@Autowired
private
TopicnewsService
topicnewsService
;
/**
* 列表
*/
@RequestMapping
(
"/list"
)
// @RequiresPermissions("generator:topicnews:list")
public
R
list
(
@RequestBody
NewsParams
newsParams
){
newsParams
.
setClassId
(
435
);
Page
<
NewsEntity
>
page
=
this
.
topicnewsService
.
selectTopicList
(
newsParams
,
new
Page
(
newsParams
.
getPage
(),
newsParams
.
getLimit
()));
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"page"
,
pageUtils
);
}
/**
* 信息
*/
@RequestMapping
(
"/info/{id}"
)
// @RequiresPermissions("generator:topicnews:info")
public
R
info
(
@PathVariable
(
"id"
)
Integer
id
){
TopicnewsEntity
topicnews
=
topicnewsService
.
getById
(
id
);
return
R
.
ok
().
put
(
"topicnews"
,
topicnews
);
}
/**
* 保存
*/
@RequestMapping
(
"/save"
)
// @RequiresPermissions("generator:topicnews:save")
public
R
save
(
@RequestBody
NewsEntity
news
){
try
{
news
.
setClassid
(
435
);
R
r
=
this
.
topicnewsService
.
insertHdbd
(
news
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"insertHdbd error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
/**
* 修改
*/
@RequestMapping
(
"/update"
)
// @RequiresPermissions("generator:topicnews:update")
public
R
update
(
@RequestBody
NewsEntity
news
){
try
{
R
r
=
this
.
topicnewsService
.
updateHdbd
(
news
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"update error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
/**
* 删除
*/
@RequestMapping
(
"/delete"
)
// @RequiresPermissions("generator:topicnews:delete")
public
R
delete
(
@RequestBody
List
<
Long
>
ids
){
try
{
R
r
=
this
.
topicnewsService
.
deleteHdbd
(
ids
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"delete error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
/**
* 审核
*/
@PostMapping
(
"/verifyTopic"
)
// @RequiresPermissions("manage:news:verify")
public
R
verify
(
@RequestBody
NewsEntity
news
)
{
try
{
R
r
=
this
.
topicnewsService
.
verifyTopic
(
news
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"verifyTopic error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
}
src/main/java/io/office/modules/manage/controller/RulesAndRegulationsController.java
0 → 100644
View file @
1e8c9bec
package
io
.
office
.
modules
.
manage
.
controller
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.TopicnewsEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.service.TopicnewsService
;
import
io.office.modules.sys.controller.AbstractController
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* @author rkl
* @description
* @date 2021/11/04
*/
@RestController
@RequestMapping
(
"/rules"
)
@Slf4j
public
class
RulesAndRegulationsController
extends
AbstractController
{
@Autowired
private
TopicnewsService
topicnewsService
;
/**
* 列表
*/
@RequestMapping
(
"/list"
)
// @RequiresPermissions("generator:topicnews:list")
public
R
list
(
@RequestBody
NewsParams
newsParams
){
newsParams
.
setClassId
(
430
);
Page
<
NewsEntity
>
page
=
this
.
topicnewsService
.
selectTopicList
(
newsParams
,
new
Page
(
newsParams
.
getPage
(),
newsParams
.
getLimit
()));
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"page"
,
pageUtils
);
}
/**
* 信息
*/
@RequestMapping
(
"/info/{id}"
)
// @RequiresPermissions("generator:topicnews:info")
public
R
info
(
@PathVariable
(
"id"
)
Integer
id
){
TopicnewsEntity
topicnews
=
topicnewsService
.
getById
(
id
);
return
R
.
ok
().
put
(
"topicnews"
,
topicnews
);
}
/**
* 保存
*/
@RequestMapping
(
"/save"
)
// @RequiresPermissions("generator:topicnews:save")
public
R
save
(
@RequestBody
NewsEntity
news
){
try
{
news
.
setClassid
(
430
);
R
r
=
this
.
topicnewsService
.
insertHdbd
(
news
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"insertHdbd error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
/**
* 修改
*/
@RequestMapping
(
"/update"
)
// @RequiresPermissions("generator:topicnews:update")
public
R
update
(
@RequestBody
NewsEntity
news
){
try
{
R
r
=
this
.
topicnewsService
.
updateHdbd
(
news
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"update error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
/**
* 删除
*/
@RequestMapping
(
"/delete"
)
// @RequiresPermissions("generator:topicnews:delete")
public
R
delete
(
@RequestBody
List
<
Long
>
ids
){
try
{
R
r
=
this
.
topicnewsService
.
deleteHdbd
(
ids
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"delete error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
/**
* 审核
*/
@PostMapping
(
"/verifyTopic"
)
// @RequiresPermissions("manage:news:verify")
public
R
verify
(
@RequestBody
NewsEntity
news
)
{
try
{
R
r
=
this
.
topicnewsService
.
verifyTopic
(
news
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"verifyTopic error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
}
src/main/java/io/office/modules/manage/entity/NewsEntity.java
View file @
1e8c9bec
package
io
.
office
.
modules
.
manage
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
...
...
@@ -98,7 +99,7 @@ public class NewsEntity implements Serializable {
* 分类id
*/
private
Integer
classid
;
@TableField
(
exist
=
false
)
private
Integer
cclassid
;
/**
* 出版时间
...
...
src/main/java/io/office/modules/manage/entity/dto/NewsParams.java
View file @
1e8c9bec
...
...
@@ -29,4 +29,5 @@ public class NewsParams extends PageParams {
private
Date
updateTimeStart
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTimeEnd
;
private
Integer
classId
;
}
src/main/java/io/office/modules/manage/service/impl/TopicnewsServiceImpl.java
View file @
1e8c9bec
...
...
@@ -46,10 +46,10 @@ public class TopicnewsServiceImpl extends ServiceImpl<TopicnewsDao, TopicnewsEnt
private
NewsService
newsService
;
@Override
public
R
insertHdbd
(
NewsEntity
news
,
SysUserEntity
user
)
{
news
.
setCclassid
(
35
);
newsService
.
insertNews
(
news
,
user
);
TopicnewsEntity
topicnewsEntity
=
new
TopicnewsEntity
();
topicnewsEntity
.
setClassid
(
428
);
topicnewsEntity
.
setClassid
(
news
.
getClassid
());
news
.
setClassid
(
35
);
newsService
.
insertNews
(
news
,
user
);
topicnewsEntity
.
setNewsid
(
news
.
getId
());
topicnewsEntity
.
setNewslevels
(
news
.
getLevels
());
topicnewsEntity
.
setTime
(
new
Date
());
...
...
@@ -97,6 +97,7 @@ public class TopicnewsServiceImpl extends ServiceImpl<TopicnewsDao, TopicnewsEnt
@Override
public
Page
<
NewsEntity
>
selectTopicList
(
NewsParams
newsParams
,
Page
page
)
{
newsParams
.
setClassId
(
newsParams
.
getClassId
());
List
<
NewsEntity
>
newsList
=
this
.
topicnewsDao
.
selectTopicList
(
newsParams
,
page
);
page
.
setRecords
(
newsList
);
return
page
;
...
...
src/main/resources/mapper/manage/TopicnewsDao.xml
View file @
1e8c9bec
...
...
@@ -32,7 +32,7 @@
TopIcNews AS a
LEFT JOIN news AS b ON a.newsid = b.id
WHERE
a.classid =
428
a.classid =
#{newsParams.classId}
AND levels > 0
ORDER BY
levels DESC,
...
...
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