package api

import "time"

// user-----------------------------------------------------------------------------------------------
type result struct {
	Date        string
	Password    string
	ConfirmCode string
	UpdatedAt   time.Time
	Key         string
	AesKey      string
}

// weather---------------------------------------------------------------------------------------------
type resWeather struct {
	Status  int     `json:"status"`
	Message string  `json:"message"`
	Data    resData `json:"data"`
}
type resData struct {
	Forecast24h resDate `json:"forecast_24h"`
}
type resDate struct {
	D0 res24h `json:"1"`
	D1 res24h `json:"2"`
}
type res24h struct {
	Time               string `json:"time"`
	MaxDegree          string `json:"max_degree"`
	MinDegree          string `json:"min_degree"`
	DayWeather         string `json:"day_weather"`
	DayWindDirection   string `json:"day_wind_direction"`
	DayWindPower       string `json:"day_wind_power"`
	NightWeather       string `json:"night_weather"`
	NightWindPower     string `json:"night_wind_power"`
	NightWindDirection string `json:"night_wind_direction"`
}
type resLocation struct {
	Data    map[string]string `json:"data"`
	Message string            `json:"message"`
	Status  int               `json:"status"`
}

// backgammon-----------------------------------------------------------------------------------------------
type typeRoomStatus struct {
	RoomId int    `json:"room_id"`
	Player string `json:"player"`
}

// file-----------------------------------------------------------------------------------------------------
type filesRes struct {
	Dirs  []string   `json:"dirs"`
	Files []fileItem `json:"files"`
}
type fileItem struct {
	Name string `json:"name"`
	Type string `json:"type"`
	Size int64  `json:"size"`
}
type videoM3u8 struct {
	Video bool `json:"video"`
	M3u8  bool `json:"m3u8"`
}

// notes------------------------------------------------------------------------------------------------------
type noteParam struct {
	ID      uint   `json:"id"`
	Content string `json:"content"`
}

// sysInfo------------------------------------------------------------------------------------------------------
type resSysInfo struct {
	Datetime string    `json:"datetime"`
	CpuPer   float64   `json:"cpu_per"`
	Mem      resMem    `json:"mem"`
	Disk     []resDisk `json:"disk"`
	Net      resNet    `json:"net"`
}
type resMem struct {
	MemTotal string  `json:"mem_total"`
	MemUsed  string  `json:"mem_used"`
	MemPer   float64 `json:"mem_per"`
}
type resDisk struct {
	Point string  `json:"point"`
	Total string  `json:"total"`
	Used  string  `json:"used"`
	Per   float64 `json:"per"`
}
type resNet struct {
	Sent string `json:"sent"`
	Rec  string `json:"rec"`
}
type resSystem struct {
	Hostname string `json:"hostname"`
	Ip       string `json:"ip"`
}
type sysInfoIDs struct {
	IDs []int `json:"ids"`
}

// yeb----------------------------------------------------------------------------------------------------------
type paramsBalance struct {
	Card    string  `json:"card"`
	Type    bool    `json:"type"`
	Balance float64 `json:"balance"`
}

type paramSZBalance struct {
	Card   string  `json:"card"`
	Type   bool    `json:"type"` // 1-支出；0-收入
	Amount float64 `json:"amount"`
}

// 月余额
type dateLog struct {
	Date     string    `json:"date"`
	Duration string    `json:"duration"`
	Changes  float64   `json:"changes"`
	Balance  float64   `json:"balance"`
	Detail   []cardLog `json:"detail"`
}

// 详情
type cardLog struct {
	Card    string  `json:"card"`
	Balance float64 `json:"balance"`
	Changes float64 `json:"changes"`
}

// menus-----------------------------------------------------------------------------
type resMenu struct {
	MenuId    string    `json:"menu_id"`
	Name      string    `json:"name"`
	Icon      string    `json:"icon"`
	Path      string    `json:"path"`
	RouteOnly bool      `json:"route_only"`
	Detail    []subMenu `json:"detail"`
}

type subMenu struct {
	MenuId    string `json:"menu_id"`
	Name      string `json:"name"`
	Icon      string `json:"icon"`
	Path      string `json:"path"`
	RouteOnly bool   `json:"route_only"`
}

type sysIconsParam struct {
	Icons string `json:"icons"`
}

// sudoku-----------------------------------------------------------------------------
type resSudokuListType struct {
	New      []sudokuListType `json:"new"`
	Starting []sudokuListType `json:"starting"`
	Complete []sudokuListType `json:"complete"`
}

type sudokuListType struct {
	Sudoku   string `json:"sudoku"`
	SudokuId uint   `json:"sudokuId"`
	Username string `json:"username"`
	Status   string `json:"status"`
	Complete bool   `json:"complete"`
	Id       uint   `json:"id"`
}
type addSudokuParam struct {
	Sudoku string `json:"sudoku"`
	Result string `json:"result"`
}
