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.

74 lines
1.6 KiB
Plaintext

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 BaseID {
// Id | 序号
ID int64 `json:"id,string,optional" form:"id,string,optional"`
}
// Basic ID request (path) | 基础ID结构地址参数
type PathID {
// ID | 序号
//
// In: path
ID int64 `json:"id,optional,string" path:"id,optional,string"`
}
// Basic ID List request | 基础ID列表结构用于Post
// swagger:model BaseIDs
type BaseIDs {
// 主键列表
Ids []int64 `json:"ids,optional" form:"ids,optional"`
}
@server(
group: base
prefix: /api/base
)
service api {
// Initialize database | 初始化数据库
@handler initDatabase
get /initDatabase
}