// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved. package accounts import ( "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/iwind/TeaGo/maps" ) type UserAccountAction struct { actionutils.ParentAction } func (this *UserAccountAction) RunPost(params struct { UserId int64 }) { resp, err := this.RPC().UserAccountRPC().FindEnabledUserAccountWithUserId(this.AdminContext(), &pb.FindEnabledUserAccountWithUserIdRequest{UserId: params.UserId}) if err != nil { this.ErrorPage(err) return } var account = resp.UserAccount if account == nil { account = &pb.UserAccount{} } this.Data["account"] = maps.Map{ "total": account.Total, "totalFrozen": account.TotalFrozen, } this.Success() }