2023-08-07 21:30:30 +03:00
|
|
|
package models
|
|
|
|
|
|
|
|
import (
|
|
|
|
_ "database/sql"
|
2023-08-09 14:31:23 +03:00
|
|
|
"github.com/google/uuid"
|
2023-08-07 21:30:30 +03:00
|
|
|
"github.com/jackc/pgtype"
|
|
|
|
)
|
|
|
|
|
2023-08-09 14:31:23 +03:00
|
|
|
type Package struct {
|
2023-08-10 22:24:41 +03:00
|
|
|
ID uint64 `db:"id" json:"id"` // package id
|
2023-08-10 17:53:11 +03:00
|
|
|
Name string `db:"name" json:"name"` // service name, last component path
|
|
|
|
URL string `db:"url" json:"url"` // scm url
|
|
|
|
Modules []uint64 `db:"modules" json:"modules"` // parsed go.mod modules
|
2023-08-10 22:24:41 +03:00
|
|
|
Issues []uint64 `db:"issues" json:"issues,omitempty"` // issues list
|
|
|
|
Comments []uint64 `db:"comments" json:"comments,omitempty"`
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
|
2023-08-09 14:31:23 +03:00
|
|
|
type Module struct {
|
2023-08-10 17:53:11 +03:00
|
|
|
ID int64 `db:"id"`
|
|
|
|
Name string `db:"name"` // module name
|
|
|
|
Version string `db:"version"` // module
|
|
|
|
Package int64 `db:"package"`
|
|
|
|
LastVersion string `db:"last_version"`
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
|
2023-08-09 14:31:23 +03:00
|
|
|
type Issue struct {
|
2023-08-07 21:30:30 +03:00
|
|
|
ID int64 `db:"id"`
|
|
|
|
Status int64 `db:"status"`
|
|
|
|
Desc string `db:"desc"`
|
2023-08-09 14:31:23 +03:00
|
|
|
Package int64 `db:"package"`
|
|
|
|
Modules []int64 `db:"modules"`
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
|
2023-08-09 14:31:23 +03:00
|
|
|
type Comment struct {
|
2023-08-10 12:38:55 +03:00
|
|
|
ID int64 `db:"id" json:"id"`
|
|
|
|
Text string `db:"value" json:"text"`
|
|
|
|
Created pgtype.Date `db:"created" json:"created"`
|
|
|
|
Updated pgtype.Date `db:"updated" json:"updated,omitempty"`
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
2023-08-09 14:31:23 +03:00
|
|
|
|
|
|
|
type Dashboard struct {
|
2023-08-10 12:38:55 +03:00
|
|
|
ID int64 `db:"id"`
|
|
|
|
Uuid uuid.UUID `db:"uuid"`
|
|
|
|
Packages []int64 `db:"package"`
|
2023-08-09 14:31:23 +03:00
|
|
|
}
|