archive2.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. package gorpc
  2. import (
  3. "context"
  4. "go-common/app/service/main/archive/api"
  5. model "go-common/app/service/main/archive/model/archive"
  6. )
  7. const (
  8. _types2 = "RPC.Types2"
  9. _videoshot2 = "RPC.Videoshot2"
  10. _upCount2 = "RPC.UpCount2"
  11. _upsPassed2 = "RPC.UpsPassed2"
  12. _upVideo2 = "RPC.UpVideo2"
  13. _delVideo2 = "RPC.DelVideo2"
  14. _description2 = "RPC.Description2"
  15. _ranksTopCount2 = "RPC.RanksTopCount2"
  16. _arcCache2 = "RPC.ArcCache2"
  17. _arcFieldCache2 = "RPC.ArcFieldCache2"
  18. _setStat2 = "RPC.SetStat2"
  19. _setStatCache2 = "RPC.SetStatCache2"
  20. )
  21. // Types2 get all archive types
  22. func (s *Service2) Types2(c context.Context) (res map[int16]*model.ArcType, err error) {
  23. err = s.client.Call(c, _types2, _noArg, &res)
  24. return
  25. }
  26. // Videoshot2 get videoshot.
  27. func (s *Service2) Videoshot2(c context.Context, arg *model.ArgCid2) (res *model.Videoshot, err error) {
  28. res = new(model.Videoshot)
  29. err = s.client.Call(c, _videoshot2, arg, res)
  30. return
  31. }
  32. // UpCount2 up count2
  33. func (s *Service2) UpCount2(c context.Context, arg *model.ArgUpCount2) (count int, err error) {
  34. err = s.client.Call(c, _upCount2, arg, &count)
  35. return
  36. }
  37. // UpsPassed2 get UpsPassed aid and ptime
  38. func (s *Service2) UpsPassed2(c context.Context, arg *model.ArgUpsArcs2) (res map[int64][]*model.AidPubTime, err error) {
  39. err = s.client.Call(c, _upsPassed2, arg, &res)
  40. return
  41. }
  42. // UpVideo2 update video cache by aid & cid
  43. func (s *Service2) UpVideo2(c context.Context, arg *model.ArgVideo2) (err error) {
  44. err = s.client.Call(c, _upVideo2, arg, _noArg)
  45. return
  46. }
  47. // DelVideo2 delete video cache by aid & cid
  48. func (s *Service2) DelVideo2(c context.Context, arg *model.ArgVideo2) (err error) {
  49. err = s.client.Call(c, _delVideo2, arg, _noArg)
  50. return
  51. }
  52. // Description2 add share.
  53. func (s *Service2) Description2(c context.Context, arg *model.ArgAid) (des string, err error) {
  54. err = s.client.Call(c, _description2, arg, &des)
  55. return
  56. }
  57. // RanksTopCount2 get top region count.
  58. func (s *Service2) RanksTopCount2(c context.Context, arg *model.ArgRankTopsCount2) (res map[int16]int, err error) {
  59. err = s.client.Call(c, _ranksTopCount2, arg, &res)
  60. return
  61. }
  62. // ArcCache2 add/update archive cache
  63. func (s *Service2) ArcCache2(c context.Context, arg *model.ArgCache2) (err error) {
  64. err = s.client.Call(c, _arcCache2, arg, _noArg)
  65. return
  66. }
  67. // ArcFieldCache2 update archive field cache
  68. func (s *Service2) ArcFieldCache2(c context.Context, arg *model.ArgFieldCache2) (err error) {
  69. err = s.client.Call(c, _arcFieldCache2, arg, _noArg)
  70. return
  71. }
  72. // SetStat2 set all stat info.
  73. func (s *Service2) SetStat2(c context.Context, arg *api.Stat) (err error) {
  74. err = s.client.Call(c, _setStat2, arg, _noArg)
  75. return
  76. }
  77. // SetStatCache2 up stat.
  78. func (s *Service2) SetStatCache2(c context.Context, arg *model.ArgStat2) (err error) {
  79. err = s.client.Call(c, _setStatCache2, arg, _noArg)
  80. return
  81. }