Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fzm-joying
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
lei
fzm-joying
Commits
eb08e5c7
Commit
eb08e5c7
authored
Jan 28, 2022
by
tangtuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
banner页、委托上架功能开发
parent
2e38b0d7
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
576 additions
and
3 deletions
+576
-3
fzm-joying.iml
fzm-joying.iml
+0
-3
BannerController.java
.../main/java/com/fzm/admin/controller/BannerController.java
+94
-0
EntrustShelfController.java
...java/com/fzm/admin/controller/EntrustShelfController.java
+44
-0
Banner.java
...ng-common/src/main/java/com/fzm/common/entity/Banner.java
+39
-0
EntrustShelf.java
...mon/src/main/java/com/fzm/common/entity/EntrustShelf.java
+53
-0
Nft.java
joying-common/src/main/java/com/fzm/common/entity/Nft.java
+3
-0
BannerMapper.java
...mon/src/main/java/com/fzm/common/mapper/BannerMapper.java
+13
-0
EntrustShelfMapper.java
...c/main/java/com/fzm/common/mapper/EntrustShelfMapper.java
+13
-0
BannerService.java
...n/src/main/java/com/fzm/common/service/BannerService.java
+21
-0
EntrustShelfService.java
...main/java/com/fzm/common/service/EntrustShelfService.java
+49
-0
NftService.java
...mmon/src/main/java/com/fzm/common/service/NftService.java
+8
-0
BannerServiceImpl.java
...n/java/com/fzm/common/service/impl/BannerServiceImpl.java
+26
-0
EntrustShelfServiceImpl.java
.../com/fzm/common/service/impl/EntrustShelfServiceImpl.java
+99
-0
NftServiceImpl.java
...main/java/com/fzm/common/service/impl/NftServiceImpl.java
+10
-0
InsertGroup.java
...ommon/src/main/java/com/fzm/common/valid/InsertGroup.java
+8
-0
UpdateGroup.java
...ommon/src/main/java/com/fzm/common/valid/UpdateGroup.java
+10
-0
BannerController.java
...main/java/com/fzm/portal/controller/BannerController.java
+32
-0
EntrustShelfController.java
...ava/com/fzm/portal/controller/EntrustShelfController.java
+54
-0
No files found.
fzm-joying.iml
deleted
100644 → 0
View file @
2e38b0d7
<?xml version="1.0" encoding="UTF-8"?>
<module
type=
"JAVA_MODULE"
version=
"4"
/>
\ No newline at end of file
joying-admin/src/main/java/com/fzm/admin/controller/BannerController.java
0 → 100644
View file @
eb08e5c7
package
com
.
fzm
.
admin
.
controller
;
import
com.fzm.common.annotation.Authentication
;
import
com.fzm.common.entity.Banner
;
import
com.fzm.common.enums.ResultCode
;
import
com.fzm.common.exception.GlobalException
;
import
com.fzm.common.model.ResponseModel
;
import
com.fzm.common.service.BannerService
;
import
com.fzm.common.utils.ObsUtil
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.util.List
;
/**
* @author tangtuo
* @date 2022/1/11 14:35
*/
@Authentication
@RestController
@RequestMapping
(
"/banner"
)
@Api
(
tags
=
"banner页管理"
)
public
class
BannerController
{
@Resource
private
BannerService
bannerService
;
@Resource
private
ObsUtil
obsUtil
;
@PostMapping
(
"/create"
)
@ApiOperation
(
"新建banner"
)
public
ResponseModel
<
Boolean
>
create
(
MultipartFile
posterFile
,
String
name
,
String
jumpUrl
,
Integer
sort
)
throws
IOException
{
if
(
posterFile
==
null
||
StringUtils
.
isAnyBlank
(
name
,
jumpUrl
)
||
sort
==
null
)
{
throw
GlobalException
.
newException
(
ResultCode
.
VALIDATE_FAILED
);
}
String
url
=
obsUtil
.
putObject
(
posterFile
);
Banner
banner
=
new
Banner
();
banner
.
setName
(
name
);
banner
.
setJumpUrl
(
jumpUrl
);
banner
.
setPoster
(
url
);
banner
.
setSort
(
sort
);
return
ResponseModel
.
success
(
bannerService
.
save
(
banner
));
}
@GetMapping
(
"/page"
)
@ApiOperation
(
"分页查询banner列表"
)
public
ResponseModel
<
PageInfo
<
Banner
>>
page
(
@RequestParam
Integer
pageNum
,
@RequestParam
Integer
pageSize
)
{
PageHelper
.
startPage
(
pageNum
,
pageSize
);
List
<
Banner
>
list
=
bannerService
.
listAll
();
return
ResponseModel
.
success
(
new
PageInfo
<>(
list
));
}
@GetMapping
(
"/detail"
)
@ApiOperation
(
"查询banner详情"
)
public
ResponseModel
<
Banner
>
getDetailById
(
@RequestParam
Integer
id
)
{
return
ResponseModel
.
success
(
bannerService
.
getById
(
id
));
}
@PostMapping
(
"/update"
)
@ApiOperation
(
"修改banner"
)
public
ResponseModel
<
Boolean
>
update
(
MultipartFile
posterFile
,
Integer
id
,
String
name
,
String
jumpUrl
,
Integer
sort
)
throws
IOException
{
if
(
id
==
null
)
{
throw
GlobalException
.
newException
(
ResultCode
.
VALIDATE_FAILED
);
}
Banner
banner
=
new
Banner
();
if
(
posterFile
!=
null
)
{
// 删除原有海报
String
poster
=
bannerService
.
getById
(
id
).
getPoster
();
obsUtil
.
delete
(
poster
);
// 上传新海报
String
posterUrl
=
obsUtil
.
putObject
(
posterFile
);
banner
.
setPoster
(
posterUrl
);
}
banner
.
setName
(
name
);
banner
.
setJumpUrl
(
jumpUrl
);
banner
.
setSort
(
sort
);
banner
.
setId
(
id
);
return
ResponseModel
.
success
(
bannerService
.
updateById
(
banner
));
}
@PostMapping
(
"/delete"
)
@ApiOperation
(
"删除banner"
)
public
ResponseModel
<
Boolean
>
delete
(
@RequestParam
Integer
id
)
{
return
ResponseModel
.
success
(
bannerService
.
removeById
(
id
));
}
}
joying-admin/src/main/java/com/fzm/admin/controller/EntrustShelfController.java
0 → 100644
View file @
eb08e5c7
package
com
.
fzm
.
admin
.
controller
;
import
com.fzm.common.annotation.Authentication
;
import
com.fzm.common.entity.EntrustShelf
;
import
com.fzm.common.model.ResponseModel
;
import
com.fzm.common.service.EntrustShelfService
;
import
com.github.pagehelper.PageInfo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
/**
* @author tangtuo
* @date 2022/1/11 17:19
*/
@Authentication
@RestController
@RequestMapping
(
"/entrust/shelf"
)
@Api
(
tags
=
"委托上架"
)
public
class
EntrustShelfController
{
@Resource
private
EntrustShelfService
entrustShelfService
;
@GetMapping
(
"/page"
)
@ApiOperation
(
value
=
"分页查询"
)
public
ResponseModel
<
PageInfo
<
EntrustShelf
>>
page
(
@ApiParam
(
value
=
"页码"
,
required
=
true
)
@RequestParam
Integer
pageNum
,
@ApiParam
(
value
=
"每页记录数"
,
required
=
true
)
@RequestParam
Integer
pageSize
,
@ApiParam
(
value
=
"手机号"
)
@RequestParam
(
required
=
false
)
String
telephone
,
@ApiParam
(
value
=
"用户姓名"
)
@RequestParam
(
required
=
false
)
String
name
,
@ApiParam
(
value
=
"审核开始日期 yyyy-MM-dd"
)
@RequestParam
(
required
=
false
)
String
from
,
@ApiParam
(
value
=
"审核截止日期 yyyy-MM-dd"
)
@RequestParam
(
required
=
false
)
String
to
)
{
PageInfo
<
EntrustShelf
>
pageInfo
=
entrustShelfService
.
getPages
(
pageNum
,
pageSize
,
telephone
,
name
,
from
,
to
);
return
ResponseModel
.
success
(
pageInfo
);
}
}
joying-common/src/main/java/com/fzm/common/entity/Banner.java
0 → 100644
View file @
eb08e5c7
package
com
.
fzm
.
common
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @author tangtuo
* @date 2022/1/11 14:22
*/
@Data
@TableName
(
value
=
"tb_banner"
)
public
class
Banner
{
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
@ApiModelProperty
(
"banner名称"
)
private
String
name
;
@ApiModelProperty
(
"详情信息"
)
private
String
jumpUrl
;
@ApiModelProperty
(
"海报地址"
)
private
String
poster
;
@ApiModelProperty
(
"排序"
)
private
Integer
sort
;
@ApiModelProperty
(
"创建时间"
)
private
Date
createDate
;
@ApiModelProperty
(
"修改时间"
)
private
Date
updateDate
;
}
joying-common/src/main/java/com/fzm/common/entity/EntrustShelf.java
0 → 100644
View file @
eb08e5c7
package
com
.
fzm
.
common
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fzm.common.valid.InsertGroup
;
import
com.fzm.common.valid.UpdateGroup
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
/**
* @author tangtuo
* @date 2022/1/11 17:05
*/
@Data
@TableName
(
"tb_entrust_shelf"
)
public
class
EntrustShelf
{
@NotNull
(
message
=
"id不能为空"
,
groups
=
UpdateGroup
.
class
)
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
@ApiModelProperty
(
"用户id"
)
private
Integer
userId
;
@NotBlank
(
message
=
"nft哈希不能为空"
,
groups
=
InsertGroup
.
class
)
@ApiModelProperty
(
"nft哈希"
)
private
String
nftHash
;
@NotBlank
(
message
=
"姓名不能为空"
,
groups
=
InsertGroup
.
class
)
@ApiModelProperty
(
"姓名"
)
private
String
name
;
@NotBlank
(
message
=
"电话号码不能为空"
,
groups
=
InsertGroup
.
class
)
@ApiModelProperty
(
"电话号码"
)
private
String
telephone
;
@NotBlank
(
message
=
"微信号不能为空"
,
groups
=
InsertGroup
.
class
)
@ApiModelProperty
(
"微信号"
)
private
String
wechatNum
;
@ApiModelProperty
(
"0-委托中 1-已取消"
)
private
Integer
status
;
private
Date
createDate
;
private
Date
updateDate
;
}
joying-common/src/main/java/com/fzm/common/entity/Nft.java
View file @
eb08e5c7
...
@@ -90,6 +90,9 @@ public class Nft extends BaseEntity {
...
@@ -90,6 +90,9 @@ public class Nft extends BaseEntity {
@ApiModelProperty
(
"0-下架 1-上架"
)
@ApiModelProperty
(
"0-下架 1-上架"
)
private
Integer
status
;
private
Integer
status
;
@ApiModelProperty
(
"是否已委托上架 0-否 1-是"
)
private
Integer
isEntrust
;
@ApiModelProperty
(
"是否是纪念版nft 0-否 1-是"
)
@ApiModelProperty
(
"是否是纪念版nft 0-否 1-是"
)
private
Integer
isCommemorate
;
private
Integer
isCommemorate
;
...
...
joying-common/src/main/java/com/fzm/common/mapper/BannerMapper.java
0 → 100644
View file @
eb08e5c7
package
com
.
fzm
.
common
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.fzm.common.entity.Banner
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* @author tangtuo
* @date 2021/7/1 14:35
*/
@Mapper
public
interface
BannerMapper
extends
BaseMapper
<
Banner
>
{
}
joying-common/src/main/java/com/fzm/common/mapper/EntrustShelfMapper.java
0 → 100644
View file @
eb08e5c7
package
com
.
fzm
.
common
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.fzm.common.entity.EntrustShelf
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* @author tangtuo
* @date 2021/6/28 11:25
*/
@Mapper
public
interface
EntrustShelfMapper
extends
BaseMapper
<
EntrustShelf
>
{
}
joying-common/src/main/java/com/fzm/common/service/BannerService.java
0 → 100644
View file @
eb08e5c7
package
com
.
fzm
.
common
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.fzm.common.entity.Banner
;
import
java.util.List
;
/**
* @author tangtuo
* @date 2021/7/5 15:08
*/
public
interface
BannerService
extends
IService
<
Banner
>
{
/**
* 查询banner列表
*
* @return
*/
List
<
Banner
>
listAll
();
}
joying-common/src/main/java/com/fzm/common/service/EntrustShelfService.java
0 → 100644
View file @
eb08e5c7
package
com
.
fzm
.
common
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.fzm.common.entity.EntrustShelf
;
import
com.github.pagehelper.PageInfo
;
/**
* @author tangtuo
* @date 2021/6/28 11:28
*/
public
interface
EntrustShelfService
extends
IService
<
EntrustShelf
>
{
/**
* 提交委托上架申请
*
* @param entrustShelf
* @return
*/
Boolean
submit
(
EntrustShelf
entrustShelf
);
/**
* 取消委托上架申请
*
* @param id
* @return
*/
Boolean
cancel
(
Integer
id
);
/**
* 分页查询
*
* @param pageNum
* @param pageSize
* @param telephone
* @param name
* @param from
* @param to
* @return
*/
PageInfo
<
EntrustShelf
>
getPages
(
Integer
pageNum
,
Integer
pageSize
,
String
telephone
,
String
name
,
String
from
,
String
to
);
/**
* 根据nft哈希查询详情
*
* @param nftHash
* @return
*/
EntrustShelf
getByNftHash
(
String
nftHash
);
}
joying-common/src/main/java/com/fzm/common/service/NftService.java
View file @
eb08e5c7
...
@@ -169,4 +169,12 @@ public interface NftService extends IService<Nft> {
...
@@ -169,4 +169,12 @@ public interface NftService extends IService<Nft> {
* @return
* @return
*/
*/
NftVo
getDetail
(
String
nftHash
)
throws
ExecutionException
,
InterruptedException
;
NftVo
getDetail
(
String
nftHash
)
throws
ExecutionException
,
InterruptedException
;
/**
* 修改当前nfthash的是否已委托的状态
*
* @param nftHash
* @param isEntrust
*/
void
updateEntrust
(
String
nftHash
,
Integer
isEntrust
);
}
}
joying-common/src/main/java/com/fzm/common/service/impl/BannerServiceImpl.java
0 → 100644
View file @
eb08e5c7
package
com
.
fzm
.
common
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.fzm.common.entity.Banner
;
import
com.fzm.common.mapper.BannerMapper
;
import
com.fzm.common.service.BannerService
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @author tangtuo
* @date 2021/7/5 15:09
*/
@Service
public
class
BannerServiceImpl
extends
ServiceImpl
<
BannerMapper
,
Banner
>
implements
BannerService
{
@Override
public
List
<
Banner
>
listAll
()
{
QueryWrapper
<
Banner
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
orderByDesc
(
"sort"
);
return
list
(
wrapper
);
}
}
joying-common/src/main/java/com/fzm/common/service/impl/EntrustShelfServiceImpl.java
0 → 100644
View file @
eb08e5c7
package
com
.
fzm
.
common
.
service
.
impl
;
import
cn.hutool.core.date.DateUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.fzm.common.constant.SystemConstant
;
import
com.fzm.common.entity.EntrustShelf
;
import
com.fzm.common.enums.ResultCode
;
import
com.fzm.common.exception.GlobalException
;
import
com.fzm.common.mapper.EntrustShelfMapper
;
import
com.fzm.common.service.EntrustShelfService
;
import
com.fzm.common.service.NftService
;
import
com.fzm.common.utils.JwtUtil
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @author tangtuo
* @date 2021/7/5 15:09
*/
@Service
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
class
EntrustShelfServiceImpl
extends
ServiceImpl
<
EntrustShelfMapper
,
EntrustShelf
>
implements
EntrustShelfService
{
@Resource
private
HttpServletRequest
request
;
@Resource
private
NftService
nftService
;
@Override
public
Boolean
submit
(
EntrustShelf
entrustShelf
)
{
// 查询当前nft是否已提交过申请
QueryWrapper
<
EntrustShelf
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"nft_hash"
,
entrustShelf
.
getNftHash
());
queryWrapper
.
eq
(
"status"
,
SystemConstant
.
BOOLEAN_DATA_FALSE
);
if
(
this
.
count
(
queryWrapper
)
>
0
)
{
throw
GlobalException
.
newException
(
ResultCode
.
FAILED
,
"此nft已提交过上架申请,请勿重复提交"
);
}
// 修改当前nft的是否已申请的状态为是
nftService
.
updateEntrust
(
entrustShelf
.
getNftHash
(),
SystemConstant
.
BOOLEAN_DATA_TRUE
);
String
authorization
=
request
.
getHeader
(
"Authorization"
);
Integer
userId
=
JwtUtil
.
getUserIdFromToken
(
authorization
);
entrustShelf
.
setUserId
(
userId
);
return
this
.
save
(
entrustShelf
);
}
@Override
public
Boolean
cancel
(
Integer
id
)
{
EntrustShelf
entrustShelf
=
this
.
getById
(
id
);
if
(
entrustShelf
==
null
)
{
throw
GlobalException
.
newException
(
ResultCode
.
SELECT_FAILED
);
}
// 已取消
if
(
entrustShelf
.
getStatus
().
equals
(
SystemConstant
.
BOOLEAN_DATA_TRUE
))
{
throw
GlobalException
.
newException
(
ResultCode
.
FAILED
,
"当前申请已取消"
);
}
// 修改当前nft的是否已申请的状态为否
nftService
.
updateEntrust
(
entrustShelf
.
getNftHash
(),
SystemConstant
.
BOOLEAN_DATA_FALSE
);
entrustShelf
.
setStatus
(
SystemConstant
.
BOOLEAN_DATA_TRUE
);
return
this
.
updateById
(
entrustShelf
);
}
@Override
public
PageInfo
<
EntrustShelf
>
getPages
(
Integer
pageNum
,
Integer
pageSize
,
String
telephone
,
String
name
,
String
from
,
String
to
)
{
PageHelper
.
startPage
(
pageNum
,
pageSize
);
QueryWrapper
<
EntrustShelf
>
queryWrapper
=
new
QueryWrapper
<>();
if
(
StringUtils
.
isNotBlank
(
name
))
{
queryWrapper
.
eq
(
"name"
,
name
);
}
if
(
StringUtils
.
isNotBlank
(
telephone
))
{
queryWrapper
.
eq
(
"telephone"
,
telephone
);
}
if
(
StringUtils
.
isNotBlank
(
from
))
{
queryWrapper
.
ge
(
"create_date"
,
DateUtil
.
parse
(
from
+
" 00:00:00"
,
"yyyy-MM-dd HH:mm:ss"
));
}
if
(
StringUtils
.
isNotBlank
(
to
))
{
queryWrapper
.
le
(
"create_date"
,
DateUtil
.
parse
(
to
+
" 23:59:59"
,
"yyyy-MM-dd HH:mm:ss"
));
}
return
new
PageInfo
<>(
this
.
list
(
queryWrapper
));
}
@Override
public
EntrustShelf
getByNftHash
(
String
nftHash
)
{
QueryWrapper
<
EntrustShelf
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"nft_hash"
,
nftHash
);
queryWrapper
.
eq
(
"status"
,
SystemConstant
.
BOOLEAN_DATA_FALSE
);
return
this
.
getOne
(
queryWrapper
);
}
}
joying-common/src/main/java/com/fzm/common/service/impl/NftServiceImpl.java
View file @
eb08e5c7
...
@@ -420,4 +420,14 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
...
@@ -420,4 +420,14 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
return
stringBuilder
.
deleteCharAt
(
stringBuilder
.
length
()
-
1
).
toString
();
return
stringBuilder
.
deleteCharAt
(
stringBuilder
.
length
()
-
1
).
toString
();
}
}
@Override
public
void
updateEntrust
(
String
nftHash
,
Integer
isEntrust
)
{
Nft
nft
=
new
Nft
();
nft
.
setIsEntrust
(
isEntrust
);
QueryWrapper
<
Nft
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"nft_hash"
,
nftHash
);
this
.
update
(
nft
,
wrapper
);
}
}
}
joying-common/src/main/java/com/fzm/common/valid/InsertGroup.java
0 → 100644
View file @
eb08e5c7
package
com
.
fzm
.
common
.
valid
;
/**
* @author tangtuo
* @date 2022/1/17 14:44
*/
public
interface
InsertGroup
{
}
joying-common/src/main/java/com/fzm/common/valid/UpdateGroup.java
0 → 100644
View file @
eb08e5c7
package
com
.
fzm
.
common
.
valid
;
import
javax.validation.Payload
;
/**
* @author tangtuo
* @date 2021/11/29 16:13
*/
public
interface
UpdateGroup
extends
Payload
{
}
joying-portal/src/main/java/com/fzm/portal/controller/BannerController.java
0 → 100644
View file @
eb08e5c7
package
com
.
fzm
.
portal
.
controller
;
import
com.fzm.common.entity.Banner
;
import
com.fzm.common.model.ResponseModel
;
import
com.fzm.common.service.BannerService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* @author tangtuo
* @date 2022/1/11 15:08
*/
@RestController
@RequestMapping
(
"/banner"
)
@Api
(
tags
=
"banner页管理"
)
public
class
BannerController
{
@Resource
private
BannerService
bannerService
;
@GetMapping
(
"/list"
)
@ApiOperation
(
value
=
"查询banner页列表"
)
public
ResponseModel
<
List
<
Banner
>>
list
()
{
return
ResponseModel
.
success
(
bannerService
.
listAll
());
}
}
joying-portal/src/main/java/com/fzm/portal/controller/EntrustShelfController.java
0 → 100644
View file @
eb08e5c7
package
com
.
fzm
.
portal
.
controller
;
import
com.fzm.common.annotation.Authentication
;
import
com.fzm.common.entity.EntrustShelf
;
import
com.fzm.common.model.ResponseModel
;
import
com.fzm.common.service.EntrustShelfService
;
import
com.fzm.common.valid.InsertGroup
;
import
com.fzm.common.valid.UpdateGroup
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
/**
* @author tangtuo
* @date 2022/1/11 17:19
*/
@Authentication
@RestController
@RequestMapping
(
"/entrust/shelf"
)
@Api
(
tags
=
"委托上架"
)
public
class
EntrustShelfController
{
@Resource
private
EntrustShelfService
entrustShelfService
;
@PostMapping
(
"/submit"
)
@ApiOperation
(
value
=
"提交委托上架申请"
)
public
ResponseModel
<
Boolean
>
submit
(
@RequestBody
@Validated
(
value
=
InsertGroup
.
class
)
EntrustShelf
entrustShelf
)
{
return
ResponseModel
.
success
(
entrustShelfService
.
submit
(
entrustShelf
));
}
@GetMapping
(
"/detail/{nftHash}"
)
@ApiOperation
(
value
=
"根据nftHash查询委托详情"
)
public
ResponseModel
<
EntrustShelf
>
getById
(
@PathVariable
String
nftHash
)
{
return
ResponseModel
.
success
(
entrustShelfService
.
getByNftHash
(
nftHash
));
}
@PostMapping
(
"/update"
)
@ApiOperation
(
value
=
"修改委托上架信息"
)
public
ResponseModel
<
Boolean
>
updateById
(
@RequestBody
@Validated
(
value
=
UpdateGroup
.
class
)
EntrustShelf
entrustShelf
)
{
return
ResponseModel
.
success
(
entrustShelfService
.
updateById
(
entrustShelf
));
}
@PostMapping
(
"/cancel"
)
@ApiOperation
(
"取消委托申请"
)
public
ResponseModel
<
Boolean
>
cancel
(
@RequestParam
Integer
id
)
{
return
ResponseModel
.
success
(
entrustShelfService
.
cancel
(
id
));
}
}
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