123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- syntax = "proto3";
- package api.user.v2;
- import "google/api/annotations.proto";
- import "validate/validate.proto";
- option go_package = "w303a/server/apis/user/v2;v2";
- option java_multiple_files = true;
- option java_package = "apis.user.v2";
- /*
- 设备服务
- - 绑定设备
- - 解绑设备
- - 查询设备绑定状态
- - 设备交换三码
- */
- service Device {
- // 获取设备绑定状态
- rpc DeviceBinding(DeviceBindingRequest) returns (DeviceBindingResponse) {
- option (google.api.http) = {
- get: "/apis/v2/userctx/user/child/device/binding"
- };
- };
- // 绑定设备
- rpc DeviceBind(DeviceBindRequest) returns (DeviceBindResponse) {
- option (google.api.http) = {
- post: "/apis/v2/userctx/user/child/device/bind"
- body: "*"
- };
- };
- // 解绑设备
- rpc DeviceUnbind(DeviceUnbindRequest) returns (DeviceUnbindResponse) {
- option (google.api.http) = {
- post: "/apis/v2/userctx/user/child/device/unbind"
- body: "*"
- };
- };
- // 交换三码
- rpc DeviceExchange(DeviceExchangeRequest) returns (DeviceExchangeResponse) {
- option (google.api.http) = {
- get: "/apis/v2/userctx/user/child/device/exchange"
- };
- };
- }
- // 获取设备绑定状态 Request
- message DeviceBindingRequest {
- string ticket = 1 [(validate.rules).string.min_len = 1];
- };
- // 获取设备绑定状态 Response
- message DeviceBindingResponse {
- // 是否被绑定
- bool isBind = 3;
- // 被绑定的小孩ID
- string cid = 1;
- // 设备的 accessToken
- // 后续接口需要通过这个来进行交互
- string token = 2;
- // 体重
- int32 weight = 4;
- // 身高
- int32 height = 5;
- };
- // 绑定设备 Request
- message DeviceBindRequest {
- string cid = 1 [(validate.rules).string.min_len = 1, (validate.rules).string.uuid = true];
- string ticket = 2 [(validate.rules).string.min_len = 1];
- };
- // 绑定设备 Response
- message DeviceBindResponse {};
- // 解绑设备
- message DeviceUnbindRequest {
- string cid = 1 [(validate.rules).string.min_len = 1, (validate.rules).string.uuid = true];
- string ticket = 2 [(validate.rules).string.min_len = 1];
- };
- // 解绑设备
- message DeviceUnbindResponse {};
- message DeviceExchangeRequest {
- string hc = 1 [(validate.rules).string.min_len = 1];
- };
- message DeviceExchangeResponse {
- // ticket 用于生成设备绑定二维码使用
- // 在连接 temp websocket 时也会用到
- string ticket = 1;
- string aseKey = 2;
- string hc = 3;
- // 设备激活时间
- int64 activationTime = 4;
- };
|