tons of code
This commit is contained in:
parent
8be9d454d5
commit
57835e81ac
@ -46,11 +46,11 @@ func (g *GoApiParser) Parse(sourceFile string) (*api.Api, error) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
structType, ok := typeSpec.Type.(*ast.StructType)
|
_, isStruct := typeSpec.Type.(*ast.StructType)
|
||||||
if !ok {
|
_, isIface := typeSpec.Type.(*ast.InterfaceType)
|
||||||
|
if !isStruct && !isIface {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
_ = structType
|
|
||||||
|
|
||||||
apis.Endpoints = append(apis.Endpoints, api.Endpoint{
|
apis.Endpoints = append(apis.Endpoints, api.Endpoint{
|
||||||
Name: typeSpec.Name.Name,
|
Name: typeSpec.Name.Name,
|
||||||
@ -96,8 +96,8 @@ func (g *GoApiParser) Parse(sourceFile string) (*api.Api, error) {
|
|||||||
var apiPar api.Val
|
var apiPar api.Val
|
||||||
ident := param.Type.(*ast.Ident)
|
ident := param.Type.(*ast.Ident)
|
||||||
switch ident.Name {
|
switch ident.Name {
|
||||||
case "int":
|
//case "int":
|
||||||
apiPar.Type = api.TInt
|
// apiPar.Type = api.TInt
|
||||||
case "string":
|
case "string":
|
||||||
apiPar.Type = api.TString
|
apiPar.Type = api.TString
|
||||||
case "bool":
|
case "bool":
|
||||||
|
|||||||
@ -107,8 +107,8 @@ func (t *TypescriptApiParser) Parse(sourceFilePath string) (*api.Api, error) {
|
|||||||
if method.Type != nil {
|
if method.Type != nil {
|
||||||
var apiRet api.Val
|
var apiRet api.Val
|
||||||
switch method.Type.Kind {
|
switch method.Type.Kind {
|
||||||
case ast.KindNumberKeyword:
|
//case ast.KindNumberKeyword:
|
||||||
apiRet.Type = api.TInt
|
// apiRet.Type = api.TInt
|
||||||
case ast.KindStringKeyword:
|
case ast.KindStringKeyword:
|
||||||
apiRet.Type = api.TString
|
apiRet.Type = api.TString
|
||||||
case ast.KindBooleanKeyword:
|
case ast.KindBooleanKeyword:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user