浏览代码

fix goctl api (#71)

miaogaolin 4 年之前
父节点
当前提交
9a57993e83
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      tools/goctl/api/gogen/genhandlers.go

+ 1 - 1
tools/goctl/api/gogen/genhandlers.go

@@ -164,7 +164,7 @@ func genHandlerImports(group spec.Group, route spec.Route, parentPkg string) str
 	imports = append(imports, fmt.Sprintf("\"%s\"",
 		util.JoinPackages(parentPkg, getLogicFolderPath(group, route))))
 	imports = append(imports, fmt.Sprintf("\"%s\"", util.JoinPackages(parentPkg, contextDir)))
-	if len(route.RequestType.Name) > 0 || len(route.ResponseType.Name) > 0 {
+	if len(route.RequestType.Name) > 0 {
 		imports = append(imports, fmt.Sprintf("\"%s\"\n", util.JoinPackages(parentPkg, typesDir)))
 	}
 	imports = append(imports, fmt.Sprintf("\"%s/rest/httpx\"", vars.ProjectOpenSourceUrl))