|
@@ -22,7 +22,6 @@ func main() {
|
|
|
web.BConfig.WebConfig.DirectoryIndex = true
|
|
|
web.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
|
|
|
}
|
|
|
- //sysConfig := config.GetConfig(contants.HT).(*config.HTBizConfig)
|
|
|
//web.ErrorHandler("*", exception.ControllerAdvice())
|
|
|
web.BConfig.RecoverFunc = exception.PanicAdvice
|
|
|
go func() {
|
|
@@ -76,11 +75,13 @@ func initReport() {
|
|
|
t := time.UnixMilli(timestamp)
|
|
|
htReportList[i].PublishedTime = t.Format(time.DateTime)
|
|
|
plateId := htReportList[i].PlateId
|
|
|
- plate, err := ht.GetPermissionNameById(plateId)
|
|
|
+ var plate ht.HTPlate
|
|
|
+ plate, err = ht.GetPermissionNameById(plateId)
|
|
|
if err != nil || plate.ParentId == 0 {
|
|
|
htReportList[i].PermissionName = htReportList[i].PlateName
|
|
|
} else {
|
|
|
- PermissionName, err := getPermissionNameById(plate.ParentId)
|
|
|
+ var PermissionName string
|
|
|
+ err = getPermissionNameById(plate.Id, &PermissionName)
|
|
|
if err != nil {
|
|
|
logger.Error("获取ETA研报列表失败:%v", err)
|
|
|
htReportList[i].PermissionName = ""
|
|
@@ -109,14 +110,16 @@ func initReport() {
|
|
|
logger.Info("初始化研报库完成")
|
|
|
}
|
|
|
|
|
|
-func getPermissionNameById(id int) (name string, err error) {
|
|
|
+func getPermissionNameById(id int, currentName *string) (err error) {
|
|
|
plate, err := ht.GetPermissionNameById(id)
|
|
|
if err != nil {
|
|
|
+ logger.Error("查询海通板块品种名称失败:%v", err)
|
|
|
return
|
|
|
}
|
|
|
if plate.ParentId != 0 {
|
|
|
- return getPermissionNameById(plate.ParentId)
|
|
|
+ *currentName = plate.PlateName
|
|
|
+ return getPermissionNameById(plate.ParentId, currentName)
|
|
|
} else {
|
|
|
- return plate.PlateName, nil
|
|
|
+ return
|
|
|
}
|
|
|
}
|