story

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FxModule

func FxModule() fx.Option

Types

type AggregatedCharacterArt added in v1.5.0

type AggregatedCharacterArt struct {
	Server   ark.Server `json:"server"`
	ID       string     `json:"id"`
	Category string     `json:"category"`

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

type AggregatedPictureArt added in v1.5.0

type AggregatedPictureArt struct {
	Server   ark.Server `json:"server"`
	ID       string     `json:"id"`
	Category string     `json:"category"`

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

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[];default:array[]::text[]"`

	SortID *uint64 `json:"-" gorm:"unique;autoIncrement"`
}

type Group

type Group struct {
	Server  ark.Server `json:"server" gorm:"primaryKey;type:game_server"`
	ID      string     `json:"id" gorm:"primaryKey;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;constraint:OnDelete:CASCADE"`

	SortID *uint64 `json:"-" gorm:"unique;autoIncrement"`
}

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:""`

	SortID *uint64 `json:"-" gorm:"unique;autoIncrement"`
}

type Service

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

func (*Service) GetAggregatedCharacterArt added in v1.5.0

func (s *Service) GetAggregatedCharacterArt(server ark.Server, id string) (*AggregatedCharacterArt, error)

func (*Service) GetAggregatedPictureArt added in v1.5.0

func (s *Service) GetAggregatedPictureArt(server ark.Server, id string) (*AggregatedPictureArt, error)

func (*Service) GetCharacterArts

func (s *Service) GetCharacterArts(server ark.Server) ([]*CharacterArt, 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 *arkparser2.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;check:id=lower(id)"`

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

	GroupID string  `json:"groupID" gorm:""`
	SortID  *uint64 `json:"-" gorm:"unique;autoIncrement"`

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

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