Commit 1876a84b authored by 官佳财's avatar 官佳财

新增袋鼠运营后台各个菜单分页查询条件

parent 2e848b5d
......@@ -28,14 +28,14 @@ import java.util.Map;
/**
* app版本号
*
* @author momin 460363410@qq.com
* @since 1.0 2021-07-02
*/
* app版本号
*
* @author momin 460363410@qq.com
* @since 1.0 2021-07-02
*/
@RestController
@RequestMapping("apprevision")
@Api(tags="app版本号")
@Api(tags = "app版本号")
public class AppRevisionController {
@Autowired
private AppRevisionService appRevisionService;
......@@ -43,13 +43,15 @@ public class AppRevisionController {
@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")
@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"),
@ApiImplicitParam(name = "platform", value = "平台(android/ios)", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "version", value = "版本号", paramType = "query", dataType = "String")
})
@PreAuthorize("hasAuthority('roowallet:apprevision:page')")
public Result<PageData<AppRevisionDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
public Result<PageData<AppRevisionDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
PageData<AppRevisionDTO> page = appRevisionService.page(params);
return new Result<PageData<AppRevisionDTO>>().ok(page);
......@@ -58,7 +60,7 @@ public class AppRevisionController {
@GetMapping("{id}")
@ApiOperation("信息")
@PreAuthorize("hasAuthority('roowallet:apprevision:info')")
public Result<AppRevisionDTO> get(@PathVariable("id") Long id){
public Result<AppRevisionDTO> get(@PathVariable("id") Long id) {
AppRevisionDTO data = appRevisionService.get(id);
return new Result<AppRevisionDTO>().ok(data);
......@@ -68,7 +70,7 @@ public class AppRevisionController {
@ApiOperation("保存")
@LogOperation("保存")
@PreAuthorize("hasAuthority('roowallet:apprevision:save')")
public Result save(@RequestBody AppRevisionDTO dto){
public Result save(@RequestBody AppRevisionDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
......@@ -81,7 +83,7 @@ public class AppRevisionController {
@ApiOperation("修改")
@LogOperation("修改")
@PreAuthorize("hasAuthority('roowallet:apprevision:update')")
public Result update(@RequestBody AppRevisionDTO dto){
public Result update(@RequestBody AppRevisionDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
......@@ -94,7 +96,7 @@ public class AppRevisionController {
@ApiOperation("删除")
@LogOperation("删除")
@PreAuthorize("hasAuthority('roowallet:apprevision:delete')")
public Result delete(@RequestBody Long[] ids){
public Result delete(@RequestBody Long[] ids) {
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
......
......@@ -46,7 +46,9 @@ public class BlockChainController {
@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")
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "code", value = "主链标识,如:BSC", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "isEnabled", value = "是否启用", paramType = "query", dataType="Boolean")
})
@PreAuthorize("hasAuthority('roowallet:blockchain:page')")
public Result<PageData<BlockChainDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
......
......@@ -28,14 +28,14 @@ import java.util.Map;
/**
* RPC节点配置
*
* @author momin 460363410@qq.com
* @since 1.0 2021-07-02
*/
* RPC节点配置
*
* @author momin 460363410@qq.com
* @since 1.0 2021-07-02
*/
@RestController
@RequestMapping("chainnodes")
@Api(tags="RPC节点配置")
@Api(tags = "RPC节点配置")
public class ChainNodesController {
@Autowired
private ChainNodesService chainNodesService;
......@@ -43,13 +43,16 @@ public class ChainNodesController {
@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")
@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"),
@ApiImplicitParam(name = "chainCode", value = "block_chain_code,主链符号,如:BSC", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "network", value = "网络标识(MAIN=主网,TEST=测试网)", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "isEnabled", value = "是否启用", paramType = "query", dataType = "Boolean")
})
@PreAuthorize("hasAuthority('chainnodes:chainnodes:page')")
public Result<PageData<ChainNodesDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
public Result<PageData<ChainNodesDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
PageData<ChainNodesDTO> page = chainNodesService.page(params);
return new Result<PageData<ChainNodesDTO>>().ok(page);
......@@ -58,7 +61,7 @@ public class ChainNodesController {
@GetMapping("{id}")
@ApiOperation("信息")
@PreAuthorize("hasAuthority('chainnodes:chainnodes:info')")
public Result<ChainNodesDTO> get(@PathVariable("id") Long id){
public Result<ChainNodesDTO> get(@PathVariable("id") Long id) {
ChainNodesDTO data = chainNodesService.get(id);
return new Result<ChainNodesDTO>().ok(data);
......@@ -68,7 +71,7 @@ public class ChainNodesController {
@ApiOperation("保存")
@LogOperation("保存")
@PreAuthorize("hasAuthority('chainnodes:chainnodes:save')")
public Result save(@RequestBody ChainNodesDTO dto){
public Result save(@RequestBody ChainNodesDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
......@@ -81,7 +84,7 @@ public class ChainNodesController {
@ApiOperation("修改")
@LogOperation("修改")
@PreAuthorize("hasAuthority('chainnodes:chainnodes:update')")
public Result update(@RequestBody ChainNodesDTO dto){
public Result update(@RequestBody ChainNodesDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
......@@ -94,7 +97,7 @@ public class ChainNodesController {
@ApiOperation("删除")
@LogOperation("删除")
@PreAuthorize("hasAuthority('chainnodes:chainnodes:delete')")
public Result delete(@RequestBody Long[] ids){
public Result delete(@RequestBody Long[] ids) {
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
......
......@@ -28,14 +28,14 @@ import java.util.Map;
/**
* dapp管理
*
* @author momin 460363410@qq.com
* @since 1.0 2021-07-02
*/
* dapp管理
*
* @author momin 460363410@qq.com
* @since 1.0 2021-07-02
*/
@RestController
@RequestMapping("dapps")
@Api(tags="dapp管理")
@Api(tags = "dapp管理")
public class DappsController {
@Autowired
private DappsService dappsService;
......@@ -43,13 +43,18 @@ public class DappsController {
@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")
@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"),
@ApiImplicitParam(name = "name", value = "名称,如:paraswap", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "type", value = "类型", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "hots", value = "是否热门(1:热门 0:非热门)", paramType = "query", dataType = "Boolean"),
@ApiImplicitParam(name = "chain", value = "dapp所属链", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "display", value = "是否显示(show、hide)", paramType = "query", dataType = "String")
})
@PreAuthorize("hasAuthority('dapps:dapps:page')")
public Result<PageData<DappsDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
public Result<PageData<DappsDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
PageData<DappsDTO> page = dappsService.page(params);
return new Result<PageData<DappsDTO>>().ok(page);
......@@ -58,7 +63,7 @@ public class DappsController {
@GetMapping("{id}")
@ApiOperation("信息")
@PreAuthorize("hasAuthority('dapps:dapps:info')")
public Result<DappsDTO> get(@PathVariable("id") Long id){
public Result<DappsDTO> get(@PathVariable("id") Long id) {
DappsDTO data = dappsService.get(id);
return new Result<DappsDTO>().ok(data);
......@@ -68,7 +73,7 @@ public class DappsController {
@ApiOperation("保存")
@LogOperation("保存")
@PreAuthorize("hasAuthority('dapps:dapps:save')")
public Result save(@RequestBody DappsDTO dto){
public Result save(@RequestBody DappsDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
......@@ -81,7 +86,7 @@ public class DappsController {
@ApiOperation("修改")
@LogOperation("修改")
@PreAuthorize("hasAuthority('dapps:dapps:update')")
public Result update(@RequestBody DappsDTO dto){
public Result update(@RequestBody DappsDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
......@@ -94,7 +99,7 @@ public class DappsController {
@ApiOperation("删除")
@LogOperation("删除")
@PreAuthorize("hasAuthority('dapps:dapps:delete')")
public Result delete(@RequestBody Long[] ids){
public Result delete(@RequestBody Long[] ids) {
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
......
......@@ -46,7 +46,10 @@ public class MarketController {
@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")
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "symbol", value = "交易对符号,如:BTC_USDT", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "baseAsset", value = "对比币种,如:BTC", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "quoteAsset", value = "计价币种,如:USDT", paramType = "query", dataType="String")
})
@PreAuthorize("hasAuthority('market:market:page')")
public Result<PageData<MarketDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
......
......@@ -28,14 +28,14 @@ import java.util.Map;
/**
* 法币币种
*
* @author momin 460363410@qq.com
* @since 1.0 2021-07-02
*/
* 法币币种
*
* @author momin 460363410@qq.com
* @since 1.0 2021-07-02
*/
@RestController
@RequestMapping("otc")
@Api(tags="法币币种")
@Api(tags = "法币币种")
public class OtcController {
@Autowired
private OtcService otcService;
......@@ -43,13 +43,15 @@ public class OtcController {
@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")
@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"),
@ApiImplicitParam(name = "symbol", value = "法币符号,如:CNY", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "isEnabled", value = "是否启用(1=启用,0=关闭)", paramType = "query", dataType = "Boolean")
})
@PreAuthorize("hasAuthority('otc:otc:page')")
public Result<PageData<OtcDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
public Result<PageData<OtcDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
PageData<OtcDTO> page = otcService.page(params);
return new Result<PageData<OtcDTO>>().ok(page);
......@@ -58,7 +60,7 @@ public class OtcController {
@GetMapping("{id}")
@ApiOperation("信息")
@PreAuthorize("hasAuthority('otc:otc:info')")
public Result<OtcDTO> get(@PathVariable("id") Long id){
public Result<OtcDTO> get(@PathVariable("id") Long id) {
OtcDTO data = otcService.get(id);
return new Result<OtcDTO>().ok(data);
......@@ -68,7 +70,7 @@ public class OtcController {
@ApiOperation("保存")
@LogOperation("保存")
@PreAuthorize("hasAuthority('otc:otc:save')")
public Result save(@RequestBody OtcDTO dto){
public Result save(@RequestBody OtcDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
......@@ -81,7 +83,7 @@ public class OtcController {
@ApiOperation("修改")
@LogOperation("修改")
@PreAuthorize("hasAuthority('otc:otc:update')")
public Result update(@RequestBody OtcDTO dto){
public Result update(@RequestBody OtcDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
......@@ -94,7 +96,7 @@ public class OtcController {
@ApiOperation("删除")
@LogOperation("删除")
@PreAuthorize("hasAuthority('otc:otc:delete')")
public Result delete(@RequestBody Long[] ids){
public Result delete(@RequestBody Long[] ids) {
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
......
......@@ -28,14 +28,14 @@ import java.util.Map;
/**
* 代币管理
*
* @author momin 460363410@qq.com
* @since 1.0 2021-07-02
*/
* 代币管理
*
* @author momin 460363410@qq.com
* @since 1.0 2021-07-02
*/
@RestController
@RequestMapping("token")
@Api(tags="代币管理")
@Api(tags = "代币管理")
public class TokenController {
@Autowired
private TokenService tokenService;
......@@ -43,13 +43,19 @@ public class TokenController {
@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")
@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"),
@ApiImplicitParam(name = "blockChainCode", value = "block_chain_code,如:ETH、BSC", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "symbol", value = "符号,如:USDT", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "contractId", value = "合约地址", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "isRecommend", value = "是否系统推荐;1:是 0:否", paramType = "query", dataType = "Boolean"),
@ApiImplicitParam(name = "isSearch", value = "是否可搜索;1:是 0:否", paramType = "query", dataType = "Boolean"),
@ApiImplicitParam(name = "isScan", value = "是否可区块扫描;1:是 0:否", paramType = "query", dataType = "Boolean")
})
@PreAuthorize("hasAuthority('token:token:page')")
public Result<PageData<TokenDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
public Result<PageData<TokenDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
PageData<TokenDTO> page = tokenService.page(params);
return new Result<PageData<TokenDTO>>().ok(page);
......@@ -58,7 +64,7 @@ public class TokenController {
@GetMapping("{id}")
@ApiOperation("信息")
@PreAuthorize("hasAuthority('token:token:info')")
public Result<TokenDTO> get(@PathVariable("id") Long id){
public Result<TokenDTO> get(@PathVariable("id") Long id) {
TokenDTO data = tokenService.get(id);
return new Result<TokenDTO>().ok(data);
......@@ -68,7 +74,7 @@ public class TokenController {
@ApiOperation("保存")
@LogOperation("保存")
@PreAuthorize("hasAuthority('token:token:save')")
public Result save(@RequestBody TokenDTO dto){
public Result save(@RequestBody TokenDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
......@@ -81,7 +87,7 @@ public class TokenController {
@ApiOperation("修改")
@LogOperation("修改")
@PreAuthorize("hasAuthority('token:token:update')")
public Result update(@RequestBody TokenDTO dto){
public Result update(@RequestBody TokenDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
......@@ -94,7 +100,7 @@ public class TokenController {
@ApiOperation("删除")
@LogOperation("删除")
@PreAuthorize("hasAuthority('token:token:delete')")
public Result delete(@RequestBody Long[] ids){
public Result delete(@RequestBody Long[] ids) {
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
......
......@@ -22,9 +22,11 @@ public class AppRevisionServiceImpl extends CrudServiceImpl<AppRevisionDao, AppR
@Override
public QueryWrapper<AppRevisionEntity> getWrapper(Map<String, Object> params){
String platform = (String) params.get("platform");
String version = (String) params.get("version");
QueryWrapper<AppRevisionEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(platform), "platform", platform);
wrapper.eq(StringUtils.isNotBlank(version), "version", version);
return wrapper;
}
......
......@@ -6,6 +6,7 @@ import com.roo.dao.BlockChainDao;
import com.roo.dto.BlockChainDTO;
import com.roo.entity.BlockChainEntity;
import com.roo.service.BlockChainService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
......@@ -21,9 +22,11 @@ public class BlockChainServiceImpl extends CrudServiceImpl<BlockChainDao, BlockC
@Override
public QueryWrapper<BlockChainEntity> getWrapper(Map<String, Object> params){
String code = (String) params.get("code");
Boolean isEnabled = (Boolean) params.get("isEnabled");
QueryWrapper<BlockChainEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(code), "code", code);
wrapper.eq(isEnabled != null, "is_enabled", isEnabled);
return wrapper;
}
......
......@@ -6,6 +6,7 @@ import com.roo.dao.ChainNodesDao;
import com.roo.dto.ChainNodesDTO;
import com.roo.entity.ChainNodesEntity;
import com.roo.service.ChainNodesService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
......@@ -21,9 +22,13 @@ public class ChainNodesServiceImpl extends CrudServiceImpl<ChainNodesDao, ChainN
@Override
public QueryWrapper<ChainNodesEntity> getWrapper(Map<String, Object> params){
String chainCode = (String) params.get("chainCode");
String network = (String) params.get("network");
Boolean isEnabled = (Boolean) params.get("isEnabled");
QueryWrapper<ChainNodesEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(chainCode), "chain_code", chainCode);
wrapper.eq(StringUtils.isNotBlank(network), "network", network);
wrapper.eq(isEnabled != null, "is_enabled", isEnabled);
return wrapper;
}
......
......@@ -6,6 +6,7 @@ import com.roo.dao.DappsDao;
import com.roo.dto.DappsDTO;
import com.roo.entity.DappsEntity;
import com.roo.service.DappsService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
......@@ -21,9 +22,17 @@ public class DappsServiceImpl extends CrudServiceImpl<DappsDao, DappsEntity, Dap
@Override
public QueryWrapper<DappsEntity> getWrapper(Map<String, Object> params){
String name = (String) params.get("name");
String type = (String) params.get("type");
Boolean hots = (Boolean) params.get("hots");
String chain = (String) params.get("chain");
String display = (String) params.get("display");
QueryWrapper<DappsEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(name), "name", name);
wrapper.eq(StringUtils.isNotBlank(type), "type", type);
wrapper.eq(hots != null, "hots", hots);
wrapper.eq(StringUtils.isNotBlank(chain), "chain", chain);
wrapper.eq(StringUtils.isNotBlank(display), "display", display);
return wrapper;
}
......
......@@ -6,6 +6,7 @@ import com.roo.dao.MarketDao;
import com.roo.dto.MarketDTO;
import com.roo.entity.MarketEntity;
import com.roo.service.MarketService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
......@@ -21,9 +22,13 @@ public class MarketServiceImpl extends CrudServiceImpl<MarketDao, MarketEntity,
@Override
public QueryWrapper<MarketEntity> getWrapper(Map<String, Object> params){
String symbol = (String) params.get("symbol");
String baseAsset = (String) params.get("baseAsset");
String quoteAsset = (String) params.get("quoteAsset");
QueryWrapper<MarketEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(symbol), "symbol", symbol);
wrapper.eq(StringUtils.isNotBlank(baseAsset), "base_asset", baseAsset);
wrapper.eq(StringUtils.isNotBlank(quoteAsset), "quote_asset", quoteAsset);
return wrapper;
}
......
......@@ -6,6 +6,7 @@ import com.roo.dao.OtcDao;
import com.roo.dto.OtcDTO;
import com.roo.entity.OtcEntity;
import com.roo.service.OtcService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
......@@ -21,9 +22,11 @@ public class OtcServiceImpl extends CrudServiceImpl<OtcDao, OtcEntity, OtcDTO> i
@Override
public QueryWrapper<OtcEntity> getWrapper(Map<String, Object> params){
String symbol = (String) params.get("symbol");
Boolean isEnabled = (Boolean) params.get("isEnabled");
QueryWrapper<OtcEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(symbol), "symbol", symbol);
wrapper.eq(isEnabled != null, "is_enabled", isEnabled);
return wrapper;
}
......
......@@ -6,6 +6,7 @@ import com.roo.dao.TokenDao;
import com.roo.dto.TokenDTO;
import com.roo.entity.TokenEntity;
import com.roo.service.TokenService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
......@@ -21,11 +22,20 @@ public class TokenServiceImpl extends CrudServiceImpl<TokenDao, TokenEntity, Tok
@Override
public QueryWrapper<TokenEntity> getWrapper(Map<String, Object> params){
QueryWrapper<TokenEntity> wrapper = new QueryWrapper<>();
String chainCode = (String) params.get("blockChainCode");
String symbol = (String) params.get("symbol");
String contractId = (String) params.get("contractId");
Boolean isRecommend = (Boolean) params.get("isRecommend");
Boolean isSearch = (Boolean) params.get("isSearch");
Boolean isScan = (Boolean) params.get("isScan");
QueryWrapper<TokenEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(chainCode), "chain_code", chainCode);
wrapper.eq(StringUtils.isNotBlank(symbol), "symbol", symbol);
wrapper.eq(StringUtils.isNotBlank(contractId), "contract_id", contractId);
wrapper.eq(isRecommend != null, "is_recommend", isRecommend);
wrapper.eq(isSearch != null, "is_search", isSearch);
wrapper.eq(isScan != null, "is_scan", isScan);
return wrapper;
}
}
package com.roo.service;
import com.roo.commons.tools.page.PageData;
import com.roo.dto.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.HashMap;
import java.util.Map;
@RunWith(SpringRunner.class)
@SpringBootTest
public class AllServiceTest {
private static Logger logger = LoggerFactory.getLogger(AllServiceTest.class);
@Autowired
private AppRevisionService appRevisionService;
@Autowired
private BlockChainService blockChainService;
@Autowired
private ChainNodesService chainNodesService;
@Autowired
private DappsService dappsService;
@Autowired
private MarketService marketService;
@Autowired
private OtcService otcService;
@Autowired
private TokenService tokenService;
@Test
public void testAppRevisionPageParams() {
Map<String, Object> params = new HashMap<>();
params.put("page", "1");
params.put("limit", "10");
params.put("platform", "android");
params.put("version", "0.2.0");
PageData<AppRevisionDTO> page = appRevisionService.page(params);
logger.info("total:{}", page.getTotal());
}
@Test
public void testBlockChainPageParams() {
Map<String, Object> params = new HashMap<>();
params.put("page", "1");
params.put("limit", "10");
params.put("isEnabled", true);
params.put("code", "BSC");
PageData<BlockChainDTO> page = blockChainService.page(params);
logger.info("total:{}", page.getTotal());
}
@Test
public void testChainNodesPageParams() {
Map<String, Object> params = new HashMap<>();
params.put("page", "1");
params.put("limit", "10");
params.put("chainCode", "BSC");
params.put("network", "TEST");
params.put("isEnabled", true);
PageData<ChainNodesDTO> page = chainNodesService.page(params);
logger.info("total:{}", page.getTotal());
}
@Test
public void testDappsPageParams() {
Map<String, Object> params = new HashMap<>();
params.put("page", "1");
params.put("limit", "10");
params.put("name", "paraswap");
params.put("hots", true);
params.put("chain", "ethereum");
params.put("display", "show");
PageData<DappsDTO> page = dappsService.page(params);
logger.info("total:{}", page.getTotal());
}
@Test
public void testMarketPageParams() {
Map<String, Object> params = new HashMap<>();
params.put("page", "1");
params.put("limit", "10");
params.put("symbol", "BTC_USDT");
params.put("baseAsset", "BTC");
params.put("quoteAsset", "USDT");
PageData<MarketDTO> page = marketService.page(params);
logger.info("total:{}", page.getTotal());
}
@Test
public void testOtcPageParams() {
Map<String, Object> params = new HashMap<>();
params.put("page", "1");
params.put("limit", "10");
params.put("isEnabled", true);
params.put("symbol", "cny");
PageData<OtcDTO> page = otcService.page(params);
logger.info("total:{}", page.getTotal());
}
@Test
public void testTokenPageParams() {
Map<String, Object> params = new HashMap<>();
params.put("page", "1");
params.put("limit", "10");
params.put("blockChainCode", "ETH");
params.put("symbol", "USDT");
params.put("contractId", "0xdac17f958d2ee523a2206206994597c13d831ec7");
params.put("isRecommend", true);
params.put("isSearch", true);
params.put("isScan", true);
PageData<TokenDTO> page = tokenService.page(params);
logger.info("total:{}", page.getTotal());
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment