|
@@ -2,7 +2,6 @@ package controllers
|
|
|
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
- "fmt"
|
|
|
"hongze/hongze_api/models"
|
|
|
"hongze/hongze_api/services"
|
|
|
"hongze/hongze_api/utils"
|
|
@@ -77,20 +76,11 @@ func (this *ReportController) Detail() {
|
|
|
productId = 1
|
|
|
}
|
|
|
|
|
|
- maxPermissionCountKey := fmt.Sprint(`hongze_api:max_permission_count:product_id:`, productId)
|
|
|
- maxPermissionCount, err = utils.Rc.RedisInt(maxPermissionCountKey)
|
|
|
- if err != nil || maxPermissionCount <= 0 {
|
|
|
- maxPermissionCount, err = models.GetDefaultChartPermissionCount(productId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取报告详情失败"
|
|
|
- br.ErrMsg = "获取产品默认最大权限数量失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- utils.Rc.SetNX(maxPermissionCountKey, maxPermissionCount, time.Second*3600)
|
|
|
- }
|
|
|
- //ficc需要移除策略的权限
|
|
|
- if productId == 1 {
|
|
|
- maxPermissionCount = maxPermissionCount - 1
|
|
|
+ maxPermissionCount, err = models.GetDefaultChartPermissionCountByCache(productId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取报告详情失败"
|
|
|
+ br.ErrMsg = "获取产品默认最大权限数量失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
utils.FileLog.Info("report.detail %d,%d", user.CompanyId, productId)
|