Skip to content

Commit

Permalink
feat: expose crud dates
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoBorai committed Apr 21, 2023
1 parent 902c8b1 commit 3400a19
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ serve:

clippy:
cargo clippy --fix --workspace

prepare:
cp .env.example .env
cargo install sea-orm-cli
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,36 @@
### Requirements

- [Rust](https://rustup.rs)
- [Justfile](https://github.com/casey/just) (**Recommended**)

### Getting Started

```bash
# install just command runner
cargo install just

# clone this repository
git clone https://github.com/whizzes/quicklink.git

# step into repository directory
cd ./quicklink

# copy the `.env.example` file into a `.env` file
cp .env.example .env
# prepare project (depends on unix shell)
just prepare

# execute the server
cargo run
# execute the server (next time you just run this command)
just serve
```

> Note: As of today migrations runs when bootstrapping the server automatically
## GUI

Even though Quicklink is designed to be a Headless URL Shortener, you can
use the Dashboard solution for a enhanced user experience.

Visit the source code on [quicklink-dashboard][1]

## Architecture

<div align="center">
Expand All @@ -49,3 +60,5 @@ All contributions to this project are welcome. Feel free to open a PR or issue
## License

Licensed under the MIT License

[1]: https://github.com/whizzes/quicklink-dashboard
7 changes: 7 additions & 0 deletions src/server/src/graphql/modules/link/types.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use async_graphql::{Enum, SimpleObject, ID};
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};

#[derive(Debug, Deserialize, Serialize, SimpleObject)]
Expand Down Expand Up @@ -44,6 +45,9 @@ pub struct Link {
pub id: ID,
pub ulid: String,
pub original_url: String,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub deleted_at: Option<DateTime<Utc>>,
}

impl From<quicklink::link::model::link::Link> for Link {
Expand All @@ -52,6 +56,9 @@ impl From<quicklink::link::model::link::Link> for Link {
id: ID(value.id.to_string()),
ulid: value.ulid.to_string(),
original_url: value.original_url.to_string(),
created_at: value.created_at,
updated_at: value.updated_at,
deleted_at: value.deleted_at,
}
}
}

0 comments on commit 3400a19

Please sign in to comment.