syntax = "proto3";


import "base.proto";

package com.ywt.gapi.user;

option java_multiple_files = true;
option java_package = "com.ywt.gapi.user";
option java_outer_classname = "UserProto";

//用户信息
message User {
    int32 userid = 1;
    string username = 2;
    string realname = 3;
    string mobile = 4;
    int32 idtype = 5;
    string idno = 6;
    int32 sex = 7;
    int32 age = 8;
    string avatar = 9;
    string birthday = 10;
    int64 createtime = 11;
    string registerip = 12;
    int32 usertype = 13;
}


message UserRequest {
    int32 userid = 1;
    string phone = 2;
}

message UserResponse {
    Result result = 1;
    User user = 2;
}

// 第三方账户信息
message SnsUserInfo{
    int32 id = 1;
    string openId = 2;
    string unionId = 3;
    int32 userId = 4;
    string nickname = 5;
    int32 sex = 6;
    string province = 7;
    string city = 8;
    string country = 9;
    string avatar = 10;
    string language = 11;
    int32 snsType = 12;
    int32 status = 13;
    int64 createTime = 14;
    int32 terminal = 15;
}

message GetSnsUserInfoRequest{
    string openId = 1;
    string unionId = 2;
    int32 userId = 3;
    int32 terminal = 4;
}

message GetSnsUserInfoResponse{
    int32 code = 1;
    string msg = 2;
    SnsUserInfo snsUserInfo = 3;
}


//用户相关服务  // 对应 rpc 项目的 UserServiceImpl 类
service UserService {
    rpc findByUserId(UserRequest) returns (UserResponse); //根据用户ID获取用户信息
    //
    rpc getSnsUserInfo (GetSnsUserInfoRequest) returns (GetSnsUserInfoResponse);
}