optimize unit test & add document

This commit is contained in:
anqiansong
2020-08-16 23:28:01 +08:00
parent 790b29b8eb
commit dbc034c9eb
46 changed files with 735 additions and 1855 deletions

View File

@@ -1,9 +1,8 @@
package template
var Insert = `
func (m *{{.upperStartCamelObject}}Model) Insert(data {{.upperStartCamelObject}}) error {
func (m *{{.upperStartCamelObject}}Model) Insert(data {{.upperStartCamelObject}}) (sql.Result, error) {
query := ` + "`" + `insert into ` + "`" + ` + m.table + ` + "`(` + " + `{{.lowerStartCamelObject}}RowsExpectAutoSet` + " + `) value ({{.expression}})` " + `
_, err := m.ExecNoCache(query, {{.expressionValues}})
return err
return m.{{if .withCache}}ExecNoCache{{else}}conn.Exec{{end}}(query, {{.expressionValues}})
}
`