feat: let model customizable (#1738)
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
package template
|
||||
|
||||
// Delete defines a delete template
|
||||
var Delete = `
|
||||
const (
|
||||
// Delete defines a delete template
|
||||
Delete = `
|
||||
func (m *default{{.upperStartCamelObject}}Model) Delete(ctx context.Context, {{.lowerStartCamelPrimaryKey}} {{.dataType}}) error {
|
||||
{{if .withCache}}{{if .containsIndexCache}}data, err:=m.FindOne(ctx, {{.lowerStartCamelPrimaryKey}})
|
||||
if err!=nil{
|
||||
@@ -18,5 +19,6 @@ func (m *default{{.upperStartCamelObject}}Model) Delete(ctx context.Context, {{.
|
||||
}
|
||||
`
|
||||
|
||||
// DeleteMethod defines a delete template for interface method
|
||||
var DeleteMethod = `Delete(ctx context.Context, {{.lowerStartCamelPrimaryKey}} {{.dataType}}) error`
|
||||
// DeleteMethod defines a delete template for interface method
|
||||
DeleteMethod = `Delete(ctx context.Context, {{.lowerStartCamelPrimaryKey}} {{.dataType}}) error`
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user