package request

import "server/dao"

// PageInfo Paging common input parameter structure
type PageInfo struct {
	Page     int    `json:"page" form:"page"`         // 页码
	PageSize int    `json:"pageSize" form:"pageSize"` // 每页大小
	Keyword  string `json:"keyword" form:"keyword"`   //关键字
}

// GetById Find by id structure
type GetById struct {
	ID int `json:"id" form:"id"` // 主键ID
}

func (r *GetById) Uint() uint {
	return uint(r.ID)
}

type IdsReq struct {
	Ids []int `json:"ids" form:"ids"`
}

// GetAuthorityId Get role by id structure
type GetAuthorityId struct {
	AuthorityId uint `json:"authorityId" form:"authorityId"` // 角色ID
}

type DeviceSearch struct {
	PageInfo PageInfo `json:"pageInfo" form:"pageInfo"` // 分页信息
	Sn       string   `json:"sn" form:"sn"`             //设备sn
	Name     string   `json:"name" form:"name"`         // 设备名称
	Genre    int      `json:"genre" form:"genre"`       //设备类型
}

type TunnelSearch struct {
	PageInfo PageInfo `json:"pageInfo" form:"pageInfo"` // 分页信息
	Name     string   `json:"name" form:"name"`         //隧道名称
	UserId   int      `json:"userId" form:"userId"`     //
	RegionId int      `json:"regionId" form:"regionId"`
}

type RegionTunnelsId struct {
	TunnelIds []int `json:"tunnelIds" form:"tunnelIds"`
	RegionId  int   `json:"regionId" form:"regionId"`
}

type EditTactics struct {
	Sn      string `json:"sn" form:"sn"`
	Tactics int    `json:"tactics" form:"tactics"`
}

type UserTunnels struct {
	User      dao.SysUser `json:"user" form:"user"`
	TunnelIds []int       `json:"tunnelIds" form:"tunnelIds"`
}

type SwitchTunnel struct {
	TunnelSn string `json:"tunnelSn" form:"tunnelSn"`
	RadarId  int    `json:"radarId"`
	RelayId  int    `json:"relayId"`
	State    bool   `json:"state"`
}

type TunnelLamp struct {
	Id         int    `json:"id" form:"id"`
	TunnelSn   string `json:"tunnelSn" form:"tunnelSn"`
	LampValue1 int    `json:"lampValue1"`
	LampValue2 int    `json:"lampValue2"`
}

type Empty struct{}
