package ndb

import (
	"gadmin/internal/admin/forms"
	"log"

	"github.com/xujiajun/nutsdb"
)

type Ndb struct {
	nutsdb.DB
}

var (
	ndb *Ndb
)

func init() {
	var err error
	opt := nutsdb.DefaultOptions
	opt.Dir = "./db"
	db, err := nutsdb.Open(opt)
	if err != nil {
		log.Fatal(err)
	}

	ndb = &Ndb{*db}
}

// 返回邮件列表
func (db *Ndb) GetEmails(offset int, limit int) (data []forms.EmailItem, err error) {

	return
}
