You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
1.7 KiB
Smarty

1 year ago
syntax = "v1"
info(
title: "Base Api"
desc: "API basic"
author: "NorthLan"
email: "lan6995@gmail.com"
version: "v1.0"
)
// Pagination | 分页模型
// swagger:model Pagination
// swagger:allOf
type Pagination {
// Page Size | 每页大小
//
// Minimum: 0
// Maximum: 9999
// Required: false
// Example: 10
Size uint64 `json:"size,optional" form:"size,optional" validate:"number,max=9999"`
// Current Page | 当前页
//
// Minimum: 1
// Maximum: 100000
// Required: false
// Example: 1
Current uint64 `json:"current,optional" form:"current,optional" validate:"number,max=100000"`
// Total Number | 数据总数
//
// Required: false
Total uint64 `json:"total,optional" form:"total,optional" validate:"number"`
}
// TimeInfo | 时间结构
// swagger:model TimeInfo
type TimeInfo {
// Create Time | 创建时间
CreatedAt string `json:"createdAt,optional"`
// Update Time | 更新时间
UpdatedAt string `json:"updatedAt,optional"`
}
// Basic ID Request | 基础ID结构
type IDReq {
// Id | 序号
Id uint64 `json:"id,string,optional" form:"id,string,optional"`
}
// Basic ID request (path) | 基础ID结构地址参数
type IDPathReq {
// ID | 序号
//
// In: path
Id uint64 `json:"id,optional,string" path:"id,optional,string"`
}
// Basic ID List request | 基础ID列表结构用于Post
// swagger:model IDsReq
type IDsReq {
// 主键列表
Ids []uint64 `json:"ids,optional" form:"ids,optional"`
}
// The base ID response data | 基础ID信息
type BaseIDInfo {
// Id | 序号
Id uint64 `json:"id,string,optional"`
TimeInfo
}
@server(
group: base
prefix: /api/base
)
service {{.name}} {
// Initialize database | 初始化数据库
@handler initDatabase
get /initDatabase
}