firest commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
author: "Asadz"
|
||||
date: "2024-06-19"
|
||||
version: "1.0"
|
||||
)
|
||||
|
||||
type (
|
||||
UserInfoReq {
|
||||
UserId int64 `json:"userId"`
|
||||
}
|
||||
UserInfoResp {
|
||||
UserId int64 `json:"userId"`
|
||||
Nickname string `json:"nickname"`
|
||||
}
|
||||
)
|
||||
|
||||
service user-api {
|
||||
@doc (
|
||||
summary: "Get user infomaction by user id"
|
||||
)
|
||||
@handler userInfo
|
||||
post /user/info (UserInfoReq) returns (UserInfoResp)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
message GetUserInfoReq {
|
||||
int64 id = 1;
|
||||
}
|
||||
|
||||
message GetUserInfoResp {
|
||||
int64 id = 1;
|
||||
string nickname = 2;
|
||||
}
|
||||
|
||||
service Usercenter {
|
||||
rpc GetUserInfo(GetUserInfoReq) returns (GetUserInfoResp);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
create extension if not exists "uuid-ossp";
|
||||
create extension if not exists "pg_trgm";
|
||||
|
||||
CREATE TABLE users (
|
||||
user_id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
username VARCHAR(50) UNIQUE NOT NULL,
|
||||
passwd VARCHAR(255) NOT NULL,
|
||||
nikename VARCHAR(50) NOT NULL,
|
||||
phone VARCHAR(20) UNIQUE NOT NULL,
|
||||
role_type SMALLINT NOT NULL, -- 1:玩家, 2:打手, 3:店长
|
||||
is_verified BOOLEAN DEFAULT false,
|
||||
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
Reference in New Issue
Block a user