|
@@ -10,16 +10,41 @@ import (
|
|
|
|
|
|
|
|
|
func GetBannerUrlBody(url string) (itemResp *models.BannerUrlResp) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
- material := "material/info"
|
|
|
- activity := "activity/detail"
|
|
|
- indepth := "indepth/info"
|
|
|
- about := "/about"
|
|
|
- internal := "internal/article"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ mapPath := make(map[int]string)
|
|
|
+ mapPath[2] = utils.WX_MSG_PATH_ARTICLE_DETAIL
|
|
|
+ mapPath[3] = utils.WX_MSG_PATH_ACTIVITY_DETAIL
|
|
|
+ mapPath[4] = utils.WX_MSG_PATH_INDUSTRY_DETAIL
|
|
|
+ mapPath[6] = utils.WX_MSG_PATH_PRODUCTINTERIOR_DETAIL
|
|
|
+ mapPath[7] = utils.WX_MSG_PATH_THIS_WEEK_DETAIL
|
|
|
+ mapPath[8] = utils.WX_MSG_PATH_LAST_WEEK_DETAIL
|
|
|
+ mapPath[9] = utils.WX_MSG_PATH_ACTIVITY_SPECIAL_DETAIL
|
|
|
+ mapPath[10] = utils.WX_MSG_PATH_KEY_COMPANY_DETAIL
|
|
|
+ mapPath[11] = utils.WX_MSG_PATH_RESEARCHTHEME_DETAIL
|
|
|
+ mapPath[12] = utils.WX_MSG_PATH_AUTHOR_DETAIL
|
|
|
+
|
|
|
+ material := "material/info"
|
|
|
+ activity := "activity/detail"
|
|
|
+ indepth := "indepth/info"
|
|
|
+ about := "/about"
|
|
|
+ internal := "internal/article"
|
|
|
+ thisWeek := "summary/2/"
|
|
|
+ lastWeek := "summary/3/"
|
|
|
+ activitySpecial := "activity/info"
|
|
|
+ recent := "/recent/"
|
|
|
+ communityTheme := "/community/theme/"
|
|
|
+ communityAuthor := "/community/author/"
|
|
|
item := new(models.BannerUrlResp)
|
|
|
item.Body = url
|
|
|
urlSlice := strings.Split(url, "/")
|
|
@@ -40,9 +65,22 @@ func GetBannerUrlBody(url string) (itemResp *models.BannerUrlResp) {
|
|
|
item.Type = 5
|
|
|
} else if strings.Contains(url, internal) {
|
|
|
item.Type = 6
|
|
|
+ } else if strings.Contains(url, thisWeek) {
|
|
|
+ item.Type = 7
|
|
|
+ } else if strings.Contains(url, lastWeek) {
|
|
|
+ item.Type = 8
|
|
|
+ } else if strings.Contains(url, activitySpecial) {
|
|
|
+ item.Type = 9
|
|
|
+ } else if strings.Contains(url, recent) {
|
|
|
+ item.Type = 10
|
|
|
+ } else if strings.Contains(url, communityTheme) {
|
|
|
+ item.Type = 11
|
|
|
+ } else if strings.Contains(url, communityAuthor) {
|
|
|
+ item.Type = 12
|
|
|
} else {
|
|
|
item.Type = 1
|
|
|
}
|
|
|
+ item.Path = mapPath[item.Type]
|
|
|
itemResp = item
|
|
|
return
|
|
|
}
|