showing id now also when executing a get Request
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
use std::i32;
|
||||||
|
|
||||||
use axum::{Json, debug_handler, extract::{Query, State}, http::StatusCode, response::IntoResponse};
|
use axum::{Json, debug_handler, extract::{Query, State}, http::StatusCode, response::IntoResponse};
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
@@ -7,6 +9,7 @@ use crate::{AppState, types::Alarm};
|
|||||||
|
|
||||||
#[derive(ToSchema, Serialize)]
|
#[derive(ToSchema, Serialize)]
|
||||||
pub struct OkResponse {
|
pub struct OkResponse {
|
||||||
|
id: i32,
|
||||||
title: String,
|
title: String,
|
||||||
enabled: bool,
|
enabled: bool,
|
||||||
time: DateTime<Utc>,
|
time: DateTime<Utc>,
|
||||||
@@ -39,6 +42,7 @@ pub struct RequestQuery {
|
|||||||
impl From<Alarm> for OkResponse {
|
impl From<Alarm> for OkResponse {
|
||||||
fn from(value: Alarm) -> Self {
|
fn from(value: Alarm) -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
id: value.id,
|
||||||
title: value.title,
|
title: value.title,
|
||||||
enabled: value.enabled,
|
enabled: value.enabled,
|
||||||
time: value.time,
|
time: value.time,
|
||||||
|
|||||||
Reference in New Issue
Block a user