Skip to content

Commit

Permalink
fix: proto gen
Browse files Browse the repository at this point in the history
  • Loading branch information
hthieu1110 committed Aug 10, 2023
1 parent c4bba90 commit 666c476
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion api/feed/v1/feed.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ message Post {
string metadata = 4;
string parent_post_identifier = 5;
uint32 sub_post_length = 6;
string author_id = 11;
int64 created_at = 8;
int64 tip_amount = 10;
string author_id = 11;
repeated Reaction reactions = 9;
}

Expand Down
28 changes: 14 additions & 14 deletions go/pkg/feedpb/feed.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions packages/api/feed/v1/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export interface Post {
metadata: string;
parentPostIdentifier: string;
subPostLength: number;
authorId: string;
createdAt: number;
tipAmount: number;
authorId: string;
reactions: Reaction[];
}

Expand Down Expand Up @@ -209,9 +209,9 @@ function createBasePost(): Post {
metadata: "",
parentPostIdentifier: "",
subPostLength: 0,
authorId: "",
createdAt: 0,
tipAmount: 0,
authorId: "",
reactions: [],
};
}
Expand All @@ -236,15 +236,15 @@ export const Post = {
if (message.subPostLength !== 0) {
writer.uint32(48).uint32(message.subPostLength);
}
if (message.authorId !== "") {
writer.uint32(90).string(message.authorId);
}
if (message.createdAt !== 0) {
writer.uint32(64).int64(message.createdAt);
}
if (message.tipAmount !== 0) {
writer.uint32(80).int64(message.tipAmount);
}
if (message.authorId !== "") {
writer.uint32(90).string(message.authorId);
}
for (const v of message.reactions) {
Reaction.encode(v!, writer.uint32(74).fork()).ldelim();
}
Expand Down Expand Up @@ -276,15 +276,15 @@ export const Post = {
case 6:
message.subPostLength = reader.uint32();
break;
case 11:
message.authorId = reader.string();
break;
case 8:
message.createdAt = longToNumber(reader.int64() as Long);
break;
case 10:
message.tipAmount = longToNumber(reader.int64() as Long);
break;
case 11:
message.authorId = reader.string();
break;
case 9:
message.reactions.push(Reaction.decode(reader, reader.uint32()));
break;
Expand All @@ -304,9 +304,9 @@ export const Post = {
metadata: isSet(object.metadata) ? String(object.metadata) : "",
parentPostIdentifier: isSet(object.parentPostIdentifier) ? String(object.parentPostIdentifier) : "",
subPostLength: isSet(object.subPostLength) ? Number(object.subPostLength) : 0,
authorId: isSet(object.authorId) ? String(object.authorId) : "",
createdAt: isSet(object.createdAt) ? Number(object.createdAt) : 0,
tipAmount: isSet(object.tipAmount) ? Number(object.tipAmount) : 0,
authorId: isSet(object.authorId) ? String(object.authorId) : "",
reactions: Array.isArray(object?.reactions) ? object.reactions.map((e: any) => Reaction.fromJSON(e)) : [],
};
},
Expand All @@ -319,9 +319,9 @@ export const Post = {
message.metadata !== undefined && (obj.metadata = message.metadata);
message.parentPostIdentifier !== undefined && (obj.parentPostIdentifier = message.parentPostIdentifier);
message.subPostLength !== undefined && (obj.subPostLength = Math.round(message.subPostLength));
message.authorId !== undefined && (obj.authorId = message.authorId);
message.createdAt !== undefined && (obj.createdAt = Math.round(message.createdAt));
message.tipAmount !== undefined && (obj.tipAmount = Math.round(message.tipAmount));
message.authorId !== undefined && (obj.authorId = message.authorId);
if (message.reactions) {
obj.reactions = message.reactions.map((e) => e ? Reaction.toJSON(e) : undefined);
} else {
Expand All @@ -338,9 +338,9 @@ export const Post = {
message.metadata = object.metadata ?? "";
message.parentPostIdentifier = object.parentPostIdentifier ?? "";
message.subPostLength = object.subPostLength ?? 0;
message.authorId = object.authorId ?? "";
message.createdAt = object.createdAt ?? 0;
message.tipAmount = object.tipAmount ?? 0;
message.authorId = object.authorId ?? "";
message.reactions = object.reactions?.map((e) => Reaction.fromPartial(e)) || [];
return message;
},
Expand Down

0 comments on commit 666c476

Please sign in to comment.