v1

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateReq

type CreateReq struct {
	g.Meta `path:"/demo" method:"post" tags:"DemoService" summary:"Create a demo record"`
	Fielda string `p:"fileda" v:"required|passport|length:4,30"`
	Fieldb string `p:"filedb" v:"required|length:10,30"`
}

创建记录示例.

type CreateRes

type CreateRes struct {
	ID uint `json:"id"`
}

type DeleteReq

type DeleteReq struct {
	g.Meta `path:"/demo/:id" method:"delete" tags:"DemoService" summary:"Delete a demo record"`
	ID     uint `p:"id" in:"path" v:"required|integer|min:1"`
}

删除记录示例.

type DeleteRes

type DeleteRes struct {
}

type GetListReq

type GetListReq struct {
	g.Meta `path:"/demo" method:"get" tags:"DemoService" summary:"Get demo records list"`
	api.CommonPaginationReq
}

查询记录列表示例.

type GetListRes

type GetListRes struct {
	api.CommonPaginationRes

	List []model.DemoListOutputItem `json:"list"`
}

type GetOneReq

type GetOneReq struct {
	g.Meta `path:"/demo/:fielda" method:"get" tags:"DemoService" summary:"Get demo info by fielda"`
	Fielda string `p:"fielda" in:"path" v:"required|length:4,30"`
}

查询单条记录示例.

type GetOneRes

type GetOneRes struct {
	ID        uint        `json:"id"`
	Fielda    string      `json:"fielda"`
	CreatedAt *gtime.Time `json:"created_at"`
	UpdatedAt *gtime.Time `json:"updated_at"`
}

type UpdateReq

type UpdateReq struct {
	g.Meta `path:"/demo/:id" method:"put" tags:"DemoService" summary:"Update a demo record"`
	ID     uint   `p:"id" in:"path" v:"integer|min:1"`
	Fielda string `p:"fileda" v:"required|passport|length:4,30"`
	Fieldb string `p:"filedb" v:"required|length:10,30"`
}

更新记录示例.

type UpdateRes

type UpdateRes struct {
}

Jump to

Keyboard shortcuts

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