value_object.go 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package operate_log
  2. import (
  3. "git.sxidc.com/go-framework/baize/framework/core/domain"
  4. "git.sxidc.com/go-framework/baize/framework/core/domain/value_object"
  5. "time"
  6. )
  7. const (
  8. FieldResource = "Resource"
  9. FieldResourceID = "ResourceID"
  10. FieldOperate = "Operate"
  11. FieldOperatorID = "OperatorID"
  12. FieldOperatorName = "OperatorName"
  13. FieldOperateTime = "OperateTime"
  14. FieldContent = "Content"
  15. )
  16. var fieldMap = map[string]string{
  17. FieldResource: "资源名称",
  18. FieldResourceID: "资源ID",
  19. FieldOperate: "操作",
  20. FieldOperatorID: "操作者ID",
  21. FieldOperatorName: "操作者",
  22. FieldOperateTime: "操作时间",
  23. FieldContent: "日志内容",
  24. }
  25. var (
  26. ColumnResource = domain.ColumnName(FieldResource)
  27. ColumnResourceID = domain.ColumnName(FieldResourceID)
  28. ColumnOperate = domain.ColumnName(FieldOperate)
  29. ColumnOperatorID = domain.ColumnName(FieldOperatorID)
  30. ColumnOperatorName = domain.ColumnName(FieldOperatorName)
  31. ColumnOperateTime = domain.ColumnName(FieldOperateTime)
  32. ColumnContent = domain.ColumnName(FieldContent)
  33. )
  34. type ValueObject struct {
  35. value_object.Base
  36. Resource string `sqlmapping:"column:resource" sqlresult:"column:resource"`
  37. ResourceID string `sqlmapping:"column:resource_id" sqlresult:"column:resource_id"`
  38. Operate string `sqlmapping:"column:operate" sqlresult:"column:operate"`
  39. OperatorID string `sqlmapping:"column:operator_id" sqlresult:"column:operator_id"`
  40. OperatorName string `sqlmapping:"column:operator_name" sqlresult:"column:operator_name"`
  41. OperateTime time.Time `sqlmapping:"column:operate_time" sqlresult:"column:operate_time"`
  42. Content string `sqlmapping:"column:content" sqlresult:"column:content"`
  43. }
  44. func (v *ValueObject) DomainCNName() string {
  45. return "操作日志"
  46. }
  47. func (v *ValueObject) DomainCamelName() string {
  48. return "OperateLog"
  49. }
  50. func (v *ValueObject) GetFieldMap() map[string]string {
  51. return fieldMap
  52. }