作者 yangfu

fix: table split

@@ -26,6 +26,7 @@ require ( @@ -26,6 +26,7 @@ require (
26 github.com/patrickmn/go-cache v2.1.0+incompatible 26 github.com/patrickmn/go-cache v2.1.0+incompatible
27 github.com/sergi/go-diff v1.2.0 // indirect 27 github.com/sergi/go-diff v1.2.0 // indirect
28 github.com/shopspring/decimal v1.3.1 28 github.com/shopspring/decimal v1.3.1
  29 + github.com/silenceper/wechat/v2 v2.1.4 // indirect
29 github.com/smartystreets/goconvey v1.7.2 // indirect 30 github.com/smartystreets/goconvey v1.7.2 // indirect
30 github.com/stretchr/testify v1.7.1 31 github.com/stretchr/testify v1.7.1
31 github.com/valyala/fasthttp v1.38.0 // indirect 32 github.com/valyala/fasthttp v1.38.0 // indirect
@@ -18,7 +18,10 @@ type AddTableStructCommand struct { @@ -18,7 +18,10 @@ type AddTableStructCommand struct {
18 } 18 }
19 19
20 func (updateTableCommand *AddTableStructCommand) Valid(validation *validation.Validation) { 20 func (updateTableCommand *AddTableStructCommand) Valid(validation *validation.Validation) {
21 - 21 + if len(updateTableCommand.Fields) == 0 {
  22 + validation.Error("数据列不能为空")
  23 + return
  24 + }
22 } 25 }
23 26
24 func (updateTableCommand *AddTableStructCommand) ValidateCommand() error { 27 func (updateTableCommand *AddTableStructCommand) ValidateCommand() error {
@@ -18,7 +18,10 @@ type UpdateTableStructCommand struct { @@ -18,7 +18,10 @@ type UpdateTableStructCommand struct {
18 } 18 }
19 19
20 func (updateTableCommand *UpdateTableStructCommand) Valid(validation *validation.Validation) { 20 func (updateTableCommand *UpdateTableStructCommand) Valid(validation *validation.Validation) {
21 - 21 + if len(updateTableCommand.Fields) == 0 {
  22 + validation.Error("数据列不能为空")
  23 + return
  24 + }
22 } 25 }
23 26
24 func (updateTableCommand *UpdateTableStructCommand) ValidateCommand() error { 27 func (updateTableCommand *UpdateTableStructCommand) ValidateCommand() error {