chore: update goctl interface{} to any (#2819)

* chore: update goctl interface{} to any

* chore: update goctl interface{} to any
This commit is contained in:
Kevin Wan
2023-01-24 17:51:03 +08:00
committed by GitHub
parent ae87114282
commit eab904af64
32 changed files with 112 additions and 112 deletions

View File

@@ -33,7 +33,7 @@ func genDelete(table Table, withCache, postgreSql bool) (string, string, error)
output, err := util.With("delete").
Parse(text).
Execute(map[string]interface{}{
Execute(map[string]any{
"upperStartCamelObject": camel,
"withCache": withCache,
"containsIndexCache": table.ContainsUniqueCacheKey,
@@ -57,7 +57,7 @@ func genDelete(table Table, withCache, postgreSql bool) (string, string, error)
deleteMethodOut, err := util.With("deleteMethod").
Parse(text).
Execute(map[string]interface{}{
Execute(map[string]any{
"lowerStartCamelPrimaryKey": util.EscapeGolangKeyword(stringx.From(table.PrimaryKey.Name.ToCamel()).Untitle()),
"dataType": table.PrimaryKey.DataType,
"data": table,

View File

@@ -37,7 +37,7 @@ func genField(table Table, field *parser.Field) (string, error) {
output, err := util.With("types").
Parse(text).
Execute(map[string]interface{}{
Execute(map[string]any{
"name": util.SafeString(field.Name.ToCamel()),
"type": field.DataType,
"tag": tag,

View File

@@ -16,7 +16,7 @@ func genFindOne(table Table, withCache, postgreSql bool) (string, string, error)
output, err := util.With("findOne").
Parse(text).
Execute(map[string]interface{}{
Execute(map[string]any{
"withCache": withCache,
"upperStartCamelObject": camel,
"lowerStartCamelObject": stringx.From(camel).Untitle(),
@@ -39,7 +39,7 @@ func genFindOne(table Table, withCache, postgreSql bool) (string, string, error)
findOneMethod, err := util.With("findOneMethod").
Parse(text).
Execute(map[string]interface{}{
Execute(map[string]any{
"upperStartCamelObject": camel,
"lowerStartCamelPrimaryKey": util.EscapeGolangKeyword(stringx.From(table.PrimaryKey.Name.ToCamel()).Untitle()),
"dataType": table.PrimaryKey.DataType,

View File

@@ -28,7 +28,7 @@ func genFindOneByField(table Table, withCache, postgreSql bool) (*findOneCode, e
for _, key := range table.UniqueCacheKey {
in, paramJoinString, originalFieldString := convertJoin(key, postgreSql)
output, err := t.Execute(map[string]interface{}{
output, err := t.Execute(map[string]any{
"upperStartCamelObject": camelTableName,
"upperField": key.FieldNameJoin.Camel().With("").Source(),
"in": in,
@@ -68,7 +68,7 @@ func genFindOneByField(table Table, withCache, postgreSql bool) (*findOneCode, e
if len(inJoin) > 0 {
in = inJoin.With(", ").Source()
}
output, err := t.Execute(map[string]interface{}{
output, err := t.Execute(map[string]any{
"upperStartCamelObject": camelTableName,
"upperField": key.FieldNameJoin.Camel().With("").Source(),
"in": in,
@@ -88,7 +88,7 @@ func genFindOneByField(table Table, withCache, postgreSql bool) (*findOneCode, e
return nil, err
}
out, err := util.With("findOneByFieldExtraMethod").Parse(text).Execute(map[string]interface{}{
out, err := util.With("findOneByFieldExtraMethod").Parse(text).Execute(map[string]any{
"upperStartCamelObject": camelTableName,
"primaryKeyLeft": table.PrimaryCacheKey.VarLeft,
"lowerStartCamelObject": stringx.From(camelTableName).Untitle(),

View File

@@ -354,7 +354,7 @@ func (g *defaultGenerator) genModelCustom(in parser.Table, withCache bool) (stri
t := util.With("model-custom").
Parse(text).
GoFmt(true)
output, err := t.Execute(map[string]interface{}{
output, err := t.Execute(map[string]any{
"pkg": g.pkg,
"withCache": withCache,
"upperStartCamelObject": in.Name.ToCamel(),
@@ -375,7 +375,7 @@ func (g *defaultGenerator) executeModel(table Table, code *code) (*bytes.Buffer,
t := util.With("model").
Parse(text).
GoFmt(true)
output, err := t.Execute(map[string]interface{}{
output, err := t.Execute(map[string]any{
"pkg": g.pkg,
"imports": code.importsCode,
"vars": code.varsCode,

View File

@@ -30,7 +30,7 @@ func genImports(table Table, withCache, timeImport bool) (string, error) {
return "", err
}
buffer, err := util.With("import").Parse(text).Execute(map[string]interface{}{
buffer, err := util.With("import").Parse(text).Execute(map[string]any{
"time": timeImport,
"containsPQ": table.ContainsPQ,
"data": table,

View File

@@ -58,7 +58,7 @@ func genInsert(table Table, withCache, postgreSql bool) (string, string, error)
output, err := util.With("insert").
Parse(text).
Execute(map[string]interface{}{
Execute(map[string]any{
"withCache": withCache,
"upperStartCamelObject": camel,
"lowerStartCamelObject": stringx.From(camel).Untitle(),
@@ -78,7 +78,7 @@ func genInsert(table Table, withCache, postgreSql bool) (string, string, error)
return "", "", err
}
insertMethodOutput, err := util.With("insertMethod").Parse(text).Execute(map[string]interface{}{
insertMethodOutput, err := util.With("insertMethod").Parse(text).Execute(map[string]any{
"upperStartCamelObject": camel,
"data": table,
})

View File

@@ -21,7 +21,7 @@ func genNew(table Table, withCache, postgreSql bool) (string, error) {
output, err := util.With("new").
Parse(text).
Execute(map[string]interface{}{
Execute(map[string]any{
"table": t,
"withCache": withCache,
"upperStartCamelObject": table.Name.ToCamel(),

View File

@@ -14,7 +14,7 @@ func genTableName(table Table) (string, error) {
output, err := util.With("tableName").
Parse(text).
Execute(map[string]interface{}{
Execute(map[string]any{
"tableName": table.Name.Source(),
"upperStartCamelObject": table.Name.ToCamel(),
})

View File

@@ -16,7 +16,7 @@ func genTag(table Table, in string) (string, error) {
return "", err
}
output, err := util.With("tag").Parse(text).Execute(map[string]interface{}{
output, err := util.With("tag").Parse(text).Execute(map[string]any{
"field": in,
"data": table,
})

View File

@@ -21,7 +21,7 @@ func genTypes(table Table, methods string, withCache bool) (string, error) {
output, err := util.With("types").
Parse(text).
Execute(map[string]interface{}{
Execute(map[string]any{
"withCache": withCache,
"method": methods,
"upperStartCamelObject": table.Name.ToCamel(),

View File

@@ -95,7 +95,7 @@ func genUpdate(table Table, withCache, postgreSql bool) (
}
updateMethodOutput, err := util.With("updateMethod").Parse(text).Execute(
map[string]interface{}{
map[string]any{
"upperStartCamelObject": camelTableName,
"data": table,
},

View File

@@ -26,7 +26,7 @@ func genVars(table Table, withCache, postgreSql bool) (string, error) {
}
output, err := util.With("var").Parse(text).
GoFmt(true).Execute(map[string]interface{}{
GoFmt(true).Execute(map[string]any{
"lowerStartCamelObject": stringx.From(camel).Untitle(),
"upperStartCamelObject": camel,
"cacheKeys": strings.Join(keys, "\n"),