Use selective imports

This commit is contained in:
Johannes Loher 2017-08-07 01:33:17 +02:00
parent f521d39772
commit 1b5e64859c
3 changed files with 21 additions and 10 deletions

View file

@ -1,5 +1,10 @@
import calendarwebapp; import calendarwebapp;
import vibe.vibe;
import vibe.core.log : logInfo;
import vibe.http.fileserver : serveStaticFiles;
import vibe.http.router : URLRouter;
import vibe.http.server : HTTPServerSettings, listenHTTP, MemorySessionStore;
import vibe.web.web : registerWebInterface;
shared static this() shared static this()
{ {

View file

@ -1,13 +1,19 @@
module calendarwebapp; module calendarwebapp;
import core.time : days;
import event; import event;
import std.datetime.date : Date; import std.datetime.date : Date;
import std.exception : enforce;
import std.typecons : Nullable; import std.typecons : Nullable;
import vibe.vibe; import vibe.core.path : Path;
import vibe.http.common : HTTPStatusException;
import vibe.http.server : HTTPServerRequest, HTTPServerResponse;
import vibe.http.status : HTTPStatus;
import vibe.web.auth; import vibe.web.auth;
import vibe.web.web : errorDisplay, noRoute, redirect, render, SessionVar, terminateSession;
struct AuthInfo struct AuthInfo
{ {

View file

@ -4,9 +4,9 @@ import std.datetime.date;
import std.typecons : Nullable; import std.typecons : Nullable;
import vibe.core.file: existsFile, readFileUTF8, writeFileUTF8; import vibe.core.file: existsFile, readFileUTF8, writeFileUTF8;
import vibe.core.path; import vibe.core.path : Path;
import vibe.data.json : deserializeJson, parseJsonString, serializeToPrettyJson; import vibe.data.json : deserializeJson, parseJsonString, serializeToPrettyJson;
import vibe.data.serialization; import vibe.data.serialization : serializationName = name;
enum EventType enum EventType
{ {
@ -19,17 +19,17 @@ enum EventType
struct Entry struct Entry
{ {
@name("date") Date begin; @serializationName("date") Date begin;
@name("end_date") Nullable!Date end; @serializationName("end_date") Nullable!Date end;
Event event; Event event;
} }
struct Event struct Event
{ {
@(vibe.data.serialization.name("eid")) string id; @serializationName("eid") string id;
string name; string name;
@(vibe.data.serialization.name("desc")) string[] description; @serializationName("desc") string[] description;
@(vibe.data.serialization.name("etype")) EventType type; @serializationName("etype") EventType type;
bool shout; bool shout;
} }