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