25 lines
614 B
C++
25 lines
614 B
C++
#include "logservice.h"
|
|
|
|
#include "../models/logrecord.h"
|
|
#include "../repositories/logrepository.h"
|
|
|
|
LogService &LogService::instance()
|
|
{
|
|
static LogService service;
|
|
return service;
|
|
}
|
|
|
|
bool LogService::record(const QString &type, const QString &module, const QString &action,
|
|
const QString &content, const QString &status, QString *error)
|
|
{
|
|
LogRecord record;
|
|
record.type = type;
|
|
record.module = module;
|
|
record.action = action;
|
|
record.content = content;
|
|
record.status = status;
|
|
|
|
LogRepository repository;
|
|
return repository.insertLog(record, error);
|
|
}
|