syntax = "proto3";
package pressreleases;
//import "descriptor.proto";
//import "validator.proto";

option go_package = "./;pressreleases";

service PressReleases{
    rpc List(ListReq) returns (ListResp) {}
    rpc Display(DisplayReq) returns (DisplayResp) {}
    rpc Edit(EditReq) returns (EditResp) {}
    rpc Create(CreateReq) returns (CreateResp) {}
    rpc Delete(DeleteReq) returns (DeleteResp) {}
    rpc Get(GetReq) returns (GetResp) {}
}

message Item{
    uint32 id = 1;
    string title = 2;
    uint64 createdAt = 3;
    uint32 sort = 4;
    string content = 5;
    string attachment = 6;
    string attachmentName = 7;
    uint64 updatedAt = 8;
    uint32 status = 9;
    uint32 display = 10;
    string summary = 11;
    string operator = 12;
    int32 operatorId = 13;
}

message ListReq{
    string title = 1;
    uint64 startTime = 2;
    uint64 endTime = 3;
    uint32 status = 4;
    uint32 display = 5;
    int32 page = 6;
    int32 pageSize = 7; 
}

message ListResp{
    uint64 total = 1;
    repeated Item data = 2;
}

message DisplayReq{
    string query = 1;
    uint32 page = 2;
    uint32 pageSize = 3;
}

message DisplayResp{
    int64 total = 1;
    repeated Item data = 2;
}

message EditReq{
    uint32 id = 1;
    string title = 2;
    uint64 createdAt = 3;
    uint32 sort = 4;
    string content = 5;
    string attachment = 6;
    string attachmentName = 7;
    uint32 status = 8;
    uint32 display = 9;
    string summary = 10;
    string operator = 11;
    int32 operatorId = 12;

}

message EditResp{
}

message CreateReq{
    string title = 1;
    uint64 createdAt = 2;
    uint32 sort = 3;
    string content = 4;
    string attachment = 5;
    string attachmentName = 6;
    uint32 status = 7;
    uint32 display = 8;
    string summary = 9;
    string operator = 10;
    int32 operatorId = 11;
}

message CreateResp{

}

message DeleteReq{
    uint32 id = 1;
}

message DeleteResp{

}

message GetReq{
    int64 id = 1;
}

message GetResp{
    uint32 id = 1;
    string title = 2;
    uint64 createdAt = 3;
    string content = 4;
    string attachment = 5;
    string attachmentName = 6;
    string summary = 7;
}