8
0

entity.go 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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.UserIDFields
  47. entity.OperatorUserNameField
  48. entity.TimeFields
  49. /* HAC: ENTITY RELATION FIELDS */
  50. /* HAC: END ENTITY RELATION FIELDS */
  51. }
  52. func (e *Entity) DomainCNName() string {
  53. return "宣传视频配置表"
  54. }
  55. func (e *Entity) DomainCamelName() string {
  56. return "MiniVideoConfig"
  57. }
  58. func (e *Entity) GetFieldMap() map[string]string {
  59. return fieldMap
  60. }
  61. /* HAC: ENTITY RELATION METHODS */
  62. /* HAC: END ENTITY RELATION METHODS */