syntax = "v1" type Request { Name string `path:"name,options=you|me"` } type Response { Message string `json:"message"` } type DbPingResponse { Ok bool `json:"ok"` Version string `json:"version"` Database string `json:"database"` } type DeleteResp { Ok bool `json:"ok"` } type CreateDirectoryReq { Id int64 `json:"id"` ServiceId int64 `json:"serviceId,optional"` Directory string `json:"directory,optional"` } type UpdateDirectoryReq { Id int64 `path:"id"` ServiceId int64 `json:"serviceId,optional"` Directory string `json:"directory,optional"` } type DirectoryIdReq { Id int64 `path:"id"` } type DirectoryResp { Id int64 `json:"id"` ServiceId int64 `json:"serviceId"` Directory string `json:"directory"` } type ListDirectoryReq { Page int64 `form:"page,optional"` PageSize int64 `form:"pageSize,optional"` } type DirectoryListResp { List []DirectoryResp `json:"list"` Total int64 `json:"total"` } type CreateKeyReq { Name string `json:"name"` } type UpdateKeyReq { Id int64 `path:"id"` Iden string `json:"iden,optional"` Name string `json:"name,optional"` Content string `json:"content,optional"` Status string `json:"status,optional"` } type KeyIdReq { Id int64 `path:"id"` } type KeyResp { Id int64 `json:"id"` Iden string `json:"iden"` Name string `json:"name"` Content string `json:"content"` Status string `json:"status"` CreateAt string `json:"createAt"` } type ListKeysReq { Page int64 `form:"page,optional"` PageSize int64 `form:"pageSize,optional"` } type KeyListResp { List []KeyResp `json:"list"` Total int64 `json:"total"` } type CreateServiceReq { Id int64 `json:"id"` Name string `json:"name,optional"` Ip string `json:"ip,optional"` Port string `json:"port,optional"` Iden string `json:"iden,optional"` KeyIden string `json:"keyIden,optional"` KeyAlgo string `json:"keyAlgo,optional"` Status string `json:"status,optional"` } type UpdateServiceReq { Id int64 `path:"id"` Name string `json:"name,optional"` Ip string `json:"ip,optional"` Port string `json:"port,optional"` Iden string `json:"iden,optional"` KeyIden string `json:"keyIden,optional"` KeyAlgo string `json:"keyAlgo,optional"` Status string `json:"status,optional"` } type ServiceIdReq { Id int64 `path:"id"` } type ServiceResp { Id int64 `json:"id"` Name string `json:"name"` Ip string `json:"ip"` Port string `json:"port"` Iden string `json:"iden"` KeyIden string `json:"keyIden"` KeyAlgo string `json:"keyAlgo"` Status string `json:"status"` CreateAt string `json:"createAt"` } type ListServiceReq { Page int64 `form:"page,optional"` PageSize int64 `form:"pageSize,optional"` } type ServiceListResp { List []ServiceResp `json:"list"` Total int64 `json:"total"` } @server ( prefix: /api/v1 ) service udeServer-api { @handler UdeServerHandler get /from/:name (Request) returns (Response) @handler DbPingHandler get /db/ping returns (DbPingResponse) @handler CreateDirectoryHandler post /directories (CreateDirectoryReq) returns (DirectoryResp) @handler ListDirectoriesHandler get /directories (ListDirectoryReq) returns (DirectoryListResp) @handler GetDirectoryHandler get /directories/:id (DirectoryIdReq) returns (DirectoryResp) @handler UpdateDirectoryHandler put /directories/:id (UpdateDirectoryReq) returns (DirectoryResp) @handler DeleteDirectoryHandler delete /directories/:id (DirectoryIdReq) returns (DeleteResp) @handler CreateKeyHandler post /keys (CreateKeyReq) returns (KeyResp) @handler ListKeysHandler get /keys (ListKeysReq) returns (KeyListResp) @handler GetKeyHandler get /keys/:id (KeyIdReq) returns (KeyResp) @handler UpdateKeyHandler put /keys/:id (UpdateKeyReq) returns (KeyResp) @handler DeleteKeyHandler delete /keys/:id (KeyIdReq) returns (DeleteResp) @handler CreateServiceHandler post /services (CreateServiceReq) returns (ServiceResp) @handler ListServicesHandler get /services (ListServiceReq) returns (ServiceListResp) @handler GetServiceHandler get /services/:id (ServiceIdReq) returns (ServiceResp) @handler UpdateServiceHandler put /services/:id (UpdateServiceReq) returns (ServiceResp) @handler DeleteServiceHandler delete /services/:id (ServiceIdReq) returns (DeleteResp) }