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.
OneAuth/oa/protoc/api/app.api

38 lines
937 B
Plaintext

import "base.api"
type (
3 months ago
// 定义登录接口的请求体
AppReq {
4 weeks ago
appname string `form:"username"`
3 months ago
Password string `json:"password"`
Pa string `path:"pa"`
}
// 定义登录接口的响应体
AppResp {
Id int64 `json:"id"`
Name string `json:"name"`
Token string `json:"token"`
ExpireAt string `json:"expireAt"`
}
)
@server (
3 months ago
// 代表当前 service 代码块下的路由生成代码时都会被放到 app 目录下
group: app
// 定义路由前缀为 "/v1"
prefix: /api/app
)
// 定义 HTTP 服务
// 微服务名称为 main生成的代码目录和配置文件将和 user 值相关
3 months ago
service main {
// 定义 http.HandleFunc 转换的 go 文件名称及方法
@handler Login
// 定义接口
// 请求方法为 post
// 路由为 /app/login
// 请求体为 LoginReq
// 响应体为 LoginResp响应体必须有 returns 关键字修饰
4 weeks ago
get /login/:pa (AppReq) returns (AppResp)
}
3 months ago