2017-08-16 14:37:37 -07:00
|
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
2020-08-09 15:29:54 -07:00
|
|
|
// See LICENSE.txt for license information.
|
2016-04-10 14:39:38 -07:00
|
|
|
|
|
|
|
package model
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"io"
|
|
|
|
)
|
|
|
|
|
2017-03-25 13:04:10 -07:00
|
|
|
const (
|
2020-08-09 15:29:54 -07:00
|
|
|
MaxImageSize = int64(6048 * 4032) // 24 megapixels, roughly 36MB as a raw image
|
2017-03-25 13:04:10 -07:00
|
|
|
)
|
|
|
|
|
2016-04-10 14:39:38 -07:00
|
|
|
type FileUploadResponse struct {
|
2016-11-12 13:00:53 -08:00
|
|
|
FileInfos []*FileInfo `json:"file_infos"`
|
|
|
|
ClientIds []string `json:"client_ids"`
|
2016-04-10 14:39:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
func FileUploadResponseFromJson(data io.Reader) *FileUploadResponse {
|
2018-11-18 09:55:05 -08:00
|
|
|
var o *FileUploadResponse
|
|
|
|
json.NewDecoder(data).Decode(&o)
|
|
|
|
return o
|
2016-04-10 14:39:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
func (o *FileUploadResponse) ToJson() string {
|
2018-11-18 09:55:05 -08:00
|
|
|
b, _ := json.Marshal(o)
|
|
|
|
return string(b)
|
2016-04-10 14:39:38 -07:00
|
|
|
}
|