service

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card added in v0.2.3

type Card struct {
	ID           int64
	GameID       string
	CollectionID string
	Count        int
}

type CardService

type CardService struct {
	// contains filtered or unexported fields
}

func NewCardService

func NewCardService(cfg *config.Config, cardRepository repository.ICardRepository) *CardService

func (*CardService) Create

func (s *CardService) Create(gameID, collectionID, deckID string, dtoObject *dto.CreateCardDTO) (*entity.CardInfo, error)

func (*CardService) Delete

func (s *CardService) Delete(gameID, collectionID, deckID string, cardID int64) error

func (*CardService) GetImage

func (s *CardService) GetImage(gameID, collectionID, deckID string, cardID int64) ([]byte, string, error)

func (*CardService) Item

func (s *CardService) Item(gameID, collectionID, deckID string, cardID int64) (*entity.CardInfo, error)

func (*CardService) List

func (s *CardService) List(gameID, collectionID, deckID, sortField, search string) ([]*entity.CardInfo, *network.Meta, error)

func (*CardService) Update

func (s *CardService) Update(gameID, collectionID, deckID string, cardID int64, dtoObject *dto.UpdateCardDTO) (*entity.CardInfo, error)

type CollectionService

type CollectionService struct {
	// contains filtered or unexported fields
}

func NewCollectionService

func NewCollectionService(cfg *config.Config, collectionRepository repository.ICollectionRepository) *CollectionService

func (*CollectionService) Create

func (s *CollectionService) Create(gameID string, dtoObject *dto.CreateCollectionDTO) (*entity.CollectionInfo, error)

func (*CollectionService) Delete

func (s *CollectionService) Delete(gameID, collectionID string) error

func (*CollectionService) GetImage

func (s *CollectionService) GetImage(gameID, collectionID string) ([]byte, string, error)

func (*CollectionService) Item

func (s *CollectionService) Item(gameID, collectionID string) (*entity.CollectionInfo, error)

func (*CollectionService) List

func (s *CollectionService) List(gameID, sortField, search string) ([]*entity.CollectionInfo, *network.Meta, error)

func (*CollectionService) Update

func (s *CollectionService) Update(gameID, collectionID string, dtoObject *dto.UpdateCollectionDTO) (*entity.CollectionInfo, error)

type Couple added in v0.2.3

type Couple struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Deck added in v0.2.3

type Deck struct {
	ID    string
	Name  string
	Image string
}

type DeckService

type DeckService struct {
	// contains filtered or unexported fields
}

func NewDeckService

func NewDeckService(cfg *config.Config, deckRepository repository.IDeckRepository) *DeckService

func (*DeckService) Create

func (s *DeckService) Create(gameID, collectionID string, dtoObject *dto.CreateDeckDTO) (*entity.DeckInfo, error)

func (*DeckService) Delete

func (s *DeckService) Delete(gameID, collectionID, deckID string) error

func (*DeckService) GetImage

func (s *DeckService) GetImage(gameID, collectionID, deckID string) ([]byte, string, error)

func (*DeckService) Item

func (s *DeckService) Item(gameID, collectionID, deckID string) (*entity.DeckInfo, error)

func (*DeckService) List

func (s *DeckService) List(gameID, collectionID, sortField, search string) ([]*entity.DeckInfo, *network.Meta, error)

func (*DeckService) ListAllUnique

func (s *DeckService) ListAllUnique(gameID string) ([]*entity.DeckInfo, error)

func (*DeckService) Update

func (s *DeckService) Update(gameID, collectionID, deckID string, dtoObject *dto.UpdateDeckDTO) (*entity.DeckInfo, error)

type GameService

type GameService struct {
	// contains filtered or unexported fields
}

func NewGameService

func NewGameService(cfg *config.Config, gameRepository repository.IGameRepository) *GameService

func (*GameService) Create

func (s *GameService) Create(dtoObject *dto.CreateGameDTO) (*entity.GameInfo, error)

func (*GameService) Delete

func (s *GameService) Delete(gameID string) error

func (*GameService) Duplicate

func (s *GameService) Duplicate(gameID string, dtoObject *dto.DuplicateGameDTO) (*entity.GameInfo, error)

func (*GameService) Export

func (s *GameService) Export(gameID string) ([]byte, error)

func (*GameService) GetImage

func (s *GameService) GetImage(gameID string) ([]byte, string, error)

func (*GameService) Import

func (s *GameService) Import(data []byte, name string) (*entity.GameInfo, error)

func (*GameService) Item

func (s *GameService) Item(gameID string) (*entity.GameInfo, error)

func (*GameService) List

func (s *GameService) List(sortField, search string) ([]*entity.GameInfo, *network.Meta, error)

func (*GameService) Update

func (s *GameService) Update(gameID string, dtoObject *dto.UpdateGameDTO) (*entity.GameInfo, error)

type GeneratorService

type GeneratorService struct {
	// contains filtered or unexported fields
}

func NewGeneratorService

func NewGeneratorService(cfg *config.Config, gameService IGameService, collectionService ICollectionService, deckService IDeckService, cardService ICardService, ttsService ITTSService) *GeneratorService

func (*GeneratorService) GenerateGame

func (s *GeneratorService) GenerateGame(gameID string, dtoObject *dto.GenerateGameDTO) error

type ICardService

type ICardService interface {
	Create(gameID, collectionID, deckID string, dtoObject *dto.CreateCardDTO) (*entity.CardInfo, error)
	Item(gameID, collectionID, deckID string, cardID int64) (*entity.CardInfo, error)
	List(gameID, collectionID, deckID, sortField, search string) ([]*entity.CardInfo, *network.Meta, error)
	Update(gameID, collectionID, deckID string, cardID int64, dtoObject *dto.UpdateCardDTO) (*entity.CardInfo, error)
	Delete(gameID, collectionID, deckID string, cardID int64) error
	GetImage(gameID, collectionID, deckID string, cardID int64) ([]byte, string, error)
}

type ICollectionService

type ICollectionService interface {
	Create(gameID string, dtoObject *dto.CreateCollectionDTO) (*entity.CollectionInfo, error)
	Item(gameID, collectionID string) (*entity.CollectionInfo, error)
	List(gameID, sortField, search string) ([]*entity.CollectionInfo, *network.Meta, error)
	Update(gameID, collectionID string, dtoObject *dto.UpdateCollectionDTO) (*entity.CollectionInfo, error)
	Delete(gameID, collectionID string) error
	GetImage(gameID, collectionID string) ([]byte, string, error)
}

type IDeckService

type IDeckService interface {
	Create(gameID, collectionID string, dtoObject *dto.CreateDeckDTO) (*entity.DeckInfo, error)
	Item(gameID, collectionID, deckID string) (*entity.DeckInfo, error)
	List(gameID, collectionID, sortField, search string) ([]*entity.DeckInfo, *network.Meta, error)
	Update(gameID, collectionID, deckID string, dtoObject *dto.UpdateDeckDTO) (*entity.DeckInfo, error)
	Delete(gameID, collectionID, deckID string) error
	GetImage(gameID, collectionID, deckID string) ([]byte, string, error)
	ListAllUnique(gameID string) ([]*entity.DeckInfo, error)
}

type IGameService

type IGameService interface {
	Create(dtoObject *dto.CreateGameDTO) (*entity.GameInfo, error)
	Item(gameID string) (*entity.GameInfo, error)
	List(sortField, search string) ([]*entity.GameInfo, *network.Meta, error)
	Update(gameID string, dtoObject *dto.UpdateGameDTO) (*entity.GameInfo, error)
	Delete(gameID string) error
	GetImage(gameID string) ([]byte, string, error)
	Duplicate(gameID string, dtoObject *dto.DuplicateGameDTO) (*entity.GameInfo, error)
	Export(gameID string) ([]byte, error)
	Import(data []byte, name string) (*entity.GameInfo, error)
}

type IGeneratorService

type IGeneratorService interface {
	GenerateGame(gameID string, dtoObject *dto.GenerateGameDTO) error
}

type IReplaceService added in v0.2.3

type IReplaceService interface {
	Prepare(data []byte) ([]Couple, error)
	Replace(data, mapping []byte) (*tts_entity.RootObjects, error)
}

type ISearchService added in v0.2.3

type ISearchService interface {
	RecursiveSearch(sortField, search, gameID, collectionID string) (*entity.RecursiveSearchItems, *network.Meta, error)
}

type ISystemService added in v0.1.0

type ISystemService interface {
	Quit()
	GetSettings() (*entity.SettingInfo, error)
	UpdateSettings(dtoObject *dto.UpdateSettingsDTO) (*entity.SettingInfo, error)
}

type ITTSService added in v0.2.3

type ITTSService interface {
	SendToTTS(data any)
	DataForTTS() ([]byte, error)
}

type Mapping added in v0.2.3

type Mapping struct {
	Data []Couple `json:"data"`
}

type PageInfo added in v0.2.3

type PageInfo struct {
	Image    string
	Backside string
	Columns  int
	Rows     int
}

type ReplaceService added in v0.2.3

type ReplaceService struct {
	// contains filtered or unexported fields
}

func NewReplaceService added in v0.2.3

func NewReplaceService(ttsService ITTSService) *ReplaceService

func (*ReplaceService) Prepare added in v0.2.3

func (s *ReplaceService) Prepare(data []byte) ([]Couple, error)

func (*ReplaceService) Replace added in v0.2.3

func (s *ReplaceService) Replace(data, mapping []byte) (*tts_entity.RootObjects, error)

type Request added in v0.2.3

type Request struct {
	ObjectStates []struct {
		ContainedObjects []struct {
			ContainedObjects []struct {
				CustomDeck map[string]struct {
					FaceURL string `json:"FaceURL"`
					BackURL string `json:"BackURL"`
				} `json:"CustomDeck"`
			} `json:"containedObjects"`
		} `json:"ContainedObjects"`
	} `json:"ObjectStates"`
}

type SearchService added in v0.2.3

type SearchService struct {
	// contains filtered or unexported fields
}

func NewSearchService added in v0.2.3

func NewSearchService(
	gameService IGameService,
	collectionService ICollectionService,
	deckService IDeckService,
	cardService ICardService,
) *SearchService

func (*SearchService) RecursiveSearch added in v0.2.3

func (s *SearchService) RecursiveSearch(sortField, search, gameID, collectionID string) (*entity.RecursiveSearchItems, *network.Meta, error)

type SystemService added in v0.1.0

type SystemService struct {
	// contains filtered or unexported fields
}

func NewService added in v0.1.0

func NewService(cfg *config.Config, db *db.DB) *SystemService

func (*SystemService) GetSettings added in v0.1.0

func (s *SystemService) GetSettings() (*entity.SettingInfo, error)

func (*SystemService) Quit added in v0.1.0

func (s *SystemService) Quit()

func (*SystemService) UpdateSettings added in v0.1.0

func (s *SystemService) UpdateSettings(dtoObject *dto.UpdateSettingsDTO) (*entity.SettingInfo, error)

type TTSMessage added in v0.2.3

type TTSMessage struct {
	MessageID int    `json:"messageID"`
	GUID      string `json:"guid"`
	Script    string `json:"script"`
}

type TTSService added in v0.2.3

type TTSService struct {
	// contains filtered or unexported fields
}

func NewTTSService added in v0.2.3

func NewTTSService() *TTSService

func (*TTSService) DataForTTS added in v0.2.3

func (s *TTSService) DataForTTS() ([]byte, error)

func (*TTSService) SendToTTS added in v0.2.3

func (s *TTSService) SendToTTS(data any)

Jump to

Keyboard shortcuts

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