zero-ppanel/apps/rpc/core/core.proto
shanshanzhong 3b4429bdd9
All checks were successful
Build docker and publish / prepare (20.15.1) (push) Successful in 11s
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.admin image_name:ppanel-admin name:admin]) (push) Successful in 4m32s
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.api image_name:ppanel-api name:api]) (push) Successful in 8m6s
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.node image_name:ppanel-node name:node]) (push) Successful in 4m26s
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.queue image_name:ppanel-queue name:queue]) (push) Successful in 3m55s
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.rpc-core image_name:ppanel-rpc-core name:rpc-core]) (push) Successful in 8m23s
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.scheduler image_name:ppanel-scheduler name:scheduler]) (push) Successful in 4m1s
Build docker and publish / deploy (push) Successful in 45s
Build docker and publish / notify (push) Successful in 3s
feat: 新增设备登录功能,包括API接口、RPC服务、逻辑处理和相关数据类型及错误码。
2026-03-01 18:51:12 -08:00

81 lines
2.1 KiB
Protocol Buffer

syntax = "proto3";
package core;
option go_package = "./core";
// ----------------------------------------------------------------------------
// 通用结构
// ----------------------------------------------------------------------------
message Empty {}
message BasicResponse {
int32 code = 1;
string msg = 2;
}
// ----------------------------------------------------------------------------
// User 服务定义
// ----------------------------------------------------------------------------
message GetUserInfoReq {
int64 id = 1;
string email = 2; // 用于根据邮箱查询用户
}
message GetUserInfoResp {
int64 id = 1;
string email = 2;
string role = 3;
string uuid = 4;
string password = 5; // 用于验证密码
bool is_disabled = 6; // 用户是否被禁用
bool is_deleted = 7; // 用户是否已被删除
}
// ----------------------------------------------------------------------------
// Node 服务定义
// ----------------------------------------------------------------------------
message GetNodeInfoReq {
int64 id = 1;
}
message GetNodeInfoResp {
int64 id = 1;
string name = 2;
string server = 3;
string status = 4;
}
// ----------------------------------------------------------------------------
// Device 服务定义
// ----------------------------------------------------------------------------
message DeviceLoginReq {
string identifier = 1;
string user_agent = 2;
string ip = 3;
string short_code = 4;
}
message DeviceLoginResp {
int64 user_id = 1;
bool is_admin = 2;
bool is_disabled = 3;
bool is_new_user = 4;
}
// ----------------------------------------------------------------------------
// 核心 RPC 服务接口
// ----------------------------------------------------------------------------
service Core {
// Ping 检查服务健康状态
rpc Ping(Empty) returns(BasicResponse);
// 用户相关
rpc GetUserInfo(GetUserInfoReq) returns(GetUserInfoResp);
// 节点相关
rpc GetNodeInfo(GetNodeInfoReq) returns(GetNodeInfoResp);
// 设备登录
rpc DeviceLogin(DeviceLoginReq) returns(DeviceLoginResp);
}