result.go 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. package search
  2. import (
  3. "bytes"
  4. "fmt"
  5. // "hash/crc32"
  6. "regexp"
  7. "strconv"
  8. "strings"
  9. "go-common/app/interface/main/app-intl/model"
  10. bgmmdl "go-common/app/interface/main/app-intl/model/bangumi"
  11. article "go-common/app/interface/openplatform/article/model"
  12. "go-common/app/service/main/archive/api"
  13. xtime "go-common/library/time"
  14. )
  15. // search const
  16. var getHightLight = regexp.MustCompile(`<em.*?em>`)
  17. // Result struct
  18. type Result struct {
  19. Trackid string `json:"trackid,omitempty"`
  20. Page int `json:"page,omitempty"`
  21. NavInfo []*NavInfo `json:"nav,omitempty"`
  22. Item []*Item `json:"item,omitempty"`
  23. Array int `json:"array,omitempty"`
  24. Attribute int32 `json:"attribute"`
  25. EasterEgg *EasterEgg `json:"easter_egg,omitempty"`
  26. }
  27. // NavInfo struct
  28. type NavInfo struct {
  29. Name string `json:"name"`
  30. Total int `json:"total"`
  31. Pages int `json:"pages"`
  32. Type int `json:"type"`
  33. Show int `json:"show_more,omitempty"`
  34. }
  35. // TypeSearch struct
  36. type TypeSearch struct {
  37. TrackID string `json:"trackid"`
  38. Pages int `json:"pages"`
  39. Total int `json:"total"`
  40. Items []*Item `json:"items,omitempty"`
  41. }
  42. // Suggestion struct
  43. type Suggestion struct {
  44. TrackID string `json:"trackid"`
  45. UpUser interface{} `json:"upuser,omitempty"`
  46. Bangumi interface{} `json:"bangumi,omitempty"`
  47. Suggest []string `json:"suggest,omitempty"`
  48. }
  49. // SuggestionResult3 struct
  50. type SuggestionResult3 struct {
  51. TrackID string `json:"trackid"`
  52. List []*Item `json:"list,omitempty"`
  53. }
  54. // NoResultRcndResult struct
  55. type NoResultRcndResult struct {
  56. TrackID string `json:"trackid"`
  57. Title string `json:"title,omitempty"`
  58. Pages int `json:"pages"`
  59. Items []*Item `json:"items,omitempty"`
  60. }
  61. // EasterEgg struct
  62. type EasterEgg struct {
  63. ID int64 `json:"id,omitempty"`
  64. ShowCount int `json:"show_count,omitempty"`
  65. }
  66. // Item struct
  67. type Item struct {
  68. TrackID string `json:"trackid,omitempty"`
  69. LinkType string `json:"linktype,omitempty"`
  70. Position int `json:"position,omitempty"`
  71. SuggestKeyword string `json:"suggest_keyword,omitempty"`
  72. Title string `json:"title,omitempty"`
  73. Name string `json:"name,omitempty"`
  74. Cover string `json:"cover,omitempty"`
  75. URI string `json:"uri,omitempty"`
  76. Param string `json:"param,omitempty"`
  77. Goto string `json:"goto,omitempty"`
  78. // av
  79. Play int `json:"play,omitempty"`
  80. Danmaku int `json:"danmaku,omitempty"`
  81. Author string `json:"author,omitempty"`
  82. ViewType string `json:"view_type,omitempty"`
  83. PTime xtime.Time `json:"ptime,omitempty"`
  84. RecTags []string `json:"rec_tags,omitempty"`
  85. // bangumi season
  86. SeasonID int64 `json:"season_id,omitempty"`
  87. SeasonType int `json:"season_type,omitempty"`
  88. Finish int8 `json:"finish,omitempty"`
  89. Started int8 `json:"started,omitempty"`
  90. Index string `json:"index,omitempty"`
  91. NewestCat string `json:"newest_cat,omitempty"`
  92. NewestSeason string `json:"newest_season,omitempty"`
  93. CatDesc string `json:"cat_desc,omitempty"`
  94. TotalCount int `json:"total_count,omitempty"`
  95. MediaType int `json:"media_type,omitempty"`
  96. PlayState int `json:"play_state,omitempty"`
  97. Style string `json:"style,omitempty"`
  98. CV string `json:"cv,omitempty"`
  99. Rating float64 `json:"rating,omitempty"`
  100. Vote int `json:"vote,omitempty"`
  101. RatingCount int `json:"rating_count,omitempty"`
  102. BadgeType int `json:"badge_type,omitempty"`
  103. // upper
  104. Sign string `json:"sign,omitempty"`
  105. Fans int `json:"fans,omitempty"`
  106. Level int `json:"level,omitempty"`
  107. Desc string `json:"desc,omitempty"`
  108. OfficialVerify *OfficialVerify `json:"official_verify,omitempty"`
  109. AvItems []*Item `json:"av_items,omitempty"`
  110. Item []*Item `json:"item,omitempty"`
  111. CTime int64 `json:"ctime,omitempty"`
  112. IsUp bool `json:"is_up,omitempty"`
  113. LiveURI string `json:"live_uri,omitempty"`
  114. // movie
  115. ScreenDate string `json:"screen_date,omitempty"`
  116. Area string `json:"area,omitempty"`
  117. CoverMark string `json:"cover_mark,omitempty"`
  118. // arc and sp
  119. Arcs int `json:"archives,omitempty"`
  120. // arc and movie
  121. Duration string `json:"duration,omitempty"`
  122. DurationInt int64 `json:"duration_int,omitempty"`
  123. Actors string `json:"actors,omitempty"`
  124. Staff string `json:"staff,omitempty"`
  125. Length int `json:"length,omitempty"`
  126. Status int `json:"status,omitempty"`
  127. // live
  128. RoomID int64 `json:"roomid,omitempty"`
  129. Mid int64 `json:"mid,omitempty"`
  130. Type string `json:"type,omitempty"`
  131. Attentions int `json:"attentions,omitempty"`
  132. LiveStatus int `json:"live_status,omitempty"`
  133. Tags string `json:"tags,omitempty"`
  134. Region int `json:"region,omitempty"`
  135. Online int `json:"online,omitempty"`
  136. ShortID int `json:"short_id,omitempty"`
  137. CateName string `json:"area_v2_name,omitempty"`
  138. IsSelection int `json:"is_selection,omitempty"`
  139. // article
  140. ID int64 `json:"id,omitempty"`
  141. TemplateID int `json:"template_id,omitempty"`
  142. ImageUrls []string `json:"image_urls,omitempty"`
  143. View int `json:"view,omitempty"`
  144. Like int `json:"like,omitempty"`
  145. Reply int `json:"reply,omitempty"`
  146. // special
  147. Badge string `json:"badge,omitempty"`
  148. RcmdReason *RcmdReason `json:"rcmd_reason,omitempty"`
  149. // media bangumi and mdeia ft
  150. Prompt string `json:"prompt,omitempty"`
  151. Episodes []*Item `json:"episodes,omitempty"`
  152. Label string `json:"label,omitempty"`
  153. // game
  154. Reserve string `json:"reserve,omitempty"`
  155. // user
  156. Face string `json:"face,omitempty"`
  157. // suggest
  158. From string `json:"from,omitempty"`
  159. KeyWord string `json:"keyword,omitempty"`
  160. CoverSize float64 `json:"cover_size,omitempty"`
  161. SugType string `json:"sug_type,omitempty"`
  162. TermType int `json:"term_type,omitempty"`
  163. // rcmd query
  164. List []*Item `json:"list,omitempty"`
  165. FromSource string `json:"from_source,omitempty"`
  166. // live master
  167. UCover string `json:"ucover,omitempty"`
  168. VerifyType int `json:"verify_type,omitempty"`
  169. VerifyDesc string `json:"verify_desc,omitempty"`
  170. LevelColor int64 `json:"level_color,omitempty"`
  171. IsAttention int `json:"is_atten,omitempty"`
  172. CateParentName string `json:"cate_parent_name,omitempty"`
  173. CateNameNew string `json:"cate_name,omitempty"`
  174. Glory *Glory `json:"glory_info,omitempty"`
  175. // twitter
  176. Covers []string `json:"covers,omitempty"`
  177. CoverCount int `json:"cover_count,omitempty"`
  178. }
  179. // Glory live struct
  180. type Glory struct {
  181. Title string `json:"title,omitempty"`
  182. Total int `json:"total"`
  183. Items []*Item `json:"items,omitempty"`
  184. }
  185. // RcmdReason struct
  186. type RcmdReason struct {
  187. Content string `json:"content,omitempty"`
  188. }
  189. // UserResult struct
  190. type UserResult struct {
  191. Items []*Item `json:"items,omitempty"`
  192. }
  193. // DefaultWords struct
  194. type DefaultWords struct {
  195. Trackid string `json:"trackid,omitempty"`
  196. Param string `json:"param,omitempty"`
  197. Show string `json:"show,omitempty"`
  198. Word string `json:"word,omitempty"`
  199. }
  200. // FromSeason form func
  201. func (i *Item) FromSeason(b *Bangumi, bangumi string) {
  202. i.Title = b.Title
  203. i.Cover = b.Cover
  204. i.Goto = model.GotoBangumi
  205. i.Param = strconv.Itoa(int(b.SeasonID))
  206. i.URI = model.FillURI(bangumi, i.Param, nil)
  207. i.Finish = int8(b.IsFinish)
  208. i.Started = int8(b.IsStarted)
  209. i.Index = b.NewestEpIndex
  210. i.NewestCat = b.NewestCat
  211. i.NewestSeason = b.NewestSeason
  212. i.TotalCount = b.TotalCount
  213. var buf bytes.Buffer
  214. if b.CatList.TV != 0 {
  215. buf.WriteString(`TV(`)
  216. buf.WriteString(strconv.Itoa(b.CatList.TV))
  217. buf.WriteString(`) `)
  218. }
  219. if b.CatList.Movie != 0 {
  220. buf.WriteString(`剧场版(`)
  221. buf.WriteString(strconv.Itoa(b.CatList.Movie))
  222. buf.WriteString(`) `)
  223. }
  224. if b.CatList.Ova != 0 {
  225. buf.WriteString(`OVA/OAD/SP(`)
  226. buf.WriteString(strconv.Itoa(b.CatList.Ova))
  227. buf.WriteString(`)`)
  228. }
  229. i.CatDesc = buf.String()
  230. }
  231. // FromUser form func
  232. func (i *Item) FromUser(u *User, as map[int64]*api.Arc) {
  233. i.Title = u.Name
  234. i.Cover = u.Pic
  235. i.Goto = model.GotoAuthor
  236. i.OfficialVerify = u.OfficialVerify
  237. i.Param = strconv.Itoa(int(u.Mid))
  238. i.URI = model.FillURI(i.Goto, i.Param, nil)
  239. i.Mid = u.Mid
  240. i.Sign = u.Usign
  241. i.Fans = u.Fans
  242. i.Level = u.Level
  243. i.Arcs = u.Videos
  244. i.AvItems = make([]*Item, 0, len(u.Res))
  245. i.RoomID = u.RoomID
  246. if u.IsUpuser == 1 {
  247. for _, v := range u.Res {
  248. vi := &Item{}
  249. vi.Title = v.Title
  250. vi.Cover = v.Pic
  251. vi.Goto = model.GotoAv
  252. vi.Param = strconv.Itoa(int(v.Aid))
  253. vi.URI = model.FillURI(vi.Goto, vi.Param, model.AvHandler(as[v.Aid], "", nil))
  254. a, ok := as[v.Aid]
  255. if ok {
  256. vi.Play = int(a.Stat.View)
  257. vi.Danmaku = int(a.Stat.Danmaku)
  258. } else {
  259. switch play := v.Play.(type) {
  260. case float64:
  261. vi.Play = int(play)
  262. case string:
  263. vi.Play, _ = strconv.Atoi(play)
  264. }
  265. vi.Danmaku = v.Danmaku
  266. }
  267. vi.CTime = v.Pubdate
  268. vi.Duration = v.Duration
  269. i.AvItems = append(i.AvItems, vi)
  270. }
  271. i.IsUp = true
  272. }
  273. }
  274. // FromUpUser form func
  275. func (i *Item) FromUpUser(u *User, as map[int64]*api.Arc) {
  276. i.Title = u.Name
  277. i.Cover = u.Pic
  278. i.Goto = model.GotoAuthor
  279. i.OfficialVerify = u.OfficialVerify
  280. i.Param = strconv.Itoa(int(u.Mid))
  281. i.URI = model.FillURI(i.Goto, i.Param, nil)
  282. i.Mid = u.Mid
  283. i.Sign = u.Usign
  284. i.Fans = u.Fans
  285. i.Level = u.Level
  286. i.Arcs = u.Videos
  287. i.AvItems = make([]*Item, 0, len(u.Res))
  288. for _, v := range u.Res {
  289. vi := &Item{}
  290. vi.Title = v.Title
  291. vi.Cover = v.Pic
  292. vi.Goto = model.GotoAv
  293. vi.Param = strconv.Itoa(int(v.Aid))
  294. vi.URI = model.FillURI(vi.Goto, vi.Param, model.AvHandler(as[v.Aid], "", nil))
  295. a, ok := as[v.Aid]
  296. if ok {
  297. vi.Play = int(a.Stat.View)
  298. vi.Danmaku = int(a.Stat.Danmaku)
  299. } else {
  300. switch play := v.Play.(type) {
  301. case float64:
  302. vi.Play = int(play)
  303. case string:
  304. vi.Play, _ = strconv.Atoi(play)
  305. }
  306. vi.Danmaku = v.Danmaku
  307. }
  308. vi.CTime = v.Pubdate
  309. vi.Duration = v.Duration
  310. i.AvItems = append(i.AvItems, vi)
  311. }
  312. i.RoomID = u.RoomID
  313. i.IsUp = u.IsUpuser == 1
  314. }
  315. // FromMovie form func
  316. func (i *Item) FromMovie(m *Movie, as map[int64]*api.Arc) {
  317. i.Title = m.Title
  318. i.Desc = m.Desc
  319. if m.Type == "movie" {
  320. i.Cover = m.Cover
  321. i.Param = strconv.Itoa(int(m.Aid))
  322. i.Goto = model.GotoAv
  323. i.URI = model.FillURI(i.Goto, i.Param, model.AvHandler(as[m.Aid], "", nil))
  324. i.CoverMark = model.StatusMark(m.Status)
  325. } else if m.Type == "special" {
  326. i.Param = m.SpID
  327. i.Goto = model.GotoSp
  328. i.URI = model.FillURI(i.Goto, i.Param, nil)
  329. i.Cover = m.Pic
  330. }
  331. i.Staff = m.Staff
  332. i.Actors = m.Actors
  333. i.Area = m.Area
  334. i.Length = m.Length
  335. i.Status = m.Status
  336. i.ScreenDate = m.ScreenDate
  337. }
  338. // FromVideo form func
  339. func (i *Item) FromVideo(v *Video, a *api.Arc) {
  340. i.Title = v.Title
  341. i.Cover = v.Pic
  342. i.Author = v.Author
  343. i.Param = strconv.Itoa(int(v.ID))
  344. i.Goto = model.GotoAv
  345. if a != nil {
  346. i.Face = a.Author.Face
  347. i.URI = model.FillURI(i.Goto, i.Param, model.AvHandler(a, "", nil))
  348. i.Play = int(a.Stat.View)
  349. i.Danmaku = int(a.Stat.Danmaku)
  350. } else {
  351. i.URI = model.FillURI(i.Goto, i.Param, nil)
  352. switch play := v.Play.(type) {
  353. case float64:
  354. i.Play = int(play)
  355. case string:
  356. i.Play, _ = strconv.Atoi(play)
  357. }
  358. i.Danmaku = v.Danmaku
  359. }
  360. i.Desc = v.Desc
  361. i.Duration = v.Duration
  362. i.ViewType = v.ViewType
  363. i.RecTags = v.RecTags
  364. }
  365. // FromOperate form func
  366. func (i *Item) FromOperate(o *Operate, gt string) {
  367. i.Title = o.Title
  368. i.Cover = o.Cover
  369. i.URI = o.RedirectURL
  370. i.Param = strconv.FormatInt(o.ID, 10)
  371. i.Desc = o.Desc
  372. i.Badge = o.Corner
  373. i.Goto = gt
  374. if o.RecReason != "" {
  375. i.RcmdReason = &RcmdReason{Content: o.RecReason}
  376. }
  377. }
  378. // FromConverge form func
  379. func (i *Item) FromConverge(o *Operate, am map[int64]*api.Arc, artm map[int64]*article.Meta) {
  380. const _convergeMinCount = 2
  381. cis := make([]*Item, 0, len(o.ContentList))
  382. for _, c := range o.ContentList {
  383. ci := &Item{}
  384. switch c.Type {
  385. case 0:
  386. if a, ok := am[c.ID]; ok && a.IsNormal() {
  387. ci.Title = a.Title
  388. ci.Cover = a.Pic
  389. ci.Goto = model.GotoAv
  390. ci.Param = strconv.FormatInt(a.Aid, 10)
  391. ci.URI = model.FillURI(ci.Goto, ci.Param, model.AvHandler(a, "", nil))
  392. ci.fillArcStat(a)
  393. cis = append(cis, ci)
  394. }
  395. case 2:
  396. if art, ok := artm[c.ID]; ok {
  397. ci.Title = art.Title
  398. ci.Desc = art.Summary
  399. if len(art.ImageURLs) != 0 {
  400. ci.Cover = art.ImageURLs[0]
  401. }
  402. ci.Goto = model.GotoArticle
  403. ci.Param = strconv.FormatInt(art.ID, 10)
  404. ci.URI = model.FillURI(ci.Goto, ci.Param, nil)
  405. if art.Stats != nil {
  406. ci.fillArtStat(art)
  407. }
  408. ci.Badge = "文章"
  409. cis = append(cis, ci)
  410. }
  411. }
  412. }
  413. if len(cis) < _convergeMinCount {
  414. return
  415. }
  416. i.Item = cis
  417. i.Title = o.Title
  418. i.Cover = o.Cover
  419. i.URI = o.RedirectURL
  420. i.Param = strconv.FormatInt(o.ID, 10)
  421. i.Desc = o.Desc
  422. i.Badge = o.Corner
  423. i.Goto = model.GotoConverge
  424. if o.RecReason != "" {
  425. i.RcmdReason = &RcmdReason{Content: o.RecReason}
  426. }
  427. }
  428. // FromMedia form func
  429. func (i *Item) FromMedia(m *Media, prompt string, gt string, bangumis map[string]*bgmmdl.Card) {
  430. i.Title = m.Title
  431. if i.Title == "" {
  432. i.Title = m.OrgTitle
  433. }
  434. i.Cover = m.Cover
  435. i.Goto = gt
  436. i.Param = strconv.Itoa(int(m.MediaID))
  437. i.URI = m.GotoURL
  438. i.MediaType = m.MediaType
  439. i.PlayState = m.PlayState
  440. i.Style = m.Styles
  441. i.CV = m.CV
  442. i.Staff = m.Staff
  443. if m.MediaScore != nil {
  444. i.Rating = m.MediaScore.Score
  445. i.Vote = m.MediaScore.UserCount
  446. }
  447. i.PTime = m.Pubtime
  448. areas := strings.Split(m.Areas, "、")
  449. if len(areas) != 0 {
  450. i.Area = areas[0]
  451. }
  452. i.Prompt = prompt
  453. var hit string
  454. for _, v := range m.HitColumns {
  455. if v == "cv" {
  456. hit = v
  457. break
  458. } else if v == "staff" {
  459. hit = v
  460. }
  461. }
  462. if hit == "cv" {
  463. for _, v := range getHightLight.FindAllStringSubmatch(m.CV, -1) {
  464. if gt == model.GotoBangumi {
  465. i.Label = fmt.Sprintf("声优: %v...", v[0])
  466. break
  467. } else if gt == model.GotoMovie {
  468. i.Label = fmt.Sprintf("演员: %v...", v[0])
  469. break
  470. }
  471. }
  472. } else if hit == "staff" {
  473. for _, v := range getHightLight.FindAllStringSubmatch(m.Staff, -1) {
  474. i.Label = fmt.Sprintf("制作人员: %v...", v[0])
  475. break
  476. }
  477. }
  478. // get from PGC API.
  479. i.SeasonID = m.SeasonID
  480. ssID := strconv.Itoa(int(m.SeasonID))
  481. if bgm, ok := bangumis[ssID]; ok {
  482. i.IsAttention = bgm.IsFollow
  483. i.IsSelection = bgm.IsSelection
  484. i.SeasonType = bgm.SeasonType
  485. for _, v := range bgm.Episodes {
  486. tmp := &Item{
  487. Param: strconv.Itoa(int(v.ID)),
  488. Index: v.Index,
  489. }
  490. tmp.URI = model.FillURI(model.GotoEP, tmp.Param, nil)
  491. i.Episodes = append(i.Episodes, tmp)
  492. }
  493. }
  494. }
  495. // FromArticle form func
  496. func (i *Item) FromArticle(a *Article) {
  497. i.ID = a.ID
  498. i.Mid = a.Mid
  499. i.TemplateID = a.TemplateID
  500. i.Title = a.Title
  501. i.Desc = a.Desc
  502. i.ImageUrls = a.ImageUrls
  503. i.View = a.View
  504. i.Play = a.View
  505. i.Like = a.Like
  506. i.Reply = a.Reply
  507. i.Goto = model.GotoArticle
  508. i.Param = strconv.Itoa(int(a.ID))
  509. i.URI = model.FillURI(i.Goto, i.Param, nil)
  510. }
  511. // FromChannel form func
  512. func (i *Item) FromChannel(c *Channel) {
  513. i.ID = c.TagID
  514. i.Title = c.TagName
  515. i.Cover = c.Cover
  516. i.Param = strconv.FormatInt(c.TagID, 10)
  517. i.Goto = model.GotoChannel
  518. i.URI = model.FillURI(i.Goto, i.Param, nil)
  519. i.Type = c.Type
  520. i.Attentions = c.AttenCount
  521. }
  522. // FromQuery form func
  523. func (i *Item) FromQuery(qs []*Query) {
  524. i.Goto = model.GotoRecommendWord
  525. for _, q := range qs {
  526. i.List = append(i.List, &Item{Param: strconv.FormatInt(q.ID, 10), Title: q.Name, Type: q.Type, FromSource: q.FromSource})
  527. }
  528. }
  529. // FromTwitter form twitter
  530. func (i *Item) FromTwitter(t *Twitter) {
  531. i.Title = t.Content
  532. i.Covers = t.Cover
  533. i.CoverCount = t.CoverCount
  534. i.Param = strconv.FormatInt(t.ID, 10)
  535. i.Goto = model.GotoTwitter
  536. i.URI = model.FillURI(i.Goto, strconv.FormatInt(t.PicID, 10), nil)
  537. }
  538. // fillArcStat fill func
  539. func (i *Item) fillArcStat(a *api.Arc) {
  540. if a.Access == 0 {
  541. i.Play = int(a.Stat.View)
  542. }
  543. i.Danmaku = int(a.Stat.Danmaku)
  544. i.Reply = int(a.Stat.Reply)
  545. i.Like = int(a.Stat.Like)
  546. }
  547. // fillArtStat fill func
  548. func (i *Item) fillArtStat(m *article.Meta) {
  549. i.Play = int(m.Stats.View)
  550. i.Reply = int(m.Stats.Reply)
  551. }
  552. // FromSuggest3 form func
  553. func (i *Item) FromSuggest3(st *Sug, as map[int64]*api.Arc) {
  554. i.From = "search"
  555. i.Title = st.ShowName
  556. i.KeyWord = st.Term
  557. i.Position = st.Pos
  558. i.Cover = st.Cover
  559. i.CoverSize = st.CoverSize
  560. i.SugType = st.SubType
  561. i.TermType = st.TermType
  562. if st.TermType == SuggestionJump {
  563. switch st.SubType {
  564. case SuggestionAV:
  565. i.Goto = model.GotoAv
  566. i.URI = model.FillURI(i.Goto, strconv.Itoa(int(st.Ref)), model.AvHandler(as[st.Ref], "", nil))
  567. i.SugType = "视频"
  568. }
  569. }
  570. }