feat: import services and standardize Go 1.26.5
This commit is contained in:
102
apps/base/cloud/proto/album.proto
Normal file
102
apps/base/cloud/proto/album.proto
Normal file
@@ -0,0 +1,102 @@
|
||||
syntax = "proto3";
|
||||
package cloud;
|
||||
option go_package = ".;cloud";
|
||||
import "blocks.proto";
|
||||
|
||||
// 相册服务
|
||||
service Album {
|
||||
// 创建相册
|
||||
rpc CreateAlbum(CreateAlbumRequest) returns (StatusReply);
|
||||
// 获取相册详情
|
||||
rpc GetAlbum(IdentRequest) returns (CloudAlbumItem);
|
||||
// 更新相册
|
||||
rpc UpdateAlbum(CloudAlbumItem) returns (StatusReply);
|
||||
// 删除相册
|
||||
rpc DeleteAlbum(IdentRequest) returns (StatusReply);
|
||||
// 获取相册列表
|
||||
rpc ListAlbums(FetchRequest) returns (ListAlbumsResponse);
|
||||
// 设置封面照片
|
||||
rpc SetCoverPhoto(SetCoverPhotoRequest) returns (StatusReply);
|
||||
|
||||
// 上传照片
|
||||
rpc UploadPhoto(CloudPhotoItem) returns (StatusReply);
|
||||
// 获取照片详情
|
||||
rpc GetPhoto(IdentRequest) returns (CloudPhotoItem);
|
||||
// 更新照片
|
||||
rpc UpdatePhoto(CloudPhotoItem) returns (StatusReply);
|
||||
// 删除照片
|
||||
rpc DeletePhoto(IdentRequest) returns (StatusReply);
|
||||
// 获取照片列表
|
||||
rpc ListPhotos(FetchRequest) returns (ListPhotosResponse);
|
||||
// 移动照片到其他相册
|
||||
rpc MovePhoto(MovePhotoRequest) returns (StatusReply);
|
||||
}
|
||||
|
||||
// 请求消息定义
|
||||
message CreateAlbumRequest {
|
||||
uint64 cloud_id = 1;
|
||||
string cloud_identity = 2;
|
||||
string name = 3; // 相册名称
|
||||
string description = 4; // 相册描述
|
||||
string cover_photo = 5; // 封面照片URL
|
||||
bool is_private = 6; // 是否私有
|
||||
}
|
||||
|
||||
message ListAlbumsResponse {
|
||||
repeated CloudAlbumItem albums = 1;
|
||||
int64 total = 2;
|
||||
}
|
||||
|
||||
message SetCoverPhotoRequest {
|
||||
uint64 album_id = 1;
|
||||
uint64 photo_id = 2;
|
||||
}
|
||||
|
||||
// 相册模型
|
||||
message CloudAlbumItem {
|
||||
uint64 id = 1;
|
||||
string identity = 2;
|
||||
string name = 3; // 相册名称
|
||||
string description = 4; // 相册描述
|
||||
string cover_photo = 5; // 封面照片URL
|
||||
bool is_private = 6; // 是否私有
|
||||
string created_at = 7;
|
||||
string updated_at = 8;
|
||||
|
||||
// 关联关系
|
||||
repeated CloudPhotoItem photos = 9; // 相册下的照片
|
||||
}
|
||||
|
||||
|
||||
message ListPhotosResponse {
|
||||
repeated CloudPhotoItem photos = 1;
|
||||
int64 total = 2;
|
||||
}
|
||||
|
||||
message MovePhotoRequest {
|
||||
uint64 photo_id = 1;
|
||||
uint64 new_album_id = 2;
|
||||
}
|
||||
|
||||
|
||||
// 照片模型
|
||||
message CloudPhotoItem {
|
||||
uint64 id = 1;
|
||||
string identity = 2;
|
||||
uint64 album_id = 3; // 专辑ID
|
||||
string title = 4; // 照片标题
|
||||
string description = 5; // 照片描述
|
||||
string file_path = 6; // 文件路径
|
||||
int64 file_size = 7; // 文件大小
|
||||
string mime_type = 8; // 文件类型
|
||||
int32 width = 9; // 图片宽度
|
||||
int32 height = 10; // 图片高度
|
||||
string taken_at = 11; // 拍摄时间
|
||||
string location = 12; // 拍摄地点
|
||||
string tags = 13; // 标签,逗号分隔
|
||||
string created_at = 14;
|
||||
string updated_at = 15;
|
||||
|
||||
// 关联关系
|
||||
CloudAlbumItem album = 16;
|
||||
}
|
||||
Reference in New Issue
Block a user