Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
74099990
Commit
74099990
authored
Aug 28, 2019
by
libin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
banner 添加字段platform
parent
be1df259
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
26 deletions
+32
-26
BannerAdminController.java
...m/xxfc/platform/app/rest/admin/BannerAdminController.java
+32
-26
No files found.
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/rest/admin/BannerAdminController.java
View file @
74099990
...
@@ -21,22 +21,23 @@ import org.springframework.web.bind.annotation.*;
...
@@ -21,22 +21,23 @@ import org.springframework.web.bind.annotation.*;
*/
*/
@RestController
@RestController
@RequestMapping
(
"/admin/banner"
)
@RequestMapping
(
"/admin/banner"
)
@Api
(
value
=
"banner后台接口"
,
tags
=
"banner后台接口"
)
@Api
(
value
=
"banner后台接口"
,
tags
=
"banner后台接口"
)
public
class
BannerAdminController
{
public
class
BannerAdminController
{
@Autowired
@Autowired
private
BannerBiz
bannerBiz
;
private
BannerBiz
bannerBiz
;
/**
/**
* 修改
* 修改
*
* @param banner
* @param banner
* @return
* @return
*/
*/
@PutMapping
@PutMapping
@ApiOperation
(
value
=
"banner修改"
,
notes
=
"修改"
)
@ApiOperation
(
value
=
"banner修改"
,
notes
=
"修改"
)
public
ObjectRestResponse
<
Banner
>
update
(
@RequestBody
Banner
banner
,
UserDTO
userInfo
){
public
ObjectRestResponse
<
Banner
>
update
(
@RequestBody
Banner
banner
,
UserDTO
userInfo
)
{
int
effectRows
=
bannerBiz
.
save
(
banner
,
userInfo
);
int
effectRows
=
bannerBiz
.
save
(
banner
,
userInfo
);
if
(
effectRows
>
0
)
{
if
(
effectRows
>
0
)
{
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
...
@@ -44,48 +45,51 @@ public class BannerAdminController {
...
@@ -44,48 +45,51 @@ public class BannerAdminController {
/**
/**
* 根据id查询banner
* 根据id查询banner
*
* @param id
* @param id
* @return
* @return
*/
*/
@GetMapping
(
"/{id}"
)
@GetMapping
(
"/{id}"
)
@ApiOperation
(
value
=
"根据id查询banner图"
,
notes
=
"根据id查询banner图"
)
@ApiOperation
(
value
=
"根据id查询banner图"
,
notes
=
"根据id查询banner图"
)
public
ObjectRestResponse
<
Banner
>
findBannerById
(
@PathVariable
Integer
id
){
public
ObjectRestResponse
<
Banner
>
findBannerById
(
@PathVariable
Integer
id
)
{
Banner
Banner
=
bannerBiz
.
selectById
(
id
);
Banner
Banner
=
bannerBiz
.
selectById
(
id
);
return
ObjectRestResponse
.
succ
(
Banner
);
return
ObjectRestResponse
.
succ
(
Banner
);
}
}
/**
/**
* 分页查询banner
* 分页查询banner
*
* @param pageNo
* @param pageNo
* @param pageSize
* @param pageSize
* @return
* @return
*/
*/
@GetMapping
(
"/page"
)
@GetMapping
(
"/page"
)
@ApiOperation
(
value
=
"banner分页查询"
,
notes
=
"banner分页查询"
)
@ApiOperation
(
value
=
"banner分页查询"
,
notes
=
"banner分页查询"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"pageNo"
,
paramType
=
"query"
,
required
=
false
,
dataType
=
"integer"
,
defaultValue
=
"0"
),
@ApiImplicitParam
(
name
=
"pageNo"
,
paramType
=
"query"
,
required
=
false
,
dataType
=
"integer"
,
defaultValue
=
"0"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
paramType
=
"query"
,
required
=
false
,
dataType
=
"integer"
,
defaultValue
=
"10"
)
@ApiImplicitParam
(
name
=
"pageSize"
,
paramType
=
"query"
,
required
=
false
,
dataType
=
"integer"
,
defaultValue
=
"10"
)
})
})
public
ObjectRestResponse
<
PageDataVO
>
findBannerPage
(
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"0"
,
required
=
false
)
Integer
pageNo
,
public
ObjectRestResponse
<
PageDataVO
>
findBannerPage
(
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"0"
,
required
=
false
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
,
required
=
false
)
Integer
pageSize
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
,
required
=
false
)
Integer
pageSize
,
@RequestParam
(
name
=
"platform"
,
defaultValue
=
"0"
,
required
=
false
)
Integer
platform
)
{
@RequestParam
(
name
=
"platform"
,
defaultValue
=
"0"
,
required
=
false
)
Integer
platform
)
{
PageDataVO
<
Banner
>
pageDataVO
=
bannerBiz
.
findBannePage
(
pageNo
,
pageSize
,
platform
);
PageDataVO
<
Banner
>
pageDataVO
=
bannerBiz
.
findBannePage
(
pageNo
,
pageSize
,
platform
);
return
ObjectRestResponse
.
succ
(
pageDataVO
);
return
ObjectRestResponse
.
succ
(
pageDataVO
);
}
}
/**
/**
* 保存banner
* 保存banner
*
* @param banner
* @param banner
* @return
* @return
*/
*/
@ApiOperation
(
value
=
"banner保存"
,
notes
=
"banner保存"
)
@ApiOperation
(
value
=
"banner保存"
,
notes
=
"banner保存"
)
@PostMapping
@PostMapping
public
ObjectRestResponse
<
Void
>
saveBanner
(
@RequestBody
Banner
banner
,
UserDTO
userDTO
)
{
public
ObjectRestResponse
<
Void
>
saveBanner
(
@RequestBody
Banner
banner
,
UserDTO
userDTO
)
{
banner
.
setIsDel
(
0
);
banner
.
setIsDel
(
0
);
int
effectRows
=
bannerBiz
.
save
(
banner
,
userDTO
);
int
effectRows
=
bannerBiz
.
save
(
banner
,
userDTO
);
if
(
effectRows
>
0
)
{
if
(
effectRows
>
0
)
{
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
...
@@ -94,14 +98,15 @@ public class BannerAdminController {
...
@@ -94,14 +98,15 @@ public class BannerAdminController {
/**
/**
* 逻辑删除
* 逻辑删除
*
* @param id
* @param id
* @return
* @return
*/
*/
@DeleteMapping
(
"/{id}"
)
@DeleteMapping
(
"/{id}"
)
@ApiOperation
(
value
=
"banner逻辑删除"
,
notes
=
"banner逻辑删除"
)
@ApiOperation
(
value
=
"banner逻辑删除"
,
notes
=
"banner逻辑删除"
)
public
ObjectRestResponse
<
Void
>
deleteBannerById
(
@PathVariable
Integer
id
,
UserDTO
userDTO
)
{
public
ObjectRestResponse
<
Void
>
deleteBannerById
(
@PathVariable
Integer
id
,
UserDTO
userDTO
)
{
int
effectRows
=
bannerBiz
.
updateBannerStatus
(
id
,
1
,
userDTO
);
int
effectRows
=
bannerBiz
.
updateBannerStatus
(
id
,
1
,
userDTO
);
if
(
effectRows
>
0
)
{
if
(
effectRows
>
0
)
{
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
...
@@ -109,11 +114,12 @@ public class BannerAdminController {
...
@@ -109,11 +114,12 @@ public class BannerAdminController {
/**
/**
* 真实删除
* 真实删除
*
* @param id
* @param id
* @return
* @return
*/
*/
@DeleteMapping
(
"/del/{id}"
)
@DeleteMapping
(
"/del/{id}"
)
public
ObjectRestResponse
<
Void
>
deleteReallyBannerById
(
@PathVariable
(
value
=
"id"
)
Integer
id
){
public
ObjectRestResponse
<
Void
>
deleteReallyBannerById
(
@PathVariable
(
value
=
"id"
)
Integer
id
)
{
bannerBiz
.
deleteById
(
id
);
bannerBiz
.
deleteById
(
id
);
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
...
...
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