Merge branch 'lixing' into dev
This commit is contained in:
@@ -239,6 +239,12 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
// 查询castile代币余额
|
||||
Method: http.MethodPost,
|
||||
Path: "/getBalance",
|
||||
Handler: transfercastile.GetCastileBalanceHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// 获取提取castile到游戏的记录
|
||||
Method: http.MethodPost,
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package transfercastile
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
"nova_task/internal/logic/transfercastile"
|
||||
"nova_task/internal/svc"
|
||||
)
|
||||
|
||||
// 查询castile代币余额
|
||||
func GetCastileBalanceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := transfercastile.NewGetCastileBalanceLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetCastileBalance()
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user