mirror of
https://github.com/Unkn0wnCat/matrix-veles.git
synced 2025-08-04 09:08:28 +02:00
api: Add graphql endpoint
This commit is contained in:
parent
9e05c54d81
commit
8256b70fcb
21 changed files with 9111 additions and 15 deletions
24
graph/model/list.go
Normal file
24
graph/model/list.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
package model
|
||||
|
||||
import (
|
||||
"github.com/Unkn0wnCat/matrix-veles/internal/db/model"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
type List struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Tags []string `json:"tags"`
|
||||
RawComments []*model.DBComment
|
||||
MaintainerIDs []*primitive.ObjectID
|
||||
}
|
||||
|
||||
func MakeList(dbList *model.DBHashList) *List {
|
||||
return &List{
|
||||
ID: dbList.ID.Hex(),
|
||||
Name: dbList.Name,
|
||||
Tags: dbList.Tags,
|
||||
RawComments: dbList.Comments,
|
||||
MaintainerIDs: dbList.Maintainers,
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue