Skip to content

Commit

Permalink
fix:xds server resource build cache fail
Browse files Browse the repository at this point in the history
  • Loading branch information
chuntaojun committed Mar 4, 2024
1 parent eb9c3da commit f955f09
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
1 change: 1 addition & 0 deletions common/model/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func (e *EnrichServiceContract) ToSpec() *apiservice.ServiceContract {
interfaces = append(interfaces, &apiservice.InterfaceDescriptor{
Id: item.ID,
Path: item.Path,
Name: item.Name,
Method: item.Method,
Source: item.Source,
Content: item.Content,
Expand Down
14 changes: 0 additions & 14 deletions service/client_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -673,26 +673,12 @@ func (s *Server) serviceContractCheckDiscoverRequest(req *apiservice.ServiceCont
resp.ServiceContract = req
return false
}
if req.GetService() == "" {
resp.Code = utils.NewUInt32Value(uint32(apimodel.Code_InvalidServiceName))
resp.Info = utils.NewStringValue(api.Code2Info(resp.GetCode().GetValue()))
resp.Service = svc
resp.ServiceContract = req
return false
}
if req.GetProtocol() == "" {
resp.Code = utils.NewUInt32Value(uint32(apimodel.Code_InvalidParameter))
resp.Info = utils.NewStringValue(api.Code2Info(resp.GetCode().GetValue()))
resp.Service = svc
resp.ServiceContract = req
return false
}
if req.GetVersion() == "" {
resp.Code = utils.NewUInt32Value(uint32(apimodel.Code_InvalidParameter))
resp.Info = utils.NewStringValue(api.Code2Info(resp.GetCode().GetValue()))
resp.Service = svc
resp.ServiceContract = req
return false
}
return true
}
4 changes: 2 additions & 2 deletions store/mysql/service_contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (s *serviceContractStore) AddServiceContractInterfaces(contract *model.Enri
addSql := "REPLACE INTO service_contract_detail(`id`, `contract_id`, `name`, `method`, `path` " +
" ,`content`,`revision`" +

Check warning on line 151 in store/mysql/service_contract.go

View check run for this annotation

Codecov / codecov/patch

store/mysql/service_contract.go#L150-L151

Added lines #L150 - L151 were not covered by tests
",`flag`,`ctime`, `mtime`, `source`" +
") VALUES (?,?,?,?,?,?,?,sysdate(),sysdate(),?)"
") VALUES (?,?,?,?,?,?,?,?,sysdate(),sysdate(),?)"

Check warning on line 153 in store/mysql/service_contract.go

View check run for this annotation

Codecov / codecov/patch

store/mysql/service_contract.go#L153

Added line #L153 was not covered by tests
if _, err := tx.Exec(addSql, []interface{}{
item.ID,
contract.ID,
Expand Down Expand Up @@ -182,7 +182,7 @@ func (s *serviceContractStore) AppendServiceContractInterfaces(contract *model.E
addSql := "REPLACE INTO service_contract_detail(`id`,`contract_id`, `name`, `method`, " +
" `path` ,`content`,`revision`" +
",`flag`,`ctime`, `mtime`,`source`" +
") VALUES (?,?,?,?,?,?,?,sysdate(),sysdate(),?)"
") VALUES (?,?,?,?,?,?,?,?,sysdate(),sysdate(),?)"

if _, err := tx.Exec(addSql, []interface{}{
item.ID,
Expand Down

0 comments on commit f955f09

Please sign in to comment.