mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 04:52:24 -05:00
[feature] Implement markers API (#1989)
* Implement markers API Fixes #1856 * Correct import grouping in markers files * Regenerate Swagger for markers API * Shorten names for readability * Cache markers for 6 hours * Update DB ref * Update envparsing.sh
This commit is contained in:
parent
cf4bd700fb
commit
b874e9251e
29 changed files with 1083 additions and 3 deletions
|
|
@ -41,6 +41,7 @@ var testModels = []interface{}{
|
|||
>smodel.FollowRequest{},
|
||||
>smodel.List{},
|
||||
>smodel.ListEntry{},
|
||||
>smodel.Marker{},
|
||||
>smodel.MediaAttachment{},
|
||||
>smodel.Mention{},
|
||||
>smodel.Status{},
|
||||
|
|
@ -287,6 +288,12 @@ func StandardDBSetup(db db.DB, accounts map[string]*gtsmodel.Account) {
|
|||
}
|
||||
}
|
||||
|
||||
for _, v := range NewTestMarkers() {
|
||||
if err := db.Put(ctx, v); err != nil {
|
||||
log.Panic(nil, err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := db.CreateInstanceAccount(ctx); err != nil {
|
||||
log.Panic(nil, err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2007,6 +2007,25 @@ func NewTestListEntries() map[string]*gtsmodel.ListEntry {
|
|||
}
|
||||
}
|
||||
|
||||
func NewTestMarkers() map[string]*gtsmodel.Marker {
|
||||
return map[string]*gtsmodel.Marker{
|
||||
"local_account_1_home_marker": {
|
||||
AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
|
||||
Name: gtsmodel.MarkerNameHome,
|
||||
UpdatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
|
||||
Version: 0,
|
||||
LastReadID: "01F8MH82FYRXD2RC6108DAJ5HB",
|
||||
},
|
||||
"local_account_1_notification_marker": {
|
||||
AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
|
||||
Name: gtsmodel.MarkerNameNotifications,
|
||||
UpdatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
|
||||
Version: 4,
|
||||
LastReadID: "01F8Q0ANPTWW10DAKTX7BRPBJP",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func NewTestBlocks() map[string]*gtsmodel.Block {
|
||||
return map[string]*gtsmodel.Block{
|
||||
"local_account_2_block_remote_account_1": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue