| @@ -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) | ||||
| @@ -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) | ||||
| @@ -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,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"> | ||||
| @@ -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; | ||||