|
|
@@ -20,7 +20,7 @@ type QueryWalletChainsReq struct {
|
|
|
// @Security ApiKeyAuth
|
|
|
// @Param channelCode query string true "渠道代码"
|
|
|
// @Success 200 {array} models.WalletChainRsp
|
|
|
-// @Failure 500 {object} app.Response
|
|
|
+// @Failure 500 {object} app.Response
|
|
|
// @Router /Wallet/QueryWalletChains [get]
|
|
|
// @Tags 钱包
|
|
|
func QueryWalletChains(c *gin.Context) {
|
|
|
@@ -40,3 +40,34 @@ func QueryWalletChains(c *gin.Context) {
|
|
|
appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+type QueryWalletTokensReq struct {
|
|
|
+ Curreny string `form:"currency" binding:"required"` // 币种代码
|
|
|
+}
|
|
|
+
|
|
|
+// QueryWalletTokens
|
|
|
+// @Summary 查询代币信息
|
|
|
+// @Produce json
|
|
|
+// @Security ApiKeyAuth
|
|
|
+// @Param currency query string true "币种代码"
|
|
|
+// @Success 200 {array} models.Wallettokens
|
|
|
+// @Failure 500 {object} app.Response
|
|
|
+// @Router /Wallet/QueryWalletTokens [get]
|
|
|
+// @Tags 钱包
|
|
|
+func QueryWalletTokens(c *gin.Context) {
|
|
|
+ appG := app.Gin{C: c}
|
|
|
+
|
|
|
+ // 获取请求参数
|
|
|
+ var req QueryWalletTokensReq
|
|
|
+ if err := appG.C.ShouldBindQuery(&req); err != nil {
|
|
|
+ logger.GetLogger().Errorf("QueryWalletTokens failed: %s", err.Error())
|
|
|
+ appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if rsp, err := models.GetWalletTokens(req.Curreny); err == nil {
|
|
|
+ appG.Response(http.StatusOK, e.SUCCESS, rsp)
|
|
|
+ } else {
|
|
|
+ appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
|
|
|
+ }
|
|
|
+}
|