Browse Source

Merge remote-tracking branch 'origin/zouap_static' into fix-1936

pull/2093/head
zouap 3 years ago
parent
commit
40a9d36693
5 changed files with 43 additions and 2 deletions
  1. +2
    -1
      models/user_business_analysis.go
  2. +34
    -0
      routers/home.go
  3. +1
    -0
      routers/routes/routes.go
  4. +1
    -1
      templates/explore/repo_right.tmpl
  5. +5
    -0
      templates/repo/cloudbrain/trainjob/show.tmpl

+ 2
- 1
models/user_business_analysis.go View File

@@ -893,7 +893,8 @@ func CounDataByDateAndReCount(wikiCountMap map[string]int, startTime time.Time,


//insert userMetrics table //insert userMetrics table
var useMetrics UserMetrics var useMetrics UserMetrics
useMetrics.CountDate = CountDate.Unix()
metricCountDate := time.Date(startTime.Year(), startTime.Month(), startTime.Day(), 0, 0, 0, 0, currentTimeNow.Location())
useMetrics.CountDate = metricCountDate.Unix()
statictisSess.Delete(&useMetrics) statictisSess.Delete(&useMetrics)


useMetrics.ActivateRegistUser = getMapKeyStringValue("ActivateRegistUser", userMetrics) useMetrics.ActivateRegistUser = getMapKeyStringValue("ActivateRegistUser", userMetrics)


+ 34
- 0
routers/home.go View File

@@ -667,6 +667,31 @@ func GetRecommendOrg() ([]map[string]interface{}, error) {
return resultOrg, nil return resultOrg, nil
} }


func GetImageInfo() ([]map[string]interface{}, error) {
url := setting.RecommentRepoAddr + "picture_info"
result, err := repository.RecommendFromPromote(url)

if err != nil {
return nil, err
}
imageInfo := make([]map[string]interface{}, 0)
for i := 0; i < (len(result) - 1); i++ {
line := result[i]
imageMap := make(map[string]interface{})
if line[0:4] == "url=" {
url := line[4:]
imageMap["url"] = url
if result[i+1][0:11] == "image_link=" {
image_link := result[i+1][11:]
imageMap["image_link"] = image_link
}
}
imageInfo = append(imageInfo, imageMap)
i = i + 1
}
return imageInfo, nil
}

func GetRankUser(index string) ([]map[string]interface{}, error) { func GetRankUser(index string) ([]map[string]interface{}, error) {
url := setting.RecommentRepoAddr + "user_rank_" + index url := setting.RecommentRepoAddr + "user_rank_" + index
result, err := repository.RecommendFromPromote(url) result, err := repository.RecommendFromPromote(url)
@@ -705,6 +730,15 @@ func GetRankUser(index string) ([]map[string]interface{}, error) {
return resultOrg, nil return resultOrg, nil
} }


func GetImageInfoFromPromote(ctx *context.Context) {
imageInfo, err := GetImageInfo()
if err != nil {
ctx.ServerError("500", err)
return
}
ctx.JSON(200, imageInfo)
}

func GetUserRankFromPromote(ctx *context.Context) { func GetUserRankFromPromote(ctx *context.Context) {
index := ctx.Params("index") index := ctx.Params("index")
resultUserRank, err := GetRankUser(index) resultUserRank, err := GetRankUser(index)


+ 1
- 0
routers/routes/routes.go View File

@@ -326,6 +326,7 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Get("/recommend/org", routers.RecommendOrgFromPromote) m.Get("/recommend/org", routers.RecommendOrgFromPromote)
m.Get("/recommend/repo", routers.RecommendRepoFromPromote) m.Get("/recommend/repo", routers.RecommendRepoFromPromote)
m.Get("/recommend/userrank/:index", routers.GetUserRankFromPromote) m.Get("/recommend/userrank/:index", routers.GetUserRankFromPromote)
m.Get("/recommend/imageinfo", routers.GetImageInfoFromPromote)
m.Post("/all/search/", routers.Search) m.Post("/all/search/", routers.Search)
m.Get("/all/search/", routers.EmptySearch) m.Get("/all/search/", routers.EmptySearch)
m.Get("/all/dosearch/", routers.SearchApi) m.Get("/all/dosearch/", routers.SearchApi)


+ 1
- 1
templates/explore/repo_right.tmpl View File

@@ -1,4 +1,4 @@
<a href="https://openi.org.cn/html/2020/qimengxingdong_0813/450.html" target="_blank"><img class="ui mini image" src="/img/banner-qimen-4X3.jpg" style="width:100%;"></a>
<a href="https://openi.org.cn/index.php?m=content&c=index&a=lists&catid=208" target="_blank"><img class="ui mini image" src="https://openi.org.cn/uploadfile/2022/0507/e8bdd42ed598f12.jpg" style="width:100%;"></a>


<div class="ui secondary pointing menu"> <div class="ui secondary pointing menu">
<div class="active item"> <div class="active item">


+ 5
- 0
templates/repo/cloudbrain/trainjob/show.tmpl View File

@@ -102,6 +102,11 @@
td, th { td, th {
padding: 0; padding: 0;
} }
.info_text {
padding-bottom: 20px;
padding-right: 20px;
font-size: 12px;
}
.ac-grid-col .text-span { .ac-grid-col .text-span {
width: 450px; width: 450px;
overflow: hidden; overflow: hidden;


Loading…
Cancel
Save