First table is working
parent
2485133661
commit
9df45cf83a
@ -0,0 +1,14 @@
|
|||||||
|
{{template "base" .}}
|
||||||
|
|
||||||
|
{{define "title"}}{{ .Dispensa.Title }} • Appunti • PHC{{end}}
|
||||||
|
|
||||||
|
{{define "body"}}
|
||||||
|
<section>
|
||||||
|
<h1>
|
||||||
|
<i class="fas fa-book"></i>
|
||||||
|
{{ .Dispensa.Title }}
|
||||||
|
</h1>
|
||||||
|
<p>
|
||||||
|
{{ .Dispensa.Description }}
|
||||||
|
</p>
|
||||||
|
{{end}}
|
@ -1,44 +1,9 @@
|
|||||||
package model
|
package model
|
||||||
|
|
||||||
import "time"
|
|
||||||
|
|
||||||
// Tables
|
|
||||||
|
|
||||||
type Dispensa struct {
|
type Dispensa struct {
|
||||||
// Id is a unique identifier of this object
|
Id string `json:"id"`
|
||||||
Id string
|
OwnerId string `json:"ownerId"`
|
||||||
// CreatedAt is the time of creation of this object
|
Title string `json:"title"`
|
||||||
CreatedAt time.Time
|
Description string `json:"description"`
|
||||||
// Title of this dispensa
|
Tags []string `json:"tags"`
|
||||||
Title string
|
|
||||||
// Description of this dispensa
|
|
||||||
Description string
|
|
||||||
// Tags for this dispensa, used by search to easily categorize dispense
|
|
||||||
Tags string
|
|
||||||
}
|
|
||||||
|
|
||||||
// Upload represents a file identified by its hash and stored in the appunti content store
|
|
||||||
type Upload struct {
|
|
||||||
// Id is a unique identifier of this object
|
|
||||||
Id string
|
|
||||||
// CreatedAt is the time of creation of this object
|
|
||||||
CreatedAt time.Time
|
|
||||||
// Hash of this file
|
|
||||||
Hash string
|
|
||||||
}
|
|
||||||
|
|
||||||
// ApprovedHash represents an approved hash
|
|
||||||
type ApprovedHash struct {
|
|
||||||
// Hash being approved
|
|
||||||
Hash string
|
|
||||||
// CreatedAt is the creation time of this object
|
|
||||||
CreatedAt time.Time
|
|
||||||
}
|
|
||||||
|
|
||||||
// RejectedHash represents a rejected hash
|
|
||||||
type RejectedHash struct {
|
|
||||||
// Hash being rejected
|
|
||||||
Hash string
|
|
||||||
// CreatedAt is the creation time of this object
|
|
||||||
CreatedAt time.Time
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
package util
|
||||||
|
|
||||||
|
import "log"
|
||||||
|
|
||||||
|
func Must[T any](value T, err error) T {
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return value
|
||||||
|
}
|
Loading…
Reference in New Issue