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

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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
}