controllers

package
v0.0.0-...-2b36349 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MainController

type MainController struct {
	beego.Controller
}

func (*MainController) Get

func (this *MainController) Get()

func (*MainController) Get2

func (this *MainController) Get2()

type TaskController

type TaskController struct {
	beego.Controller
}

func (*TaskController) GetTask

func (this *TaskController) GetTask()

Examples:

req: GET /task/1
res: 200 {"ID": 1, "Title": "Buy bread", "Done": true}

req: GET /task/42
res: 404 task not found

func (*TaskController) ListTasks

func (this *TaskController) ListTasks()

Example:

req: GET /task/
res: 200 {"Tasks": [
       {"ID": 1, "Title": "Learn Go", "Done": false},
       {"ID": 2, "Title": "Buy bread", "Done": true}
     ]}

func (*TaskController) NewTask

func (this *TaskController) NewTask()

Examples:

req: POST /task/ {"Title": ""}
res: 400 empty title

req: POST /task/ {"Title": "Buy bread"}
res: 200

func (*TaskController) TestDca

func (this *TaskController) TestDca()

func (*TaskController) UpdateTask

func (this *TaskController) UpdateTask()

Example:

req: PUT /task/1 {"ID": 1, "Title": "Learn Go", "Done": true}
res: 200

req: PUT /task/2 {"ID": 2, "Title": "Learn Go", "Done": true}
res: 400 inconsistent task IDs

Jump to

Keyboard shortcuts

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