跳到主要内容

v1/user.proto (version not set)

Download OpenAPI specification:Download

UserService

获取验证码

query Parameters
phone
string

手机号

email
string

邮箱

Responses

Response samples

Content type
application/json
{ }

登录

Request Body schema: application/json
username
string
password
string

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "token": "string"
}

注册

Request Body schema: application/json
phone
string (手机号)
email
string (邮箱)
username
string (用户名)
captcha
string (验证码)
password
string (密码)

Responses

Request samples

Content type
application/json
{
  • "phone": "string",
  • "email": "string",
  • "username": "string",
  • "captcha": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "token": "string"
}

获取登录用户信息

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "nickname": "string",
  • "username": "string",
  • "avatar": "string",
  • "permissions": {
    }
}

获取用户主页信息

path Parameters
id
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "nickname": "string",
  • "username": "string",
  • "realname": "string",
  • "role": "REGULAR_USER",
  • "avatar": "string"
}

修改用户信息

path Parameters
id
required
integer <int32>
Request Body schema: application/json
nickname
string
location
string
bio
string
gender
integer <int32>
school
string
birthday
string <date-time>
company
string
job
string

Responses

Request samples

Content type
application/json
{
  • "nickname": "string",
  • "location": "string",
  • "bio": "string",
  • "gender": 0,
  • "school": "string",
  • "birthday": "2019-08-24T14:15:22Z",
  • "company": "string",
  • "job": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "nickname": "string",
  • "username": "string",
  • "realname": "string",
  • "role": "REGULAR_USER",
  • "avatar": "string"
}

修改用户头像

path Parameters
id
required
integer <int32>
Request Body schema: application/json
avatarFile
string
avatarName
string

Responses

Request samples

Content type
application/json
{
  • "avatarFile": "string",
  • "avatarName": "string"
}

Response samples

Content type
application/json
{
  • "url": "string"
}

修改用户密码

path Parameters
id
required
integer <int32>
Request Body schema: application/json
oldPassword
string
newPassword
string

Responses

Request samples

Content type
application/json
{
  • "oldPassword": "string",
  • "newPassword": "string"
}

Response samples

Content type
application/json
{ }

获取用户信息

path Parameters
id
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "location": "string",
  • "bio": "string",
  • "gender": 0,
  • "school": "string",
  • "birthday": "2019-08-24T14:15:22Z",
  • "company": "string",
  • "job": "string"
}

用户主页提交统计

path Parameters
id
required
integer <int32>
query Parameters
year
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "activeYears": [
    ],
  • "submissionCalendar": [
    ],
  • "totalActiveDays": 0,
  • "totalSubmission": 0,
  • "totalProblemSolved": 0,
  • "start": "string",
  • "end": "string"
}

用户主页统计

path Parameters
id
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "problemSolved": 0,
  • "contestRating": 0,
  • "contestRankingHistory": [
    ]
}

用户主页做题进度

path Parameters
id
required
integer <int32>
query Parameters
type
string
Default: "PROBLEMSET"
Enum: "PROBLEMSET" "CONTEST" "GROUP"
page
integer <int32>
perPage
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "problemsets": [
    ],
  • "contests": [
    ],
  • "groups": [
    ],
  • "total": "string"
}

用户主页勋章成就

path Parameters
id
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "total": 0
}