Skip to content

Commit 46ef8a6

Browse files
QinYuuuuRader
authored andcommitted
I18n for Tag
1 parent 8cf69e3 commit 46ef8a6

File tree

9 files changed

+22
-22
lines changed

9 files changed

+22
-22
lines changed

api/handler/tag.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type TagsHandler struct {
3939
// @Param scope query string false "scope name" Enums(model, dataset, code, space, prompt)
4040
// @Param built_in query bool false "built_in"
4141
// @Param search query string false "search on name and show_name fields"
42-
// @Success 200 {object} types.ResponseWithTotal{data=[]database.Tag} "tags"
42+
// @Success 200 {object} types.ResponseWithTotal{data=[]types.RepoTag} "tags"
4343
// @Failure 400 {object} types.APIBadRequest "Bad request"
4444
// @Failure 500 {object} types.APIInternalServerError "Internal server error"
4545
// @Router /tags [get]

api/handler/tag_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func TestTagHandler_AllTags(t *testing.T) {
6666

6767
t.Run("with builtin", func(t *testing.T) {
6868
var tags []*types.RepoTag
69-
tags = append(tags, &types.RepoTag{ID: 1, Name: "test1"})
69+
tags = append(tags, &types.RepoTag{Name: "test1"})
7070

7171
values := url.Values{}
7272
values.Add("category", "task")

component/dataset.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ func (c *datasetComponentImpl) Create(ctx context.Context, req *types.CreateData
172172
Category: tag.Category,
173173
Group: tag.Group,
174174
BuiltIn: tag.BuiltIn,
175-
ShowName: tag.I18nKey, // ShowName: tag.ShowName,
175+
ShowName: tag.I18nKey, //ShowName: tag.ShowName,
176176
I18nKey: tag.I18nKey,
177177
CreatedAt: tag.CreatedAt,
178178
UpdatedAt: tag.UpdatedAt,
@@ -267,7 +267,7 @@ func (c *datasetComponentImpl) commonIndex(ctx context.Context, filter *types.Re
267267
Category: tag.Category,
268268
Group: tag.Group,
269269
BuiltIn: tag.BuiltIn,
270-
ShowName: tag.I18nKey, // ShowName: tag.ShowName,
270+
ShowName: tag.I18nKey, //ShowName: tag.ShowName,
271271
I18nKey: tag.I18nKey,
272272
CreatedAt: tag.CreatedAt,
273273
UpdatedAt: tag.UpdatedAt,
@@ -411,7 +411,7 @@ func (c *datasetComponentImpl) Show(ctx context.Context, namespace, name, curren
411411
Category: tag.Category,
412412
Group: tag.Group,
413413
BuiltIn: tag.BuiltIn,
414-
ShowName: tag.I18nKey, // ShowName: tag.ShowName,
414+
ShowName: tag.I18nKey, //ShowName: tag.ShowName,
415415
I18nKey: tag.I18nKey,
416416
CreatedAt: tag.CreatedAt,
417417
UpdatedAt: tag.UpdatedAt,

component/evaluation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func (c *evaluationComponentImpl) GetEvaluation(ctx context.Context, req types.E
203203
Category: tag.Category,
204204
Group: tag.Group,
205205
BuiltIn: tag.BuiltIn,
206-
ShowName: tag.I18nKey, // ShowName: tag.ShowName,
206+
ShowName: tag.I18nKey, //ShowName: tag.ShowName,
207207
I18nKey: tag.I18nKey,
208208
CreatedAt: tag.CreatedAt,
209209
UpdatedAt: tag.UpdatedAt,

component/list.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (c *listComponentImpl) ListModelsByPath(ctx context.Context, req *types.Lis
4444
Category: tag.Category,
4545
Group: tag.Group,
4646
BuiltIn: tag.BuiltIn,
47-
ShowName: tag.I18nKey, // ShowName: tag.ShowName,
47+
ShowName: tag.I18nKey, //ShowName: tag.ShowName,
4848
I18nKey: tag.I18nKey,
4949
CreatedAt: tag.CreatedAt,
5050
UpdatedAt: tag.UpdatedAt,
@@ -81,7 +81,7 @@ func (c *listComponentImpl) ListDatasetsByPath(ctx context.Context, req *types.L
8181
Category: tag.Category,
8282
Group: tag.Group,
8383
BuiltIn: tag.BuiltIn,
84-
ShowName: tag.I18nKey, // ShowName: tag.ShowName,
84+
ShowName: tag.I18nKey, //ShowName: tag.ShowName,
8585
I18nKey: tag.I18nKey,
8686
CreatedAt: tag.CreatedAt,
8787
UpdatedAt: tag.UpdatedAt,

component/mcp_server.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func (m *mcpServerComponentImpl) Create(ctx context.Context, req *types.CreateMC
125125
Category: tag.Category,
126126
Group: tag.Group,
127127
BuiltIn: tag.BuiltIn,
128-
ShowName: tag.I18nKey, // ShowName: tag.ShowName,
128+
ShowName: tag.I18nKey, //ShowName: tag.ShowName,
129129
I18nKey: tag.I18nKey,
130130
CreatedAt: tag.CreatedAt,
131131
UpdatedAt: tag.UpdatedAt,
@@ -357,7 +357,7 @@ func (m *mcpServerComponentImpl) Show(ctx context.Context, namespace string, nam
357357
Category: tag.Category,
358358
Group: tag.Group,
359359
BuiltIn: tag.BuiltIn,
360-
ShowName: tag.I18nKey, // ShowName: tag.ShowName,
360+
ShowName: tag.I18nKey, //ShowName: tag.ShowName,
361361
I18nKey: tag.I18nKey,
362362
CreatedAt: tag.CreatedAt,
363363
UpdatedAt: tag.UpdatedAt,
@@ -471,7 +471,7 @@ func (m *mcpServerComponentImpl) Index(ctx context.Context, filter *types.RepoFi
471471
Category: tag.Category,
472472
Group: tag.Group,
473473
BuiltIn: tag.BuiltIn,
474-
ShowName: tag.I18nKey, // ShowName: tag.ShowName,
474+
ShowName: tag.I18nKey, //ShowName: tag.ShowName,
475475
I18nKey: tag.I18nKey,
476476
CreatedAt: tag.CreatedAt,
477477
UpdatedAt: tag.UpdatedAt,
@@ -550,7 +550,7 @@ func (m *mcpServerComponentImpl) Properties(ctx context.Context, req *types.MCPP
550550
Category: tag.Category,
551551
Group: tag.Group,
552552
BuiltIn: tag.BuiltIn,
553-
ShowName: tag.I18nKey, // ShowName: tag.ShowName,
553+
ShowName: tag.I18nKey, //ShowName: tag.ShowName,
554554
I18nKey: tag.I18nKey,
555555
CreatedAt: tag.CreatedAt,
556556
UpdatedAt: tag.UpdatedAt,

component/multi_sync.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ func (c *multiSyncComponentImpl) createLocalDataset(ctx context.Context, m *type
334334
Category: tag.Category,
335335
Group: tag.Group,
336336
BuiltIn: tag.BuiltIn,
337-
ShowName: tag.ShowName,
337+
I18nKey: tag.ShowName, // ShowName: tag.ShowName,
338338
Scope: types.DatasetTagScope,
339339
}
340340
t, err := c.tagStore.FindOrCreate(ctx, dbTag)
@@ -473,7 +473,7 @@ func (c *multiSyncComponentImpl) createLocalModel(ctx context.Context, m *types.
473473
Category: tag.Category,
474474
Group: tag.Group,
475475
BuiltIn: tag.BuiltIn,
476-
ShowName: tag.ShowName,
476+
I18nKey: tag.ShowName, // ShowName: tag.ShowName,
477477
Scope: types.ModelTagScope,
478478
}
479479
t, err := c.tagStore.FindOrCreate(ctx, dbTag)
@@ -612,7 +612,7 @@ func (c *multiSyncComponentImpl) createLocalCode(ctx context.Context, m *types.C
612612
Category: tag.Category,
613613
Group: tag.Group,
614614
BuiltIn: tag.BuiltIn,
615-
ShowName: tag.ShowName,
615+
I18nKey: tag.ShowName, // ShowName: tag.ShowName,
616616
Scope: types.CodeTagScope,
617617
}
618618
t, err := c.tagStore.FindOrCreate(ctx, dbTag)
@@ -749,7 +749,7 @@ func (c *multiSyncComponentImpl) createLocalPrompt(ctx context.Context, m *types
749749
Category: tag.Category,
750750
Group: tag.Group,
751751
BuiltIn: tag.BuiltIn,
752-
ShowName: tag.ShowName,
752+
I18nKey: tag.ShowName, // ShowName: tag.ShowName,
753753
Scope: types.CodeTagScope,
754754
}
755755
t, err := c.tagStore.FindOrCreate(ctx, dbTag)
@@ -886,7 +886,7 @@ func (c *multiSyncComponentImpl) createLocalMCPServer(ctx context.Context, m *ty
886886
Category: tag.Category,
887887
Group: tag.Group,
888888
BuiltIn: tag.BuiltIn,
889-
ShowName: tag.ShowName,
889+
I18nKey: tag.ShowName, // ShowName: tag.ShowName,
890890
Scope: types.CodeTagScope,
891891
}
892892
t, err := c.tagStore.FindOrCreate(ctx, dbTag)

component/prompt.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ func (c *promptComponentImpl) CreatePromptRepo(ctx context.Context, req *types.C
688688
Category: tag.Category,
689689
Group: tag.Group,
690690
BuiltIn: tag.BuiltIn,
691-
ShowName: tag.I18nKey, // ShowName: tag.ShowName,
691+
ShowName: tag.I18nKey, //ShowName: tag.ShowName,
692692
I18nKey: tag.I18nKey,
693693
CreatedAt: tag.CreatedAt,
694694
UpdatedAt: tag.UpdatedAt,
@@ -758,7 +758,7 @@ func (c *promptComponentImpl) IndexPromptRepo(ctx context.Context, filter *types
758758
Category: tag.Category,
759759
Group: tag.Group,
760760
BuiltIn: tag.BuiltIn,
761-
ShowName: tag.I18nKey, // ShowName: tag.ShowName,
761+
ShowName: tag.I18nKey, //ShowName: tag.ShowName,
762762
I18nKey: tag.I18nKey,
763763
CreatedAt: tag.CreatedAt,
764764
UpdatedAt: tag.UpdatedAt,
@@ -879,7 +879,7 @@ func (c *promptComponentImpl) Show(ctx context.Context, namespace, name, current
879879
Category: tag.Category,
880880
Group: tag.Group,
881881
BuiltIn: tag.BuiltIn,
882-
ShowName: tag.I18nKey, // ShowName: tag.ShowName,
882+
ShowName: tag.I18nKey, //ShowName: tag.ShowName,
883883
I18nKey: tag.I18nKey,
884884
CreatedAt: tag.CreatedAt,
885885
UpdatedAt: tag.UpdatedAt,

component/space.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ func (c *spaceComponentImpl) Index(ctx context.Context, repoFilter *types.RepoFi
611611
Category: tag.Category,
612612
Group: tag.Group,
613613
BuiltIn: tag.BuiltIn,
614-
ShowName: tag.I18nKey, // ShowName: tag.ShowName,
614+
ShowName: tag.I18nKey, //ShowName: tag.ShowName,
615615
I18nKey: tag.I18nKey,
616616
CreatedAt: tag.CreatedAt,
617617
UpdatedAt: tag.UpdatedAt,
@@ -768,7 +768,7 @@ func (c *spaceComponentImpl) ListByPath(ctx context.Context, paths []string) ([]
768768
Category: tag.Category,
769769
Group: tag.Group,
770770
BuiltIn: tag.BuiltIn,
771-
ShowName: tag.I18nKey, // ShowName: tag.ShowName,
771+
ShowName: tag.I18nKey, //ShowName: tag.ShowName,
772772
I18nKey: tag.I18nKey,
773773
CreatedAt: tag.CreatedAt,
774774
UpdatedAt: tag.UpdatedAt,

0 commit comments

Comments
 (0)