kobe6258 8 月之前
父节点
当前提交
a498ea4707

+ 2 - 3
domian/report/permission_service.go

@@ -48,7 +48,7 @@ func GetReportPermissionsById(id int, source string) (permissionIds []Permission
 		//展示一级品种
 		return getETAReportFirstPermissions(id)
 	case SourceHT:
-		return []PermissionDTO{}
+		getHTReportFirstPermissions(id)
 	}
 	return
 }
@@ -56,10 +56,9 @@ func GetReportPermissionsById(id int, source string) (permissionIds []Permission
 func GetReportSecondPermissionsById(id int, source string) (permissionIds []PermissionDTO) {
 	switch source {
 	case SourceETA:
-		//展示一级品种
 		return getETAReportSecondPermissions(id)
 	case SourceHT:
-		return []PermissionDTO{}
+		getHTReportSecondPermissions(id)
 	}
 	return
 }

+ 32 - 0
domian/report/report_service.go

@@ -267,6 +267,24 @@ func getETAReportFirstPermissions(id int) (permissionDTOs []PermissionDTO) {
 	return
 }
 
+func getHTReportFirstPermissions(id int) (permissionDTOs []PermissionDTO) {
+	report, err := reportDao.GetReportById(id)
+	if err != nil {
+		logger.Error("获取报告失败:%v", err)
+	}
+	permissionName := report.PlateName
+	plateName, err := reportDao.GetPlateNameByPermissionName(permissionName)
+	if err != nil {
+		return []PermissionDTO{}
+	}
+	return []PermissionDTO{
+		{
+			ID:       0,
+			Name:     plateName,
+			ParentID: 0,
+		},
+	}
+}
 func getETAReportSecondPermissions(id int) (permissionDTOs []PermissionDTO) {
 	classifyId, err := etaDao.GetReportClassifyById(id)
 	if err != nil || classifyId == 0 {
@@ -283,6 +301,20 @@ func getETAReportSecondPermissions(id int) (permissionDTOs []PermissionDTO) {
 	}
 	return
 }
+
+func getHTReportSecondPermissions(id int) (permissionDTOs []PermissionDTO) {
+	report, err := reportDao.GetReportById(id)
+	if err != nil {
+		logger.Error("获取报告失败:%v", err)
+	}
+	return []PermissionDTO{
+		{
+			ID:       0,
+			Name:     report.PlateName,
+			ParentID: 0,
+		},
+	}
+}
 func (es ESReport) GetId() string {
 	return strconv.Itoa(es.ReportID)
 }

+ 62 - 0
eta_mini_ht_api/conf/app.conf

@@ -0,0 +1,62 @@
+appname = wechat
+httpport = 80
+run_mode = dev
+runmode = dev
+autorender = false
+copyrequestbody = true
+EnableDocs = true
+sqlconn =
+file.path="./conf"
+file.notice="海通小程序注册用户须知.txt"
+file.disclaimer="海通免责声明.txt"
+file.publicKey ="MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAIwpWwsvZB2bZSSuFzjv5GE+spQdnd5sW2bDjnGM9hw8Zf1kXuOO2ThuokXgr0iHjQU5WHbrkcefUcvJmQ9NLJ0CAwEAAQ=="
+[dev]
+#系统配置
+
+#验证码长度
+auth.code.length=6
+#redis配置
+#redis.host = 192.168.77.130:6379,127.0.0.1:6379
+redis.host = 192.168.77.130:6379
+redis.password = ""
+redis.db = 0
+redis.maxidle = 50
+redis.maxactive = 100
+redis.timeout = 300
+
+#HT
+ht.es_report_index = "ht_test_report_v1"
+ht.es_media_index="ht_test_media_v1"
+ht.task="false"
+#ht.config_path="/home/code/config/eta_mini_ht_api/conf/app.conf"
+#ht.es_report_index = "report_index"
+#ht.es_media_index="media_index"
+ht.response.encode="false"
+ht.response.des_code="5filp4vSvLVQK8SLioNlKm3q"
+#wechat配置
+#wechat.appid = wx49f965502877530a
+#wechat.secret= eef0b899951d5d5074915e1f56c5e87a
+wechat.appid = wxcc4ac5526a578908
+wechat.secret= a289a3a3289e4ede54932216931ed16f
+#短信
+sms.sms_type = "juhe"
+sms.juhe.tlp_id="254663"
+sms.juhe.expire_minute=3
+sms.juhe.key="4c8504c49dd335e99cfd7b6a3a9e2415"
+sms.emas.url="root:199118@(localhost:3306)/emas?timeout=5000ms&readTimeout=5000ms&writeTimeout=5000ms&charset=utf8mb4&parseTime=true&loc=Local"
+sms.emas.expire_minute=3
+sms.emas.template="【期海通行】您的期海通行小程序验证码为:{{.Code}},请在{{.ExpireMinute}}分钟内完成验证。"
+#database配置
+database.driver = "mysql"
+database.url="hz_technology:hongze@2021@tcp(rm-uf67kg347rhjfep5c1o.mysql.rds.aliyuncs.com:3306)/test_eta_mini_master_ht?charset=utf8mb4&loc=Asia%2FShanghai&parseTime=true"
+#database.url="root:199118@tcp(localhost:3306)/wechat?charset=utf8mb4&loc=Asia%2FShanghai&parseTime=true"
+#eta数据库配置
+eta.database.url= "hz_technology:hongze@2021@tcp(rm-uf67kg347rhjfep5c1o.mysql.rds.aliyuncs.com:3306)/test_v2_hongze_rddp?charset=utf8mb4&loc=Asia%2FShanghai&parseTime=true"
+#钢联数据库配置
+gl.database.url= "hz_technology:hongze@2021@tcp(rm-uf67kg347rhjfep5c1o.mysql.rds.aliyuncs.com:3306)/test_eta_mini_master_ht?charset=utf8mb4&loc=Asia%2FShanghai&parseTime=true"
+#ES配置
+#es.url="http://192.168.77.130:9200"
+es.url="http://es-cn-nif227b580019rgw6.public.elasticsearch.aliyuncs.com:9200"
+es.username="elastic"
+es.password="hongze@2021"
+#es.password="DV=NPV7pTEbRJ4JnMNnt"

+ 57 - 0
eta_mini_ht_api/conf/log/log_config.json

@@ -0,0 +1,57 @@
+{
+  "filepath": "./etalogs",
+  "appenders": [
+    {
+      "type": "console",
+      "rotate": true,
+      "level": "info",
+      "color": true
+    },
+    {
+      "type": "file",
+      "filename": "file/error.log",
+      "maxlines": 1000000,
+      "maxsize": 268435456,
+      "daily": true,
+      "maxdays": 7,
+      "rotate": true,
+      "level": "error",
+      "color": true
+    },
+    {
+      "type": "file",
+      "filename": "file/info.log",
+      "maxlines": 1000000,
+      "maxsize": 268435456,
+      "daily": true,
+      "maxdays": 30,
+      "rotate": true,
+      "level": "info",
+      "color": true
+    },
+    {
+      "filter": "apiRequest",
+      "type": "file",
+      "filename": "api/api.log",
+      "maxlines": 1000000,
+      "maxsize": 268435456,
+      "daily": true,
+      "maxdays": 30,
+      "rotate": true,
+      "level": "info",
+      "color": true
+    },
+    {
+      "filter": "coin,orm....*",
+      "type": "file",
+      "filename": "db/db.log",
+      "maxlines": 1000000,
+      "maxsize": 268435456,
+      "daily": false,
+      "maxdays": 30,
+      "rotate": true,
+      "level": "info",
+      "color": true
+    }
+  ]
+}

文件差异内容过多而无法显示
+ 0 - 0
eta_mini_ht_api/conf/海通免责声明.txt


文件差异内容过多而无法显示
+ 0 - 0
eta_mini_ht_api/conf/海通小程序注册用户须知.txt


二进制
eta_mini_ht_api/eta_mini_ht_api


+ 7 - 0
models/report/gl_report_author_mappings.go

@@ -4,6 +4,7 @@ import "eta/eta_mini_ht_api/models"
 
 type GLReportAuthorMapping struct {
 	ID          int    `gorm:"column:id;primary_key;comment:'id'" json:"id"`
+	Plate       string `gorm:"column:plate;comment:'板块'" json:"plate"`
 	Permission  string `gorm:" column:permission;comment:'权限'" json:"permission"`
 	AuthorNames string `gorm:"column:author_names;comment:'作者'" json:"author_names"f`
 }
@@ -13,3 +14,9 @@ func GetGLAuthorNames() (mappingList []GLReportAuthorMapping, err error) {
 	err = db.Model(&GLReportAuthorMapping{}).Select("*").Find(&mappingList).Error
 	return
 }
+
+func GetPlateNameByPermissionName(permissionName string) (name string, err error) {
+	db := models.Main()
+	err = db.Model(&GLReportAuthorMapping{}).Select("Plate").Where("permission = ?", permissionName).First(&name).Error
+	return
+}

部分文件因为文件数量过多而无法显示