qdy преди 1 месец
родител
ревизия
fbec456300
променени са 9 файла, в които са добавени 32674 реда и са изтрити 11 реда
  1. 16
    1
      config/config.go
  2. 69
    0
      config/subconfigs/mcp_config.go
  3. 4
    1
      go.mod
  4. 15
    2
      go.sum
  5. 11
    7
      graceful/shutdown.go
  6. 35
    0
      model/request/requset_model.go
  7. 11040
    0
      sdk/opencode/opencode-api.json
  8. 13977
    0
      sdk/opencode/opencode_api_client.gen.go
  9. 7507
    0
      sdk/opencode/opencode_api_types.gen.go

+ 16
- 1
config/config.go Целия файл

@@ -24,7 +24,8 @@ type IConfig interface {
24 24
 	GetDbsConfig(name string) (*subconfigs.DatabaseConfig, bool) // 获取指定数据库连接
25 25
 
26 26
 	//服务支持
27
-	GetServiceConfig() *subconfigs.ServiceConfig //获取默认微服务配置
27
+	GetServiceConfig() *subconfigs.ServiceConfig       //获取默认微服务配置
28
+	GetMcpServiceConfig() *subconfigs.McpServiceConfig //获取默认微服务配置
28 29
 
29 30
 	// 其他配置(保持不变)
30 31
 	GetRedisConfig() *subconfigs.RedisConfig
@@ -137,6 +138,13 @@ func (c *Config) GetServiceConfig() *subconfigs.ServiceConfig {
137 138
 	return nil
138 139
 }
139 140
 
141
+func (c *Config) GetMcpServiceConfig() *subconfigs.McpServiceConfig {
142
+	if config := subconfigs.GetRegisteredConfig("mcpservice"); config != nil {
143
+		return config.(*subconfigs.McpServiceConfig)
144
+	}
145
+	return nil
146
+}
147
+
140 148
 func (c *Config) GetHTTPConfig() *subconfigs.HTTPConfig {
141 149
 	if config := subconfigs.GetRegisteredConfig("http"); config != nil {
142 150
 		return config.(*subconfigs.HTTPConfig)
@@ -282,6 +290,13 @@ func GetServiceConfig() *subconfigs.ServiceConfig {
282 290
 	return cfgInstance.GetServiceConfig()
283 291
 }
284 292
 
293
+func GetMcpServiceConfig() *subconfigs.McpServiceConfig {
294
+	if cfgInstance == nil {
295
+		return &subconfigs.McpServiceConfig{}
296
+	}
297
+	return cfgInstance.GetMcpServiceConfig()
298
+}
299
+
285 300
 var (
286 301
 	cfgInstance *Config
287 302
 	once        sync.Once

+ 69
- 0
config/subconfigs/mcp_config.go Целия файл

@@ -0,0 +1,69 @@
1
+// subconfigs/service_config.go
2
+package subconfigs
3
+
4
+import (
5
+	"fmt"
6
+	"log"
7
+)
8
+
9
+// ServiceConfig 数据库配置
10
+type McpServiceConfig struct {
11
+	BaseConfig
12
+	Port         int    `yaml:"port"`
13
+	ServiceName  string `yaml:"service_name"`
14
+	InstanceName string `yaml:"instance_name"`
15
+	ReadTimeout  int    `yaml:"read_timeout"`
16
+	WriteTimeout int    `yaml:"write_timeout"`
17
+	IdleTimeout  int    `yaml:"idle_timeout"`
18
+}
19
+
20
+// SetDefaults 设置默认值 - 实现 ConfigLoader 接口
21
+func (c *McpServiceConfig) SetDefaults() {
22
+
23
+	if c.Port == 0 {
24
+		c.Port = 8080
25
+	}
26
+	if c.IdleTimeout == 0 {
27
+		c.IdleTimeout = 60
28
+	}
29
+	if c.ReadTimeout == 0 {
30
+		c.ReadTimeout = 30
31
+	}
32
+	if c.WriteTimeout == 0 {
33
+		c.WriteTimeout = 30
34
+	}
35
+}
36
+
37
+// Load 从yaml数据加载 - 实现 ConfigLoader 接口
38
+func (c *McpServiceConfig) Load(data map[string]interface{}) error {
39
+	// 虽然可能不会被直接调用,但为了接口完整性还是要实现
40
+	return c.LoadFromYAML(data, c)
41
+}
42
+
43
+// ========== 业务方法 ==========
44
+
45
+// Validate 验证配置(数据库配置)
46
+func (c *McpServiceConfig) Validate() error {
47
+
48
+	if c.Port <= 0 || c.Port > 65535 {
49
+		return fmt.Errorf("invalid service port: %d", c.Port)
50
+	}
51
+
52
+	return nil
53
+}
54
+
55
+// IsConfigured 判断是否已配置(数据库配置)
56
+func (c *McpServiceConfig) IsConfigured() bool {
57
+
58
+	if c.Port <= 0 {
59
+		log.Println("⚠️  警告: 微服务 Port 未配置或无效")
60
+		return false
61
+	}
62
+
63
+	return true
64
+}
65
+
66
+// 自动注册
67
+func init() {
68
+	Register("mcpservice", &McpServiceConfig{})
69
+}

+ 4
- 1
go.mod Целия файл

@@ -4,11 +4,13 @@ go 1.25.4
4 4
 
5 5
 require (
6 6
 	github.com/hashicorp/consul/api v1.9.0
7
+	github.com/oapi-codegen/runtime v1.1.2
7 8
 	go.mongodb.org/mongo-driver v1.17.6
8 9
 	gopkg.in/yaml.v2 v2.4.0
9 10
 )
10 11
 
11 12
 require (
13
+	github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
12 14
 	github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da // indirect
13 15
 	github.com/elastic/elastic-transport-go/v8 v8.7.0 // indirect
14 16
 	github.com/fatih/color v1.9.0 // indirect
@@ -16,6 +18,7 @@ require (
16 18
 	github.com/go-logr/stdr v1.2.2 // indirect
17 19
 	github.com/google/btree v1.0.0 // indirect
18 20
 	github.com/google/go-cmp v0.7.0 // indirect
21
+	github.com/google/uuid v1.5.0 // indirect
19 22
 	github.com/hashicorp/errwrap v1.1.0 // indirect
20 23
 	github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
21 24
 	github.com/hashicorp/go-hclog v0.12.0 // indirect
@@ -26,7 +29,7 @@ require (
26 29
 	github.com/hashicorp/golang-lru v0.5.3 // indirect
27 30
 	github.com/hashicorp/serf v0.9.5 // indirect
28 31
 	github.com/kr/pretty v0.3.1 // indirect
29
-	github.com/mattn/go-colorable v0.1.8 // indirect
32
+	github.com/mattn/go-colorable v0.1.13 // indirect
30 33
 	github.com/mattn/go-isatty v0.0.20 // indirect
31 34
 	github.com/mitchellh/mapstructure v1.3.3 // indirect
32 35
 	github.com/rogpeppe/go-internal v1.14.1 // indirect

+ 15
- 2
go.sum Целия файл

@@ -1,9 +1,13 @@
1
+github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk=
2
+github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ=
3
+github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk=
1 4
 github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
2 5
 github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I=
3 6
 github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
4 7
 github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
5 8
 github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
6 9
 github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
10
+github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
7 11
 github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
8 12
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
9 13
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -25,6 +29,8 @@ github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
25 29
 github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
26 30
 github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
27 31
 github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
32
+github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
33
+github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
28 34
 github.com/hashicorp/consul/api v1.9.0 h1:T6dKIWcaihG2c21YUi0BMAHbJanVXiYuz+mPgqxY3N4=
29 35
 github.com/hashicorp/consul/api v1.9.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M=
30 36
 github.com/hashicorp/consul/sdk v0.8.0 h1:OJtKBtEjboEZvG6AOUdh4Z1Zbyu0WcxQ0qatRrZHTVU=
@@ -64,6 +70,7 @@ github.com/hashicorp/serf v0.9.5 h1:EBWvyu9tcRszt3Bxp3KNssBMP1KuHWyO51lz9+786iM=
64 70
 github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk=
65 71
 github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=
66 72
 github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
73
+github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE=
67 74
 github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
68 75
 github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
69 76
 github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
@@ -75,13 +82,14 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
75 82
 github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
76 83
 github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
77 84
 github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
78
-github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
79
-github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
85
+github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
86
+github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
80 87
 github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
81 88
 github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
82 89
 github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
83 90
 github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
84 91
 github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
92
+github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
85 93
 github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
86 94
 github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
87 95
 github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
@@ -97,6 +105,8 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F
97 105
 github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
98 106
 github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8=
99 107
 github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
108
+github.com/oapi-codegen/runtime v1.1.2 h1:P2+CubHq8fO4Q6fV1tqDBZHCwpVpvPg7oKiYzQgXIyI=
109
+github.com/oapi-codegen/runtime v1.1.2/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg=
100 110
 github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs=
101 111
 github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
102 112
 github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
@@ -113,10 +123,12 @@ github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7
113 123
 github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
114 124
 github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=
115 125
 github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
126
+github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0=
116 127
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
117 128
 github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
118 129
 github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
119 130
 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
131
+github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
120 132
 github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
121 133
 github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
122 134
 github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
@@ -162,6 +174,7 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w
162 174
 golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
163 175
 golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
164 176
 golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
177
+golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
165 178
 golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
166 179
 golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
167 180
 golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=

+ 11
- 7
graceful/shutdown.go Целия файл

@@ -15,7 +15,7 @@ import (
15 15
 )
16 16
 
17 17
 // WaitForShutdown 带可选清理函数的优雅关闭
18
-func WaitForShutdown(serviceName string, server *http.Server, containerFactory *container.ContainerFactory) {
18
+func WaitForShutdown(serviceName string, containerFactory *container.ContainerFactory, servers ...*http.Server) {
19 19
 
20 20
 	quit := make(chan os.Signal, 1)
21 21
 	signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
@@ -33,13 +33,17 @@ func WaitForShutdown(serviceName string, server *http.Server, containerFactory *
33 33
 	ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
34 34
 	defer cancel()
35 35
 
36
-	// 停止接收新请求,完成当前请求
37
-	if err := server.Shutdown(ctx); err != nil {
38
-		log.Printf("服务 %s 关闭失败: %v", serviceName, err)
39
-	} else {
40
-		log.Printf("服务 %s 已关闭", serviceName)
36
+	for _, srv := range servers {
37
+		p := srv.Addr
38
+		if err := srv.Shutdown(ctx); err != nil {
39
+			log.Printf("服务 %s 关闭失败: %v", p, err)
40
+		} else {
41
+			log.Printf("服务 %s 已关闭", p)
42
+		}
41 43
 	}
42 44
 
45
+	// 停止接收新请求,完成当前请求
46
+
43 47
 	// 执行关闭处理
44 48
 	if containerFactory != nil {
45 49
 		containerFactory.CloseAll()
@@ -47,7 +51,7 @@ func WaitForShutdown(serviceName string, server *http.Server, containerFactory *
47 51
 
48 52
 	// 停止日志写入
49 53
 	logger.StopESWriter()
50
-	log.Printf("服务 %s 优雅关闭完成", serviceName)
54
+	log.Printf("%s 服务全部优雅关闭完成", serviceName)
51 55
 
52 56
 	// 等待一小段时间确保日志写入完成
53 57
 	time.Sleep(100 * time.Millisecond)

+ 35
- 0
model/request/requset_model.go Целия файл

@@ -101,3 +101,38 @@ type QueryRequest struct {
101 101
 	DorisTable       string                 `json:"dorisTable,omitempty"`       //doris数据库里的表名称
102 102
 
103 103
 }
104
+
105
+// TableRequest 表字典
106
+type TableRequest struct {
107
+	TableName           string `json:"table_name"`
108
+	TableNameCN         string `json:"table_name_cn"`
109
+	Description         string `json:"description"`
110
+	PrimaryKeyFieldName string `json:"primary_key_field_name"`
111
+}
112
+
113
+// TablesRequest 表字典集合
114
+type TablesRequest struct {
115
+	TableNames []*TableRequest `json:"table_names"`
116
+	FieldInfos []*FieldInfo    `json:"field_names"`
117
+}
118
+
119
+// FieldInfo 字段信息
120
+type FieldInfo struct {
121
+	TableName string `json:"table_name"`
122
+	// 字段名称(英文/数据库字段名)
123
+	FieldName string `json:"field_name"`
124
+	// 字段中文名称
125
+	FieldNameCN string `json:"field_name_cn"`
126
+	// 字段描述
127
+	Description string `json:"description"`
128
+	// 字段类型(如:varchar, int, datetime等)
129
+	FieldType string `json:"field_type"`
130
+	// 字段长度/精度
131
+	FieldLength *int `json:"field_length,omitempty"`
132
+	// 是否为主键
133
+	IsPrimaryKey bool `json:"is_primary_key"`
134
+	// 是否允许为空
135
+	IsNullable bool `json:"is_nullable"`
136
+	// 小数位数(对于decimal类型)
137
+	DecimalPlaces *int `json:"decimal_places,omitempty"`
138
+}

+ 11040
- 0
sdk/opencode/opencode-api.json
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 13977
- 0
sdk/opencode/opencode_api_client.gen.go
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 7507
- 0
sdk/opencode/opencode_api_types.gen.go
Файловите разлики са ограничени, защото са твърде много
Целия файл


Loading…
Отказ
Запис