【升级go 1.18】

This commit is contained in:
PandaGoAdmin
2022-07-13 11:54:54 +08:00
parent 2e18999587
commit 433ee08634
60 changed files with 253 additions and 248 deletions

View File

@@ -28,7 +28,7 @@ func (g *GenTableApi) GetDBTableList(rc *ctx.ReqCtx) {
pageSize := ginx.QueryInt(rc.GinCtx, "pageSize", 10)
tableName := rc.GinCtx.Query("tableName")
list, total := g.GenTableApp.FindDbTablesListPage(pageNum, pageSize, entity.DBTables{TableName: tableName})
rc.ResData = map[string]interface{}{
rc.ResData = map[string]any{
"data": list,
"total": total,
"pageNum": pageNum,
@@ -51,7 +51,7 @@ func (g *GenTableApi) GetTablePage(rc *ctx.ReqCtx) {
tableName := rc.GinCtx.Query("tableName")
tableComment := rc.GinCtx.Query("tableComment")
list, total := g.GenTableApp.FindListPage(pageNum, pageSize, entity.DevGenTable{TableName: tableName, TableComment: tableComment})
rc.ResData = map[string]interface{}{
rc.ResData = map[string]any{
"data": list,
"total": total,
"pageNum": pageNum,
@@ -69,7 +69,7 @@ func (g *GenTableApi) GetTablePage(rc *ctx.ReqCtx) {
func (g *GenTableApi) GetTableInfo(rc *ctx.ReqCtx) {
tableId := ginx.PathParamInt(rc.GinCtx, "tableId")
result := g.GenTableApp.FindOne(entity.DevGenTable{TableId: int64(tableId)}, true)
mp := make(map[string]interface{})
mp := make(map[string]any)
mp["list"] = result.Columns
mp["info"] = result
rc.ResData = mp
@@ -85,7 +85,7 @@ func (g *GenTableApi) GetTableInfo(rc *ctx.ReqCtx) {
func (g *GenTableApi) GetTableInfoByName(rc *ctx.ReqCtx) {
tableName := rc.GinCtx.Query("tableName")
result := g.GenTableApp.FindOne(entity.DevGenTable{TableName: tableName}, true)
mp := make(map[string]interface{})
mp := make(map[string]any)
mp["list"] = result.Columns
mp["info"] = result
rc.ResData = mp

View File

@@ -323,7 +323,7 @@ func (s *toolsGenTableColumn) GenTableInit(tableName string) entity.DevGenTable
}
// 视图预览
func Preview(tableId int64) map[string]interface{} {
func Preview(tableId int64) map[string]any {
t1, err := template.ParseFiles("resource/template/go/entity.template")
biz.ErrIsNil(err, "entity模版读取失败")
@@ -362,7 +362,7 @@ func Preview(tableId int64) map[string]interface{} {
var b7 bytes.Buffer
err = t7.Execute(&b7, tab)
mp := make(map[string]interface{})
mp := make(map[string]any)
mp["template/entity.template"] = b1.String()
mp["template/service.template"] = b2.String()
mp["template/api.template"] = b3.String()

View File

@@ -41,7 +41,7 @@ var DevGenTableModelDao SysGenTableModel = &devGenTableModelImpl{
func (m *devGenTableModelImpl) FindDbTablesListPage(page, pageSize int, data entity.DBTables) (*[]entity.DBTables, int64) {
list := make([]entity.DBTables, 0)
pgdata := make([]map[string]interface{}, 0)
pgdata := make([]map[string]any, 0)
var total int64 = 0
offset := pageSize * (page - 1)
if config.Conf.Server.DbType != "mysql" && config.Conf.Server.DbType != "postgresql" {