未验证 提交 a45bf134 编写于 作者: P Phodal Huang

fix: fix restApi empty issue

上级 0ab9ee0f
......@@ -44,7 +44,7 @@ var apiCmd = &cobra.Command{
if *&apiCmdConfig.ForceUpdate {
app := new(JavaApiApp)
// TODO: 如果已有 API 时,不再重新生成
restApis := app.AnalysisPath(path, dependence)
restApis = app.AnalysisPath(path, dependence)
cModel, _ := json.MarshalIndent(restApis, "", "\t")
WriteToCocaFile("apis.json", string(cModel))
} else {
......
......@@ -16,7 +16,7 @@ type JavaApiApp struct {
}
func (j *JavaApiApp) AnalysisPath(codeDir string, depPath string) *[]RestApi {
func (j *JavaApiApp) AnalysisPath(codeDir string, depPath string) []RestApi {
parsedDeps = nil
file := support.ReadFile(depPath)
if file == nil {
......@@ -43,6 +43,6 @@ func (j *JavaApiApp) AnalysisPath(codeDir string, depPath string) *[]RestApi {
allApis = listener.getClassApis()
}
return &allApis
return *&allApis
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册