[MM-43917] Cloud Freemium limits API: messages/posts (#20152)
* WIP - Add api and app funcs * Add test cases * Add utils testcases * Exclude deleted posts * Add doc for func * Move api from cloud to usage * Allow api access to authenticated users * Change int to int64 * Fix lint issue * Simplify err check Co-authored-by: Ashish Bhate <ashish.bhate@mattermost.com> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> Co-authored-by: Ashish Bhate <ashish.bhate@mattermost.com>
Этот коммит содержится в:
@@ -297,7 +297,7 @@ func (ts *TelemetryService) trackActivity() {
|
||||
deletedPrivateChannelCount = dpccr
|
||||
}
|
||||
|
||||
postsCount, _ = ts.dbStore.Post().AnalyticsPostCount("", false, false)
|
||||
postsCount, _ = ts.dbStore.Post().AnalyticsPostCount(&model.PostCountOptions{})
|
||||
|
||||
postCountsOptions := &model.AnalyticsPostCountsOptions{TeamId: "", BotsOnly: false, YesterdayOnly: true}
|
||||
postCountsYesterday, _ := ts.dbStore.Post().AnalyticsPostCountsByDay(postCountsOptions)
|
||||
|
||||
@@ -112,7 +112,7 @@ func initializeMocks(cfg *model.Config) (*mocks.ServerIface, *storeMocks.Store,
|
||||
channelStore.On("GroupSyncedChannelCount").Return(int64(17), nil)
|
||||
|
||||
postStore := storeMocks.PostStore{}
|
||||
postStore.On("AnalyticsPostCount", "", false, false).Return(int64(1000), nil)
|
||||
postStore.On("AnalyticsPostCount", &model.PostCountOptions{}).Return(int64(1000), nil)
|
||||
postStore.On("AnalyticsPostCountsByDay", &model.AnalyticsPostCountsOptions{TeamId: "", BotsOnly: false, YesterdayOnly: true}).Return(model.AnalyticsRows{}, nil)
|
||||
postStore.On("AnalyticsPostCountsByDay", &model.AnalyticsPostCountsOptions{TeamId: "", BotsOnly: true, YesterdayOnly: true}).Return(model.AnalyticsRows{}, nil)
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user