github.com/infraboard/keyauth@v0.8.1/apps/session/pb/session.proto (about) 1 syntax = "proto3"; 2 3 package infraboard.keyauth.session; 4 option go_package = "github.com/infraboard/keyauth/apps/session"; 5 6 import "apps/user/pb/types.proto"; 7 import "apps/token/pb/token.proto"; 8 9 // UserAgent todo 10 message UserAgent { 11 // @gotags: bson:"os" json:"os" 12 string os = 1; 13 // @gotags: bson:"platform" json:"platform" 14 string platform = 2; 15 // @gotags: bson:"engine_name" json:"engine_name" 16 string engine_name = 3; 17 // @gotags: bson:"engine_version" json:"engine_version" 18 string engine_version = 4; 19 // @gotags: bson:"browser_name" json:"browser_name" 20 string browser_name = 5; 21 // @gotags: bson:"browser_version" json:"browser_version" 22 string browser_version = 6; 23 } 24 25 // IPInfo todo 26 message IPInfo { 27 // @gotags: bson:"city_id" json:"city_id" 28 int64 city_id = 1; 29 // @gotags: bson:"country" json:"country" 30 string country = 2; 31 // @gotags: bson:"region" json:"region" 32 string region = 3; 33 // @gotags: bson:"province" json:"province" 34 string province = 4; 35 // @gotags: bson:"city" json:"city" 36 string city = 5; 37 // @gotags: bson:"isp" json:"isp" 38 string isp = 6; 39 } 40 41 // Session 登录回话 42 message Session { 43 // 唯一ID 44 // @gotags: bson:"_id" json:"id" 45 string id = 1; 46 // 所处域 47 // @gotags: bson:"domain" json:"domain" 48 string domain =2; 49 // 用户名称 50 // @gotags: bson:"account" json:"account" 51 string account =3; 52 // 用户类型 53 // @gotags: bson:"user_type" json:"user_type" 54 user.UserType user_type = 4; 55 // 用户通过哪个端登录的 56 // @gotags: bson:"application_id" json:"application_id" 57 string application_id = 5; 58 // 用户通过哪个端登录的 59 // @gotags: bson:"application_name" json:"application_name" 60 string application_name = 6; 61 // 登录方式 62 // @gotags: bson:"grant_type" json:"grant_type" 63 token.GrantType grant_type = 7; 64 // 登录时间 65 // @gotags: bson:"login_at" json:"login_at" 66 int64 login_at =8; 67 // 登录IP 68 // @gotags: bson:"login_ip" json:"login_ip" 69 string login_ip = 9; 70 // 登出时间 71 // @gotags: bson:"logout_at" json:"logout_at" 72 int64 logout_at = 10; 73 // AT 74 // @gotags: bson:"access_token" json:"access_token" 75 string access_token = 11; 76 // 用户所在空间Id 77 // @gotags: bson:"namespace_id" json:"namespace_id" 78 string namespace_id = 14; 79 // 用户所在空间名称 80 // @gotags: bson:"namespace_name" json:"namespace_name" 81 string namespace_name = 15; 82 // UA信息 83 // @gotags: bson:"user_agent" json:"user_agent" 84 UserAgent user_agent = 12; 85 // 登录Ip的地域信息 86 // @gotags: bson:"ip_info" json:"ip_info" 87 IPInfo ip_info = 13; 88 } 89 90 message Set { 91 int64 total = 1; 92 repeated Session items = 2; 93 }