You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
875 B
37 lines
875 B
9 months ago
|
package influencer
|
||
|
|
||
|
import (
|
||
|
"github.com/gin-gonic/gin"
|
||
|
"pure/model/request"
|
||
|
"pure/model/response"
|
||
|
"pure/service"
|
||
|
"pure/utils"
|
||
|
)
|
||
|
|
||
|
// GetChainInfo
|
||
|
// @Summary 获取区块链数据
|
||
|
// @Description
|
||
|
// @Tags Chain
|
||
|
// @Param data query request.ChainParams false "data..."
|
||
|
// @Success 200 {object} []response.ChainResp "{"code": 0, "data": [...]}"
|
||
|
// @Success 201 {string} string "{"code": 1, "message": ""}"
|
||
|
// @Router /influencer/base/chain [get]
|
||
|
func GetChainInfo(c *gin.Context) {
|
||
|
var (
|
||
|
err error
|
||
|
params request.ChainParams
|
||
|
result []response.ChainResp
|
||
|
)
|
||
|
_ = c.ShouldBindQuery(¶ms)
|
||
|
if err = utils.Verify(params, utils.ChainVerify); err != nil {
|
||
|
response.FailWithMessage(err.Error(), c)
|
||
|
return
|
||
|
}
|
||
|
err, result = service.GetChainInfo(params.Hash)
|
||
|
if err != nil {
|
||
|
response.FailWithMessage(err.Error(), c)
|
||
|
return
|
||
|
}
|
||
|
response.OkWithData(result, c)
|
||
|
}
|