package postgres

import (
	"context"

	"github.com/break/junhong_cmp_fiber/internal/model"
	"gorm.io/gorm"
)

// AccountOperationLogStore 账号操作日志存储层
type AccountOperationLogStore struct {
	db *gorm.DB
}

// NewAccountOperationLogStore 创建账号操作日志存储实例
func NewAccountOperationLogStore(db *gorm.DB) *AccountOperationLogStore {
	return &AccountOperationLogStore{
		db: db,
	}
}

// Create 创建账号操作日志记录
func (s *AccountOperationLogStore) Create(ctx context.Context, log *model.AccountOperationLog) error {
	return s.db.WithContext(ctx).Create(log).Error
}
