文件
csp/backend/include/csp/services/wrong_book_service.h

34 行
790 B
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);
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