library.go 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. package model
  2. import "iot_manager_service/app/multimedia/dao"
  3. const (
  4. LibraryTypeVideo = 1
  5. LibraryTypeImage = 2
  6. LibraryTypeTxt = 3
  7. LibraryTypeAudio = 4
  8. LibraryTypeVideoStr = "视频"
  9. LibraryTypeImageStr = "图片"
  10. LibraryTypeTxtStr = "文本"
  11. LibraryTypeAudioStr = "音频"
  12. )
  13. func LibToModel(library dao.Library) LibraryDetail {
  14. typeName := ""
  15. switch library.LibType {
  16. case LibraryTypeVideo:
  17. typeName = LibraryTypeVideoStr
  18. case LibraryTypeImage:
  19. typeName = LibraryTypeImageStr
  20. case LibraryTypeTxt:
  21. typeName = LibraryTypeTxtStr
  22. case LibraryTypeAudio:
  23. typeName = LibraryTypeAudioStr
  24. }
  25. return LibraryDetail{
  26. Library: library,
  27. TypeName: typeName,
  28. }
  29. }
  30. type LibraryDetail struct {
  31. dao.Library
  32. TypeName string `json:"typeName"` //素材类型(中文) 视频 图片
  33. }
  34. type RsqLibraryList struct {
  35. Records []LibraryDetail `json:"records"` //记录列表
  36. Current int `json:"current"` //当前分页
  37. Size int `json:"size"` //每页数量
  38. Pages int `json:"pages"` //总页数
  39. Total int `json:"total"` //总数
  40. }
  41. type RspUploadFile struct {
  42. Link string `json:"link"`
  43. Domain string `json:"domain"`
  44. Name string `json:"name"`
  45. OriginalName string `json:"originalName"`
  46. AttachId int `json:"attachId"`
  47. Duration int `json:"duration"`
  48. Resolution string `json:"resolution"`
  49. FileSize int64 `json:"fileSize"`
  50. FileType int `json:"fileType"`
  51. }
  52. type ReqLibrarySubmit struct {
  53. Id int `json:"id"`
  54. FileSize int64 `json:"fileSize"`
  55. LibName string `json:"libName"`
  56. Resolution string `json:"resolution"`
  57. MaterialAddress string `json:"materialAddress"`
  58. LibType int `json:"libType"`
  59. LibDuration int `json:"libDuration"`
  60. LibExplain string `json:"libExplain"`
  61. TalkSpeed int `json:"talkSpeed"`
  62. }