-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhttpservice.h
35 lines (30 loc) · 1.36 KB
/
httpservice.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef HTTPSERVICE_H
#define HTTPSERVICE_H
#include <QtHttpServer>
#include "databasequery.h"
class HttpService
{
public:
HttpService(QSqlDatabase databaseConnection);
bool startListening();
protected:
void loadHttpServiceConfig();
void initUrlRouting();
void writeResponseData(
QHttpServerResponder &responder,
const QJsonDocument &document,
QHttpServerResponder::StatusCode status = QHttpServerResponder::StatusCode::Ok
);
QJsonArray queryProteinByReferenceSequenceRegion(quint16 datasetId, QString proteinName, QString position);
QJsonArray queryRegionByProteinId(quint16 datasetId, QString proteinName);
QJsonArray queryAnnotationBySequenceRegion(quint16 datasetId, QString name, QString posStart, QString posEnd);
bool insertSequenceAnnotationAtSpecificPosition(quint16 datasetId, qint32 id, QString name, qint32 position, QString time, QString contents, QString authorUsername, QString remoteAddress);
QJsonArray queryDatasetsList();
QJsonArray queryProteinIdListForAutoComplete(quint16 datasetId, QString proteinName);
QJsonArray searchAnnotation(quint16 datasetId, qint32 id, QString contents, QString authorUsername, QString remoteAddress);
private:
QHttpServer snowHttpServer;
quint16 listenPort = 12080;
DatabaseQuery databaseQuery;
};
#endif // HTTPSERVICE_H