story

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FxModule

func FxModule() fx.Option

Types

type CharacterArt

type CharacterArt struct {
	Server   ark.Server `json:"server" gorm:"primaryKey;type:game_server"`
	ID       string     `json:"id" gorm:"primaryKey;check:id=lower(id)"`
	StoryID  string     `json:"storyID" gorm:"primaryKey"`
	Category string     `json:"category" gorm:""`

	Names pq.StringArray `json:"names" gorm:"type:text[]"`
}

type Group

type Group struct {
	Server  ark.Server `json:"server" gorm:"primaryKey;type:game_server"`
	ID      string     `json:"id" gorm:"primaryKey;collate:numeric;check:id=lower(id)"`
	Name    string     `json:"name" gorm:""`
	Type    GroupType  `json:"type" gorm:"type:story_group_type"`
	Stories []Story    `json:"stories" gorm:"foreignKey:Server,GroupID;reference:Server,ID"`
}

type GroupFilter

type GroupFilter struct {
	Type string
}

type GroupType

type GroupType = string
const (
	GroupTypeMainStory  GroupType = "main-story"
	GroupTypeMajorEvent GroupType = "major-event"
	GroupTypeMinorEvent GroupType = "minor-event"
	GroupTypeOther      GroupType = "other"
)

type PictureArt

type PictureArt struct {
	Server   ark.Server `json:"server" gorm:"primaryKey;type:game_server"`
	ID       string     `json:"id" gorm:"primaryKey;check:id=lower(id)"`
	StoryID  string     `json:"storyID" gorm:"primaryKey"`
	Category string     `json:"category" gorm:""`

	Title    string `json:"title" gorm:""`
	Subtitle string `json:"subtitle" gorm:""`
}

type Service

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

func (*Service) GetCharacterArt

func (s *Service) GetCharacterArt(server ark.Server, id string) (*CharacterArt, error)

func (*Service) GetCharacterArts

func (s *Service) GetCharacterArts(server ark.Server) ([]*CharacterArt, error)

func (*Service) GetPictureArt

func (s *Service) GetPictureArt(server ark.Server, id string) (*PictureArt, error)

func (*Service) GetPictureArts

func (s *Service) GetPictureArts(server ark.Server) ([]*PictureArt, error)

func (*Service) GetStories

func (s *Service) GetStories(server ark.Server) ([]*Story, error)

func (*Service) GetStory

func (s *Service) GetStory(server ark.Server, id string) (*Story, error)

func (*Service) GetStoryGroup

func (s *Service) GetStoryGroup(server ark.Server, id string) (*Group, error)

func (*Service) GetStoryGroups

func (s *Service) GetStoryGroups(server ark.Server, filter GroupFilter) ([]*Group, error)

func (*Service) PopulateFrom

func (s *Service) PopulateFrom(rawTree *arkparser.StoryTree, server ark.Server) error

type Story

type Story struct {
	Server ark.Server `json:"server" gorm:"primaryKey;type:game_server"`
	ID     string     `json:"id" gorm:"primaryKey;collate:numeric;check:id=lower(id)"`

	Tag     Tag    `json:"tag" gorm:"type:story_tag"`
	TagText string `json:"tagText" gorm:""`
	Code    string `json:"code" gorm:"collate:numeric"`
	Name    string `json:"name" gorm:""`
	Info    string `json:"info" gorm:""`

	GroupID string `json:"groupID" gorm:"collate:numeric"`

	PictureArts   []PictureArt   `json:"pictureArts" gorm:"foreignKey:Server,StoryID;reference:(Server,ID)"`
	CharacterArts []CharacterArt `json:"characterArts" gorm:"foreignKey:Server,StoryID;reference:(Server,ID)"`
}

type Tag

type Tag = string
const (
	TagBefore    Tag = "before"
	TagAfter     Tag = "after"
	TagInterlude Tag = "interlude"
)

type Tree

type Tree = []Group

Jump to

Keyboard shortcuts

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