Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
roo-cloud
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
万敏
roo-cloud
Commits
d0d54c84
Commit
d0d54c84
authored
Jul 24, 2021
by
wanmin@bu2.cn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
币种详情
parent
851b52d5
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
348 additions
and
0 deletions
+348
-0
roo-admin/roo-admin-client/src/main/java/com/roo/dto/TokenResourceDTO.java
...in-client/src/main/java/com/roo/dto/TokenResourceDTO.java
+46
-0
roo-admin/roo-admin-server/src/main/java/com/roo/controller/TokenResourceController.java
...main/java/com/roo/controller/TokenResourceController.java
+116
-0
roo-admin/roo-admin-server/src/main/java/com/roo/dao/TokenResourceDao.java
...in-server/src/main/java/com/roo/dao/TokenResourceDao.java
+16
-0
roo-admin/roo-admin-server/src/main/java/com/roo/entity/TokenResourceEntity.java
...ver/src/main/java/com/roo/entity/TokenResourceEntity.java
+63
-0
roo-admin/roo-admin-server/src/main/java/com/roo/excel/TokenResourceExcel.java
...erver/src/main/java/com/roo/excel/TokenResourceExcel.java
+41
-0
roo-admin/roo-admin-server/src/main/java/com/roo/service/TokenResourceService.java
...r/src/main/java/com/roo/service/TokenResourceService.java
+15
-0
roo-admin/roo-admin-server/src/main/java/com/roo/service/impl/TokenResourceServiceImpl.java
...n/java/com/roo/service/impl/TokenResourceServiceImpl.java
+32
-0
roo-admin/roo-admin-server/src/main/resources/mapper/TokenResourceDao.xml
...min-server/src/main/resources/mapper/TokenResourceDao.xml
+19
-0
No files found.
roo-admin/roo-admin-client/src/main/java/com/roo/dto/TokenResourceDTO.java
0 → 100644
View file @
d0d54c84
package
com.roo.dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.roo.commons.tools.utils.DateUtils
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 代币详情
*
* @author momin 460363410@qq.com
* @since 1.0 2021-07-24
*/
@Data
@ApiModel
(
value
=
"代币详情"
)
public
class
TokenResourceDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"block_chain_code"
)
private
String
chainCode
;
@ApiModelProperty
(
value
=
"符号"
)
private
String
symbol
;
@ApiModelProperty
(
value
=
"合约地址"
)
private
String
contractId
;
@ApiModelProperty
(
value
=
"资源:JSON"
)
private
Object
resource
;
@ApiModelProperty
(
value
=
"详情"
)
private
String
detail
;
@ApiModelProperty
(
value
=
"发行量"
)
private
Long
totalSupply
;
@ApiModelProperty
(
value
=
"是否限制供应"
)
private
Boolean
isUpper
;
@JsonFormat
(
pattern
=
DateUtils
.
DATE_TIME_PATTERN
)
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createDate
;
@JsonFormat
(
pattern
=
DateUtils
.
DATE_TIME_PATTERN
)
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
updateDate
;
}
roo-admin/roo-admin-server/src/main/java/com/roo/controller/TokenResourceController.java
0 → 100644
View file @
d0d54c84
package
com.roo.controller
;
import
com.roo.commons.log.annotation.LogOperation
;
import
com.roo.commons.tools.constant.Constant
;
import
com.roo.commons.tools.page.PageData
;
import
com.roo.commons.tools.utils.Result
;
import
com.roo.commons.tools.utils.ExcelUtils
;
import
com.roo.commons.tools.validator.AssertUtils
;
import
com.roo.commons.tools.validator.ValidatorUtils
;
import
com.roo.commons.tools.validator.group.AddGroup
;
import
com.roo.commons.tools.validator.group.DefaultGroup
;
import
com.roo.commons.tools.validator.group.UpdateGroup
;
import
com.roo.dto.TokenResourceDTO
;
import
com.roo.excel.TokenResourceExcel
;
import
com.roo.service.TokenResourceService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
import
java.util.Map
;
/**
* 代币详情
*
* @author momin 460363410@qq.com
* @since 1.0 2021-07-24
*/
@RestController
@RequestMapping
(
"tokenresource"
)
@Api
(
tags
=
"代币详情"
)
public
class
TokenResourceController
{
@Autowired
private
TokenResourceService
tokenResourceService
;
@GetMapping
(
"page"
)
@ApiOperation
(
"分页"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
Constant
.
PAGE
,
value
=
"当前页码,从1开始"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)
,
@ApiImplicitParam
(
name
=
Constant
.
LIMIT
,
value
=
"每页显示记录数"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)
,
@ApiImplicitParam
(
name
=
Constant
.
ORDER_FIELD
,
value
=
"排序字段"
,
paramType
=
"query"
,
dataType
=
"String"
)
,
@ApiImplicitParam
(
name
=
Constant
.
ORDER
,
value
=
"排序方式,可选值(asc、desc)"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@PreAuthorize
(
"hasAuthority('tokenresource:tokenresource:page')"
)
public
Result
<
PageData
<
TokenResourceDTO
>>
page
(
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
){
PageData
<
TokenResourceDTO
>
page
=
tokenResourceService
.
page
(
params
);
return
new
Result
<
PageData
<
TokenResourceDTO
>>().
ok
(
page
);
}
@GetMapping
(
"{id}"
)
@ApiOperation
(
"信息"
)
@PreAuthorize
(
"hasAuthority('tokenresource:tokenresource:info')"
)
public
Result
<
TokenResourceDTO
>
get
(
@PathVariable
(
"id"
)
Long
id
){
TokenResourceDTO
data
=
tokenResourceService
.
get
(
id
);
return
new
Result
<
TokenResourceDTO
>().
ok
(
data
);
}
@PostMapping
@ApiOperation
(
"保存"
)
@LogOperation
(
"保存"
)
@PreAuthorize
(
"hasAuthority('tokenresource:tokenresource:save')"
)
public
Result
save
(
@RequestBody
TokenResourceDTO
dto
){
//效验数据
ValidatorUtils
.
validateEntity
(
dto
,
AddGroup
.
class
,
DefaultGroup
.
class
);
tokenResourceService
.
save
(
dto
);
return
new
Result
();
}
@PutMapping
@ApiOperation
(
"修改"
)
@LogOperation
(
"修改"
)
@PreAuthorize
(
"hasAuthority('tokenresource:tokenresource:update')"
)
public
Result
update
(
@RequestBody
TokenResourceDTO
dto
){
//效验数据
ValidatorUtils
.
validateEntity
(
dto
,
UpdateGroup
.
class
,
DefaultGroup
.
class
);
tokenResourceService
.
update
(
dto
);
return
new
Result
();
}
@DeleteMapping
@ApiOperation
(
"删除"
)
@LogOperation
(
"删除"
)
@PreAuthorize
(
"hasAuthority('tokenresource:tokenresource:delete')"
)
public
Result
delete
(
@RequestBody
Long
[]
ids
){
//效验数据
AssertUtils
.
isArrayEmpty
(
ids
,
"id"
);
tokenResourceService
.
delete
(
ids
);
return
new
Result
();
}
@GetMapping
(
"export"
)
@ApiOperation
(
"导出"
)
@LogOperation
(
"导出"
)
@PreAuthorize
(
"hasAuthority('tokenresource:tokenresource:export')"
)
public
void
export
(
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
,
HttpServletResponse
response
)
throws
Exception
{
List
<
TokenResourceDTO
>
list
=
tokenResourceService
.
list
(
params
);
ExcelUtils
.
exportExcelToTarget
(
response
,
null
,
"代币详情"
,
list
,
TokenResourceExcel
.
class
);
}
}
roo-admin/roo-admin-server/src/main/java/com/roo/dao/TokenResourceDao.java
0 → 100644
View file @
d0d54c84
package
com.roo.dao
;
import
com.roo.commons.mybatis.dao.BaseDao
;
import
com.roo.entity.TokenResourceEntity
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* 代币详情
*
* @author momin 460363410@qq.com
* @since 1.0 2021-07-24
*/
@Mapper
public
interface
TokenResourceDao
extends
BaseDao
<
TokenResourceEntity
>
{
}
\ No newline at end of file
roo-admin/roo-admin-server/src/main/java/com/roo/entity/TokenResourceEntity.java
0 → 100644
View file @
d0d54c84
package
com.roo.entity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
com.baomidou.mybatisplus.annotation.*
;
import
java.util.Date
;
/**
* 代币详情
*
* @author momin 460363410@qq.com
* @since 1.0 2021-07-24
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"roo_wallet.t_token_resource"
)
public
class
TokenResourceEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键
*/
@TableId
private
Long
id
;
/**
* block_chain_code
*/
private
String
chainCode
;
/**
* 符号
*/
private
String
symbol
;
/**
* 合约地址
*/
private
String
contractId
;
/**
* 资源:JSON
*/
private
Object
resource
;
/**
* 详情
*/
private
String
detail
;
/**
* 发行量
*/
private
Long
totalSupply
;
/**
* 是否限制供应
*/
private
Boolean
isUpper
;
/**
* 创建时间
*/
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Date
createDate
;
/**
* 更新时间
*/
@TableField
(
fill
=
FieldFill
.
INSERT_UPDATE
)
private
Date
updateDate
;
}
roo-admin/roo-admin-server/src/main/java/com/roo/excel/TokenResourceExcel.java
0 → 100644
View file @
d0d54c84
package
com.roo.excel
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.write.style.ColumnWidth
;
import
com.alibaba.excel.annotation.write.style.ContentRowHeight
;
import
com.alibaba.excel.annotation.write.style.HeadRowHeight
;
import
lombok.Data
;
import
java.util.Date
;
/**
* 代币详情
*
* @author momin 460363410@qq.com
* @since 1.0 2021-07-24
*/
@Data
@ContentRowHeight
(
20
)
@HeadRowHeight
(
20
)
@ColumnWidth
(
25
)
public
class
TokenResourceExcel
{
@ExcelProperty
(
value
=
"主键"
,
index
=
0
)
private
Long
id
;
@ExcelProperty
(
value
=
"block_chain_code"
,
index
=
1
)
private
String
chainCode
;
@ExcelProperty
(
value
=
"符号"
,
index
=
2
)
private
String
symbol
;
@ExcelProperty
(
value
=
"合约地址"
,
index
=
3
)
private
String
contractId
;
@ExcelProperty
(
value
=
"资源:JSON"
,
index
=
4
)
private
Object
resource
;
@ExcelProperty
(
value
=
"详情"
,
index
=
5
)
private
String
detail
;
@ExcelProperty
(
value
=
"发行量"
,
index
=
6
)
private
Long
totalSupply
;
@ExcelProperty
(
value
=
"是否限制供应"
,
index
=
7
)
private
Boolean
isUpper
;
@ExcelProperty
(
value
=
"创建时间"
,
index
=
8
)
private
Date
createDate
;
@ExcelProperty
(
value
=
"更新时间"
,
index
=
9
)
private
Date
updateDate
;
}
\ No newline at end of file
roo-admin/roo-admin-server/src/main/java/com/roo/service/TokenResourceService.java
0 → 100644
View file @
d0d54c84
package
com.roo.service
;
import
com.roo.commons.mybatis.service.CrudService
;
import
com.roo.dto.TokenResourceDTO
;
import
com.roo.entity.TokenResourceEntity
;
/**
* 代币详情
*
* @author momin 460363410@qq.com
* @since 1.0 2021-07-24
*/
public
interface
TokenResourceService
extends
CrudService
<
TokenResourceEntity
,
TokenResourceDTO
>
{
}
\ No newline at end of file
roo-admin/roo-admin-server/src/main/java/com/roo/service/impl/TokenResourceServiceImpl.java
0 → 100644
View file @
d0d54c84
package
com.roo.service.impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.roo.commons.mybatis.service.impl.CrudServiceImpl
;
import
com.roo.dao.TokenResourceDao
;
import
com.roo.dto.TokenResourceDTO
;
import
com.roo.entity.TokenResourceEntity
;
import
com.roo.service.TokenResourceService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
/**
* 代币详情
*
* @author momin 460363410@qq.com
* @since 1.0 2021-07-24
*/
@Service
public
class
TokenResourceServiceImpl
extends
CrudServiceImpl
<
TokenResourceDao
,
TokenResourceEntity
,
TokenResourceDTO
>
implements
TokenResourceService
{
@Override
public
QueryWrapper
<
TokenResourceEntity
>
getWrapper
(
Map
<
String
,
Object
>
params
){
QueryWrapper
<
TokenResourceEntity
>
wrapper
=
new
QueryWrapper
<>();
return
wrapper
;
}
}
\ No newline at end of file
roo-admin/roo-admin-server/src/main/resources/mapper/TokenResourceDao.xml
0 → 100644
View file @
d0d54c84
<?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=
"com.roo.dao.TokenResourceDao"
>
<resultMap
type=
"com.roo.entity.TokenResourceEntity"
id=
"tokenResourceMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"chainCode"
column=
"chain_code"
/>
<result
property=
"symbol"
column=
"symbol"
/>
<result
property=
"contractId"
column=
"contract_id"
/>
<result
property=
"resource"
column=
"resource"
/>
<result
property=
"detail"
column=
"detail"
/>
<result
property=
"totalSupply"
column=
"total_supply"
/>
<result
property=
"isUpper"
column=
"is_upper"
/>
<result
property=
"createDate"
column=
"create_date"
/>
<result
property=
"updateDate"
column=
"update_date"
/>
</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