use axum::Router;
use libservice::ToService;
use utoipa::OpenApi;

mod components;
mod routes;

pub struct WebpageService {}

impl WebpageService {
	#[inline]
	pub fn new() -> Self {
		Self {}
	}
}

impl ToService for WebpageService {
	#[inline]
	fn make_router(&self) -> Option<Router<()>> {
		Some(routes::router())
	}

	#[inline]
	fn make_openapi(&self) -> utoipa::openapi::OpenApi {
		routes::Api::openapi()
	}

	#[inline]
	fn service_name(&self) -> Option<String> {
		Some("webpage".to_owned())
	}
}
