Use selective imports
This commit is contained in:
parent
f521d39772
commit
1b5e64859c
3 changed files with 21 additions and 10 deletions
|
@ -1,5 +1,10 @@
|
|||
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()
|
||||
{
|
||||
|
|
|
@ -1,13 +1,19 @@
|
|||
module calendarwebapp;
|
||||
|
||||
import core.time : days;
|
||||
|
||||
import event;
|
||||
|
||||
import std.datetime.date : Date;
|
||||
import std.exception : enforce;
|
||||
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.web : errorDisplay, noRoute, redirect, render, SessionVar, terminateSession;
|
||||
|
||||
struct AuthInfo
|
||||
{
|
||||
|
|
|
@ -4,9 +4,9 @@ import std.datetime.date;
|
|||
import std.typecons : Nullable;
|
||||
|
||||
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.serialization;
|
||||
import vibe.data.serialization : serializationName = name;
|
||||
|
||||
enum EventType
|
||||
{
|
||||
|
@ -19,17 +19,17 @@ enum EventType
|
|||
|
||||
struct Entry
|
||||
{
|
||||
@name("date") Date begin;
|
||||
@name("end_date") Nullable!Date end;
|
||||
@serializationName("date") Date begin;
|
||||
@serializationName("end_date") Nullable!Date end;
|
||||
Event event;
|
||||
}
|
||||
|
||||
struct Event
|
||||
{
|
||||
@(vibe.data.serialization.name("eid")) string id;
|
||||
@serializationName("eid") string id;
|
||||
string name;
|
||||
@(vibe.data.serialization.name("desc")) string[] description;
|
||||
@(vibe.data.serialization.name("etype")) EventType type;
|
||||
@serializationName("desc") string[] description;
|
||||
@serializationName("etype") EventType type;
|
||||
bool shout;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue