Skip to content

Commit

Permalink
Merge pull request #218 from intelops/revert-217-main
Browse files Browse the repository at this point in the history
Revert "feat: added swagger feature to compage for go-gin-server framework"
  • Loading branch information
mahendraintelops authored May 3, 2024
2 parents 5f0b10c + 4d393eb commit d33e7df
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 77 deletions.
11 changes: 0 additions & 11 deletions internal/languages/golang/common.go

This file was deleted.

21 changes: 0 additions & 21 deletions internal/languages/golang/frameworks/go-gin-server/copier.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ const SQLServiceFile = "sqls-service.go.tmpl"
const MySQLDaoFile = "mysql-dao.go.tmpl"
const SQLModelFile = "sqls-model.go.tmpl"

// common file for common utility functions in controllers
const ControllersCommonFile = "common.go.tmpl"

const DaoFile = "dao.go.tmpl"
const SQLiteDaoFile = "sqlite-dao.go.tmpl"
const MySQLDBConfigFile = "mysql.go.tmpl"
Expand Down Expand Up @@ -475,15 +472,6 @@ func (c *Copier) copyNoSQLDBResourceFiles(resourceName string, filePaths []*stri
}
filePaths = append(filePaths, &targetResourceControllerFileName)

// copy controller common file to a generated project
targetResourceControllerCommonFileName := c.NodeDirectoryName + ControllersPath + "/" + ControllersCommonFile
_, err = utils.CopyFile(targetResourceControllerCommonFileName, c.TemplatesRootPath+ControllersPath+"/"+ControllersCommonFile)
if err != nil {
log.Debugf("error copying controller utils file: %v", err)
return nil, err
}
filePaths = append(filePaths, &targetResourceControllerCommonFileName)

// copy model files to a generated project
targetResourceModelFileName := c.NodeDirectoryName + ModelsPath + "/" + resourceName + "-" + strings.Replace(NoSQLModelFile, "nosqls-", "", 1)
_, err = utils.CopyFile(targetResourceModelFileName, c.TemplatesRootPath+ModelsPath+"/"+NoSQLModelFile)
Expand Down Expand Up @@ -527,15 +515,6 @@ func (c *Copier) copySQLDBResourceFiles(resourceName string, filePaths []*string
}
filePaths = append(filePaths, &targetResourceControllerFileName)

// copy controller common file to a generated project
targetResourceControllerCommonFileName := c.NodeDirectoryName + ControllersPath + "/" + ControllersCommonFile
_, err = utils.CopyFile(targetResourceControllerCommonFileName, c.TemplatesRootPath+ControllersPath+"/"+ControllersCommonFile)
if err != nil {
log.Debugf("error copying controller utils file: %v", err)
return nil, err
}
filePaths = append(filePaths, &targetResourceControllerCommonFileName)

// copy service files to a generated project
targetResourceServiceFileName := c.NodeDirectoryName + ServicesPath + "/" + resourceName + "-" + strings.Replace(SQLServiceFile, "sqls-", "", 1)
_, err = utils.CopyFile(targetResourceServiceFileName, c.TemplatesRootPath+ServicesPath+"/"+SQLServiceFile)
Expand Down
7 changes: 0 additions & 7 deletions internal/languages/golang/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ func Generate(ctx context.Context) error {
return err
}

// RunSwag runs the swag command to generate the swagger documentation
err = RunSwag(goValues.Values.NodeDirectoryName)
if err != nil {
log.Errorf("err : %s", err)
return err
}

return nil
}

Expand Down
6 changes: 6 additions & 0 deletions internal/languages/golang/make-proto-runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,9 @@ func RunMakeProto(directoryName string) error {
}
return fmt.Errorf("%s command doesn't exist", protocCommand)
}

// as util
func commandExists(cmd string) bool {
_, err := exec.LookPath(cmd)
return err == nil
}
38 changes: 0 additions & 38 deletions internal/languages/golang/swag-runner.go

This file was deleted.

0 comments on commit d33e7df

Please sign in to comment.