mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-18 11:47:31 -06:00
add api/v1/instance info handler + instance model (#18)
This commit is contained in:
parent
0cbab627c7
commit
3363e0ebdd
11 changed files with 222 additions and 22 deletions
|
|
@ -34,6 +34,7 @@ import (
|
|||
"github.com/superseriousbusiness/gotosocial/internal/api/client/app"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/auth"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/fileserver"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/instance"
|
||||
mediaModule "github.com/superseriousbusiness/gotosocial/internal/api/client/media"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/status"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/api/security"
|
||||
|
|
@ -68,6 +69,7 @@ var models []interface{} = []interface{}{
|
|||
>smodel.Tag{},
|
||||
>smodel.User{},
|
||||
>smodel.Emoji{},
|
||||
>smodel.Instance{},
|
||||
&oauth.Token{},
|
||||
&oauth.Client{},
|
||||
}
|
||||
|
|
@ -105,6 +107,7 @@ var Run action.GTSAction = func(ctx context.Context, c *config.Config, log *logr
|
|||
// build client api modules
|
||||
authModule := auth.New(c, dbService, oauthServer, log)
|
||||
accountModule := account.New(c, processor, log)
|
||||
instanceModule := instance.New(c, processor, log)
|
||||
appsModule := app.New(c, processor, log)
|
||||
mm := mediaModule.New(c, processor, log)
|
||||
fileServerModule := fileserver.New(c, processor, log)
|
||||
|
|
@ -119,6 +122,7 @@ var Run action.GTSAction = func(ctx context.Context, c *config.Config, log *logr
|
|||
|
||||
// now everything else
|
||||
accountModule,
|
||||
instanceModule,
|
||||
appsModule,
|
||||
mm,
|
||||
fileServerModule,
|
||||
|
|
@ -142,6 +146,10 @@ var Run action.GTSAction = func(ctx context.Context, c *config.Config, log *logr
|
|||
return fmt.Errorf("error creating instance account: %s", err)
|
||||
}
|
||||
|
||||
if err := dbService.CreateInstanceInstance(); err != nil {
|
||||
return fmt.Errorf("error creating instance instance: %s", err)
|
||||
}
|
||||
|
||||
gts, err := New(dbService, router, federator, c)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error creating gotosocial service: %s", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue