2017-04-12 08:27:57 -04:00
|
|
|
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
2016-12-21 16:35:01 -05:00
|
|
|
// See License.txt for license information.
|
|
|
|
|
|
|
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"encoding/json"
|
|
|
|
|
"io"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type ChannelView struct {
|
|
|
|
|
ChannelId string `json:"channel_id"`
|
|
|
|
|
PrevChannelId string `json:"prev_channel_id"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (o *ChannelView) ToJson() string {
|
2018-01-30 17:23:00 -06:00
|
|
|
b, _ := json.Marshal(o)
|
|
|
|
|
return string(b)
|
2016-12-21 16:35:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func ChannelViewFromJson(data io.Reader) *ChannelView {
|
2018-01-30 17:23:00 -06:00
|
|
|
var o *ChannelView
|
|
|
|
|
json.NewDecoder(data).Decode(&o)
|
|
|
|
|
return o
|
2016-12-21 16:35:01 -05:00
|
|
|
}
|
2017-09-29 11:45:59 -04:00
|
|
|
|
|
|
|
|
type ChannelViewResponse struct {
|
|
|
|
|
Status string `json:"status"`
|
|
|
|
|
LastViewedAtTimes map[string]int64 `json:"last_viewed_at_times"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (o *ChannelViewResponse) ToJson() string {
|
2018-01-30 17:23:00 -06:00
|
|
|
b, _ := json.Marshal(o)
|
|
|
|
|
return string(b)
|
2017-09-29 11:45:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func ChannelViewResponseFromJson(data io.Reader) *ChannelViewResponse {
|
2018-01-30 17:23:00 -06:00
|
|
|
var o *ChannelViewResponse
|
|
|
|
|
json.NewDecoder(data).Decode(&o)
|
|
|
|
|
return o
|
2017-09-29 11:45:59 -04:00
|
|
|
}
|