syntax = "proto3";
package cloud;
option go_package = "bsm/full/module/base/cloud/pb;cloud";
import "protobuf/blocks.proto";

// 书签服务
service Bookmark {
  // 创建书签
  rpc CreateBookmark(CreateBookmarkRequest) returns (blocks.StatusReply);
  // 获取书签详情
  rpc GetBookmark(blocks.IDRequest) returns (CloudBookmarkItem);
  // 更新书签
  rpc UpdateBookmark(CloudBookmarkItem) returns (blocks.StatusReply);
  // 删除书签
  rpc DeleteBookmark(blocks.IDRequest) returns (blocks.StatusReply);
  // 获取书签列表
  rpc ListBookmarks(blocks.FetchRequest) returns (ListBookmarksResponse);
  // 导入书签
  rpc ImportBookmarks(ImportBookmarksRequest) returns (blocks.StatusReply);
}

message CreateBookmarkRequest {
  uint64 cloud_id = 1;
  string cloud_identity = 2;
  string title = 3;                   // 标题
  string url = 4;                     // 网址
  string description = 5;             // 描述
  string category = 6;                // 分类
  string tags = 7;                    // 标签
  string icon = 8;                    // 网站图标URL
  bool is_private = 9;                // 是否私有
}

message ListBookmarksResponse {
  repeated CloudBookmarkItem bookmarks = 1;
  int64 total = 2;
}

message ImportBookmarksRequest {
  string data = 1; // JSON格式的书签数据
  string format = 2; // 导入格式: chrome, firefox, safari, etc.
}

// 网址收藏夹模型
message CloudBookmarkItem {
  uint64 id = 1;
  string identity = 2;
  string title = 3;                   // 标题
  string url = 4;                     // 网址
  string description = 5;             // 描述
  string category = 6;                // 分类
  string tags = 7;                    // 标签
  string icon = 8;                    // 网站图标URL
  bool is_private = 9;                // 是否私有
  string created_at = 10;
  string updated_at = 11;
}
