func (r repository) Create(ctx context.Context, album entity.Album) error {
	return r.db.With(ctx).Model(&album).Insert()
}
Create saves a new album record in the database.
It returns the ID of the newly inserted album record.
package album
import (
	"context"
	"github.com/qiangxue/go-rest-api/internal/entity"
	"github.com/qiangxue/go-rest-api/pkg/dbcontext"
	"github.com/qiangxue/go-rest-api/pkg/log"
)
type Repository interface {
	Get(ctx context.Context, id string) (entity.Album, error)
	Count(ctx context.Context) (int, error)
	Query(ctx context.Context, offset, limit int) ([]entity.Album, error)
	Create(ctx context.Context, album entity.Album) error
	Update(ctx context.Context, album entity.Album) error
	Delete(ctx context.Context, id string) error
}
type repository struct {
	db     *dbcontext.DB
	logger log.Logger
}
func NewRepository(db *dbcontext.DB, logger log.Logger) Repository {
	return repository{db, logger}
}
func (r repository) Get(ctx context.Context, id string) (entity.Album, error) {
	var album entity.Album
	err := r.db.With(ctx).Select().Model(id, &album)
	return album, err
}