Browse Source

增加系统配置接口

kobe6258 4 months ago
parent
commit
55aeb925e7

+ 3 - 2
service/home/home_service.go

@@ -11,6 +11,7 @@ import (
 	reportDomain "eta/eta_mini_ht_api/domian/report"
 	mediaService "eta/eta_mini_ht_api/service/media"
 	reportService "eta/eta_mini_ht_api/service/report"
+	userService "eta/eta_mini_ht_api/service/user"
 	"strings"
 	"sync"
 	"time"
@@ -79,7 +80,7 @@ func Search(key string, pageInfo page.PageInfo, login bool, templateUserId int)
 		}
 		result = append(result, searchResult)
 	}
-	_, mappingRiskLevel, err := reportService.CheckUserRisk(nil, login, templateUserId)
+	_, mappingRiskLevel, err := userService.CheckUserRisk(nil, login, templateUserId)
 	if err != nil {
 		logger.Error("获取用户信息失败:%v", err)
 	}
@@ -92,7 +93,7 @@ func Search(key string, pageInfo page.PageInfo, login bool, templateUserId int)
 			case ReportResultType:
 				searchResult.Report, _ = reportService.DealReportInfo(searchResult.Report, login, templateUserId)
 			case MediaResultType:
-				searchResult.Media, _ = mediaService.DealMediaInfo(searchResult.Media, login, templateUserId, mappingRiskLevel)
+				searchResult.Media, _ = mediaService.DealMediaInfo(searchResult.Media, login, templateUserId, mappingRiskLevel, false)
 			}
 		}(&result[i])
 	}

+ 3 - 3
service/media/media_service.go

@@ -186,7 +186,7 @@ func GetMediaById(mediaType string, mediaId int, isLogin bool, userId int) (medi
 	//	media.RiskLevelStatus = RiskLevelUnMatch
 	//	media.Login = false
 	//}
-	return DealMediaInfo(media, isLogin, userId, mappingRiskLevel)
+	return DealMediaInfo(media, isLogin, userId, mappingRiskLevel, true)
 }
 func matchRiskLevel(userId int, media mediaService.MediaDTO) (riskLevelMatch string, productRiskLevel string, err error) {
 	userProfile, userErr := user.GetUserProfile(userId)
@@ -312,7 +312,7 @@ func GetMediaPermissionNames(id []int) (labels []string) {
 	}
 	return
 }
-func DealMediaInfo(media *mediaService.MediaDTO, isLogin bool, templateUserId int, mappingRiskLevel string) (resultMedia *mediaService.MediaDTO, err error) {
+func DealMediaInfo(media *mediaService.MediaDTO, isLogin bool, templateUserId int, mappingRiskLevel string, isDetail bool) (resultMedia *mediaService.MediaDTO, err error) {
 	idStr := strings.Split(media.PermissionIDs, ",")
 	var ids []int
 	ids, err = stringUtils.StringToIntSlice(idStr)
@@ -421,7 +421,7 @@ func dealMediaInfo(list []mediaService.MediaDTO, isLogin bool, templateUserId in
 	for i := 0; i < len(list); i++ {
 		go func(media *mediaService.MediaDTO) {
 			defer wg.Done()
-			media, err = DealMediaInfo(media, isLogin, templateUserId, mappingRiskLevel)
+			media, err = DealMediaInfo(media, isLogin, templateUserId, mappingRiskLevel, false)
 			if err != nil {
 				logger.Error("处理媒体信息失败:%v", err)
 			}

+ 2 - 1
service/product/product_service.go

@@ -18,6 +18,7 @@ import (
 	mediaService "eta/eta_mini_ht_api/service/media"
 	"eta/eta_mini_ht_api/service/order"
 	reportService "eta/eta_mini_ht_api/service/report"
+	userService "eta/eta_mini_ht_api/service/user"
 	"fmt"
 	"sort"
 	"sync"
@@ -233,7 +234,7 @@ func GetRelatePackage(info ProductDTO) (prodList []ProductDTO, err error) {
 }
 
 func GetProductListByProductType(productType string, permissionIds []int, templateUserId int) (total, latestId int64, productIds []int) {
-	filterPermissionIds, riskLevel, err := reportService.CheckUserRisk(permissionIds, true, templateUserId)
+	filterPermissionIds, riskLevel, err := userService.CheckUserRisk(permissionIds, true, templateUserId)
 	if err != nil {
 		return
 	}