8
0

entity.go 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. package mini_video_config
  2. import (
  3. "git.sxidc.com/go-framework/baize/framework/core/domain"
  4. "git.sxidc.com/go-framework/baize/framework/core/domain/entity"
  5. )
  6. const (
  7. FieldComponentID = "ComponentID"
  8. FieldVideoTitle = "VideoTitle"
  9. FieldVideoUrl = "VideoUrl"
  10. FieldVideoCover = "VideoCover"
  11. FieldVideoDuration = "VideoDuration"
  12. FieldAutoPlay = "AutoPlay"
  13. FieldShowControls = "ShowControls"
  14. FieldIsEnabled = "IsEnabled"
  15. )
  16. var fieldMap = map[string]string{
  17. FieldComponentID: "组件实例ID",
  18. FieldVideoTitle: "视频标题",
  19. FieldVideoUrl: "视频地址",
  20. FieldVideoCover: "视频封面",
  21. FieldVideoDuration: "视频时长(秒)",
  22. FieldAutoPlay: "是否自动播放",
  23. FieldShowControls: "是否显示控制器",
  24. FieldIsEnabled: "是否启用",
  25. }
  26. var (
  27. ColumnComponentID = domain.ColumnName(FieldComponentID)
  28. ColumnVideoTitle = domain.ColumnName(FieldVideoTitle)
  29. ColumnVideoUrl = domain.ColumnName(FieldVideoUrl)
  30. ColumnVideoCover = domain.ColumnName(FieldVideoCover)
  31. ColumnVideoDuration = domain.ColumnName(FieldVideoDuration)
  32. ColumnAutoPlay = domain.ColumnName(FieldAutoPlay)
  33. ColumnShowControls = domain.ColumnName(FieldShowControls)
  34. ColumnIsEnabled = domain.ColumnName(FieldIsEnabled)
  35. )
  36. type Entity struct {
  37. entity.Base
  38. ComponentID string `sqlmapping:"column:component_id;" sqlresult:"column:component_id;" check:"required,lte=32,when=create/update"`
  39. VideoTitle string `sqlmapping:"column:video_title;" sqlresult:"column:video_title;" check:"required,lte=200,when=create/update"`
  40. VideoUrl string `sqlmapping:"column:video_url;" sqlresult:"column:video_url;" check:"required,lte=500,when=create/update"`
  41. VideoCover string `sqlmapping:"column:video_cover;" sqlresult:"column:video_cover;" check:"required,lte=500,when=create/update"`
  42. VideoDuration int `sqlmapping:"column:video_duration;updateClear;" sqlresult:"column:video_duration;"`
  43. AutoPlay string `sqlmapping:"column:auto_play;" sqlresult:"column:auto_play;" check:"required,when=create/update"`
  44. ShowControls string `sqlmapping:"column:show_controls;" sqlresult:"column:show_controls;" check:"required,when=create/update"`
  45. IsEnabled string `sqlmapping:"column:is_enabled;" sqlresult:"column:is_enabled;" check:"required,lte=10,when=create/update"`
  46. entity.TenantIDField
  47. entity.UserIDFields
  48. entity.OperatorUserNameField
  49. entity.TimeFields
  50. /* HAC: ENTITY RELATION FIELDS */
  51. /* HAC: END ENTITY RELATION FIELDS */
  52. }
  53. func (e *Entity) DomainCNName() string {
  54. return "宣传视频配置表"
  55. }
  56. func (e *Entity) DomainCamelName() string {
  57. return "MiniVideoConfig"
  58. }
  59. func (e *Entity) GetFieldMap() map[string]string {
  60. return fieldMap
  61. }
  62. /* HAC: ENTITY RELATION METHODS */
  63. /* HAC: END ENTITY RELATION METHODS */