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
1bffd170
Commit
1bffd170
authored
Oct 15, 2021
by
rongkailun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片咨询新增修改删除审核
parent
acc5c7e5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
344 additions
and
1 deletions
+344
-1
NewsController.java
...a/io/office/modules/manage/controller/NewsController.java
+1
-1
PictureController.java
...o/office/modules/manage/controller/PictureController.java
+114
-0
PictureDao.java
src/main/java/io/office/modules/manage/dao/PictureDao.java
+17
-0
PictureEntity.java
...n/java/io/office/modules/manage/entity/PictureEntity.java
+88
-0
PictureService.java
...java/io/office/modules/manage/service/PictureService.java
+31
-0
PictureServiceImpl.java
...ffice/modules/manage/service/impl/PictureServiceImpl.java
+93
-0
No files found.
src/main/java/io/office/modules/manage/controller/NewsController.java
View file @
1bffd170
...
@@ -22,7 +22,7 @@ import io.office.common.utils.R;
...
@@ -22,7 +22,7 @@ import io.office.common.utils.R;
/**
/**
*
${comments}
*
文章管理
*
*
* @author wudi
* @author wudi
* @email
* @email
...
...
src/main/java/io/office/modules/manage/controller/PictureController.java
0 → 100644
View file @
1bffd170
package
io
.
office
.
modules
.
manage
.
controller
;
import
java.util.Arrays
;
import
java.util.List
;
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.PictureEntity
;
import
io.office.modules.manage.service.PictureService
;
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.*
;
/**
* 图片咨询管理
*
* @author rkl
* @email
* @date 2021-10-14 15:28:27
*/
@RestController
@RequestMapping
(
"/picture"
)
@Slf4j
public
class
PictureController
extends
AbstractController
{
@Autowired
private
PictureService
pictureService
;
/**
* 列表
*/
@RequestMapping
(
"/list"
)
// @RequiresPermissions("generator:picture:list")
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
PageUtils
page
=
pictureService
.
queryPage
(
params
);
return
R
.
ok
().
put
(
"page"
,
page
);
}
/**
* 信息
*/
@RequestMapping
(
"/info/{pictureid}"
)
// @RequiresPermissions("generator:picture:info")
public
R
info
(
@PathVariable
(
"pictureid"
)
Integer
pictureid
){
PictureEntity
picture
=
pictureService
.
getById
(
pictureid
);
return
R
.
ok
().
put
(
"picture"
,
picture
);
}
/**
* 保存
*/
@RequestMapping
(
"/save"
)
// @RequiresPermissions("generator:picture:save")
public
R
save
(
@RequestBody
PictureEntity
picture
){
try
{
R
r
=
this
.
pictureService
.
insertPicture
(
picture
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"picture save error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
/**
* 修改
*/
@RequestMapping
(
"/update"
)
// @RequiresPermissions("generator:picture:update")
public
R
update
(
@RequestBody
PictureEntity
picture
){
try
{
R
r
=
this
.
pictureService
.
updatePicture
(
picture
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"update error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
/**
* 删除
*/
@RequestMapping
(
"/delete"
)
// @RequiresPermissions("generator:picture:delete")
public
R
delete
(
@RequestBody
List
ids
){
try
{
R
r
=
this
.
pictureService
.
deletePicture
(
ids
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"delete error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
/**
* 审核
*/
@PostMapping
(
"/verifyPicture"
)
// @RequiresPermissions("manage:news:verify")
public
R
verify
(
@RequestBody
PictureEntity
picture
)
{
try
{
R
r
=
this
.
pictureService
.
verifyPicture
(
picture
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"delete error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
}
src/main/java/io/office/modules/manage/dao/PictureDao.java
0 → 100644
View file @
1bffd170
package
io
.
office
.
modules
.
manage
.
dao
;
import
io.office.modules.manage.entity.PictureEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* ${comments}
*
* @author chenshun
* @email sunlightcs@gmail.com
* @date 2021-10-14 15:28:27
*/
@Mapper
public
interface
PictureDao
extends
BaseMapper
<
PictureEntity
>
{
}
src/main/java/io/office/modules/manage/entity/PictureEntity.java
0 → 100644
View file @
1bffd170
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-14 15:28:27
*/
@Data
@TableName
(
"picture"
)
public
class
PictureEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* $column.comments
*/
@TableId
private
Integer
pictureid
;
/**
* $column.comments
*/
private
String
title
;
/**
* $column.comments
*/
private
String
pictureType
;
/**
* $column.comments
*/
private
String
picFile
;
/**
* $column.comments
*/
private
String
minPicFile
;
/**
* $column.comments
*/
private
String
editor
;
/**
* $column.comments
*/
private
Date
inputdate
;
/**
* $column.comments
*/
private
Integer
piclevel
;
/**
* $column.comments
*/
private
Integer
status
;
/**
* $column.comments
*/
private
String
keyword
;
/**
* $column.comments
*/
private
String
jumppath
;
/**
* $column.comments
*/
private
String
content
;
/**
* $column.comments
*/
private
Integer
articleId
;
/**
* $column.comments
*/
private
String
showtime
;
/**
* $column.comments
*/
private
String
auditor
;
/**
* $column.comments
*/
private
String
lasteditor
;
}
src/main/java/io/office/modules/manage/service/PictureService.java
0 → 100644
View file @
1bffd170
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.PictureEntity
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
java.util.List
;
import
java.util.Map
;
/**
* ${comments}
*
* @author chenshun
* @email sunlightcs@gmail.com
* @date 2021-10-14 15:28:27
*/
public
interface
PictureService
extends
IService
<
PictureEntity
>
{
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
R
insertPicture
(
PictureEntity
picture
,
SysUserEntity
user
);
R
updatePicture
(
PictureEntity
picture
,
SysUserEntity
user
);
R
deletePicture
(
List
ids
,
SysUserEntity
user
);
R
verifyPicture
(
PictureEntity
picture
,
SysUserEntity
user
);
}
src/main/java/io/office/modules/manage/service/impl/PictureServiceImpl.java
0 → 100644
View file @
1bffd170
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.PictureDao
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.PictureEntity
;
import
io.office.modules.manage.service.PictureService
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
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
(
"pictureService"
)
public
class
PictureServiceImpl
extends
ServiceImpl
<
PictureDao
,
PictureEntity
>
implements
PictureService
{
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
PictureEntity
>
page
=
this
.
page
(
new
Query
<
PictureEntity
>().
getPage
(
params
),
new
QueryWrapper
<
PictureEntity
>()
);
return
new
PageUtils
(
page
);
}
@Override
public
R
insertPicture
(
PictureEntity
picture
,
SysUserEntity
user
)
{
picture
.
setEditor
(
user
.
getUsername
());
picture
.
setLasteditor
(
user
.
getUsername
());
int
insert
=
baseMapper
.
insert
(
picture
);
if
(
insert
>
0
){
return
R
.
ok
(
"新增成功!"
);
}
else
{
return
R
.
error
(
"新增失败!"
);
}
}
@Override
public
R
updatePicture
(
PictureEntity
picture
,
SysUserEntity
user
)
{
if
(
picture
.
getPictureid
()
==
null
){
return
R
.
error
(
"id不能为空!"
);
}
QueryWrapper
<
PictureEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
eq
(
"id"
,
picture
.
getPictureid
());
picture
.
setEditor
(
user
.
getUsername
());
picture
.
setLasteditor
(
user
.
getUsername
());
int
update
=
baseMapper
.
update
(
picture
,
newsEntityQueryWrapper
);
if
(
update
>
0
){
return
R
.
ok
(
"修改成功!"
);
}
else
{
return
R
.
error
(
"修改失败!"
);
}
}
@Override
public
R
deletePicture
(
List
ids
,
SysUserEntity
user
)
{
PictureEntity
pictureEntity
=
new
PictureEntity
();
pictureEntity
.
setPiclevel
(
0
);
QueryWrapper
<
PictureEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
in
(
"id"
,
ids
);
int
delete
=
baseMapper
.
update
(
pictureEntity
,
newsEntityQueryWrapper
);
if
(
delete
>
0
){
return
R
.
ok
(
"删除成功!"
);
}
else
{
return
R
.
error
(
"删除失败!"
);
}
}
@Override
public
R
verifyPicture
(
PictureEntity
picture
,
SysUserEntity
user
)
{
picture
.
setAuditor
(
user
.
getUsername
());
picture
.
setInputdate
(
new
Date
());
picture
.
setLasteditor
(
user
.
getUsername
());
QueryWrapper
<
PictureEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
eq
(
"id"
,
picture
.
getPictureid
());
int
verify
=
baseMapper
.
update
(
picture
,
newsEntityQueryWrapper
);
if
(
verify
>
0
){
return
R
.
ok
(
"审核成功!"
);
}
else
{
return
R
.
error
(
"审核失败!"
);
}
}
}
\ 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