Merge remote-tracking branch 'origin/main' into practical-training
This commit is contained in:
@@ -319,16 +319,18 @@ func (s *SysJobController) ResetQueueJob(c *gin.Context) {
|
||||
func (s *SysJobController) Export(c *gin.Context) {
|
||||
language := ctx.AcceptLanguage(c)
|
||||
// 查询结果,根据查询条件结果,单页最大值限制
|
||||
// querys := ctx.BodyJSONMap(c)
|
||||
// data := s.sysJobService.SelectJobPage(querys)
|
||||
// if data["total"].(int64) == 0 {
|
||||
// // 导出数据记录为空
|
||||
// c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
// return
|
||||
// }
|
||||
// rows := data["rows"].([]model.SysJob)
|
||||
querys := ctx.BodyJSONMap(c)
|
||||
querys["pageNum"] = 1
|
||||
querys["pageSize"] = 10000
|
||||
data := s.sysJobService.SelectJobPage(querys)
|
||||
if parse.Number(data["total"]) == 0 {
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
return
|
||||
}
|
||||
rows := data["rows"].([]model.SysJob)
|
||||
|
||||
rows := s.sysJobService.SelectJobList(model.SysJob{})
|
||||
// rows := s.sysJobService.SelectJobList(model.SysJob{})
|
||||
if len(rows) <= 0 {
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
|
||||
@@ -131,15 +131,18 @@ func (s *SysJobLogController) Clean(c *gin.Context) {
|
||||
func (s *SysJobLogController) Export(c *gin.Context) {
|
||||
language := ctx.AcceptLanguage(c)
|
||||
// 查询结果,根据查询条件结果,单页最大值限制
|
||||
// querys := ctx.BodyJSONMap(c)
|
||||
// data := s.sysJobLogService.SelectJobLogPage(querys)
|
||||
// if data["total"].(int64) == 0 {
|
||||
// c.JSON(200, result.ErrMsg("Export data record is empty"))
|
||||
// return
|
||||
// }
|
||||
// rows := data["rows"].([]model.SysJobLog)
|
||||
querys := ctx.BodyJSONMap(c)
|
||||
querys["pageNum"] = 1
|
||||
querys["pageSize"] = 10000
|
||||
data := s.sysJobLogService.SelectJobLogPage(querys)
|
||||
if parse.Number(data["total"]) == 0 {
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
return
|
||||
}
|
||||
rows := data["rows"].([]model.SysJobLog)
|
||||
|
||||
rows := s.sysJobLogService.SelectJobLogList(model.SysJobLog{})
|
||||
// rows := s.sysJobLogService.SelectJobLogList(model.SysJobLog{})
|
||||
if len(rows) <= 0 {
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// 加密
|
||||
// UDM K4加密
|
||||
func encrypt(origData, key []byte) ([]byte, error) {
|
||||
if len(origData) < 1 || len(key) < 1 {
|
||||
return nil, errors.New("wrong data or key")
|
||||
@@ -36,11 +36,11 @@ func TestEncrypt(t *testing.T) {
|
||||
// ki := []byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}
|
||||
// 0123456789abcdef0123456789abcdef
|
||||
|
||||
// 密码
|
||||
// k4 password
|
||||
key := []byte{0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34}
|
||||
// 1234123412341234
|
||||
|
||||
// 要加密的ki
|
||||
// k4 crypt ki
|
||||
ki := []byte{0x80, 0x5D, 0xAD, 0xC6, 0xE8, 0xA5, 0x4A, 0x0D, 0x59, 0xD6, 0x22, 0xC7, 0xA0, 0x4D, 0x08, 0xE0}
|
||||
// 805DADC6E8A54A0D59D622C7A04D08E0
|
||||
|
||||
230
src/modules/network_element/ne_config_test.go
Normal file
230
src/modules/network_element/ne_config_test.go
Normal file
@@ -0,0 +1,230 @@
|
||||
package networkelement
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"be.ems/src/modules/network_element/model"
|
||||
"gopkg.in/yaml.v3"
|
||||
"gorm.io/driver/mysql"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/logger"
|
||||
)
|
||||
|
||||
const (
|
||||
// 数据库
|
||||
DbHost = "192.168.8.58"
|
||||
DbPort = 33066
|
||||
DbUser = "root"
|
||||
DbPassswd = "1000omc@kp!"
|
||||
DbName = "omc_db"
|
||||
// 配置文件路径
|
||||
configParamDir = "../../../config/param"
|
||||
// configParamFile = "*" // 目录下全部更新
|
||||
configParamFile = "upf_param_config.yaml" // 单文件更新
|
||||
)
|
||||
|
||||
func TestEncrypt(t *testing.T) {
|
||||
fileNameList, err := getDirFileNameList(configParamDir)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
return
|
||||
}
|
||||
|
||||
if configParamFile == "*" {
|
||||
for _, v := range fileNameList {
|
||||
params := parseData(filepath.Join(configParamDir, v))
|
||||
if params == nil {
|
||||
return
|
||||
}
|
||||
saveData(params)
|
||||
}
|
||||
} else {
|
||||
params := parseData(filepath.Join(configParamDir, configParamFile))
|
||||
if params == nil {
|
||||
return
|
||||
}
|
||||
saveData(params)
|
||||
}
|
||||
}
|
||||
|
||||
// ========= Main =============
|
||||
|
||||
// parseData 文件转map数据
|
||||
func parseData(filePaht string) []map[string]string {
|
||||
data, err := parseStrToMap(filePaht)
|
||||
if err != nil {
|
||||
log.Printf("parseStrToMap => %s", err.Error())
|
||||
return nil
|
||||
}
|
||||
params, err := parseParamConfig(data)
|
||||
if err != nil {
|
||||
log.Printf("parseParamConfig => %s", err.Error())
|
||||
return nil
|
||||
}
|
||||
return params
|
||||
}
|
||||
|
||||
// saveData 保存数据
|
||||
func saveData(params []map[string]string) {
|
||||
// 定义排序函数
|
||||
sort.Slice(params, func(i, j int) bool {
|
||||
paramSortI := params[i]["paramSort"]
|
||||
if len(paramSortI) == 0 || paramSortI == "" {
|
||||
paramSortI = "0"
|
||||
}
|
||||
paramSortJ := params[j]["paramSort"]
|
||||
if len(paramSortJ) == 0 || paramSortJ == "" {
|
||||
paramSortJ = "0"
|
||||
}
|
||||
// 将 age 字段转换为整数进行比较
|
||||
si, _ := strconv.Atoi(paramSortI)
|
||||
sj, _ := strconv.Atoi(paramSortJ)
|
||||
return si < sj
|
||||
})
|
||||
// 遍历插入
|
||||
for _, v := range params {
|
||||
paramSort := v["paramSort"]
|
||||
if len(paramSort) == 0 || paramSort == "" {
|
||||
paramSort = "0"
|
||||
}
|
||||
sort, err := strconv.ParseInt(paramSort, 10, 64)
|
||||
if err != nil {
|
||||
sort = 0
|
||||
}
|
||||
|
||||
neConfig := model.NeConfig{
|
||||
NeType: v["neType"],
|
||||
ParamName: v["paramName"],
|
||||
ParamDisplay: v["paramDisplay"],
|
||||
ParamType: v["paramType"],
|
||||
ParamJson: v["paramJson"],
|
||||
ParamPerms: v["paramPerms"],
|
||||
ParamSort: sort,
|
||||
}
|
||||
neConfig.ID = saveDB(neConfig)
|
||||
log.Println(neConfig.ID, neConfig.NeType, neConfig.ParamDisplay)
|
||||
}
|
||||
}
|
||||
|
||||
// ========= DB =============
|
||||
|
||||
var gdb *gorm.DB
|
||||
|
||||
// connDB 连接到数据库
|
||||
func connDB() *gorm.DB {
|
||||
if gdb != nil {
|
||||
return gdb
|
||||
}
|
||||
|
||||
dsn := fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=utf8mb4&parseTime=True&loc=Local", DbUser, DbPassswd, DbHost, DbPort, DbName)
|
||||
newLogger := logger.New(
|
||||
log.New(os.Stdout, "\r\n", log.LstdFlags), // io writer
|
||||
logger.Config{
|
||||
SlowThreshold: time.Minute, // Slow SQL threshold
|
||||
LogLevel: logger.Error, // Log level
|
||||
IgnoreRecordNotFoundError: true, // Ignore ErrRecordNotFound error for logger
|
||||
ParameterizedQueries: true, // Don't include params in the SQL log
|
||||
Colorful: false, // Disable color
|
||||
},
|
||||
)
|
||||
db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{Logger: newLogger})
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
gdb = db
|
||||
return gdb
|
||||
}
|
||||
|
||||
// saveDB 表插入或更新
|
||||
func saveDB(s model.NeConfig) string {
|
||||
db := connDB()
|
||||
// 检查是否存在
|
||||
var id string
|
||||
db.Raw("SELECT id FROM ne_config WHERE ne_type = ? AND param_name = ?", s.NeType, s.ParamName).Scan(&id)
|
||||
// 更新时间
|
||||
s.UpdateTime = time.Now().UnixMilli()
|
||||
if id != "" {
|
||||
s.ID = id
|
||||
db.Save(s)
|
||||
} else {
|
||||
db.Create(s)
|
||||
}
|
||||
return s.ID
|
||||
}
|
||||
|
||||
// ========= Utils =============
|
||||
|
||||
// getDirFileNameList 获取文件目录下所有文件名称,不含目录名称
|
||||
func getDirFileNameList(dirPath string) ([]string, error) {
|
||||
fileNames := []string{}
|
||||
|
||||
dir, err := os.Open(dirPath)
|
||||
if err != nil {
|
||||
return fileNames, nil
|
||||
}
|
||||
defer dir.Close()
|
||||
|
||||
fileInfos, err := dir.Readdir(-1)
|
||||
if err != nil {
|
||||
return fileNames, err
|
||||
}
|
||||
|
||||
for _, fileInfo := range fileInfos {
|
||||
if fileInfo.Mode().IsRegular() {
|
||||
fileNames = append(fileNames, fileInfo.Name())
|
||||
}
|
||||
}
|
||||
|
||||
return fileNames, nil
|
||||
}
|
||||
|
||||
// parseStrToMap 解析内容string到map
|
||||
func parseStrToMap(filePath string) (map[string]any, error) {
|
||||
// 读取文件内容
|
||||
bytes, err := os.ReadFile(filePath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
content := string(bytes)
|
||||
var configMap map[string]any
|
||||
err = yaml.Unmarshal([]byte(content), &configMap)
|
||||
|
||||
return configMap, err
|
||||
}
|
||||
|
||||
// parseParamConfig 解析内容文件数据
|
||||
func parseParamConfig(data map[string]any) ([]map[string]string, error) {
|
||||
paramMapArr := make([]map[string]string, 0)
|
||||
for k, v := range data {
|
||||
for ik, iv := range v.(map[string]any) {
|
||||
itemMap := make(map[string]string)
|
||||
itemMap["neType"] = strings.ToUpper(k)
|
||||
itemMap["paramName"] = ik
|
||||
for iik, iiv := range iv.(map[string]any) {
|
||||
switch iik {
|
||||
case "display":
|
||||
itemMap["paramDisplay"] = iiv.(string)
|
||||
case "sort":
|
||||
itemMap["paramSort"] = fmt.Sprint(iiv)
|
||||
case "perms", "method":
|
||||
itemMap["paramPerms"] = iiv.(string)
|
||||
case "data", "list", "array":
|
||||
itemMap["paramType"] = iik
|
||||
strByte, _ := json.Marshal(iiv)
|
||||
itemMap["paramJson"] = string(strByte)
|
||||
}
|
||||
}
|
||||
paramMapArr = append(paramMapArr, itemMap)
|
||||
}
|
||||
}
|
||||
return paramMapArr, nil
|
||||
}
|
||||
@@ -322,12 +322,12 @@ func Setup(router *gin.Engine) {
|
||||
controller.NewNeConfigBackup.Download,
|
||||
)
|
||||
neConfigBackupGroup.PUT("",
|
||||
middleware.PreAuthorize(nil),
|
||||
middleware.PreAuthorize(map[string][]string{"hasPerms": {"ne:neConfigBackup:edit"}}),
|
||||
collectlogs.OperateLog(collectlogs.OptionNew("log.operate.title.neConfigBackup", collectlogs.BUSINESS_TYPE_UPDATE)),
|
||||
controller.NewNeConfigBackup.Edit,
|
||||
)
|
||||
neConfigBackupGroup.DELETE("",
|
||||
middleware.PreAuthorize(nil),
|
||||
middleware.PreAuthorize(map[string][]string{"hasPerms": {"ne:neConfigBackup:remove"}}),
|
||||
collectlogs.OperateLog(collectlogs.OptionNew("log.operate.title.neConfigBackup", collectlogs.BUSINESS_TYPE_DELETE)),
|
||||
controller.NewNeConfigBackup.Remove,
|
||||
)
|
||||
|
||||
@@ -228,7 +228,7 @@ func (s *SysConfigController) Export(c *gin.Context) {
|
||||
// 查询结果,根据查询条件结果,单页最大值限制
|
||||
querys := ctx.BodyJSONMap(c)
|
||||
querys["pageNum"] = 1
|
||||
querys["pageSize"] = 1000
|
||||
querys["pageSize"] = 10000
|
||||
data := s.sysConfigService.SelectConfigPage(querys)
|
||||
if parse.Number(data["total"]) == 0 {
|
||||
// 导出数据记录为空
|
||||
|
||||
@@ -241,16 +241,18 @@ func (s *SysDictDataController) DictType(c *gin.Context) {
|
||||
func (s *SysDictDataController) Export(c *gin.Context) {
|
||||
language := ctx.AcceptLanguage(c)
|
||||
// 查询结果,根据查询条件结果,单页最大值限制
|
||||
// querys := ctx.BodyJSONMap(c)
|
||||
// data := s.sysDictDataService.SelectDictDataPage(querys)
|
||||
// if data["total"].(int64) == 0 {
|
||||
// // 导出数据记录为空
|
||||
// c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
// return
|
||||
// }
|
||||
// rows := data["rows"].([]model.SysDictData)
|
||||
querys := ctx.BodyJSONMap(c)
|
||||
querys["pageNum"] = 1
|
||||
querys["pageSize"] = 10000
|
||||
data := s.sysDictDataService.SelectDictDataPage(querys)
|
||||
if parse.Number(data["total"]) == 0 {
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
return
|
||||
}
|
||||
rows := data["rows"].([]model.SysDictData)
|
||||
|
||||
rows := s.sysDictDataService.SelectDictDataList(model.SysDictData{})
|
||||
// rows := s.sysDictDataService.SelectDictDataList(model.SysDictData{})
|
||||
if len(rows) <= 0 {
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
|
||||
@@ -244,16 +244,18 @@ func (s *SysDictTypeController) DictOptionselect(c *gin.Context) {
|
||||
func (s *SysDictTypeController) Export(c *gin.Context) {
|
||||
language := ctx.AcceptLanguage(c)
|
||||
// 查询结果,根据查询条件结果,单页最大值限制
|
||||
// querys := ctx.BodyJSONMap(c)
|
||||
// data := s.sysDictTypeService.SelectDictTypePage(querys)
|
||||
// if data["total"].(int64) == 0 {
|
||||
// // 导出数据记录为空
|
||||
// c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
// return
|
||||
// }
|
||||
// rows := data["rows"].([]model.SysDictType)
|
||||
querys := ctx.BodyJSONMap(c)
|
||||
querys["pageNum"] = 1
|
||||
querys["pageSize"] = 10000
|
||||
data := s.sysDictTypeService.SelectDictTypePage(querys)
|
||||
if parse.Number(data["total"]) == 0 {
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
return
|
||||
}
|
||||
rows := data["rows"].([]model.SysDictType)
|
||||
|
||||
rows := s.sysDictTypeService.SelectDictTypeList(model.SysDictType{})
|
||||
// rows := s.sysDictTypeService.SelectDictTypeList(model.SysDictType{})
|
||||
if len(rows) <= 0 {
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
|
||||
@@ -122,16 +122,19 @@ func (s *SysLogLoginController) Unlock(c *gin.Context) {
|
||||
func (s *SysLogLoginController) Export(c *gin.Context) {
|
||||
language := ctx.AcceptLanguage(c)
|
||||
// 查询结果,根据查询条件结果,单页最大值限制
|
||||
// querys := ctx.BodyJSONMap(c)
|
||||
// data := s.sysLogLoginService.SelectSysLogLoginPage(querys)
|
||||
// if data["total"].(int64) == 0 {
|
||||
// // 导出数据记录为空
|
||||
// c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
// return
|
||||
// }
|
||||
// rows := data["rows"].([]model.SysLogLogin)
|
||||
querys := ctx.BodyJSONMap(c)
|
||||
querys["pageNum"] = 1
|
||||
querys["pageSize"] = 10000
|
||||
dataScopeSQL := ctx.LoginUserToDataScopeSQL(c, "d", "u")
|
||||
data := s.sysLogLoginService.SelectSysLogLoginPage(querys, dataScopeSQL)
|
||||
if parse.Number(data["total"]) == 0 {
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
return
|
||||
}
|
||||
rows := data["rows"].([]model.SysLogLogin)
|
||||
|
||||
rows := s.sysLogLoginService.SelectSysLogLoginList(model.SysLogLogin{})
|
||||
// rows := s.sysLogLoginService.SelectSysLogLoginList(model.SysLogLogin{})
|
||||
if len(rows) <= 0 {
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
|
||||
@@ -103,16 +103,19 @@ func (s *SysLogOperateController) Clean(c *gin.Context) {
|
||||
func (s *SysLogOperateController) Export(c *gin.Context) {
|
||||
language := ctx.AcceptLanguage(c)
|
||||
// 查询结果,根据查询条件结果,单页最大值限制
|
||||
// querys := ctx.BodyJSONMap(c)
|
||||
// data := s.SysLogOperateService.SelectSysLogOperatePage(querys)
|
||||
// if data["total"].(int64) == 0 {
|
||||
// // 导出数据记录为空
|
||||
// c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
// return
|
||||
// }
|
||||
// rows := data["rows"].([]model.SysLogOperate)
|
||||
querys := ctx.BodyJSONMap(c)
|
||||
querys["pageNum"] = 1
|
||||
querys["pageSize"] = 10000
|
||||
dataScopeSQL := ctx.LoginUserToDataScopeSQL(c, "d", "u")
|
||||
data := s.SysLogOperateService.SelectSysLogOperatePage(querys, dataScopeSQL)
|
||||
if parse.Number(data["total"]) == 0 {
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
return
|
||||
}
|
||||
rows := data["rows"].([]model.SysLogOperate)
|
||||
|
||||
rows := s.SysLogOperateService.SelectSysLogOperateList(model.SysLogOperate{})
|
||||
// rows := s.SysLogOperateService.SelectSysLogOperateList(model.SysLogOperate{})
|
||||
if len(rows) <= 0 {
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
|
||||
@@ -210,13 +210,11 @@ func (s *SysPostController) Remove(c *gin.Context) {
|
||||
func (s *SysPostController) Export(c *gin.Context) {
|
||||
language := ctx.AcceptLanguage(c)
|
||||
// 查询结果,根据查询条件结果,单页最大值限制
|
||||
// querys := ctx.BodyJSONMap(c)
|
||||
querys := map[string]any{
|
||||
"pageNum": 1,
|
||||
"pageSize": 1000,
|
||||
}
|
||||
querys := ctx.BodyJSONMap(c)
|
||||
querys["pageNum"] = 1
|
||||
querys["pageSize"] = 10000
|
||||
data := s.sysPostService.SelectPostPage(querys)
|
||||
if data["total"].(int64) == 0 {
|
||||
if parse.Number(data["total"]) == 0 {
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
return
|
||||
|
||||
@@ -413,14 +413,12 @@ func (s *SysRoleController) AuthUserChecked(c *gin.Context) {
|
||||
func (s *SysRoleController) Export(c *gin.Context) {
|
||||
language := ctx.AcceptLanguage(c)
|
||||
// 查询结果,根据查询条件结果,单页最大值限制
|
||||
// querys := ctx.BodyJSONMap(c)
|
||||
querys := map[string]any{
|
||||
"pageNum": 1,
|
||||
"pageSize": 1000,
|
||||
}
|
||||
querys := ctx.BodyJSONMap(c)
|
||||
querys["pageNum"] = 1
|
||||
querys["pageSize"] = 10000
|
||||
dataScopeSQL := ctx.LoginUserToDataScopeSQL(c, "d", "")
|
||||
data := s.sysRoleService.SelectRolePage(querys, dataScopeSQL)
|
||||
if data["total"].(int64) == 0 {
|
||||
if parse.Number(data["total"]) == 0 {
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
return
|
||||
|
||||
@@ -473,14 +473,12 @@ func (s *SysUserController) Status(c *gin.Context) {
|
||||
func (s *SysUserController) Export(c *gin.Context) {
|
||||
language := ctx.AcceptLanguage(c)
|
||||
// 查询结果,根据查询条件结果,单页最大值限制
|
||||
// querys := ctx.BodyJSONMap(c)
|
||||
querys := map[string]any{
|
||||
"pageNum": 1,
|
||||
"pageSize": 1000,
|
||||
}
|
||||
querys := ctx.BodyJSONMap(c)
|
||||
querys["pageNum"] = 1
|
||||
querys["pageSize"] = 10000
|
||||
dataScopeSQL := ctx.LoginUserToDataScopeSQL(c, "d", "u")
|
||||
data := s.sysUserService.SelectUserPage(querys, dataScopeSQL)
|
||||
if data["total"].(int64) == 0 {
|
||||
if parse.Number(data["total"]) == 0 {
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user