controller

package
v0.0.0-...-50a2d83 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	beego.Controller
	// contains filtered or unexported fields
}

func (*Controller) DefaultCruise

func (c *Controller) DefaultCruise()

func (*Controller) DefaultIdle

func (c *Controller) DefaultIdle()

func (*Controller) DefaultLine

func (c *Controller) DefaultLine()

func (*Controller) DefaultPower

func (c *Controller) DefaultPower()

func (*Controller) DeleteAllPreset

func (c *Controller) DeleteAllPreset()

func (*Controller) DeleteCruise

func (c *Controller) DeleteCruise()

func (*Controller) DeletePreset

func (c *Controller) DeletePreset()
func (c *Controller) GotoPresetOk() {
	resp := apis.Response{}
	c.Data["json"] = &resp
	defer c.ServeJSON()

	id, err := c.GetInt("id")
	if err != nil {
		log.Error(err.Error())
		resp.Error(errors.ErrGetCfgFailed, "get param id failed")
		return
	}

	if err := dsd.PresetID(id).Validate(); err != nil {
		resp.Error(errors.ErrGetCfgFailed, err.Error())
		return
	}

	ok, err := c.blp.Preset.GotoOk(dsd.PresetID(id))
	if err != nil {
		resp.Error(errors.ErrGetCfgFailed, err.Error())
		return
	}

	resp.Success(ok)
}

func (*Controller) GetIdle

func (c *Controller) GetIdle()

func (*Controller) GetPower

func (c *Controller) GetPower()

func (*Controller) ListCruise

func (c *Controller) ListCruise()

func (*Controller) ListLine

func (c *Controller) ListLine()

func (*Controller) ListPreset

func (c *Controller) ListPreset()

func (*Controller) Prepare

func (c *Controller) Prepare()

func (*Controller) SetCruise

func (c *Controller) SetCruise()

func (*Controller) SetIdle

func (c *Controller) SetIdle()

func (*Controller) SetLine

func (c *Controller) SetLine()

func (*Controller) SetLineMargin

func (c *Controller) SetLineMargin()

func (*Controller) SetPower

func (c *Controller) SetPower()

func (*Controller) SetPreset

func (c *Controller) SetPreset()

func (*Controller) UpdateCruiseName

func (c *Controller) UpdateCruiseName()

func (*Controller) UpdatePresetName

func (c *Controller) UpdatePresetName()
func (c *Controller) GotoPreset() {
	resp := apis.Response{}
	c.Data["json"] = &resp
	defer c.ServeJSON()

	id, err := c.GetInt("id")
	if err != nil {
		log.Error(err.Error())
		resp.Error(errors.ErrGetCfgFailed, "get param id failed")
		return
	}

	if err := dsd.PresetID(id).Validate(); err != nil {
		resp.Error(errors.ErrGetCfgFailed, err.Error())
		return
	}

	if err := c.blp.Preset.Goto(dsd.PresetID(id)); err != nil {
		resp.Error(errors.ErrGetCfgFailed, err.Error())
		return
	}

	resp.Success()
}

Jump to

Keyboard shortcuts

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