package http

import (
	"netease_control_center/globals"
)

type ScenePeriod int

const (
	ScenePeriod_Once       ScenePeriod = 1
	ScenePeriod_EveryDay   ScenePeriod = 2
	ScenePeriod_WorkDay    ScenePeriod = 3
	ScenePeriod_Weekend    ScenePeriod = 4
	ScenePeriod_EveryWeek  ScenePeriod = 5
	ScenePeriod_EveryMonth ScenePeriod = 6
	ScenePeriod_EveryYear  ScenePeriod = 7
)

type SceneTask_Status int

const (
	SceneTask_Status_On SceneTask_Status = 0 + iota
	SceneTask_Status_Off
)

type SceneTask struct {
	ServerId         int                   `json:"taskId"`
	LocalId          int                   `json:"type"`
	SongType         int                   `json:"playSongType"`
	TaskName         string                `json:"taskName"`
	EnterTts         SceneTts              `json:"enterTts"`
	Duration         int64                 `json:"duration"`
	Args             string                `json:"taskValues"`
	Progress         int                   `json:"taskProgress"`
	Priority         int                   `json:"taskPriority"`
	Count            int                   `json:"taskCount"`
	PlayMode         globals.MusicPlayMode `json:"playMode"`
	Status           SceneTask_Status      `json:"status"`
	NeedSyncProgress bool                  `json:"isSyncStatus"`
}

type SceneStatus int

const (
	SceneStatus_Create SceneStatus = 1
	SceneStatus_Pause  SceneStatus = 2
	SceneStatus_Close  SceneStatus = 3
)

type SceneTts struct {
	Tts       string `json:"tts"`
	BeginHour int    `json:"beginTime"`
	EndHour   int    `json:"endTime"`
	Count     int    `json:"count"`
}

type Scene struct {
	Id              string           `json:"id"`
	Name            string           `json:"name"`
	Duration        int64            `json:"duration"`
	Type            ScenePeriod      `json:"dataType"`
	Date            globals.VboxDate `json:"vboxDate"`
	EnterCommands   []string         `json:"enterCommands"`
	ExitCOmmands    []string         `json:"exitCommands"`
	Status          SceneStatus      `json:"status"`
	RemindCount     int              `json:"remindCount"`
	IsUserConfirm   bool             `json:"isUserConfirm"`
	UpdateTime      int64            `json:"updateTime"`
	UserId          string           `json:"userId"`
	SceneTasks      []SceneTask      `json:"sceneTasks"`
	EnterTts        []SceneTts       `json:"enterTts"`
	ExitTts         []SceneTts       `json:"exitTts"`
	EnterTimes      int              `json:"exeCount"`
	ConfirmEnterTts SceneTts         `json:"enterBeforeTts"`
}

type HttpReqSceneById struct {
	SceneId string `json:"id"`
}
type HttpRspSceneById = Scene

type SceneWrapper struct {
	//local module asked
	Id         uint64 `json:"id"`
	Vboxid     string `json:"vboxid"`
	VoiceType  int    `json:"voiceType"`
	VoiceName  string `json:"voiceName"`
	Status     int    `json:"status"`
	UpdateTime uint64 `json:"updateTime"`
	CreateTime uint64 `json:"createTime"`

	//server return
	SceneId  string           `json:"remark"`
	Label    int              `json:"label"`
	Type     int              `json:"type"`
	Vboxdate globals.VboxDate `json:"vboxDate"`
}

type HttpReqRefreshScene struct {
}

type HttpRspRefreshScene []SceneWrapper

type HttpReqSceneConfirmTts struct {
	SceneId string `json:"sceneId"`
}

type HttpRspSceneConfirmTts = SceneTts

type HttpReqReportSceneProgress struct {
	SceneId  string `json:"sceneId"`
	TaskId   int    `json:"taskId"`
	TaskType int    `json:"taskType"`
	Progress int    `json:"progress"`
}

type HttpRspReportSceneProgress interface{}
