Skip to content

Instantly share code, notes, and snippets.

@vitiko
Last active July 23, 2019 09:06
Show Gist options
  • Save vitiko/baa045f49ac4cc74e2b7b9918ac0e1e7 to your computer and use it in GitHub Desktop.
Save vitiko/baa045f49ac4cc74e2b7b9918ac0e1e7 to your computer and use it in GitHub Desktop.
syntax = "proto3";
package service;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "github.com/s7techlab/cckit/examples/cpaper_asservice/schema/schema.proto";
service CPaper {
// List method returns all registered commercial papers
rpc List (google.protobuf.Empty) returns (schema.CommercialPaperList) {
option (google.api.http) = {
get: "/cpaper"
};
}
// Get method returns commercial paper data by id
rpc Get (schema.CommercialPaperId) returns (schema.CommercialPaper) {
option (google.api.http) = {
get: "/cpaper/{issuer}/{paper_number}"
};
}
// GetByExternalId
rpc GetByExternalId (schema.ExternalId) returns (schema.CommercialPaper) {
option (google.api.http) = {
get: "/cpaper/extid/{id}"
};
}
// Issue commercial paper
rpc Issue (schema.IssueCommercialPaper) returns (schema.CommercialPaper) {
option (google.api.http) = {
post : "/cpaper/issue"
body: "*"
};
}
// Buy commercial paper
rpc Buy (schema.BuyCommercialPaper) returns (schema.CommercialPaper) {
option (google.api.http) = {
post: "/cpaper/buy"
body: "*"
};
}
// Redeem commercial paper
rpc Redeem (schema.RedeemCommercialPaper) returns (schema.CommercialPaper) {
option (google.api.http) = {
post: "/cpaper/redeem"
body: "*"
};
}
// Delete commercial paper
rpc Delete (schema.CommercialPaperId) returns (schema.CommercialPaper) {
option (google.api.http) = {
delete: "/cpaper/{issuer}/{paper_number}"
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment