Fixing master (#13900)
* updating api_timer_layer_generated.go * Fixing GetFileInfos * Fixing TestPluginAPIGetFileInfos * Remove file.go.orig
Этот коммит содержится в:
@@ -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) {
|
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) {
|
func (a *App) GetFile(fileId string) ([]byte, *model.AppError) {
|
||||||
|
|||||||
1139
app/file.go.orig
1139
app/file.go.orig
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
@@ -367,7 +367,7 @@ func TestPluginAPIGetFileInfos(t *testing.T) {
|
|||||||
)
|
)
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
defer func() {
|
defer func() {
|
||||||
th.App.Srv.Store.FileInfo().PermanentDelete(fileInfo1.Id)
|
th.App.Srv().Store.FileInfo().PermanentDelete(fileInfo1.Id)
|
||||||
th.App.RemoveFile(fileInfo1.Path)
|
th.App.RemoveFile(fileInfo1.Path)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@@ -381,7 +381,7 @@ func TestPluginAPIGetFileInfos(t *testing.T) {
|
|||||||
)
|
)
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
defer func() {
|
defer func() {
|
||||||
th.App.Srv.Store.FileInfo().PermanentDelete(fileInfo2.Id)
|
th.App.Srv().Store.FileInfo().PermanentDelete(fileInfo2.Id)
|
||||||
th.App.RemoveFile(fileInfo2.Path)
|
th.App.RemoveFile(fileInfo2.Path)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@@ -395,7 +395,7 @@ func TestPluginAPIGetFileInfos(t *testing.T) {
|
|||||||
)
|
)
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
defer func() {
|
defer func() {
|
||||||
th.App.Srv.Store.FileInfo().PermanentDelete(fileInfo3.Id)
|
th.App.Srv().Store.FileInfo().PermanentDelete(fileInfo3.Id)
|
||||||
th.App.RemoveFile(fileInfo3.Path)
|
th.App.RemoveFile(fileInfo3.Path)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|||||||
@@ -713,6 +713,13 @@ func (api *apiTimerLayer) GetFileInfo(fileId string) (*model.FileInfo, *model.Ap
|
|||||||
return _returnsA, _returnsB
|
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) {
|
func (api *apiTimerLayer) GetFile(fileId string) ([]byte, *model.AppError) {
|
||||||
startTime := timePkg.Now()
|
startTime := timePkg.Now()
|
||||||
_returnsA, _returnsB := api.apiImpl.GetFile(fileId)
|
_returnsA, _returnsB := api.apiImpl.GetFile(fileId)
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ func (g *hooksRPCClient) {{.Name}}{{funcStyle .Params}} {{funcStyle .Return}} {
|
|||||||
_returns := &{{.Name | obscure}}Returns{}
|
_returns := &{{.Name | obscure}}Returns{}
|
||||||
if g.implemented[{{.Name}}Id] {
|
if g.implemented[{{.Name}}Id] {
|
||||||
if err := g.client.Call("Plugin.{{.Name}}", _args, _returns); err != nil {
|
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 }}
|
{{ if .Return }} return {{destruct "_returns." .Return}} {{ end }}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user