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
0f4b9709
Commit
0f4b9709
authored
Oct 25, 2021
by
rongkailun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】活动报道
parent
c58a490a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
238 additions
and
0 deletions
+238
-0
TopicnewsController.java
...office/modules/manage/controller/TopicnewsController.java
+98
-0
TopicnewsDao.java
src/main/java/io/office/modules/manage/dao/TopicnewsDao.java
+17
-0
TopicnewsEntity.java
...java/io/office/modules/manage/entity/TopicnewsEntity.java
+44
-0
TopicnewsService.java
...va/io/office/modules/manage/service/TopicnewsService.java
+25
-0
TopicnewsServiceImpl.java
...ice/modules/manage/service/impl/TopicnewsServiceImpl.java
+37
-0
TopicnewsDao.xml
src/main/resources/mapper/manage/TopicnewsDao.xml
+17
-0
No files found.
src/main/java/io/office/modules/manage/controller/TopicnewsController.java
0 → 100644
View file @
0f4b9709
package
io
.
office
.
modules
.
manage
.
controller
;
import
java.util.Arrays
;
import
java.util.Map
;
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.service.TopicnewsService
;
import
io.office.modules.sys.controller.AbstractController
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 党办资讯 活动报道
*
* @author rkl
* @email
* @date 2021-10-21 10:20:27
*/
@RestController
@Slf4j
@RequestMapping
(
"/topicnews"
)
public
class
TopicnewsController
extends
AbstractController
{
@Autowired
private
TopicnewsService
topicnewsService
;
/**
* 列表
*/
@RequestMapping
(
"/list"
)
// @RequiresPermissions("generator:topicnews:list")
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
PageUtils
page
=
topicnewsService
.
queryPage
(
params
);
return
R
.
ok
().
put
(
"page"
,
page
);
}
/**
* 信息
*/
@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
{
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
TopicnewsEntity
topicnews
){
topicnewsService
.
updateById
(
topicnews
);
return
R
.
ok
();
}
/**
* 删除
*/
@RequestMapping
(
"/delete"
)
// @RequiresPermissions("generator:topicnews:delete")
public
R
delete
(
@RequestBody
Integer
[]
ids
){
topicnewsService
.
removeByIds
(
Arrays
.
asList
(
ids
));
return
R
.
ok
();
}
}
src/main/java/io/office/modules/manage/dao/TopicnewsDao.java
0 → 100644
View file @
0f4b9709
package
io
.
office
.
modules
.
manage
.
dao
;
import
io.office.modules.manage.entity.TopicnewsEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* ${comments}
*
* @author chenshun
* @email sunlightcs@gmail.com
* @date 2021-10-21 10:20:27
*/
@Mapper
public
interface
TopicnewsDao
extends
BaseMapper
<
TopicnewsEntity
>
{
}
src/main/java/io/office/modules/manage/entity/TopicnewsEntity.java
0 → 100644
View file @
0f4b9709
package
io
.
office
.
modules
.
manage
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.io.Serializable
;
import
java.util.Date
;
import
lombok.Data
;
/**
* ${comments}
*
* @author chenshun
* @email sunlightcs@gmail.com
* @date 2021-10-21 10:20:27
*/
@Data
@TableName
(
"TopIcNews"
)
public
class
TopicnewsEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* $column.comments
*/
@TableId
private
Integer
id
;
/**
* $column.comments
*/
private
Integer
classid
;
/**
* $column.comments
*/
private
Integer
newsid
;
/**
* $column.comments
*/
private
Integer
newslevels
;
/**
* $column.comments
*/
private
Date
time
;
}
src/main/java/io/office/modules/manage/service/TopicnewsService.java
0 → 100644
View file @
0f4b9709
package
io
.
office
.
modules
.
manage
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
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.sys.entity.SysUserEntity
;
import
java.util.Map
;
/**
* ${comments}
*
* @author rkl
* @email
* @date 2021-10-21 10:20:27
*/
public
interface
TopicnewsService
extends
IService
<
TopicnewsEntity
>
{
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
R
insertHdbd
(
NewsEntity
news
,
SysUserEntity
user
);
}
src/main/java/io/office/modules/manage/service/impl/TopicnewsServiceImpl.java
0 → 100644
View file @
0f4b9709
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.dao.TopicnewsDao
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.TopicnewsEntity
;
import
io.office.modules.manage.service.TopicnewsService
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
@Service
(
"topicnewsService"
)
public
class
TopicnewsServiceImpl
extends
ServiceImpl
<
TopicnewsDao
,
TopicnewsEntity
>
implements
TopicnewsService
{
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
TopicnewsEntity
>
page
=
this
.
page
(
new
Query
<
TopicnewsEntity
>().
getPage
(
params
),
new
QueryWrapper
<
TopicnewsEntity
>()
);
return
new
PageUtils
(
page
);
}
@Override
public
R
insertHdbd
(
NewsEntity
news
,
SysUserEntity
user
)
{
return
null
;
}
}
\ No newline at end of file
src/main/resources/mapper/manage/TopicnewsDao.xml
0 → 100644
View file @
0f4b9709
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"io.office.modules.manage.dao.TopicnewsDao"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"io.office.modules.manage.entity.TopicnewsEntity"
id=
"topicnewsMap"
>
<result
property=
"id"
column=
"Id"
/>
<result
property=
"classid"
column=
"Classid"
/>
<result
property=
"newsid"
column=
"NewsId"
/>
<result
property=
"newslevels"
column=
"NewsLevels"
/>
<result
property=
"time"
column=
"time"
/>
</resultMap>
</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