[AI assisted]: Improve system console statistics performance (#29899)

```release-note
NONE
```

Co-authored-by: Matthew Birtch <mattbirtch@gmail.com>
Этот коммит содержится в:
Agniva De Sarker
2025-02-04 21:54:01 +05:30
коммит произвёл GitHub
родитель 6046a304b2
Коммит ae9e6174e5
45 изменённых файлов: 1052 добавлений и 407 удалений

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

@@ -20,6 +20,36 @@ type ChannelStore struct {
mock.Mock
}
// AnalyticsCountAll provides a mock function with given fields: teamID
func (_m *ChannelStore) AnalyticsCountAll(teamID string) (map[model.ChannelType]int64, error) {
ret := _m.Called(teamID)
if len(ret) == 0 {
panic("no return value specified for AnalyticsCountAll")
}
var r0 map[model.ChannelType]int64
var r1 error
if rf, ok := ret.Get(0).(func(string) (map[model.ChannelType]int64, error)); ok {
return rf(teamID)
}
if rf, ok := ret.Get(0).(func(string) map[model.ChannelType]int64); ok {
r0 = rf(teamID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[model.ChannelType]int64)
}
}
if rf, ok := ret.Get(1).(func(string) error); ok {
r1 = rf(teamID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// AnalyticsDeletedTypeCount provides a mock function with given fields: teamID, channelType
func (_m *ChannelStore) AnalyticsDeletedTypeCount(teamID string, channelType model.ChannelType) (int64, error) {
ret := _m.Called(teamID, channelType)

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

@@ -505,6 +505,24 @@ func (_m *FileInfoStore) PermanentDeleteForPost(rctx request.CTX, postID string)
return r0
}
// RefreshFileStats provides a mock function with given fields:
func (_m *FileInfoStore) RefreshFileStats() error {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for RefreshFileStats")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// RestoreForPostByIds provides a mock function with given fields: rctx, postId, fileIDs
func (_m *FileInfoStore) RestoreForPostByIds(rctx request.CTX, postId string, fileIDs []string) error {
ret := _m.Called(rctx, postId, fileIDs)

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

@@ -48,6 +48,34 @@ func (_m *PostStore) AnalyticsPostCount(options *model.PostCountOptions) (int64,
return r0, r1
}
// AnalyticsPostCountByTeam provides a mock function with given fields: teamID
func (_m *PostStore) AnalyticsPostCountByTeam(teamID string) (int64, error) {
ret := _m.Called(teamID)
if len(ret) == 0 {
panic("no return value specified for AnalyticsPostCountByTeam")
}
var r0 int64
var r1 error
if rf, ok := ret.Get(0).(func(string) (int64, error)); ok {
return rf(teamID)
}
if rf, ok := ret.Get(0).(func(string) int64); ok {
r0 = rf(teamID)
} else {
r0 = ret.Get(0).(int64)
}
if rf, ok := ret.Get(1).(func(string) error); ok {
r1 = rf(teamID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// AnalyticsPostCountsByDay provides a mock function with given fields: options
func (_m *PostStore) AnalyticsPostCountsByDay(options *model.AnalyticsPostCountsOptions) (model.AnalyticsRows, error) {
ret := _m.Called(options)
@@ -1163,6 +1191,24 @@ func (_m *PostStore) PermanentDeleteByUser(rctx request.CTX, userID string) erro
return r0
}
// RefreshPostStats provides a mock function with given fields:
func (_m *PostStore) RefreshPostStats() error {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for RefreshPostStats")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// Save provides a mock function with given fields: rctx, post
func (_m *PostStore) Save(rctx request.CTX, post *model.Post) (*model.Post, error) {
ret := _m.Called(rctx, post)