Skip to content

Commit

Permalink
feat: gen.R to gen.RowsAffected
Browse files Browse the repository at this point in the history
  • Loading branch information
luzhangqiang committed Oct 8, 2021
1 parent eb1ac5e commit 8d2f7dc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ type T interface{}
// M map[string]interface{}
type M map[string]interface{}

// R execute affected raws
type R int64
// RowsAffected execute affected raws
type RowsAffected int64

// NewGenerator create a new generator
func NewGenerator(cfg Config) *Generator {
Expand Down
2 changes: 1 addition & 1 deletion internal/check/checkinterface.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (m *InterfaceMethod) checkResult(result []parser.Param) (err error) {
m.ResultData = param
case param.IsInterface():
return fmt.Errorf("query method can not return interface in [%s.%s]", m.InterfaceName, m.MethodName)
case param.IsGenR():
case param.IsGenRowsAffected():
param.Type = "int64"
param.Package = ""
param.SetName("rowsAffected")
Expand Down
4 changes: 2 additions & 2 deletions internal/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ func (p *Param) IsGenM() bool {
return p.Package == "gen" && p.Type == "M"
}

func (p *Param) IsGenR() bool {
return p.Package == "gen" && p.Type == "R"
func (p *Param) IsGenRowsAffected() bool {
return p.Package == "gen" && p.Type == "RowsAffected"
}

func (p *Param) IsMap() bool {
Expand Down

0 comments on commit 8d2f7dc

Please sign in to comment.