Skip to content

Commit

Permalink
feat:a restful api template (#191)
Browse files Browse the repository at this point in the history
* feat:a restful api template

* fix:http only and Modify parameter name

* fix:Modify parameter name

* fix: server directory structure
  • Loading branch information
yuxialuozi authored Jun 2, 2024
1 parent ce07e0a commit 14939c0
Show file tree
Hide file tree
Showing 4 changed files with 712 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/consts/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const (
DefaultDocModelOutDir = "biz/doc/model"
DefaultDocDaoOutDir = "biz/doc/dao"
Standard = "standard"
StandardV2 = "standard_v2"
CurrentDir = "."
)

Expand Down
6 changes: 6 additions & 0 deletions pkg/server/hz.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ func convertHzArgument(sa *config.ServerArgument, hzArgument *hzConfig.Argument)
if isExist {
hzArgument.CustomizeLayoutData = layoutDataPath
}

if sa.Template == consts.StandardV2 && sa.Type == consts.HTTP {
hzArgument.CustomizeLayout = path.Join(tpl.HertzDir, consts.Server, consts.StandardV2, consts.LayoutFile)
hzArgument.CustomizePackage = path.Join(tpl.HertzDir, consts.Server, consts.StandardV2, consts.PackageLayoutFile)
}

} else {
hzArgument.CustomizeLayout = path.Join(tpl.HertzDir, consts.Server, consts.Standard, consts.LayoutFile)
hzArgument.CustomizePackage = path.Join(tpl.HertzDir, consts.Server, consts.Standard, consts.PackageLayoutFile)
Expand Down
Loading

0 comments on commit 14939c0

Please sign in to comment.