field.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. from enum import Enum
  2. from typing import NamedTuple
  3. class FeedType(Enum):
  4. # 推荐
  5. RECOMMEND = "homefeed_recommend"
  6. # 穿搭
  7. FASION = "homefeed.fashion_v3"
  8. # 美食
  9. FOOD = "homefeed.food_v3"
  10. # 彩妆
  11. COSMETICS = "homefeed.cosmetics_v3"
  12. # 影视
  13. MOVIE = "homefeed.movie_and_tv_v3"
  14. # 职场
  15. CAREER = "homefeed.career_v3"
  16. # 情感
  17. EMOTION = "homefeed.love_v3"
  18. # 家居
  19. HOURSE = "homefeed.household_product_v3"
  20. # 游戏
  21. GAME = "homefeed.gaming_v3"
  22. # 旅行
  23. TRAVEL = "homefeed.travel_v3"
  24. # 健身
  25. FITNESS = "homefeed.fitness_v3"
  26. class NoteType(Enum):
  27. NORMAL = "normal"
  28. VIDEO = "video"
  29. class SearchSortType(Enum):
  30. """search sort type"""
  31. # default
  32. GENERAL = "general"
  33. # most popular
  34. MOST_POPULAR = "popularity_descending"
  35. # Latest
  36. LATEST = "time_descending"
  37. class SearchNoteType(Enum):
  38. """search note type
  39. """
  40. # default
  41. ALL = 0
  42. # only video
  43. VIDEO = 1
  44. # only image
  45. IMAGE = 2
  46. class Note(NamedTuple):
  47. """note tuple"""
  48. note_id: str
  49. title: str
  50. desc: str
  51. type: str
  52. user: dict
  53. img_urls: list
  54. video_url: str
  55. tag_list: list
  56. at_user_list: list
  57. collected_count: str
  58. comment_count: str
  59. liked_count: str
  60. share_count: str
  61. time: int
  62. last_update_time: int