Basic API works.

This commit is contained in:
2020-05-08 15:54:40 +02:00
parent 6837e7b4c8
commit 564ac0d24a
36 changed files with 1450 additions and 80 deletions
+6 -5
View File
@@ -1,11 +1,12 @@
package models
type Item struct {
ID string `db:"item_id"`
Name string `db:"name"`
Description string `db:"description"`
Tags []string `db:"tags"`
ImageURL *string `db:"image_url"`
ID string `db:"item_id"`
Name string `db:"name"`
Description string `db:"description"`
Tags []string `db:"tags"`
QuantityUnit *string `db:"quantity_unit"`
ImageURL *string `db:"image_url"`
}
type ItemFilter struct {
+3 -1
View File
@@ -1,5 +1,7 @@
package models
import "unicode"
// A Project is a vague category for issues. It's use depend on the user's judgement, as it could represent
// an entire hobby/job or a single project within one.
type Project struct {
@@ -27,7 +29,7 @@ func (project *Project) ValidKey() bool {
}
for _, r := range project.ID {
if r < 'A' && r > 'Z' {
if !unicode.IsNumber(r) && !unicode.IsUpper(r) && !unicode.Is(unicode.Hiragana, r) && !unicode.Is(unicode.Katakana, r) && !unicode.Is(unicode.Han, r) {
return false
}
}
+9 -2
View File
@@ -3,7 +3,14 @@ package models
// ProjectStatus is an entry denoting a status a project's issues can have.
type ProjectStatus struct {
ProjectID string `db:"project_id"`
Stage int `db:"status_stage"`
Name string `db:"status_name"`
Stage int `db:"stage"`
Name string `db:"name"`
Description string `db:"description"`
}
// ProjectStatusFilter is a filter for listing ProjectStatus.
type ProjectStatusFilter struct {
ProjectID *string
MinStage *int
MaxStage *int
}