package card_info_jd

import (
	"context"
	"kami/api/commonApi"
	"kami/internal/model"
	"kami/internal/service"

	"kami/api/card_info_jd/v1"
)

func (c *ControllerV1) JDAccountUpdate(ctx context.Context, req *v1.JDAccountUpdateReq) (res *v1.JDAccountUpdateRes, err error) {
	accountService := service.CardRedeemAccount()
	err = accountService.Update(ctx, &model.RedeemAccountUpdateInput{
		CommonStrId: commonApi.CommonStrId{
			ID: req.ID,
		},
		Status:         req.Status,
		Name:           req.Name,
		Remark:         req.Remark,
		MaxAmountLimit: req.MaxAmountLimit,
		MaxCountLimit:  req.MaxAmountLimit,
	}, nil)
	return
}
