@@ -24,47 +24,47 @@ type CodeSnippetRepo interface {
2424
2525// 请求结构体
2626type CreateCodeSnippetReq struct {
27- WorkspaceFileID string `json:"workspace_file_id" validate:"required"` // 关联的workspace file ID
28- Name string `json:"name"` // 代码片段名称
29- SnippetType string `json:"snippet_type"` // 代码片段类型 (function, class, variable, etc.)
30- Language string `json:"language"` // 编程语言
31- Content string `json:"content"` // 代码片段内容
32- Hash string `json:"hash"` // 内容哈希
33- StartLine int `json:"start_line"` // 起始行号
34- EndLine int `json:"end_line"` // 结束行号
35- StartColumn int `json:"start_column"` // 起始列号
36- EndColumn int `json:"end_column"` // 结束列号
37- Namespace string `json:"namespace"` // 命名空间
38- ContainerName string `json:"container_name"` // 容器名称 (类名、模块名等)
39- Scope []string `json:"scope"` // 作用域信息
40- Dependencies []string `json:"dependencies"` // 依赖项
41- Parameters []map [string ]interface {} `json:"parameters"` // 参数列表
42- Signature string `json:"signature"` // 函数签名
43- DefinitionText string `json:"definition_text"` // 定义文本
44- StructuredInfo map [string ]interface {} `json:"structured_info"` // 结构化信息
27+ WorkspaceFileID string `json:"workspace_file_id" validate:"required"` // 关联的workspace file ID
28+ Name string `json:"name"` // 代码片段名称
29+ SnippetType string `json:"snippet_type"` // 代码片段类型 (function, class, variable, etc.)
30+ Language string `json:"language"` // 编程语言
31+ Content string `json:"content"` // 代码片段内容
32+ Hash string `json:"hash"` // 内容哈希
33+ StartLine int `json:"start_line"` // 起始行号
34+ EndLine int `json:"end_line"` // 结束行号
35+ StartColumn int `json:"start_column"` // 起始列号
36+ EndColumn int `json:"end_column"` // 结束列号
37+ Namespace string `json:"namespace"` // 命名空间
38+ ContainerName string `json:"container_name"` // 容器名称 (类名、模块名等)
39+ Scope []string `json:"scope"` // 作用域信息
40+ Dependencies []string `json:"dependencies"` // 依赖项
41+ Parameters []map [string ]any `json:"parameters"` // 参数列表
42+ Signature string `json:"signature"` // 函数签名
43+ DefinitionText string `json:"definition_text"` // 定义文本
44+ StructuredInfo map [string ]any `json:"structured_info"` // 结构化信息
4545}
4646
4747// 数据模型
4848type CodeSnippet struct {
49- ID string `json:"id"` // 代码片段ID
50- WorkspaceFileID string `json:"workspace_file_id"` // 关联的workspace file ID
51- Name string `json:"name"` // 代码片段名称
52- SnippetType string `json:"snippet_type"` // 代码片段类型
53- Language string `json:"language"` // 编程语言
54- Content string `json:"content"` // 代码片段内容
55- Hash string `json:"hash"` // 内容哈希
56- StartLine int `json:"start_line"` // 起始行号
57- EndLine int `json:"end_line"` // 结束行号
58- StartColumn int `json:"start_column"` // 起始列号
59- EndColumn int `json:"end_column"` // 结束列号
60- Namespace string `json:"namespace"` // 命名空间
61- ContainerName string `json:"container_name"` // 容器名称
62- Scope []string `json:"scope"` // 作用域信息
63- Dependencies []string `json:"dependencies"` // 依赖项
64- Parameters []map [string ]interface {} `json:"parameters"` // 参数列表
65- Signature string `json:"signature"` // 函数签名
66- DefinitionText string `json:"definition_text"` // 定义文本
67- StructuredInfo map [string ]interface {} `json:"structured_info"` // 结构化信息
49+ ID string `json:"id"` // 代码片段ID
50+ WorkspaceFileID string `json:"workspace_file_id"` // 关联的workspace file ID
51+ Name string `json:"name"` // 代码片段名称
52+ SnippetType string `json:"snippet_type"` // 代码片段类型
53+ Language string `json:"language"` // 编程语言
54+ Content string `json:"content"` // 代码片段内容
55+ Hash string `json:"hash"` // 内容哈希
56+ StartLine int `json:"start_line"` // 起始行号
57+ EndLine int `json:"end_line"` // 结束行号
58+ StartColumn int `json:"start_column"` // 起始列号
59+ EndColumn int `json:"end_column"` // 结束列号
60+ Namespace string `json:"namespace"` // 命名空间
61+ ContainerName string `json:"container_name"` // 容器名称
62+ Scope []string `json:"scope"` // 作用域信息
63+ Dependencies []string `json:"dependencies"` // 依赖项
64+ Parameters []map [string ]any `json:"parameters"` // 参数列表
65+ Signature string `json:"signature"` // 函数签名
66+ DefinitionText string `json:"definition_text"` // 定义文本
67+ StructuredInfo map [string ]any `json:"structured_info"` // 结构化信息
6868}
6969
7070func (c * CodeSnippet ) From (e * db.CodeSnippet ) * CodeSnippet {
0 commit comments