[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>
Этот коммит содержится в:
Vishal
2022-05-17 17:00:40 +05:30
коммит произвёл GitHub
родитель 9c851e996c
Коммит fd703a365b
29 изменённых файлов: 341 добавлений и 43 удалений

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

@@ -137,6 +137,8 @@ type Routes struct {
InsightsForTeam *mux.Router // 'api/v4/teams/{team_id:[A-Za-z0-9]+}/top'
InsightsForUser *mux.Router // 'api/v4/users/me/top'
Usage *mux.Router // 'api/v4/usage'
}
type API struct {
@@ -261,6 +263,8 @@ func Init(srv *app.Server) (*API, error) {
api.BaseRoutes.InsightsForTeam = api.BaseRoutes.Team.PathPrefix("/top").Subrouter()
api.BaseRoutes.InsightsForUser = api.BaseRoutes.Users.PathPrefix("/me/top").Subrouter()
api.BaseRoutes.Usage = api.BaseRoutes.APIRoot.PathPrefix("/usage").Subrouter()
api.InitUser()
api.InitBot()
api.InitTeam()
@@ -303,6 +307,7 @@ func Init(srv *app.Server) (*API, error) {
api.InitPermissions()
api.InitExport()
api.InitInsights()
api.InitUsage()
if err := api.InitGraphQL(); err != nil {
return nil, err
}