Geen omschrijving
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.

doc.go 3.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. // Package configure 提供配置中心客户端的SDK,支持数据库字典和别名字典的增删改查操作。
  2. //
  3. // 主要功能:
  4. // - 数据库表字典的创建、查询、更新、删除
  5. // - 数据库表别名和字段别名字典管理
  6. // - 别名审批工作流管理
  7. // - 支持Basic认证和Token认证
  8. // - 自动从全局配置加载配置中心地址和token
  9. // - 完整的错误处理和类型安全
  10. //
  11. // 快速开始:
  12. //
  13. // // 使用默认配置(从全局config获取)
  14. // client, err := configure.NewClient()
  15. // if err != nil {
  16. // log.Fatal(err)
  17. // }
  18. //
  19. // // 查询数据库表字典列表
  20. // query := &configure.DicTableQueryRequest{
  21. // QueryRequest: queryreq.QueryRequest{
  22. // Page: 0,
  23. // PageSize: 10,
  24. // },
  25. // }
  26. //
  27. // result, err := client.ListTables(context.Background(), query)
  28. // if err != nil {
  29. // log.Fatal(err)
  30. // }
  31. //
  32. // // 创建数据库表字典
  33. // req := &configure.DicTableRequest{
  34. // TableID: "test_table_001",
  35. // TableType: "实体表",
  36. // Name: "测试表",
  37. // Description: "测试表描述",
  38. // Fields: []configure.DicTableFieldRequest{
  39. // {
  40. // FieldID: "test_table_001.id",
  41. // TableID: "test_table_001",
  42. // FiledType: "实际字段",
  43. // DataType: "数值型",
  44. // FieldName: "id",
  45. // FieldNameCN: "主键ID",
  46. // Description: "主键字段",
  47. // },
  48. // },
  49. // }
  50. //
  51. // detail, err := client.SaveTable(context.Background(), req)
  52. // if err != nil {
  53. // log.Fatal(err)
  54. // }
  55. //
  56. // 配置说明:
  57. //
  58. // 客户端支持两种认证方式:
  59. // - Basic认证:使用用户名和密码
  60. // - Token认证:使用Bearer token
  61. //
  62. // 配置可以从以下方式获取:
  63. // - 全局配置:通过config.GetConfigureConfig()获取配置中心地址和token
  64. // - 自定义配置:通过NewClientWithConfig()传入自定义配置
  65. //
  66. // API端点:
  67. // - POST /api/dic-table/list - 查询数据库表字典列表
  68. // - POST /api/dic-table/detail/{table_id} - 查询数据库表字典详情
  69. // - POST /api/dic-table/save - 创建或更新数据库表字典
  70. // - POST /api/dic-table/delete/{table_id} - 删除数据库表字典
  71. //
  72. // 别名管理API端点:
  73. // - POST /api/dic-table-alias/list - 查询表别名字典列表
  74. // - POST /api/dic-table-alias/detail/{id} - 查询表别名字典详情
  75. // - POST /api/dic-table-alias/save - 保存表别名字典
  76. // - POST /api/dic-table-alias/batch-save - 批量保存表别名字典
  77. // - POST /api/dic-table-alias/delete/{id} - 删除表别名字典
  78. // - POST /api/dic-table-field-alias/list - 查询字段别名字典列表
  79. // - POST /api/dic-table-field-alias/detail/{id} - 查询字段别名字典详情
  80. // - POST /api/dic-table-field-alias/save - 保存字段别名字典
  81. // - POST /api/dic-table-field-alias/batch-save - 批量保存字段别名字典
  82. // - POST /api/dic-table-field-alias/delete/{id} - 删除字段别名字典
  83. // - POST /api/dic-table-alias-flow/list - 查询表别名字典流水列表
  84. // - POST /api/dic-table-alias-flow/batch-save - 批量保存表别名字典流水
  85. // - POST /api/dic-table-alias-flow/batch-approval - 批量审批表别名字典流水
  86. // - POST /api/dic-table-field-alias-flow/list - 查询字段别名字典流水列表
  87. // - POST /api/dic-table-field-alias-flow/batch-save - 批量保存字段别名字典流水
  88. // - POST /api/dic-table-field-alias-flow/batch-approval - 批量审批字段别名字典流水
  89. package configure