Basic API works.
This commit is contained in:
+6
-5
@@ -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
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user