Merge branch 'main' of http://192.168.2.166:3180/OMC/ems_backend
This commit is contained in:
@@ -116,7 +116,7 @@ func init() {
|
|||||||
Register("DELETE", dbrest.CustomXormExtDataUri, dbrest.ExtDatabaseDeleteData, deletePermission)
|
Register("DELETE", dbrest.CustomXormExtDataUri, dbrest.ExtDatabaseDeleteData, deletePermission)
|
||||||
|
|
||||||
// alarm restful Register
|
// alarm restful Register
|
||||||
Register("POST", fm.UriAlarms, fm.PostAlarmFromNF, nil)
|
Register("POST", fm.UriAlarms, fm.PostAlarmFromNF, midware.LogOperate(collectlogs.OptionNew("Alarm", collectlogs.BUSINESS_TYPE_UPDATE)))
|
||||||
Register("Get", fm.UriAlarms, fm.GetAlarmFromNF, nil)
|
Register("Get", fm.UriAlarms, fm.GetAlarmFromNF, nil)
|
||||||
|
|
||||||
Register("POST", fm.CustomUriAlarms, fm.PostAlarmFromNF, nil)
|
Register("POST", fm.CustomUriAlarms, fm.PostAlarmFromNF, nil)
|
||||||
@@ -156,9 +156,9 @@ func init() {
|
|||||||
|
|
||||||
// Get/Create/Modify/Delete NE info
|
// Get/Create/Modify/Delete NE info
|
||||||
Register("GET", cm.UriNeInfo, cm.GetNeInfo, nil)
|
Register("GET", cm.UriNeInfo, cm.GetNeInfo, nil)
|
||||||
Register("POST", cm.UriNeInfo, cm.PostNeInfo, nil)
|
Register("POST", cm.UriNeInfo, cm.PostNeInfo, midware.LogOperate(collectlogs.OptionNew("NE info", collectlogs.BUSINESS_TYPE_INSERT)))
|
||||||
Register("PUT", cm.UriNeInfo, cm.PutNeInfo, nil)
|
Register("PUT", cm.UriNeInfo, cm.PutNeInfo, midware.LogOperate(collectlogs.OptionNew("NE info", collectlogs.BUSINESS_TYPE_UPDATE)))
|
||||||
Register("DELETE", cm.UriNeInfo, cm.DeleteNeInfo, nil)
|
Register("DELETE", cm.UriNeInfo, cm.DeleteNeInfo, midware.LogOperate(collectlogs.OptionNew("NE info", collectlogs.BUSINESS_TYPE_DELETE)))
|
||||||
|
|
||||||
// Get/Create/Modify/Delete NE info
|
// Get/Create/Modify/Delete NE info
|
||||||
Register("GET", cm.CustomUriNeInfo, cm.GetNeInfo, nil)
|
Register("GET", cm.CustomUriNeInfo, cm.GetNeInfo, nil)
|
||||||
@@ -183,10 +183,10 @@ func init() {
|
|||||||
|
|
||||||
// Import/Export NF CM
|
// Import/Export NF CM
|
||||||
Register("GET", cm.NeCmUri, cm.ExportCmFromNF, nil)
|
Register("GET", cm.NeCmUri, cm.ExportCmFromNF, nil)
|
||||||
Register("POST", cm.NeCmUri, cm.ImportCmToNF, nil)
|
Register("POST", cm.NeCmUri, cm.ImportCmToNF, midware.LogOperate(collectlogs.OptionNew("Import NF", collectlogs.BUSINESS_TYPE_INSERT)))
|
||||||
|
|
||||||
Register("GET", cm.UriNeCmFile, cm.DownloadNeBackupFile, nil)
|
Register("GET", cm.UriNeCmFile, cm.DownloadNeBackupFile, nil)
|
||||||
Register("DELETE", cm.UriNeCmFile, cm.DeleteNeBackupFile, nil)
|
Register("DELETE", cm.UriNeCmFile, cm.DeleteNeBackupFile, midware.LogOperate(collectlogs.OptionNew("Delete NF Backup", collectlogs.BUSINESS_TYPE_DELETE)))
|
||||||
|
|
||||||
Register("GET", cm.CustomNeCmUri, cm.ExportCmFromNF, nil)
|
Register("GET", cm.CustomNeCmUri, cm.ExportCmFromNF, nil)
|
||||||
Register("POST", cm.CustomNeCmUri, cm.ImportCmToNF, nil)
|
Register("POST", cm.CustomNeCmUri, cm.ImportCmToNF, nil)
|
||||||
@@ -197,12 +197,12 @@ func init() {
|
|||||||
// Software management
|
// Software management
|
||||||
Register("GET", cm.UriSoftware, cm.DownloadSoftwareFile, nil)
|
Register("GET", cm.UriSoftware, cm.DownloadSoftwareFile, nil)
|
||||||
//Register("POST", cm.UriSoftware, cm.UploadSoftwareFile, nil)
|
//Register("POST", cm.UriSoftware, cm.UploadSoftwareFile, nil)
|
||||||
Register("POST", cm.UriSoftware, cm.UploadSoftwareMultiFile, nil)
|
Register("POST", cm.UriSoftware, cm.UploadSoftwareMultiFile, midware.LogOperate(collectlogs.OptionNew("Software management", collectlogs.BUSINESS_TYPE_UPDATE)))
|
||||||
Register("DELETE", cm.UriSoftware, cm.DeleteSoftwareFile, nil)
|
Register("DELETE", cm.UriSoftware, cm.DeleteSoftwareFile, midware.LogOperate(collectlogs.OptionNew("Software management", collectlogs.BUSINESS_TYPE_DELETE)))
|
||||||
|
|
||||||
Register("POST", cm.UriSoftwareNE, cm.DistributeSoftwareToNF, nil)
|
Register("POST", cm.UriSoftwareNE, cm.DistributeSoftwareToNF, midware.LogOperate(collectlogs.OptionNew("Software management", collectlogs.BUSINESS_TYPE_OTHER)))
|
||||||
Register("PUT", cm.UriSoftwareNE, cm.ActiveSoftwareToNF, nil)
|
Register("PUT", cm.UriSoftwareNE, cm.ActiveSoftwareToNF, midware.LogOperate(collectlogs.OptionNew("Software management", collectlogs.BUSINESS_TYPE_OTHER)))
|
||||||
Register("PATCH", cm.UriSoftwareNE, cm.RollBackSoftwareToNF, nil)
|
Register("PATCH", cm.UriSoftwareNE, cm.RollBackSoftwareToNF, midware.LogOperate(collectlogs.OptionNew("Software management", collectlogs.BUSINESS_TYPE_OTHER)))
|
||||||
|
|
||||||
Register("GET", cm.CustomUriSoftware, cm.DownloadSoftwareFile, nil)
|
Register("GET", cm.CustomUriSoftware, cm.DownloadSoftwareFile, nil)
|
||||||
Register("POST", cm.CustomUriSoftware, cm.UploadSoftwareFile, nil)
|
Register("POST", cm.CustomUriSoftware, cm.UploadSoftwareFile, nil)
|
||||||
@@ -213,8 +213,8 @@ func init() {
|
|||||||
Register("PATCH", cm.CustomUriSoftwareNE, cm.RollBackSoftwareToNF, nil)
|
Register("PATCH", cm.CustomUriSoftwareNE, cm.RollBackSoftwareToNF, nil)
|
||||||
|
|
||||||
// License management
|
// License management
|
||||||
Register("POST", cm.UriLicense, cm.UploadLicenseFileData, nil)
|
Register("POST", cm.UriLicense, cm.UploadLicenseFileData, midware.LogOperate(collectlogs.OptionNew("License management", collectlogs.BUSINESS_TYPE_INSERT)))
|
||||||
Register("POST", cm.UriLicenseExt, cm.UploadLicenseFileData, nil)
|
Register("POST", cm.UriLicenseExt, cm.UploadLicenseFileData, midware.LogOperate(collectlogs.OptionNew("License management", collectlogs.BUSINESS_TYPE_INSERT)))
|
||||||
|
|
||||||
Register("POST", cm.CustomUriLicense, cm.UploadLicenseFileData, nil)
|
Register("POST", cm.CustomUriLicense, cm.UploadLicenseFileData, nil)
|
||||||
Register("POST", cm.CustomUriLicenseExt, cm.UploadLicenseFileData, nil)
|
Register("POST", cm.CustomUriLicenseExt, cm.UploadLicenseFileData, nil)
|
||||||
|
|||||||
Binary file not shown.
@@ -23,6 +23,9 @@ func Setup(router *gin.Engine) {
|
|||||||
controller.NewIndex.Handler,
|
controller.NewIndex.Handler,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 系统可暴露的配置信息
|
||||||
|
indexGroup.GET("/sys-conf", controller.NewCommont.SysConfig)
|
||||||
|
|
||||||
// 验证码操作处理
|
// 验证码操作处理
|
||||||
indexGroup.GET("/captchaImage",
|
indexGroup.GET("/captchaImage",
|
||||||
middleware.RateLimit(middleware.LimitOption{
|
middleware.RateLimit(middleware.LimitOption{
|
||||||
@@ -71,7 +74,6 @@ func Setup(router *gin.Engine) {
|
|||||||
commonGroup := router.Group("/common")
|
commonGroup := router.Group("/common")
|
||||||
{
|
{
|
||||||
commonGroup.GET("/hash", middleware.PreAuthorize(nil), controller.NewCommont.Hash)
|
commonGroup.GET("/hash", middleware.PreAuthorize(nil), controller.NewCommont.Hash)
|
||||||
indexGroup.GET("/sysConf", controller.NewCommont.SysConfig)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 文件操作处理
|
// 文件操作处理
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ func (s *CommontController) Hash(c *gin.Context) {
|
|||||||
|
|
||||||
// 系统可暴露的配置信息
|
// 系统可暴露的配置信息
|
||||||
//
|
//
|
||||||
// GET /sysConf
|
// GET /sys-conf
|
||||||
func (s *CommontController) SysConfig(c *gin.Context) {
|
func (s *CommontController) SysConfig(c *gin.Context) {
|
||||||
data := s.commontService.SystemConfigInfo()
|
data := s.commontService.SystemConfigInfo()
|
||||||
c.JSON(200, result.OkData(data))
|
c.JSON(200, result.OkData(data))
|
||||||
|
|||||||
@@ -400,10 +400,11 @@ func (s *SysUserController) Export(c *gin.Context) {
|
|||||||
"E1": "手机号码",
|
"E1": "手机号码",
|
||||||
"F1": "用户性别",
|
"F1": "用户性别",
|
||||||
"G1": "帐号状态",
|
"G1": "帐号状态",
|
||||||
"H1": "最后登录IP",
|
"H1": "部门编号",
|
||||||
"I1": "最后登录时间",
|
"I1": "部门名称",
|
||||||
"J1": "部门名称",
|
"J1": "部门负责人",
|
||||||
"K1": "部门负责人",
|
"K1": "最后登录IP",
|
||||||
|
"L1": "最后登录时间",
|
||||||
}
|
}
|
||||||
// 读取用户性别字典数据
|
// 读取用户性别字典数据
|
||||||
dictSysUserSex := s.sysDictDataService.SelectDictDataByType("sys_user_sex")
|
dictSysUserSex := s.sysDictDataService.SelectDictDataByType("sys_user_sex")
|
||||||
@@ -432,10 +433,11 @@ func (s *SysUserController) Export(c *gin.Context) {
|
|||||||
"E" + idx: row.PhoneNumber,
|
"E" + idx: row.PhoneNumber,
|
||||||
"F" + idx: sysUserSex,
|
"F" + idx: sysUserSex,
|
||||||
"G" + idx: statusValue,
|
"G" + idx: statusValue,
|
||||||
"H" + idx: row.LoginIP,
|
"H" + idx: row.Dept.DeptID,
|
||||||
"I" + idx: date.ParseDateToStr(row.LoginDate, date.YYYY_MM_DD_HH_MM_SS),
|
"I" + idx: row.Dept.DeptName,
|
||||||
"J" + idx: row.Dept.DeptName,
|
"J" + idx: row.Dept.Leader,
|
||||||
"K" + idx: row.Dept.Leader,
|
"K" + idx: row.LoginIP,
|
||||||
|
"L" + idx: date.ParseDateToStr(row.LoginDate, date.YYYY_MM_DD_HH_MM_SS),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ func (r *SysUserImpl) ImportUser(rows []map[string]string, isUpdateSupport bool,
|
|||||||
failureNum := 0
|
failureNum := 0
|
||||||
successMsgArr := []string{}
|
successMsgArr := []string{}
|
||||||
failureMsgArr := []string{}
|
failureMsgArr := []string{}
|
||||||
mustItemArr := []string{"C", "D"}
|
mustItemArr := []string{"B", "C"}
|
||||||
for _, row := range rows {
|
for _, row := range rows {
|
||||||
// 检查必填列
|
// 检查必填列
|
||||||
ownItem := true
|
ownItem := true
|
||||||
@@ -218,13 +218,13 @@ func (r *SysUserImpl) ImportUser(rows []map[string]string, isUpdateSupport bool,
|
|||||||
// 用户性别转值
|
// 用户性别转值
|
||||||
sysUserSex := "0"
|
sysUserSex := "0"
|
||||||
for _, v := range dictSysUserSex {
|
for _, v := range dictSysUserSex {
|
||||||
if row["G"] == v.DictLabel {
|
if row["F"] == v.DictLabel {
|
||||||
sysUserSex = v.DictValue
|
sysUserSex = v.DictValue
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sysUserStatus := common.STATUS_NO
|
sysUserStatus := common.STATUS_NO
|
||||||
if row["H"] == "正常" {
|
if row["G"] == "正常" {
|
||||||
sysUserStatus = common.STATUS_YES
|
sysUserStatus = common.STATUS_YES
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,11 +232,11 @@ func (r *SysUserImpl) ImportUser(rows []map[string]string, isUpdateSupport bool,
|
|||||||
newSysUser := model.SysUser{
|
newSysUser := model.SysUser{
|
||||||
UserType: "sys",
|
UserType: "sys",
|
||||||
Password: initPassword,
|
Password: initPassword,
|
||||||
DeptID: row["B"],
|
DeptID: row["H"],
|
||||||
UserName: row["C"],
|
UserName: row["B"],
|
||||||
NickName: row["D"],
|
NickName: row["C"],
|
||||||
PhoneNumber: row["F"],
|
PhoneNumber: row["E"],
|
||||||
Email: row["E"],
|
Email: row["D"],
|
||||||
Status: sysUserStatus,
|
Status: sysUserStatus,
|
||||||
Sex: sysUserSex,
|
Sex: sysUserSex,
|
||||||
}
|
}
|
||||||
@@ -246,13 +246,13 @@ func (r *SysUserImpl) ImportUser(rows []map[string]string, isUpdateSupport bool,
|
|||||||
if regular.ValidMobile(newSysUser.PhoneNumber) {
|
if regular.ValidMobile(newSysUser.PhoneNumber) {
|
||||||
uniquePhone := r.CheckUniquePhone(newSysUser.PhoneNumber, "")
|
uniquePhone := r.CheckUniquePhone(newSysUser.PhoneNumber, "")
|
||||||
if !uniquePhone {
|
if !uniquePhone {
|
||||||
msg := fmt.Sprintf("序号:%s 手机号码 %s 已存在", row["A"], row["F"])
|
msg := fmt.Sprintf("序号:%s 手机号码 %s 已存在", row["A"], row["E"])
|
||||||
failureNum++
|
failureNum++
|
||||||
failureMsgArr = append(failureMsgArr, msg)
|
failureMsgArr = append(failureMsgArr, msg)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
msg := fmt.Sprintf("序号:%s 手机号码 %s 格式错误", row["A"], row["F"])
|
msg := fmt.Sprintf("序号:%s 手机号码 %s 格式错误", row["A"], row["E"])
|
||||||
failureNum++
|
failureNum++
|
||||||
failureMsgArr = append(failureMsgArr, msg)
|
failureMsgArr = append(failureMsgArr, msg)
|
||||||
continue
|
continue
|
||||||
@@ -264,13 +264,13 @@ func (r *SysUserImpl) ImportUser(rows []map[string]string, isUpdateSupport bool,
|
|||||||
if regular.ValidEmail(newSysUser.Email) {
|
if regular.ValidEmail(newSysUser.Email) {
|
||||||
uniqueEmail := r.CheckUniqueEmail(newSysUser.Email, "")
|
uniqueEmail := r.CheckUniqueEmail(newSysUser.Email, "")
|
||||||
if !uniqueEmail {
|
if !uniqueEmail {
|
||||||
msg := fmt.Sprintf("序号:%s 用户邮箱 %s 已存在", row["A"], row["E"])
|
msg := fmt.Sprintf("序号:%s 用户邮箱 %s 已存在", row["A"], row["D"])
|
||||||
failureNum++
|
failureNum++
|
||||||
failureMsgArr = append(failureMsgArr, msg)
|
failureMsgArr = append(failureMsgArr, msg)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
msg := fmt.Sprintf("序号:%s 用户邮箱 %s 格式错误", row["A"], row["E"])
|
msg := fmt.Sprintf("序号:%s 用户邮箱 %s 格式错误", row["A"], row["D"])
|
||||||
failureNum++
|
failureNum++
|
||||||
failureMsgArr = append(failureMsgArr, msg)
|
failureMsgArr = append(failureMsgArr, msg)
|
||||||
continue
|
continue
|
||||||
@@ -283,11 +283,11 @@ func (r *SysUserImpl) ImportUser(rows []map[string]string, isUpdateSupport bool,
|
|||||||
newSysUser.CreateBy = operName
|
newSysUser.CreateBy = operName
|
||||||
insertId := r.InsertUser(newSysUser)
|
insertId := r.InsertUser(newSysUser)
|
||||||
if insertId != "" {
|
if insertId != "" {
|
||||||
msg := fmt.Sprintf("序号:%s 登录名称 %s 导入成功", row["A"], row["C"])
|
msg := fmt.Sprintf("序号:%s 登录名称 %s 导入成功", row["A"], row["B"])
|
||||||
successNum++
|
successNum++
|
||||||
successMsgArr = append(successMsgArr, msg)
|
successMsgArr = append(successMsgArr, msg)
|
||||||
} else {
|
} else {
|
||||||
msg := fmt.Sprintf("序号:%s 登录名称 %s 导入失败", row["A"], row["E"])
|
msg := fmt.Sprintf("序号:%s 登录名称 %s 导入失败", row["A"], row["B"])
|
||||||
failureNum++
|
failureNum++
|
||||||
failureMsgArr = append(failureMsgArr, msg)
|
failureMsgArr = append(failureMsgArr, msg)
|
||||||
}
|
}
|
||||||
@@ -300,11 +300,11 @@ func (r *SysUserImpl) ImportUser(rows []map[string]string, isUpdateSupport bool,
|
|||||||
newSysUser.UpdateBy = operName
|
newSysUser.UpdateBy = operName
|
||||||
rows := r.UpdateUser(newSysUser)
|
rows := r.UpdateUser(newSysUser)
|
||||||
if rows > 0 {
|
if rows > 0 {
|
||||||
msg := fmt.Sprintf("序号:%s 登录名称 %s 更新成功", row["A"], row["C"])
|
msg := fmt.Sprintf("序号:%s 登录名称 %s 更新成功", row["A"], row["B"])
|
||||||
successNum++
|
successNum++
|
||||||
successMsgArr = append(successMsgArr, msg)
|
successMsgArr = append(successMsgArr, msg)
|
||||||
} else {
|
} else {
|
||||||
msg := fmt.Sprintf("序号:%s 登录名称 %s 更新失败", row["A"], row["E"])
|
msg := fmt.Sprintf("序号:%s 登录名称 %s 更新失败", row["A"], row["B"])
|
||||||
failureNum++
|
failureNum++
|
||||||
failureMsgArr = append(failureMsgArr, msg)
|
failureMsgArr = append(failureMsgArr, msg)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user