🏗️ microservice fabric splitting
This commit is contained in:
43
app/file/api/file.api
Normal file
43
app/file/api/file.api
Normal file
@@ -0,0 +1,43 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "文件服务"
|
||||
desc: "文件服务"
|
||||
author: "landaiqing"
|
||||
email: "landaiqing@126.com"
|
||||
version: "v1.0.0"
|
||||
)
|
||||
|
||||
// 上传图片请求参数
|
||||
type (
|
||||
UploadRequest {
|
||||
Image string `json:"image"`
|
||||
AccessToken string `json:"access_token"`
|
||||
userId string `json:"user_id"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
group: websocket // 微服务分组
|
||||
prefix: /api/ws // 微服务前缀
|
||||
)
|
||||
service file {
|
||||
@handler fileWebsocket
|
||||
get /file
|
||||
}
|
||||
|
||||
@server (
|
||||
group: upscale // 微服务分组
|
||||
prefix: /api/auth/upscale // 微服务前缀
|
||||
timeout: 10s // 超时时间
|
||||
maxBytes: 10485760 // 最大请求大小
|
||||
signature: false // 是否开启签名验证
|
||||
middleware: SecurityHeadersMiddleware,NonceMiddleware // 注册中间件
|
||||
MaxConns: true // 是否开启最大连接数限制
|
||||
Recover: true // 是否开启自动恢复
|
||||
)
|
||||
service file {
|
||||
@handler uploadImage
|
||||
post /upload (UploadRequest)
|
||||
}
|
||||
|
Reference in New Issue
Block a user