model

package
v0.0.0-...-1808d18 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Debug string
View Source
var MinusTable [121][2]float64
View Source
var MinusTableUrl string
View Source
var MongoURL string
View Source
var PythonAPI string
View Source
var ReCaptchaKey string
View Source
var RunAddr string
View Source
var SonolusListColl *mongo.Collection

Functions

func CalcDiffLiner

func CalcDiffLiner(key string, diff int, baseRank int, ceilLevel int) (k float32, b float32)

func CheckSonolusList

func CheckSonolusList(id int) (flag bool)

func DeleteSonolusList

func DeleteSonolusList()

func InitConfig

func InitConfig()

func InitDatabase

func InitDatabase() (err error)

func InitTencentCos

func InitTencentCos()

func MinusTableReader

func MinusTableReader() (err error)

func QueryDiffDistribution

func QueryDiffDistribution(diff int) (distribution map[int]int, base int, ceil int)

func QueryRank

func QueryRank(key string, value float32, diff int) (rank int)

func UpdateAuthor

func UpdateAuthor(username string, nickname string) (err error)

func UpdateBasic

func UpdateBasic(chartID int, diff int, chart Chart) (err error)

func UpdateDetail

func UpdateDetail(chartID int, diff int, detail Detail) (err error)

func UpdateSonolusList

func UpdateSonolusList(listItem SonolusList)

func UploadChart

func UploadChart(chart Chart) (success bool)

func UploadSonolusChart

func UploadSonolusChart(chartId int, SonolusScript []byte) (success bool)

func UploadString

func UploadString(name string, string []byte) (success bool)

Types

type Author

type Author struct {
	AuthorID int    `bson:"authorID"`
	UserName string `bson:"username"`
	NickName string `bson:"nickname"`
}

func QueryAuthor

func QueryAuthor(UserName string) (AuthorInfo Author, empty bool)

func QueryAuthorID

func QueryAuthorID(AuthorID int) (AuthorInfo Author, empty bool)

type Chart

type Chart struct {
	ID       int    `bson:"id"`
	Diff     int    `bson:"diff"`
	Level    int    `bson:"level"`
	AuthorID int    `bson:"authorID"`
	Artist   string `bson:"artist"`
	Title    string `bson:"title"`
	Notes    []Note `bson:"chart"`
}

func DownloadChart

func DownloadChart(chartID int, diff int) (chart Chart, success bool)

func QueryChartBasic

func QueryChartBasic(chartID int, diff int) (chart Chart, empty bool)

type Detail

type Detail struct {
	ActiveHPS         float32 `bson:"activeHPS"`
	TotalTime         float32 `bson:"totalTime"`
	FingerMaxHPS      float32 `bson:"fingerMaxHPS"`
	TotalNPS          float32 `bson:"totalNPS"`
	LeftPercent       float32 `bson:"leftPercent"`
	MaxSpeed          float32 `bson:"maxSpeed"`
	ID                int     `bson:"id"`
	Error             string  `bson:"error"`
	Diff              int     `bson:"diff"`
	ActiveNPS         float32 `bson:"activeNPS"`
	TotalHitNote      int     `bson:"totalHitNote"`
	ActivePercent     float32 `bson:"activePercent"`
	FlickNoteInterval float32 `bson:"flickNoteInterval"`
	MainBPM           float32 `bson:"mainBPM"`
	TotalNote         int     `bson:"totalNote"`
	BPMLow            float32 `bson:"BPMLow"`
	NoteFlickInterval float32 `bson:"noteFlickInterval"`
	BPMHigh           float32 `bson:"BPMHigh"`
	MaxScreenNPS      float32 `bson:"maxScreenNPS"`
	TotalHPS          float32 `bson:"totalHPS"`
}

func QueryChartDetail

func QueryChartDetail(chartID int, diff int, authorID int) (detail Detail, err error)

type Diffs

type Diffs struct {
	FingerMaxHPS      float32 `bson:"fingerMaxHPS"`
	TotalNPS          float32 `bson:"totalNPS"`
	FlickNoteInterval float32 `bson:"flickNoteInterval"`
	NoteFlickInterval float32 `bson:"noteFlickInterval"`
	MaxScreenNPS      float32 `bson:"maxScreenNPS"`
	TotalHPS          float32 `bson:"totalHPS"`
	BlueWhiteFunc     float32 `bson:"blueWhiteFunc"`
	MaxSpeed          float32 `bson:"MaxSpeed"`
}

type FanBasic

type FanBasic struct {
	Result bool `json:"result"`
	Post   struct {
		Title  string `json:"title"`
		Artist string `json:"artists"`
		Diff   int    `json:"diff"`
		Level  int    `json:"level"`
		Chart  []Note `json:"notes"`
		Author struct {
			Username string `json:"username"`
			Nickname string `json:"nickname"`
		} `json:"author"`
	} `json:"post"`
}

type Note

type Note struct {
	Type  string  `json:"type" bson:"type"`
	CMD   string  `json:"cmd" bson:"cmd"`
	BPM   float32 `json:"bpm" bson:"bpm"`
	Beat  float32 `json:"beat" bson:"beat"`
	Time  float32 `json:"time" bson:"time"`
	Note  string  `json:"note" bson:"note"`
	Lane  int     `json:"lane" bson:"lane"`
	Start bool    `json:"start" bson:"start"`
	End   bool    `json:"end" bson:"end"`
	Flick bool    `json:"flick" bson:"flick"`
	Pos   string  `json:"pos" bson:"pos"`
}

func BD2BDFan

func BD2BDFan(officialChart []Note) (fanChart []Note, err error)

type OfficialBasic

type OfficialBasic struct {
	Result bool `json:"result"`
	Data   struct {
		Name       string `json:"name"`
		Band       string `json:"band"`
		Difficulty map[string]struct {
			Level int `json:"level"`
			Notes int `json:"notes"`
		} `json:"difficulty"`
	} `json:"data"`
}

type SonolusData

type SonolusData struct {
	Index  int       `json:"index"`
	Values []float32 `json:"values"`
}

type SonolusDifficulty

type SonolusDifficulty struct {
	Name   string `json:"name"`
	Rating string `json:"rating"`
}

type SonolusEntity

type SonolusEntity struct {
	Archetype int         `json:"archetype"`
	Data      SonolusData `json:"data"`
}

type SonolusList

type SonolusList struct {
	ID           int               `json:"id"`
	Title        string            `json:"title"`
	Artists      string            `json:"artists"`
	Author       string            `json:"author"`
	Cover        string            `json:"cover"`
	BGM          string            `json:"bgm"`
	Difficulties SonolusDifficulty `json:"difficulties"`
	Upload       int64             `json:"upload"`
}

func GetSonolusList

func GetSonolusList() (list []SonolusList, err error)

Jump to

Keyboard shortcuts

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