parent
dc0e7f543d
commit
2333adaf8f
16 changed files with 233 additions and 13 deletions
@ -0,0 +1,24 @@ |
||||
package com.blockchain.server.eth.inner; |
||||
|
||||
import com.blockchain.common.base.dto.GasDTO; |
||||
import com.blockchain.common.base.dto.ResultDTO; |
||||
import com.blockchain.server.eth.common.constants.EthConfigConstants; |
||||
import com.blockchain.server.eth.service.IConfigWalletParamService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
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; |
||||
|
||||
@RestController |
||||
@RequestMapping("/inner/walletParam") |
||||
public class ConfigWalletParamInner { |
||||
@Autowired |
||||
private IConfigWalletParamService walletParamService; |
||||
|
||||
@GetMapping("/getGasConfig") |
||||
public ResultDTO<GasDTO> getGasConfig(@RequestParam(value = "tokenSymbol", defaultValue = EthConfigConstants.MODULE_TYPE) String tokenSymbol) { |
||||
return ResultDTO.requstSuccess(walletParamService.getGasConfig(tokenSymbol)); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package com.blockchain.server.yyyf.feign; |
||||
|
||||
import com.blockchain.common.base.dto.ResultDTO; |
||||
import com.blockchain.server.yyyf.feign.dto.BtcWalletDTO; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.PostMapping; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
||||
import java.util.List; |
||||
|
||||
@FeignClient("dapp-btc-server") |
||||
public interface BtcFeign { |
||||
String CONTENT_PATH = "/inner/wallet"; |
||||
|
||||
@PostMapping(CONTENT_PATH + "/getWallets") |
||||
ResultDTO<List<BtcWalletDTO>> getWallets(@RequestParam("userId") String userId, |
||||
@RequestParam("walletType") String walletType); |
||||
} |
@ -0,0 +1,13 @@ |
||||
package com.blockchain.server.yyyf.feign; |
||||
|
||||
import com.blockchain.common.base.dto.ResultDTO; |
||||
import com.blockchain.server.yyyf.feign.dto.CurrencyMarketDTO; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
||||
@FeignClient(name = "dapp-currency-server") |
||||
public interface CurrencyFeign { |
||||
@GetMapping("/inner/market/getList") |
||||
ResultDTO<CurrencyMarketDTO> getList(@RequestParam("currencyPair") String currencyPair); |
||||
} |
@ -0,0 +1,14 @@ |
||||
package com.blockchain.server.yyyf.feign; |
||||
|
||||
import com.blockchain.common.base.dto.ResultDTO; |
||||
import com.blockchain.server.yyyf.feign.dto.EosWalletDTO; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
||||
import java.util.List; |
||||
|
||||
@FeignClient("dapp-eos-server") |
||||
public interface EosFeign { |
||||
@GetMapping("/inner/walletTx/selectWalletByWalletType") |
||||
ResultDTO<List<EosWalletDTO>> selectWalletByWalletType(String userOpenId, String walletType); |
||||
} |
@ -0,0 +1,20 @@ |
||||
package com.blockchain.server.yyyf.feign; |
||||
|
||||
import com.blockchain.common.base.dto.GasDTO; |
||||
import com.blockchain.common.base.dto.ResultDTO; |
||||
import com.blockchain.server.yyyf.feign.dto.EthWalletDTO; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
||||
import java.util.List; |
||||
|
||||
@FeignClient("dapp-eth-server") |
||||
public interface EthFeign { |
||||
@GetMapping("/inner/wallet/getWallets") |
||||
ResultDTO<List<EthWalletDTO>> getWallets(@RequestParam("userId") String userId, |
||||
@RequestParam(name = "walletType") String walletType); |
||||
|
||||
@GetMapping("/inner/walletParam/getGasConfig") |
||||
ResultDTO<GasDTO> getGasConfig(String tokenSymbol); |
||||
} |
@ -0,0 +1,29 @@ |
||||
package com.blockchain.server.yyyf.feign.dto; |
||||
|
||||
import com.blockchain.common.base.entity.BaseModel; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
|
||||
/** |
||||
* BtcWalletDTO 数据传输类 |
||||
* |
||||
* @version 1.0 |
||||
* @date 2019-02-16 15:08:16 |
||||
*/ |
||||
@Data |
||||
@AllArgsConstructor |
||||
@NoArgsConstructor |
||||
public class BtcWalletDTO extends BaseModel { |
||||
private String addr; |
||||
private Integer tokenId; |
||||
private String userOpenId; |
||||
private String tokenSymbol; |
||||
private Double balance; |
||||
private Double freeBalance; |
||||
private Double freezeBalance; |
||||
private java.util.Date createTime; |
||||
private java.util.Date updateTime; |
||||
private String walletType; |
||||
|
||||
} |
@ -0,0 +1,36 @@ |
||||
package com.blockchain.server.yyyf.feign.dto; |
||||
|
||||
import com.blockchain.common.base.dto.BaseDTO; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
@Data |
||||
@AllArgsConstructor |
||||
@NoArgsConstructor |
||||
public class CurrencyMarketDTO extends BaseDTO implements Comparable<CurrencyMarketDTO> { |
||||
|
||||
private String currencyPair; |
||||
private BigDecimal amount; |
||||
private Long timestamp; |
||||
private float percent; |
||||
private double usdAmount; |
||||
private double cnyAmount; |
||||
private double hkdAmount; |
||||
private double eurAmount; |
||||
//最低
|
||||
private BigDecimal lowest; |
||||
//最高
|
||||
private BigDecimal highest; |
||||
//开盘
|
||||
private BigDecimal open; |
||||
//成交量
|
||||
private BigDecimal total; |
||||
|
||||
@Override |
||||
public int compareTo(CurrencyMarketDTO o) { |
||||
return (int) (10000 * o.percent - 10000 * this.percent); |
||||
} |
||||
} |
@ -0,0 +1,29 @@ |
||||
package com.blockchain.server.yyyf.feign.dto; |
||||
|
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* Wallet 数据传输类 |
||||
* @date 2018-11-05 15:10:47 |
||||
* @version 1.0 |
||||
*/ |
||||
@Data |
||||
@AllArgsConstructor |
||||
@NoArgsConstructor |
||||
public class EosWalletDTO { |
||||
private Integer id; |
||||
private String tokenName; |
||||
private String userOpenId; |
||||
private String tokenSymbol; |
||||
private BigDecimal balance; |
||||
private BigDecimal freeBalance; |
||||
private BigDecimal freezeBalance; |
||||
private java.util.Date createTime; |
||||
private java.util.Date updateTime; |
||||
private String walletType; |
||||
|
||||
} |
@ -0,0 +1,24 @@ |
||||
package com.blockchain.server.yyyf.feign.dto; |
||||
|
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* EthWallet 数据传输类 |
||||
* |
||||
* @version 1.0 |
||||
* @date 2019-02-16 15:44:06 |
||||
*/ |
||||
@Data |
||||
public class EthWalletDTO { |
||||
private String addr; |
||||
private String tokenAddr; |
||||
private String userOpenId; |
||||
private String tokenSymbol; |
||||
private int tokenDecimals; |
||||
private String balance; |
||||
private String freeBalance; |
||||
private String freezeBalance; |
||||
private String walletType; |
||||
private java.util.Date createTime; |
||||
private java.util.Date updateTime; |
||||
} |
Loading…
Reference in new issue