MM-45494: Add endpoint for message history (#20945)

* add api url

* write sql in store

* update app and client golang driver

* update layers and tests

* change sql query sort

* update layers

* fix style

* fix style post_store.go

* fix comments

* add test for app/post_test.go

* update layers

* fix test

* fix style

* fix style again :)

* add permission check

* add additional checks and tests

* change from nil to empty

* update app-layers

* fix style

* add index for OriginalId for Posts table

* fix postgres query

* update migration file names

* update app-layers

* address PR reviews

* write tests for post store

* fix style

* Update file name

* Update file name 2

* Update file name 3

* Update file name 4

* change the error orders

* update migration file name

---------

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Sinan Sonmez (Chaush)
2023-02-07 15:30:37 +01:00
коммит произвёл GitHub
родитель eabf454764
Коммит 50fec7c892
19 изменённых файлов: 433 добавлений и 0 удалений

Просмотреть файл

@@ -5371,6 +5371,22 @@ func (s *TimerLayerPostStore) GetDirectPostParentsForExportAfter(limit int, afte
return result, err
}
func (s *TimerLayerPostStore) GetEditHistoryForPost(postId string) ([]*model.Post, error) {
start := time.Now()
result, err := s.PostStore.GetEditHistoryForPost(postId)
elapsed := float64(time.Since(start)) / float64(time.Second)
if s.Root.Metrics != nil {
success := "false"
if err == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetEditHistoryForPost", success, elapsed)
}
return result, err
}
func (s *TimerLayerPostStore) GetEtag(channelID string, allowFromCache bool, collapsedThreads bool) string {
start := time.Now()