Skip to content

Commit 3cab3c1

Browse files
authored
Merge pull request #326 from APIParkLab/feature/liujian-1.8
Fix a series of bug
2 parents a7523c7 + 88bf7d0 commit 3cab3c1

File tree

8 files changed

+34210
-32014
lines changed

8 files changed

+34210
-32014
lines changed

ai-provider/local/models.json

Lines changed: 34199 additions & 32009 deletions
Large diffs are not rendered by default.

module/router/dto/input.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type Create struct {
3030
MatchRules []Match `json:"match"`
3131
Upstream string `json:"upstream"`
3232
Proxy *InputProxy `json:"proxy"`
33-
Disable bool `json:"disabled"`
33+
Disable bool `json:"disable"`
3434
}
3535

3636
type InputProxy struct {
@@ -70,7 +70,7 @@ type Edit struct {
7070
Methods *[]string `json:"methods"`
7171
Protocols *[]string `json:"protocols"`
7272
MatchRules *[]Match `json:"match"`
73-
Disable *bool `json:"disabled"`
73+
Disable *bool `json:"disable"`
7474
Upstream *string `json:"upstream"`
7575
}
7676

module/router/dto/output.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type Detail struct {
3535
SimpleDetail
3636
Proxy *Proxy `json:"proxy"`
3737
Protocols []string `json:"protocols"`
38-
Disable bool `json:"disabled"`
38+
Disable bool `json:"disable"`
3939
//Doc map[string]interface{} `json:"doc"`
4040
}
4141

module/service/dto/input.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ type EditService struct {
3131
Name *string `json:"name"`
3232
Description *string `json:"description"`
3333
ServiceType *string `json:"service_type"`
34+
Prefix *string `json:"prefix"`
3435
Catalogue *string `json:"catalogue"`
3536
Logo *string `json:"logo"`
3637
Tags *[]string `json:"tags"`

module/service/iml.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ func (i *imlServiceModule) Create(ctx context.Context, teamID string, input *ser
768768
mo.AsServer = *input.AsServer
769769
}
770770

771-
input.Prefix = strings.Trim(strings.Trim(input.Prefix, " "), "/")
771+
//input.Prefix = strings.Trim(strings.Trim(input.Prefix, " "), "/")
772772
err := i.transaction.Transaction(ctx, func(ctx context.Context) error {
773773
if input.Tags != nil {
774774
tags, err := i.getTagUuids(ctx, input.Tags)
@@ -873,6 +873,7 @@ func (i *imlServiceModule) Edit(ctx context.Context, id string, input *service_d
873873
ServiceType: serviceType,
874874
Catalogue: input.Catalogue,
875875
AdditionalConfig: &info.AdditionalConfig,
876+
Prefix: input.Prefix,
876877
ApprovalType: &approvalType,
877878
EnableMCP: input.EnableMCP,
878879
}

service/service-overview/iml.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func (i imlOverviewService) Update(ctx context.Context, serviceId string, update
4646
Service: serviceId,
4747
}
4848
genUpdateFields(info, update)
49-
return i.store.Insert(ctx)
49+
return i.store.Insert(ctx, info)
5050
}
5151
genUpdateFields(info, update)
5252
_, err = i.store.Update(ctx, info)

service/service/iml.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,5 +229,8 @@ func updateHandler(e *service.Service, i *Edit) {
229229
if i.EnableMCP != nil {
230230
e.EnableMCP = *i.EnableMCP
231231
}
232+
//if i.Prefix != nil {
233+
// e.Prefix = *i.Prefix
234+
//}
232235
e.UpdateAt = time.Now()
233236
}

service/service/model.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ type Edit struct {
182182
AdditionalConfig *map[string]string
183183
State *int
184184
ApprovalType *ApprovalType
185+
Prefix *string
185186
EnableMCP *bool
186187
}
187188

0 commit comments

Comments
 (0)