package main import "time" // Command 命令相关 type Command struct { commands CommandType commandTime time.Time } // CommandType 命令 type CommandType string const ( CMDDoNothing = "不做任何操作" CMDChaoShengBoQingXi = "超声波清洗" CMDQingXiGuanFangShui = "清洗罐放水" ) // CreateCommand 生成一个命令 func CreateCommand(cmdtype CommandType) *Command { c := &Command{} c.commands = cmdtype c.commandTime = time.Now() return c }