library.go 848 B

12345678910111213141516171819202122232425262728293031323334
  1. package model
  2. import "iot_manager_service/app/multimedia/dao"
  3. const (
  4. LibraryTypeVideo = 1
  5. LibraryTypeImage = 2
  6. LibraryTypeVideoStr = "视频"
  7. LibraryTypeImageStr = "图片"
  8. )
  9. func DaoToModel(library dao.Library) LibraryDetail {
  10. typeName := LibraryTypeVideoStr
  11. if library.LibType == LibraryTypeImage {
  12. typeName = LibraryTypeImageStr
  13. }
  14. return LibraryDetail{
  15. Library: library,
  16. TypeName: typeName,
  17. }
  18. }
  19. type LibraryDetail struct {
  20. dao.Library
  21. TypeName string `json:"typeName"` //素材类型(中文) 视频 图片
  22. }
  23. type RsqLibraryList struct {
  24. Records []LibraryDetail `json:"records"` //记录列表
  25. Current int `json:"current"` //当前分页
  26. Size int `json:"size"` //每页数量
  27. Pages int `json:"pages"` //总页数
  28. Total int `json:"total"` //总数
  29. }