Sfoglia il codice sorgente

fix 当表有唯一键时,update()的形参和实参不一致 (#2010)

taobig 2 anni fa
parent
commit
c92400ead2
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      tools/goctl/model/sql/template/update.go

+ 1 - 1
tools/goctl/model/sql/template/update.go

@@ -20,5 +20,5 @@ func (m *default{{.upperStartCamelObject}}Model) Update(ctx context.Context, {{i
 `
 
 	// UpdateMethod defines an interface method template for generating update codes
-	UpdateMethod = `Update(ctx context.Context, newData *{{.upperStartCamelObject}}) error`
+	UpdateMethod = `Update(ctx context.Context, {{if .containsIndexCache}}newData{{else}}data{{end}} *{{.upperStartCamelObject}}) error`
 )