images: update proto to include get and delete

This commit is contained in:
Tigor Hutasuhut 2024-08-17 11:10:01 +07:00
parent e7a7002293
commit fc4429a918
4 changed files with 43 additions and 0 deletions

View file

@ -0,0 +1,18 @@
syntax = "proto3";
package images.v1;
message DeleteImagesRequest {
repeated DeleteImage deletes = 1;
bool blacklist = 2;
}
message DeleteImage {
string post_name = 1;
repeated string devices = 2;
}
message DeleteImagesResponse {
// The number of images that will be deleted.
int64 count = 1;
}

View file

@ -0,0 +1,13 @@
syntax = "proto3";
package images.v1;
import "images/v1/types.proto";
message GetImageRequest {
string id = 1;
}
message GetImageResponse {
Image image = 1;
}

View file

@ -2,8 +2,12 @@ syntax = "proto3";
package images.v1;
import "images/v1/delete.proto";
import "images/v1/get.proto";
import "images/v1/list.proto";
service ImageService {
rpc ListImages(ListImagesRequest) returns (ListImagesResponse) {}
rpc DeleteImages(DeleteImagesRequest) returns (DeleteImagesResponse) {}
rpc GetImage(GetImageRequest) returns (GetImageResponse) {}
}

View file

@ -40,8 +40,13 @@ message ListImagesRequest {
// cannot be set (value > 0) with after (value > 0).
int64 before = 5;
// OrderBy orders the images by the given field.
//
// if not set, the default order is by created_at DESC,
// regardless of the sort field.
OrderBy order_by = 6;
// sort orders the images by the given sort.
Sort sort = 7;
// search searches images by text. ignored if empty.
@ -61,6 +66,9 @@ message ListImagesRequest {
// nsfw filters the images to be fetched based on the nsfw flag.
NSFW nsfw = 9;
// blacklist filters the images to be fetched based on the blacklist flag.
Blacklist blacklist = 10;
}
message ListImagesResponse {