Merge branch 'lixing' into dev

This commit is contained in:
2025-05-06 20:37:02 +08:00
5 changed files with 103 additions and 0 deletions

View File

@@ -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,

View File

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