all repos

onasty @ f469c12

a one-time notes service

onasty/internal/dtos/note.go (view raw)

Smirnov Oleksandr Smirnov Oleksandr
ss2316544@gmail.com
feat(note): return `burn_before_expiration` (#149), 11 months ago
1
package dtos
2
3
import (
4
	"time"
5
6
	"github.com/gofrs/uuid/v5"
7
)
8
9
type NoteSlug = string
10
11
type GetNote struct {
12
	Content              string
13
	BurnBeforeExpiration bool
14
	ReadAt               time.Time
15
	CreatedAt            time.Time
16
	ExpiresAt            time.Time
17
}
18
19
type NoteMetadata struct {
20
	HasPassword bool
21
	CreatedAt   time.Time
22
}
23
24
type CreateNote struct {
25
	Content              string
26
	UserID               uuid.UUID
27
	Slug                 NoteSlug
28
	BurnBeforeExpiration bool
29
	Password             string
30
	CreatedAt            time.Time
31
	ExpiresAt            time.Time
32
}
33
34
type NoteDetailed struct {
35
	Content              string
36
	Slug                 NoteSlug
37
	BurnBeforeExpiration bool
38
	HasPassword          bool
39
	CreatedAt            time.Time
40
	ExpiresAt            time.Time
41
	ReadAt               time.Time
42
}
43
44
type PatchNote struct {
45
	ExpiresAt            *time.Time
46
	BurnBeforeExpiration *bool
47
}