package activity

import (
	"context"
	"github.com/gogf/gf/v2/frame/g"
	"server/internal/model"
	"server/internal/service"

	"server/api/activity/v1"
)

func (c *ControllerV1) SignInList(ctx context.Context, req *v1.SignInListReq) (res *v1.SignInListRes, err error) {
	userId := g.RequestFromCtx(ctx).GetCtxVar("id").Int64()
	out, err := service.SignInRewardRules().SignInList(ctx, &model.SignInListIn{
		UserId: userId,
	})
	if err != nil {
		return nil, err
	}
	res = &v1.SignInListRes{
		List: out.List,
	}
	return &v1.SignInListRes{List: out.List}, nil
}
