🐛 Bug fixes

This commit is contained in:
2025-10-26 12:37:52 +08:00
parent 4347281fcd
commit c3b6358f33
3 changed files with 73 additions and 67 deletions

View File

@@ -112,39 +112,25 @@ public class SnPost : ModelBase, IIdentifiedResource, IActivity
};
if (EditedAt.HasValue)
{
proto.EditedAt = Timestamp.FromDateTimeOffset(EditedAt.Value.ToDateTimeOffset());
}
if (PublishedAt.HasValue)
{
proto.PublishedAt = Timestamp.FromDateTimeOffset(PublishedAt.Value.ToDateTimeOffset());
}
if (Content != null)
{
proto.Content = Content;
}
if (PinMode.HasValue)
{
proto.PinMode = (Proto.PostPinMode)((int)PinMode.Value + 1);
}
if (Meta != null)
{
proto.Meta = GrpcTypeHelper.ConvertObjectToByteString(Meta);
}
if (SensitiveMarks != null)
{
proto.SensitiveMarks = GrpcTypeHelper.ConvertObjectToByteString(SensitiveMarks);
}
if (EmbedView != null)
{
proto.EmbedView = EmbedView.ToProtoValue();
}
if (RepliedPostId.HasValue)
{

View File

@@ -239,14 +239,14 @@ message SearchPostsResponse {
}
message ListPostsRequest {
string publisher_id = 1;
string realm_id = 2;
google.protobuf.StringValue publisher_id = 1;
google.protobuf.StringValue realm_id = 2;
int32 page_size = 3;
string page_token = 4;
string order_by = 5;
google.protobuf.StringValue order_by = 5;
repeated string categories = 6;
repeated string tags = 7;
string query = 8;
google.protobuf.StringValue query = 8;
repeated PostType types = 9;
optional google.protobuf.Timestamp after = 10; // Filter posts created after this timestamp
optional google.protobuf.Timestamp before = 11; // Filter posts created before this timestamp