Skip to content

Commit

Permalink
允许指定 gen to 自动给 model
Browse files Browse the repository at this point in the history
  • Loading branch information
Luoxin committed Jan 1, 2025
1 parent bcad582 commit 5474d74
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cli/gen/gen_add_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ var addRpcCmd = &cobra.Command{
}

var msg *codegen.PbMessage
if v, err := cmd.Flags().GetString("model"); err == nil && v != "" {
if v, err := cmd.Flags().GetString("model"); err == nil && (v != "" || opt.GenTo != "") {
if v == "" {
v = opt.GenTo
}

// 先看一下加了 Model 的 时候存在
{
model := stringx.ToSnake(v)
Expand Down

0 comments on commit 5474d74

Please sign in to comment.