New report router and user reporting refactoring (#25713)

* Added materialized view migration

* Renamed mat view

* Added channel membership mat view and indexes

* Added channel membership mat view and indexes

* Added new index

* WIP

* Simplifying user reporting code

* Created app and API layer for cahnnel reporting, reporting refactoring in general

* New router

* Remobved channel reporting meanwhile

* Upodated autogenerated stuff

* Lint fix

* Fixed typo

* api vet

* i18n fix

* Fixed API vetting and removed channel reporting constants

* yaml

* removed app pagination tests
Этот коммит содержится в:
Harshil Sharma
2023-12-14 21:19:19 +05:30
коммит произвёл GitHub
родитель 32880efa25
Коммит 97a23d791e
16 изменённых файлов: 380 добавлений и 1339 удалений

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

@@ -166,6 +166,10 @@ func (c *Client4) usersRoute() string {
return "/users"
}
func (c *Client4) reportsRoute() string {
return "/reports"
}
func (c *Client4) userRoute(userId string) string {
return fmt.Sprintf(c.usersRoute()+"/%v", userId)
}
@@ -1918,7 +1922,7 @@ func (c *Client4) EnableUserAccessToken(ctx context.Context, tokenId string) (*R
return BuildResponse(r), nil
}
func (c *Client4) GetUsersForReporting(ctx context.Context, options *UserReportOptionsAPI) ([]*UserReport, *Response, error) {
func (c *Client4) GetUsersForReporting(ctx context.Context, options *UserReportOptions) ([]*UserReport, *Response, error) {
values := url.Values{}
if options.SortColumn != "" {
values.Set("sort_column", options.SortColumn)
@@ -1954,7 +1958,7 @@ func (c *Client4) GetUsersForReporting(ctx context.Context, options *UserReportO
values.Set("date_range", options.DateRange)
}
r, err := c.DoAPIGet(ctx, c.usersRoute()+"/report?"+values.Encode(), "")
r, err := c.DoAPIGet(ctx, c.reportsRoute()+"/users?"+values.Encode(), "")
if err != nil {
return nil, BuildResponse(r), err
}