syntax = "proto3";
package cloud;
option go_package = "bsm/full/module/base/cloud/pb;cloud";

import "protobuf/blocks.proto";
import "module/base/cloud/proto/disk.proto";
import "module/base/cloud/proto/album.proto";
import "module/base/cloud/proto/note.proto";
import "module/base/cloud/proto/bookmark.proto";
import "module/base/cloud/proto/private.proto";
import "module/base/cloud/proto/share.proto";

service Space {
  // 获取空间数据
  rpc Get(blocks.Empty) returns (CloudSpace);

  // 获取空间数据
  rpc GetByKeyIdentifier(blocks.IdentRequest) returns (CloudSpace);
}

// 系统统计和配置模型
message CloudSpace {
  uint64 id = 1;
  string identity = 2;
  int64 total_storage = 3;            // 总存储空间
  int64 used_storage = 4;             // 已用存储空间
  int64 max_storage = 5;              // 最大存储空间
  int32 file_count = 6;               // 文件数量
  int32 album_count = 7;              // 相册数量
  int32 photo_count = 8;              // 照片数量
  int32 note_count = 9;               // 笔记数量
  int32 bookmark_count = 10;          // 书签数量
  int32 private_count = 11;           // 私有数量
  string created_at = 12;
  string updated_at = 13;

  // 关联关系
  repeated CloudDiskDirItem cloud_disk_dirs = 14; // 关联云盘目录
  repeated CloudAlbumItem cloud_albums = 15;      // 关联相册
  repeated CloudNoteItem cloud_notes = 16;        // 关联笔记
  repeated CloudBookmarkItem cloud_bookmarks = 17; // 关联书签
  repeated CloudPrivateItem cloud_private = 18;   // 关联私有数据
  repeated CloudShareItem cloud_shares = 19;      // 关联分享
}
