v1

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTask added in v0.10.0

func CreateTask(ctx *gin.Context)

func DeleteTask added in v0.10.0

func DeleteTask(ctx *gin.Context)

func GetTask added in v0.10.0

func GetTask(ctx *gin.Context)

func GetTasks added in v0.10.0

func GetTasks(ctx *gin.Context)

func Login added in v0.10.0

func Login(ctx *gin.Context)

func New

func New(p gin.IRouter)

func SignUp added in v0.10.0

func SignUp(ctx *gin.Context)

func UpdateTask added in v0.10.0

func UpdateTask(ctx *gin.Context)

func UpdateUser added in v0.10.0

func UpdateUser(ctx *gin.Context)

Types

type CreateTaskReq added in v0.10.0

type CreateTaskReq struct {
	Desc string `json:"desc"`
	Kind string `json:"kind" binding:"required"`
	Spec string `json:"spec" binding:"required"`

	// Param 不同的 kind 有不同的 param, 所以这里不对 Param 解析
	Param json.RawMessage `json:"param"`
}

type CreateTaskRsp added in v0.10.0

type CreateTaskRsp struct {
	TaskID int64 `json:"task_id"`
}

type DeleteTaskReq added in v0.10.0

type DeleteTaskReq struct {
	TaskID int64 `uri:"task_id" binding:"required"`
}

type GetTaskReq added in v0.10.0

type GetTaskReq struct {
	TaskID int64 `uri:"task_id" binding:"required"`
}

type GetTaskRsp added in v0.10.0

type GetTaskRsp struct {
	Task Task `json:"task"`
}

type GetTasksReq added in v0.10.0

type GetTasksReq struct {
	Desc      string `json:"desc"`
	Kind      string `json:"kind"`
	Spec      string `json:"spec"`
	CreatedAt int64  `json:"created_at"`
	PageID    int64  `json:"page_id" binding:"gt=0"`
	PageSize  int64  `json:"page_size" binding:"gt=0"`
}

type GetTasksRsp added in v0.10.0

type GetTasksRsp struct {
	Count int64  `json:"count"`
	Tasks []Task `json:"tasks"`
}

type LoginReq added in v0.10.0

type LoginReq struct {
	Nickname string `json:"nickname" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type LoginRsp added in v0.10.0

type LoginRsp struct {
	UserID int64  `json:"user_id"`
	Token  string `json:"token"`
}

type SignUpReq added in v0.10.0

type SignUpReq struct {
	Nickname string `json:"nickname" binding:"required"`
	Password string `json:"password" binding:"required"`
	Mail     string `json:"mail"`
	Telegram int64  `json:"telegram"`
}

type SignUpRsp added in v0.10.0

type SignUpRsp struct {
	UserID int64  `json:"user_id"`
	Token  string `json:"token"`
}

type Task added in v0.10.0

type Task struct {
	TaskID    int64  `json:"task_id"`
	Desc      string `json:"desc"`
	UserID    int64  `json:"user_id"`
	Kind      string `json:"kind"`
	Spec      string `json:"spec"`
	CreatedAt int64  `json:"created_at"`

	// Param 返回时也不要进行 base64 编码
	Param json.RawMessage `json:"param"`
}

type UpdateTaskReq added in v0.10.0

type UpdateTaskReq struct {
	TaskID int64  `uri:"task_id" binding:"required"`
	Desc   string `json:"desc"`
	Spec   string `json:"spec"`

	// Param 更新时也不要解析
	Param json.RawMessage `json:"param"`
}

type UpdateUserReq added in v0.10.0

type UpdateUserReq struct {
	Nickname string `json:"nickname"`
	Password string `json:"password"`
	Mail     string `json:"mail"`
	Telegram int64  `json:"telegram"`
}

Jump to

Keyboard shortcuts

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