repositoryimpl

package
v1.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProjectRepository

func NewProjectRepository(mapper ProjectMapper) spacerepo.Project

Types

type ProjectDO

type ProjectDO struct {
	Id            string
	Owner         string
	Name          string
	FL            byte
	Desc          string
	Title         string
	Type          string
	Level         int
	CoverId       string
	Protocol      string
	Training      string
	RepoType      string
	RepoId        string
	Tags          []string
	TagKinds      []string
	CreatedAt     int64
	UpdatedAt     int64
	Version       int
	LikeCount     int
	ForkCount     int
	DownloadCount int

	RelatedModels   []repositories.ResourceIndexDO
	RelatedDatasets []repositories.ResourceIndexDO
}

type ProjectMapper

type ProjectMapper interface {
	Insert(ProjectDO) (string, error)
	Delete(*repositories.ResourceIndexDO) error
	Get(string, string) (ProjectDO, error)
	GetByName(string, string) (ProjectDO, error)
	GetSummary(string, string) (ProjectResourceSummaryDO, error)
	GetSummaryByName(string, string) (repositories.ResourceSummaryDO, error)

	ListUsersProjects(map[string][]string) ([]ProjectSummaryDO, error)

	ListAndSortByUpdateTime(string, *repositories.ResourceListDO) ([]ProjectSummaryDO, int, error)
	ListAndSortByFirstLetter(string, *repositories.ResourceListDO) ([]ProjectSummaryDO, int, error)
	ListAndSortByDownloadCount(string, *repositories.ResourceListDO) ([]ProjectSummaryDO, int, error)

	ListGlobalAndSortByUpdateTime(*repositories.GlobalResourceListDO) ([]ProjectSummaryDO, int, error)
	ListGlobalAndSortByFirstLetter(*repositories.GlobalResourceListDO) ([]ProjectSummaryDO, int, error)
	ListGlobalAndSortByDownloadCount(*repositories.GlobalResourceListDO) ([]ProjectSummaryDO, int, error)

	Search(do *repositories.GlobalResourceListDO, topNum int) ([]repositories.ResourceSummaryDO, int, error)

	IncreaseFork(repositories.ResourceIndexDO) error
	IncreaseDownload(repositories.ResourceIndexDO) error

	AddLike(repositories.ResourceIndexDO) error
	RemoveLike(repositories.ResourceIndexDO) error

	AddRelatedModel(*repositories.RelatedResourceDO) error
	RemoveRelatedModel(*repositories.RelatedResourceDO) error

	AddRelatedDataset(*repositories.RelatedResourceDO) error
	RemoveRelatedDataset(*repositories.RelatedResourceDO) error

	UpdateProperty(*ProjectPropertyDO) error
}

type ProjectPropertyDO

type ProjectPropertyDO struct {
	repositories.ResourceToUpdateDO

	FL       byte
	Name     string
	Desc     string
	Title    string
	Level    int
	CoverId  string
	RepoType string
	Tags     []string
	TagKinds []string
}

type ProjectResourceSummaryDO

type ProjectResourceSummaryDO struct {
	repositories.ResourceSummaryDO

	Tags []string
}

type ProjectSummaryDO

type ProjectSummaryDO struct {
	Id            string
	Owner         string
	Name          string
	Desc          string
	Title         string
	Level         int
	CoverId       string
	Tags          []string
	UpdatedAt     int64
	LikeCount     int
	ForkCount     int
	DownloadCount int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL