Skip to content

Instantly share code, notes, and snippets.

@idy
Last active June 30, 2018 13:04
Show Gist options
  • Select an option

  • Save idy/4f757a916f79521e8c79fa29d0533617 to your computer and use it in GitHub Desktop.

Select an option

Save idy/4f757a916f79521e8c79fa29d0533617 to your computer and use it in GitHub Desktop.

Revisions

  1. idy revised this gist Jun 30, 2018. 1 changed file with 11 additions and 11 deletions.
    22 changes: 11 additions & 11 deletions page.proto
    Original file line number Diff line number Diff line change
    @@ -1,30 +1,30 @@
    message Page {
    message Resource {
    map<string, string> attributes = 1;
    oneof id {
    string sku = 2;
    string product = 3;
    string collection = 4;
    string product_type = 5;
    string brand = 6;
    string sku = 1;
    string product = 2;
    string collection = 3;
    string product_type = 4;
    string brand = 5;

    // page id indicates another page in the same storefront
    string page = 7;
    string page = 6;

    // TODO(y)
    // When we implement discount, add this attribute
    // string discount = 8;
    // string discount = 7;
    // TODO(y)
    // When we implement group buying event, add this attribute
    // string group_buying_event = 9;
    // string group_buying_event = 8;
    // TODO(y)
    // When we implement customer hosted group buying event,
    // add this attribute
    // customer_hosted_group_buying_event = 10;
    // customer_hosted_group_buying_event = 9;
    // TODO(y)
    // When we implement lightning deal event, add this attribute
    // customer_hosted_group_buying_event = 11;
    // customer_hosted_group_buying_event = 10;
    }
    map<string, string> attributes = 100;
    }

    // <storefront>/pages/url/format/id
  2. idy created this gist Jun 30, 2018.
    41 changes: 41 additions & 0 deletions page.proto
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,41 @@
    message Page {
    message Resource {
    map<string, string> attributes = 1;
    oneof id {
    string sku = 2;
    string product = 3;
    string collection = 4;
    string product_type = 5;
    string brand = 6;

    // page id indicates another page in the same storefront
    string page = 7;

    // TODO(y)
    // When we implement discount, add this attribute
    // string discount = 8;
    // TODO(y)
    // When we implement group buying event, add this attribute
    // string group_buying_event = 9;
    // TODO(y)
    // When we implement customer hosted group buying event,
    // add this attribute
    // customer_hosted_group_buying_event = 10;
    // TODO(y)
    // When we implement lightning deal event, add this attribute
    // customer_hosted_group_buying_event = 11;
    }
    }

    // <storefront>/pages/url/format/id
    string name = 1;
    string title = 2;
    string description = 3;
    string image_url = 4;

    // 该页面包含的资源
    repeated Resource resources = 5;

    // 只读选项,GetPage 时会返回,为对应的 resource 的数据
    repeated google.protobuf.Any details = 6;
    }