mirror of
https://github.com/Unkn0wnCat/matrix-veles.git
synced 2025-08-04 00:58:39 +02:00
api: Add graphql endpoint
This commit is contained in:
parent
9e05c54d81
commit
8256b70fcb
21 changed files with 9111 additions and 15 deletions
21
graph/model/user.go
Normal file
21
graph/model/user.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package model
|
||||
|
||||
import model "github.com/Unkn0wnCat/matrix-veles/internal/db/model"
|
||||
|
||||
type User struct {
|
||||
ID string `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Admin *bool `json:"admin"`
|
||||
MatrixLinks []*string `json:"matrixLinks"`
|
||||
PendingMatrixLinks []*string `json:"pendingMatrixLinks"`
|
||||
}
|
||||
|
||||
func MakeUser(dbUser *model.DBUser) *User {
|
||||
return &User{
|
||||
ID: dbUser.ID.Hex(),
|
||||
Username: dbUser.Username,
|
||||
Admin: dbUser.Admin,
|
||||
MatrixLinks: dbUser.MatrixLinks,
|
||||
PendingMatrixLinks: dbUser.PendingMatrixLinks,
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue