* Revert changes

* Unrap nested structure for doc code generation

* Revert changes

* Remove useless code

* Remove useless code

* Format code
This commit is contained in:
anqiansong
2022-09-11 22:56:53 +08:00
committed by GitHub
parent 6ec8bc6655
commit 9581e8445a
5 changed files with 109 additions and 137 deletions

View File

@@ -1,3 +0,0 @@
type Common {
Some string `json:"some"` // some imported type
}

View File

@@ -1,48 +0,0 @@
import "./api_common.api"
type Resp {
R1 string `json:"r1"`
R2 bool `json:"r2"`
R3 Common `json:"r3"`
}
type CommonResponse {
Code int `json:"code"` // 100 | 200
Message string `json:"message"`
Common
Response Resp `json:"response"`
}
type LoginResponseDto {
Id string `bson:"_id" json:"id"`
Name string `json:"name"`
AccessToken string `json:"accessToken"`
}
type UserCreateDto {
Id string `json:"id"`
}
type LoginRequest {
Username string `json:"username,optional"` // user name is optional
Password string `json:"password,optional"`
}
type LoginResponse {
*CommonResponse
Result *LoginResponseDto `json:"result"`
}
type UserCreateRequest {
Username string `json:"username,optional"` // some dsada
Password string `json:"password,optional"`
}
type UserCreateResponse {
*CommonResponse
Result *UserCreateDto `json:"result"` // result
}
service user-api {
@handler UserHandler
post /user/signin(UserCreateRequest) returns (UserCreateResponse)
@handler LoginHandler
post /user/login(LoginRequest) returns (LoginResponse)
}