github.com/vnforks/kid/v5@v5.22.1-0.20200408055009-b89d99c65676/model/class_view.go (about) 1 // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. 2 // See LICENSE.txt for license information. 3 4 package model 5 6 import ( 7 "encoding/json" 8 "io" 9 ) 10 11 type ClassView struct { 12 ClassId string `json:"class_id"` 13 PrevClassId string `json:"prev_class_id"` 14 } 15 16 func (o *ClassView) ToJson() string { 17 b, _ := json.Marshal(o) 18 return string(b) 19 } 20 21 func ClassViewFromJson(data io.Reader) *ClassView { 22 var o *ClassView 23 json.NewDecoder(data).Decode(&o) 24 return o 25 } 26 27 type ClassViewResponse struct { 28 Status string `json:"status"` 29 LastViewedAtTimes map[string]int64 `json:"last_viewed_at_times"` 30 } 31 32 func (o *ClassViewResponse) ToJson() string { 33 b, _ := json.Marshal(o) 34 return string(b) 35 } 36 37 func ClassViewResponseFromJson(data io.Reader) *ClassViewResponse { 38 var o *ClassViewResponse 39 json.NewDecoder(data).Decode(&o) 40 return o 41 }