Add vote statistics feature and improve vote page functionality

This commit is contained in:
2025-10-24 19:39:08 +02:00
parent 41dab473b0
commit 00bf7caec2
16 changed files with 447 additions and 80 deletions
+4
View File
@@ -28,6 +28,8 @@ tags:
description: All action related to appeals
- name: mail
description: All actions related to user email verification
- name: site
description: Actions related to small features on the site such as displaying vote stats or pt/rank stats
paths:
/api/team/{team}:
$ref: './schemas/team/team.yml#/getTeam'
@@ -89,3 +91,5 @@ paths:
$ref: './schemas/forms/mail/mail.yml#/DeleteEmail'
/api/mail/list:
$ref: './schemas/forms/mail/mail.yml#/GetEmails'
/api/site/vote:
$ref: './schemas/site/vote.yml#/VoteStats'
@@ -0,0 +1,81 @@
VoteStats:
get:
tags:
- site
summary: Get vote stats
description: Get vote stats for current user
operationId: getVoteStats
responses:
'200':
description: Vote stats retrieved
content:
application/json:
schema:
$ref: '#/components/schemas/VoteData'
components:
schemas:
VoteData:
type: object
required:
- allVoteInfo
- voteStats
- voteStreak
- bestVoteStreak
properties:
allVoteInfo:
type: array
items:
$ref: '#/components/schemas/VoteInfo'
voteStats:
$ref: '#/components/schemas/VoteStats'
voteStreak:
$ref: '#/components/schemas/VoteStreak'
bestVoteStreak:
$ref: '#/components/schemas/VoteStreak'
VoteInfo:
type: object
required:
- siteName
- lastVoteTimestamp
properties:
siteName:
type: string
lastVoteTimestamp:
type: integer
format: int64
VoteStats:
type: object
required:
- total
- monthly
- weekly
- daily
properties:
total:
type: integer
format: int32
monthly:
type: integer
format: int32
weekly:
type: integer
format: int32
daily:
type: integer
format: int32
VoteStreak:
type: object
required:
- dailyStreak
- weeklyStreak
- monthlyStreak
properties:
dailyStreak:
type: integer
format: int32
weeklyStreak:
type: integer
format: int32
monthlyStreak:
type: integer
format: int32