package card_info_t_mall_game

import (
	"context"
	"kami/internal/errHandler"
	"kami/internal/model"
	"kami/internal/service"

	"kami/api/card_info_t_mall_game/v1"

	"github.com/gogf/gf/v2/errors/gcode"
)

func (c *ControllerV1) TMallGameAccountCreate(ctx context.Context, req *v1.TMallGameAccountCreateReq) (res *v1.TMallGameAccountCreateRes, err error) {
	accountService := service.RechargeTMallGameAccount()
	err = accountService.Add(ctx, &model.RechargeTMallGameAccountAddInput{
		TMallGameAccountCreateReq: req,
	})
	if err != nil {
		err = errHandler.WrapError(ctx, gcode.CodeInternalError, err, "创建账户失败")
	}
	return
}
