diff --git a/cmd/account-gateway/k8s/04-traefik-ingress.yaml b/cmd/account-gateway/k8s/04-traefik-ingress.yaml index be569d9..9b50943 100644 --- a/cmd/account-gateway/k8s/04-traefik-ingress.yaml +++ b/cmd/account-gateway/k8s/04-traefik-ingress.yaml @@ -45,6 +45,8 @@ spec: http: *http_rules - host: api.jh-testing.npool.top http: *http_rules + - host: api.harbin-testing.npool.top + http: *http_rules - host: api.japan-procyon-production.npool.top http: *http_rules - host: api.hk-cryptomore-production.npool.top @@ -107,6 +109,8 @@ spec: http: *http_rules - host: api.jh-testing.npool.top http: *http_rules + - host: api.harbin-testing.npool.top + http: *http_rules - host: api.japan-procyon-production.npool.top http: *http_rules - host: api.hk-cryptomore-production.npool.top diff --git a/go.sum b/go.sum index b6fa513..c505057 100644 --- a/go.sum +++ b/go.sum @@ -428,7 +428,6 @@ github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/subosito/gotenv v1.3.0 h1:mjC+YW8QpAdXibNi+vNWgzmgBH4+5l5dCXv8cNysBLI= github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/ugorji/go v1.1.4 h1:j4s+tAvLfL3bZyefP2SEWmhBzmuIlH/eqNuPdFPgngw= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa h1:5SqCsI/2Qya2bCzK15ozrqo2sZxkh0FHynJZOTVoV6Q= diff --git a/pkg/goodbenefit/query.go b/pkg/goodbenefit/query.go index 80125e6..e27a0f4 100644 --- a/pkg/goodbenefit/query.go +++ b/pkg/goodbenefit/query.go @@ -77,6 +77,7 @@ func (h *queryHandler) formalize() { ID: info.ID, EntID: info.EntID, GoodID: info.GoodID, + GoodType: good.GoodType, GoodName: good.Name, CoinTypeID: info.CoinTypeID, CoinName: coin.Name, diff --git a/pkg/user/accountcreate.go b/pkg/user/accountcreate.go index 8bc5089..29d3fa4 100644 --- a/pkg/user/accountcreate.go +++ b/pkg/user/accountcreate.go @@ -4,7 +4,10 @@ import ( "context" "fmt" + "github.com/NpoolPlatform/go-service-framework/pkg/logger" + "github.com/NpoolPlatform/go-service-framework/pkg/pubsub" npool "github.com/NpoolPlatform/message/npool/account/gw/v1/user" + eventmwpb "github.com/NpoolPlatform/message/npool/inspire/mw/v1/event" usermwcli "github.com/NpoolPlatform/appuser-middleware/pkg/client/user" coininfocli "github.com/NpoolPlatform/chain-middleware/pkg/client/coin" @@ -29,6 +32,31 @@ type createHandler struct { checkAddressBalance bool } +func (h *createHandler) rewardSetAddress() { + if err := pubsub.WithPublisher(func(publisher *pubsub.Publisher) error { + req := &eventmwpb.CalcluateEventRewardsRequest{ + AppID: *h.AppID, + UserID: *h.UserID, + EventType: basetypes.UsedFor_SetAddress, + Consecutive: 1, + } + return publisher.Update( + basetypes.MsgID_CalculateEventRewardReq.String(), + nil, + nil, + nil, + req, + ) + }); err != nil { + logger.Sugar().Errorw( + "rewardSetAddress", + "AppID", *h.AppID, + "UserID", h.UserID, + "Error", err, + ) + } +} + func (h *createHandler) validate(ctx context.Context) error { //nolint switch *h.AccountType { case basetypes.SignMethod_Email: @@ -169,5 +197,7 @@ func (h *Handler) CreateAccount(ctx context.Context) (*npool.Account, error) { return nil, err } + handler.rewardSetAddress() + return h.GetAccount(ctx) } diff --git a/pkg/user/depositquery.go b/pkg/user/depositquery.go index ff66e25..28c9a84 100644 --- a/pkg/user/depositquery.go +++ b/pkg/user/depositquery.go @@ -74,9 +74,6 @@ func (h *queryDepositHandler) getCoins(ctx context.Context) error { if err != nil { return err } - if len(coins) == 0 { - return fmt.Errorf("invalid coin") - } for _, coin := range coins { h.coins[coin.CoinTypeID] = coin