controllers

package
v0.0.0-...-f037d2d Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TaskManager models.Tasks

Functions

This section is empty.

Types

type MainController

type MainController struct {
	// Anonymous field, so the MainController has all methods that beego.Controller has.
	beego.Controller
}

func (*MainController) Finish

func (c *MainController) Finish()

Dump tasks to session.

func (*MainController) Get

func (c *MainController) Get()

func (*MainController) Prepare

func (c *MainController) Prepare()

type Post

type Post struct {
	Id    int
	Title string
	User  *User `orm:"rel(fk)"`
}

type Task

type Task struct {
	Id    string `form:"-"`
	Title string `form:"title"`
	Body  string `form:"body"`
	Date  time.Time
}

type TaskController

type TaskController struct {
	MainController
}

func (*TaskController) Edit

func (c *TaskController) Edit()

@router /tasks/edit/:id [GET] @router /tasks/edit/:id [POST]

func (*TaskController) Index

func (c *TaskController) Index()

func (*TaskController) Post

func (c *TaskController) Post()

type User

type User struct {
	Id    int
	Name  string
	Posts []*Post `orm:"reverse(many)"`
}

DB Model.

type V1TaskController

type V1TaskController struct {
	MainController
}

func (*V1TaskController) Delete

func (c *V1TaskController) Delete()

@Title Delete @Description delete the task @Param id path string true "The id you want to delete" @Success 200 {string} delete success! @Failure 403 id is empty @router /:id [delete]

func (*V1TaskController) Get

func (c *V1TaskController) Get()

@Title Get @Description Get Task by Id @Param id path string true "The key for staticblock" @Success 200 {object} models.Task @Failure 403 :uid is empty @router /:id [get]

func (*V1TaskController) GetAll

func (c *V1TaskController) GetAll()

@Title GetAll @Description Get all Tasks @Success 200 {object} models.Task @router / [get]

func (*V1TaskController) Post

func (c *V1TaskController) Post()

@Title CreateTask @Description create tasks @Param body body models.Task true "body for task content" @Success 200 {int} models.Task.Id @Failure 403 body is empty @router / [post]

func (*V1TaskController) Put

func (c *V1TaskController) Put()

@Title Update @Description update the task @Param id path string true "The id you want to update" @Param body body models.Task true "body for task content" @Success 200 {object} models.Task @Failure 403 :id is not int @router /:id [put]

Jump to

Keyboard shortcuts

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