struct.go 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. package main
  2. import (
  3. "encoding/xml"
  4. )
  5. type XmlApplication struct {
  6. XMLName xml.Name `xml:"application"`
  7. ApplicationName string `xml:"name,attr"`
  8. PackageName string `xml:"packagename,attr"`
  9. Desc string `xml:"desc,attr"`
  10. Controllers XmlControllers `xml:"controllers"`
  11. Tables XmlTables `xml:"tables"`
  12. Beans XmlBeans `xml:"beans"`
  13. }
  14. type XmlControllers struct {
  15. ControllerList []XmlController `xml:"controller"`
  16. }
  17. type XmlController struct {
  18. Name string `xml:"name,attr"`
  19. Desc string `xml:"desc,attr"`
  20. Dir string `xml:"dir,attr"`
  21. SkipLogin bool `xml:"skip_login,attr"`
  22. Apis []XmlApi `xml:"api"`
  23. ApplicationName string `xml:"-"`
  24. PackageName string `xml:"-"`
  25. }
  26. type XmlApi struct {
  27. Name string `xml:"name,attr"`
  28. Desc string `xml:"desc,attr"`
  29. Method string `xml:"method,attr"`
  30. Function string `xml:"function,attr"` //page,tree
  31. Table string `xml:"table,attr"`
  32. ParamList []XmlApiParam `xml:"param"`
  33. Return XmlReturn `xml:"return"`
  34. }
  35. type XmlApiParam struct {
  36. Name string `xml:"name,attr"`
  37. TransType string `xml:"trans-type,attr"`
  38. Type string `xml:"type,attr"`
  39. Desc string `xml:"desc,attr"`
  40. Ref string `xml:"ref,attr"`
  41. Must bool `xml:"must,attr"`
  42. DefaultValue string `xml:"default-value,attr"`
  43. }
  44. type XmlReturn struct {
  45. Success XmlSuccess `xml:"success"`
  46. Failure XmlFailure `xml:"failure"`
  47. }
  48. type XmlSuccess struct {
  49. Ref string `xml:"ref,attr"`
  50. Desc string `xml:"desc,attr"`
  51. }
  52. type XmlFailure struct {
  53. Ref string `xml:"ref,attr"`
  54. Desc string `xml:"desc,attr"`
  55. }
  56. //
  57. type XmlTables struct {
  58. TableList []XmlTable `xml:"table"`
  59. }
  60. type XmlTable struct {
  61. XMLName xml.Name `xml:"table"`
  62. Name string `xml:"name,attr"`
  63. Desc string `xml:"desc,attr"`
  64. ImportDateTime bool `xml:"-"`
  65. ColumnList []XmlColumn `xml:"column"`
  66. }
  67. type XmlColumn struct {
  68. Name string `xml:"name,attr"`
  69. Caption string `xml:"caption,attr"`
  70. IsNull bool `xml:"isNull,attr"`
  71. IsPK bool `xml:"isPK,attr"`
  72. IsIndex bool `xml:"isIndex,attr"`
  73. AutoIncrement bool `xml:"autoIncrement,attr"`
  74. IsUnique bool `xml:"isUnique,attr"`
  75. Size int `xml:"size,attr"`
  76. Type string `xml:"type,attr"`
  77. DbType string `xml:"dbtype,attr"`
  78. DefaultValue string `xml:"default-value,attr"`
  79. }
  80. type XmlBeans struct {
  81. BeanList []XmlBean `xml:"bean"`
  82. }
  83. type XmlBean struct {
  84. XMLName xml.Name `xml:"bean"`
  85. Name string `xml:"name,attr"`
  86. Desc string `xml:"desc,attr"`
  87. Inher string `xml:"inher,attr"`
  88. ImportDateTime bool `xml:"-"`
  89. PropList []XmlProp `xml:"prop"`
  90. }
  91. type XmlProp struct {
  92. Name string `xml:"name,attr"`
  93. Caption string `xml:"caption,attr"`
  94. Type string `xml:"type,attr"`
  95. DefaultValue string `xml:"default-value,attr"`
  96. }