No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

types.go 3.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. package configure
  2. import (
  3. "time"
  4. "git.x2erp.com/qdy/go-base/model/request/queryreq"
  5. )
  6. // DicTableRequest 数据库表字典请求(主表+子表合并)
  7. type DicTableRequest struct {
  8. // 主表字段
  9. TableID string `json:"tableID" binding:"required"` // 表ID(主键)
  10. TableType string `json:"tableType" binding:"required"` // 表类型: 实体表,视图,物化视图
  11. Name string `json:"name" binding:"required"` // 表名称
  12. Description string `json:"description"` // 表描述
  13. // 子表字段(字段列表)
  14. Fields []DicTableFieldRequest `json:"fields"` // 表字段列表
  15. // 系统字段(创建时自动填充)
  16. Creator string `json:"creator,omitempty"` // 创建人
  17. CreatedAt time.Time `json:"createdAt,omitempty"` // 创建时间
  18. UpdatedAt time.Time `json:"updatedAt,omitempty"` // 更新时间
  19. }
  20. // DicTableFieldRequest 数据库表字段字典请求(子表)
  21. type DicTableFieldRequest struct {
  22. // 注意:子表主键规则为 table_id + "." + field_name
  23. FieldID string `json:"fieldID" binding:"required"` // 字段ID(主键,由系统生成)
  24. TableID string `json:"tableID" binding:"required"` // 表ID(关联主表)
  25. FiledType string `json:"filedType" binding:"required"` // 字段类型: 实际字段,计算字段
  26. DataType string `json:"dataType" binding:"required"` // 数据类型: 字符型,数值型等
  27. FieldName string `json:"fieldName" binding:"required"` // 字段名称
  28. FieldNameCN string `json:"fieldNameCN"` // 字段中文名称(ERP中业务名称)
  29. Description string `json:"description"` // 字段描述
  30. // 系统字段(创建时自动填充)
  31. Creator string `json:"creator,omitempty"` // 创建人
  32. CreatedAt time.Time `json:"createdAt,omitempty"` // 创建时间
  33. UpdatedAt time.Time `json:"updatedAt,omitempty"` // 更新时间
  34. }
  35. // DicTableDetail 数据库表字典详情(主表+子表)
  36. type DicTableDetail struct {
  37. // 主表信息
  38. Table DicTableDB `json:"table"`
  39. // 子表信息
  40. Fields []DicTableFieldDB `json:"fields"`
  41. }
  42. // DicTableList 数据库表字典列表
  43. type DicTableList struct {
  44. TotalCount int `json:"totalCount"`
  45. LastPage int `json:"lastPage"`
  46. Data []DicTableDB `json:"data"`
  47. }
  48. // DicTableQueryRequest 数据库表字典查询请求
  49. type DicTableQueryRequest struct {
  50. QueryRequest queryreq.QueryRequest `json:"queryRequest"`
  51. TableID string `json:"tableID,omitempty"`
  52. }
  53. // DicTableDB 数据库表字典数据库模型
  54. type DicTableDB struct {
  55. ID string `db:"id" json:"id"`
  56. TableID string `db:"table_id" json:"tableID"`
  57. TableType string `db:"table_type" json:"tableType"`
  58. Name string `db:"table_name" json:"name"`
  59. Description string `db:"description" json:"description"`
  60. Creator string `db:"creator" json:"creator"`
  61. CreatedAt time.Time `db:"created_at" json:"createdAt"`
  62. UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
  63. DeletedAt *time.Time `db:"deleted_at" json:"deletedAt"`
  64. }
  65. // DicTableFieldDB 数据库表字段字典数据库模型
  66. type DicTableFieldDB struct {
  67. ID string `db:"id" json:"id"`
  68. FieldID string `db:"field_id" json:"fieldID"`
  69. TableID string `db:"table_id" json:"tableID"`
  70. FiledType string `db:"filed_type" json:"filedType"`
  71. DataType string `db:"data_type" json:"dataType"`
  72. FieldName string `db:"field_name" json:"fieldName"`
  73. FieldNameCN string `db:"field_name_cn" json:"fieldNameCN"`
  74. Description string `db:"description" json:"description"`
  75. Creator string `db:"creator" json:"creator"`
  76. CreatedAt time.Time `db:"created_at" json:"createdAt"`
  77. UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
  78. DeletedAt *time.Time `db:"deleted_at" json:"deletedAt"`
  79. }