mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-06 10:00:24 +08:00
[API节点]支持HTTP API
This commit is contained in:
@@ -19,7 +19,7 @@ func (this *APINodeService) CreateAPINode(ctx context.Context, req *pb.CreateAPI
|
||||
return nil, err
|
||||
}
|
||||
|
||||
nodeId, err := models.SharedAPINodeDAO.CreateAPINode(req.Name, req.Description, req.HttpJSON, req.HttpsJSON, req.AccessAddrsJSON, req.IsOn)
|
||||
nodeId, err := models.SharedAPINodeDAO.CreateAPINode(req.Name, req.Description, req.HttpJSON, req.HttpsJSON, req.RestIsOn, req.RestHTTPJSON, req.RestHTTPSJSON, req.AccessAddrsJSON, req.IsOn)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -34,7 +34,7 @@ func (this *APINodeService) UpdateAPINode(ctx context.Context, req *pb.UpdateAPI
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = models.SharedAPINodeDAO.UpdateAPINode(req.NodeId, req.Name, req.Description, req.HttpJSON, req.HttpsJSON, req.AccessAddrsJSON, req.IsOn)
|
||||
err = models.SharedAPINodeDAO.UpdateAPINode(req.NodeId, req.Name, req.Description, req.HttpJSON, req.HttpsJSON, req.RestIsOn, req.RestHTTPJSON, req.RestHTTPSJSON, req.AccessAddrsJSON, req.IsOn)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -138,6 +138,9 @@ func (this *APINodeService) ListEnabledAPINodes(ctx context.Context, req *pb.Lis
|
||||
Description: node.Description,
|
||||
HttpJSON: []byte(node.Http),
|
||||
HttpsJSON: []byte(node.Https),
|
||||
RestIsOn: node.RestIsOn == 1,
|
||||
RestHTTPJSON: []byte(node.RestHTTP),
|
||||
RestHTTPSJSON: []byte(node.RestHTTPS),
|
||||
AccessAddrsJSON: []byte(node.AccessAddrs),
|
||||
AccessAddrs: accessAddrs,
|
||||
StatusJSON: []byte(node.Status),
|
||||
@@ -178,6 +181,9 @@ func (this *APINodeService) FindEnabledAPINode(ctx context.Context, req *pb.Find
|
||||
Description: node.Description,
|
||||
HttpJSON: []byte(node.Http),
|
||||
HttpsJSON: []byte(node.Https),
|
||||
RestIsOn: node.RestIsOn == 1,
|
||||
RestHTTPJSON: []byte(node.RestHTTP),
|
||||
RestHTTPSJSON: []byte(node.RestHTTPS),
|
||||
AccessAddrsJSON: []byte(node.AccessAddrs),
|
||||
AccessAddrs: accessAddrs,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user