builder.go 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. package grpc
  2. import (
  3. v1 "go-common/app/service/main/archive/api"
  4. )
  5. func (s *server) archive3ToArc(a *v1.Arc) (arc *v1.Arc) {
  6. arc = &v1.Arc{
  7. Aid: a.Aid,
  8. Videos: a.Videos,
  9. TypeID: a.TypeID,
  10. TypeName: a.TypeName,
  11. Copyright: a.Copyright,
  12. Pic: a.Pic,
  13. Title: a.Title,
  14. PubDate: a.PubDate,
  15. Ctime: a.Ctime,
  16. Desc: a.Desc,
  17. State: a.State,
  18. Access: a.Access,
  19. Attribute: a.Attribute,
  20. Duration: a.Duration,
  21. MissionID: a.MissionID,
  22. OrderID: a.OrderID,
  23. RedirectURL: a.RedirectURL,
  24. Forward: a.Forward,
  25. Rights: v1.Rights{
  26. Bp: a.Rights.Bp,
  27. Elec: a.Rights.Elec,
  28. Download: a.Rights.Download,
  29. Movie: a.Rights.Movie,
  30. Pay: a.Rights.Pay,
  31. HD5: a.Rights.HD5,
  32. NoReprint: a.Rights.NoReprint,
  33. Autoplay: a.Rights.Autoplay,
  34. UGCPay: a.Rights.UGCPay,
  35. IsCooperation: a.Rights.IsCooperation,
  36. },
  37. Author: v1.Author{
  38. Mid: a.Author.Mid,
  39. Name: a.Author.Name,
  40. Face: a.Author.Face,
  41. },
  42. Stat: v1.Stat{
  43. Aid: a.Stat.Aid,
  44. View: a.Stat.View,
  45. Danmaku: a.Stat.Danmaku,
  46. Reply: a.Stat.Reply,
  47. Fav: a.Stat.Fav,
  48. Coin: a.Stat.Coin,
  49. Share: a.Stat.Share,
  50. NowRank: a.Stat.NowRank,
  51. HisRank: a.Stat.HisRank,
  52. Like: a.Stat.Like,
  53. DisLike: a.Stat.DisLike,
  54. },
  55. ReportResult: a.ReportResult,
  56. Dynamic: a.Dynamic,
  57. FirstCid: a.FirstCid,
  58. Dimension: v1.Dimension{
  59. Width: a.Dimension.Width,
  60. Height: a.Dimension.Height,
  61. Rotate: a.Dimension.Rotate,
  62. },
  63. }
  64. for _, si := range a.StaffInfo {
  65. if si != nil {
  66. arc.StaffInfo = append(arc.StaffInfo, &v1.StaffInfo{Mid: si.Mid, Title: si.Title})
  67. }
  68. }
  69. return
  70. }
  71. // ChangeToGrpc is
  72. func (s *server) page3ToPage(v *v1.Page) (vg *v1.Page) {
  73. vg = &v1.Page{
  74. Cid: v.Cid,
  75. Page: v.Page,
  76. From: v.From,
  77. Part: v.Part,
  78. Duration: v.Duration,
  79. Vid: v.Vid,
  80. Desc: v.Desc,
  81. WebLink: v.WebLink,
  82. Dimension: v1.Dimension{
  83. Width: v.Dimension.Width,
  84. Height: v.Dimension.Height,
  85. Rotate: v.Dimension.Rotate,
  86. },
  87. }
  88. return
  89. }