mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 10:58:35 +08:00
【升级go 1.18】
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user