PLT-5073 Improve performance of /channels/view endpoint (#4881)
* Improve performance of /channels/view endpoint * Fix store unit test
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ffd6ccde2e
Коммит
217cdf447a
@@ -11,7 +11,6 @@ import (
|
||||
type ChannelView struct {
|
||||
ChannelId string `json:"channel_id"`
|
||||
PrevChannelId string `json:"prev_channel_id"`
|
||||
Time int64 `json:"time"`
|
||||
}
|
||||
|
||||
func (o *ChannelView) ToJson() string {
|
||||
|
||||
@@ -1350,10 +1350,9 @@ func (c *Client) UpdateLastViewedAt(channelId string, active bool) (*Result, *Ap
|
||||
}
|
||||
|
||||
// ViewChannel performs all the actions related to viewing a channel. This includes marking
|
||||
// the channel and the previous one as read, marking the channel as being actively viewed.
|
||||
// the channel and the previous one as read, and marking the channel as being actively viewed.
|
||||
// ChannelId is required but may be blank to indicate no channel is being viewed.
|
||||
// PrevChannelId is optional, populate to indicate a channel switch occurred. Optionally
|
||||
// provide a non-zero Time, in Unix milliseconds, to manually set the viewing time.
|
||||
// PrevChannelId is optional, populate to indicate a channel switch occurred.
|
||||
func (c *Client) ViewChannel(params ChannelView) (bool, *ResponseMetadata) {
|
||||
if r, err := c.DoApiPost(c.GetTeamRoute()+"/channels/view", params.ToJson()); err != nil {
|
||||
return false, &ResponseMetadata{StatusCode: r.StatusCode, Error: err}
|
||||
|
||||
@@ -22,7 +22,7 @@ type Status struct {
|
||||
Status string `json:"status"`
|
||||
Manual bool `json:"manual"`
|
||||
LastActivityAt int64 `json:"last_activity_at"`
|
||||
ActiveChannel string `json:"active_channel"`
|
||||
ActiveChannel string `json:"active_channel" db:"-"`
|
||||
}
|
||||
|
||||
func (o *Status) ToJson() string {
|
||||
|
||||
Ссылка в новой задаче
Block a user