- Problems page: replace Luogu pass rate with local submission stats
(local_submit_count, local_ac_count)
- Problems page: add user AC/fail status column (user_ac, user_fail_count)
- Admin users: add total_submissions and total_ac columns
- Admin users: add detail panel with submissions/rating/redeem tabs
- Admin: new endpoint GET /api/v1/admin/users/{id}/rating-history
- Rating history: note field includes problem title via JOIN
- Me page: translate task codes to friendly labels with icons
- Me page: problem links in rating history are clickable
- Wrong book service, learning note scoring, note image controller
- Backend SQL uses batch queries for performance
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
41 行
1.2 KiB
C++
41 行
1.2 KiB
C++
#pragma once
|
|
|
|
#include "csp/db/sqlite_db.h"
|
|
#include "csp/domain/entities.h"
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace csp::services {
|
|
|
|
struct WrongBookEntry {
|
|
domain::WrongBookItem item;
|
|
std::string problem_title;
|
|
};
|
|
|
|
class WrongBookService {
|
|
public:
|
|
explicit WrongBookService(db::SqliteDb& db) : db_(db) {}
|
|
|
|
std::vector<WrongBookEntry> ListByUser(int64_t user_id);
|
|
void UpsertNote(int64_t user_id, int64_t problem_id, const std::string& note);
|
|
std::string GetNoteImagesJson(int64_t user_id, int64_t problem_id);
|
|
void SetNoteImagesJson(int64_t user_id, int64_t problem_id, const std::string& note_images_json);
|
|
void UpsertNoteScore(int64_t user_id,
|
|
int64_t problem_id,
|
|
int32_t note_score,
|
|
int32_t note_rating,
|
|
const std::string& note_feedback_md);
|
|
void UpsertBySubmission(int64_t user_id,
|
|
int64_t problem_id,
|
|
int64_t submission_id,
|
|
const std::string& note);
|
|
void Remove(int64_t user_id, int64_t problem_id);
|
|
|
|
private:
|
|
db::SqliteDb& db_;
|
|
};
|
|
|
|
} // namespace csp::services
|