Implement upload and get file endpoints for APIv4 (#5396)
* Implement POST /files endpoint for APIv4
* Implement GET /files/{file_id} endpoint for APIv4
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
4e7dbc3bb0
Коммит
91fe8bb2c0
@@ -3,6 +3,9 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"net/http"
|
||||
|
||||
"github.com/mattermost/platform/einterfaces"
|
||||
"github.com/mattermost/platform/model"
|
||||
"github.com/mattermost/platform/utils"
|
||||
@@ -91,7 +94,11 @@ func (fs SqlFileInfoStore) Get(id string) StoreChannel {
|
||||
WHERE
|
||||
Id = :Id
|
||||
AND DeleteAt = 0`, map[string]interface{}{"Id": id}); err != nil {
|
||||
result.Err = model.NewLocAppError("SqlFileInfoStore.Get", "store.sql_file_info.get.app_error", nil, "id="+id+", "+err.Error())
|
||||
if err == sql.ErrNoRows {
|
||||
result.Err = model.NewAppError("SqlFileInfoStore.Get", "store.sql_file_info.get.app_error", nil, "id="+id+", "+err.Error(), http.StatusNotFound)
|
||||
} else {
|
||||
result.Err = model.NewLocAppError("SqlFileInfoStore.Get", "store.sql_file_info.get.app_error", nil, "id="+id+", "+err.Error())
|
||||
}
|
||||
} else {
|
||||
result.Data = info
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user