Files
novatask/internal/handler/transfercastile/get_castile_balance_handler.go
2025-05-06 20:34:01 +08:00

23 lines
549 B
Go

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)
}
}
}