From 1b10607229477156108619532f94365ce627c3a6 Mon Sep 17 00:00:00 2001 From: zodial Date: Thu, 7 Nov 2024 13:40:31 +0800 Subject: [PATCH] fixed: pgorm --- console/commands/pgorm/pgsql.go | 6 +++++- console/commands/route.go | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/console/commands/pgorm/pgsql.go b/console/commands/pgorm/pgsql.go index fceabb7..81bd2ad 100644 --- a/console/commands/pgorm/pgsql.go +++ b/console/commands/pgorm/pgsql.go @@ -519,8 +519,12 @@ func PgTypeToGoType(pgType string, columnName string) string { return "database.JSON" case "time", "timetz": return "database.Time" - case "numeric": + case "float4": + return "float32" + case "float8", "numeric": return "float64" + case "bool": + return "bool" case "bytea": return "[]byte" default: diff --git a/console/commands/route.go b/console/commands/route.go index 35cae0b..4f5e28d 100644 --- a/console/commands/route.go +++ b/console/commands/route.go @@ -20,7 +20,7 @@ var goMethodStr = `package {package} import ({import}) -// {action}{doc} +// {action} {doc} func (receiver *Controller) {action}(req *{paramAlias}.{param}, ctx http.Context) (*{returnAlias}.{return}, error) { // TODO 这里写业务 return &{returnAlias}.{return}{}, nil