2021-11-14 11:45:34 +01:00
|
|
|
#include "village_controller.h"
|
|
|
|
|
2022-02-05 23:02:06 +01:00
|
|
|
#include "web/html/form_validator.h"
|
|
|
|
#include "web/html/html_builder.h"
|
|
|
|
#include "web/http/cookie.h"
|
|
|
|
#include "web/http/http_session.h"
|
|
|
|
#include "web/http/request.h"
|
|
|
|
#include "web/http/session_manager.h"
|
2021-11-14 11:45:34 +01:00
|
|
|
|
2021-11-14 13:59:02 +01:00
|
|
|
#include "village_model.h"
|
2021-11-14 11:45:34 +01:00
|
|
|
|
|
|
|
void VillageController::handle_request_default(Request *request) {
|
|
|
|
}
|
|
|
|
|
2022-02-05 23:02:06 +01:00
|
|
|
void VillageController::create_table() {
|
|
|
|
VillageModel::get_singleton()->create_table();
|
2021-11-14 13:59:02 +01:00
|
|
|
}
|
2022-02-05 23:02:06 +01:00
|
|
|
void VillageController::drop_table() {
|
|
|
|
VillageModel::get_singleton()->drop_table();
|
|
|
|
}
|
|
|
|
void VillageController::create_default_entries() {
|
|
|
|
VillageModel::get_singleton()->create_default_entries();
|
2021-11-14 13:59:02 +01:00
|
|
|
}
|
|
|
|
|
2021-11-14 11:45:34 +01:00
|
|
|
VillageController *VillageController::get_singleton() {
|
|
|
|
return _self;
|
|
|
|
}
|
|
|
|
|
|
|
|
VillageController::VillageController() :
|
|
|
|
Object() {
|
|
|
|
|
|
|
|
if (_self) {
|
|
|
|
printf("VillageController::VillageController(): Error! self is not null!/n");
|
|
|
|
}
|
|
|
|
|
|
|
|
_self = this;
|
|
|
|
}
|
|
|
|
|
|
|
|
VillageController::~VillageController() {
|
|
|
|
if (_self == this) {
|
|
|
|
_self = nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
VillageController *VillageController::_self = nullptr;
|