feat: major code refactor, add login and register endpoints with swagger
All checks were successful
Update changelog / changelog (push) Successful in 27s
All checks were successful
Update changelog / changelog (push) Successful in 27s
This commit is contained in:
@@ -1,48 +1,49 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinTable } from "typeorm"
|
||||
import { User } from "./User"
|
||||
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinTable } from 'typeorm'
|
||||
import { User } from './User'
|
||||
|
||||
@Entity("links")
|
||||
export class Link {
|
||||
|
||||
// Unique link id.
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number
|
||||
id: number;
|
||||
|
||||
// Experimental: subdomain which should be a part of the short url.
|
||||
// For instance in the URL "abc.example.com/def", abc is the subdomain.
|
||||
// "def.example.com/def" won't resolve to the URL that "abc.example.com/def" does.
|
||||
@Column({ nullable: true })
|
||||
subdomain: string | null
|
||||
// https://stackoverflow.com/a/67535817
|
||||
@Column({ type: 'varchar', nullable: true })
|
||||
subdomain: string | null;
|
||||
|
||||
// Shortened Uri.
|
||||
@Column()
|
||||
shortUri: string
|
||||
shortUri: string;
|
||||
|
||||
// URL to which the user should be redirected
|
||||
@Column()
|
||||
fullUrl: string
|
||||
fullUrl: string;
|
||||
|
||||
// Unix timestamp of link creation date.
|
||||
@Column('bigint')
|
||||
createDate: number
|
||||
createDate: number;
|
||||
|
||||
// Unix timestamp of when the link should expire.
|
||||
// If null, the link will never expire unless deleted.
|
||||
@Column('bigint', { nullable: true })
|
||||
expiryDate: number | null
|
||||
expiryDate: number | null;
|
||||
|
||||
// Aggregated amount of visits.
|
||||
@Column('bigint')
|
||||
visits: number
|
||||
visits: number;
|
||||
|
||||
// Link privacy:
|
||||
// - true, if link is private
|
||||
// - false, if link can be shown in a list of recent links publicly.
|
||||
@Column()
|
||||
privacy: boolean
|
||||
privacy: boolean;
|
||||
|
||||
// User to which the shortened URL belongs.
|
||||
@ManyToOne(() => User, (user) => user.links, { nullable: true })
|
||||
@JoinTable()
|
||||
author: User | null
|
||||
author: User | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user