package card_info_original_jd

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

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

	"kami/api/card_info_original_jd/v1"
)

func (c *ControllerV1) OriginalJDAccountUpdateStatus(ctx context.Context, req *v1.OriginalJDAccountUpdateStatusReq) (res *v1.OriginalJDAccountUpdateStatusRes, err error) {
	_, err = service.SysAuth().LoginOnlyIFrame(ctx)
	if err != nil {
		err = errHandler.WrapError(ctx, gcode.CodeNotAuthorized, err, "权限不足")
		return
	}
	jdAccountService := service.CardRedeemAccount()
	err = jdAccountService.UpdateStatus(ctx, req.ID, req.Status, nil)
	return
}
