* updating api_timer_layer_generated.go

* Fixing GetFileInfos

* Fixing TestPluginAPIGetFileInfos

* Remove file.go.orig
Этот коммит содержится в:
Ali Farooq
2020-02-14 18:08:00 -05:00
коммит произвёл GitHub
родитель e4fb5791b0
Коммит bd9d674006
5 изменённых файлов: 12 добавлений и 1144 удалений

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

@@ -1098,7 +1098,7 @@ func (a *App) GetFileInfo(fileId string) (*model.FileInfo, *model.AppError) {
}
func (a *App) GetFileInfos(page, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError) {
return a.Srv.Store.FileInfo().GetWithOptions(page, perPage, opt)
return a.Srv().Store.FileInfo().GetWithOptions(page, perPage, opt)
}
func (a *App) GetFile(fileId string) ([]byte, *model.AppError) {

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@@ -367,7 +367,7 @@ func TestPluginAPIGetFileInfos(t *testing.T) {
)
require.Nil(t, err)
defer func() {
th.App.Srv.Store.FileInfo().PermanentDelete(fileInfo1.Id)
th.App.Srv().Store.FileInfo().PermanentDelete(fileInfo1.Id)
th.App.RemoveFile(fileInfo1.Path)
}()
@@ -381,7 +381,7 @@ func TestPluginAPIGetFileInfos(t *testing.T) {
)
require.Nil(t, err)
defer func() {
th.App.Srv.Store.FileInfo().PermanentDelete(fileInfo2.Id)
th.App.Srv().Store.FileInfo().PermanentDelete(fileInfo2.Id)
th.App.RemoveFile(fileInfo2.Path)
}()
@@ -395,7 +395,7 @@ func TestPluginAPIGetFileInfos(t *testing.T) {
)
require.Nil(t, err)
defer func() {
th.App.Srv.Store.FileInfo().PermanentDelete(fileInfo3.Id)
th.App.Srv().Store.FileInfo().PermanentDelete(fileInfo3.Id)
th.App.RemoveFile(fileInfo3.Path)
}()

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

@@ -713,6 +713,13 @@ func (api *apiTimerLayer) GetFileInfo(fileId string) (*model.FileInfo, *model.Ap
return _returnsA, _returnsB
}
func (api *apiTimerLayer) GetFileInfos(page, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError) {
startTime := timePkg.Now()
_returnsA, _returnsB := api.apiImpl.GetFileInfos(page, perPage, opt)
api.recordTime(startTime, "GetFileInfos", true)
return _returnsA, _returnsB
}
func (api *apiTimerLayer) GetFile(fileId string) ([]byte, *model.AppError) {
startTime := timePkg.Now()
_returnsA, _returnsB := api.apiImpl.GetFile(fileId)

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

@@ -267,7 +267,7 @@ func (g *hooksRPCClient) {{.Name}}{{funcStyle .Params}} {{funcStyle .Return}} {
_returns := &{{.Name | obscure}}Returns{}
if g.implemented[{{.Name}}Id] {
if err := g.client.Call("Plugin.{{.Name}}", _args, _returns); err != nil {
g.Log().Error("RPC call {{.Name}} to plugin failed.", mlog.Err(err))
g.log.Error("RPC call {{.Name}} to plugin failed.", mlog.Err(err))
}
}
{{ if .Return }} return {{destruct "_returns." .Return}} {{ end }}