Skip to content

Commit

Permalink
feat(sqlbuilderzero): rename BulkDeleteByCondition to DeleteByCondition
Browse files Browse the repository at this point in the history
  • Loading branch information
jaronnie committed Aug 16, 2024
1 parent 89a4e52 commit 6a5009b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .template/go-zero/model/customized.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (m *custom{{.upperStartCamelObject}}Model) UpdateFieldsByCondition(ctx cont
return nil
}

func (m *custom{{.upperStartCamelObject}}Model) BulkDeleteByCondition(ctx context.Context, conds ...condition.Condition) error {
func (m *custom{{.upperStartCamelObject}}Model) DeleteByCondition(ctx context.Context, conds ...condition.Condition) error {
if len(conds) == 0 {
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion .template/go-zero/model/types.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type (
FindOneByCondition(ctx context.Context, conds ...condition.Condition) (*{{.upperStartCamelObject}}, error)
PageByCondition(ctx context.Context, conds ...condition.Condition) ([]*{{.upperStartCamelObject}}, int64 ,error)
UpdateFieldsByCondition(ctx context.Context, field map[string]any, conds ...condition.Condition) error
BulkDeleteByCondition(ctx context.Context, conds ...condition.Condition) error
DeleteByCondition(ctx context.Context, conds ...condition.Condition) error
}

default{{.upperStartCamelObject}}Model struct {
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ mkdir -p .template/go-zero
* 新增方法: FindOneByCondition: 基于不同条件查询数据, limit 1
* 新增方法: PageByCondition: 基于不同条件获取分页数据
* 新增方法: UpdateFieldsByCondition: 基于不同条件更新某几个 fields
* 新增方法: DeleteByCondition

## gen

Expand Down
4 changes: 2 additions & 2 deletions internal/model/system_dict_key/tsystemdictkeymodel_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6a5009b

Please sign in to comment.