github.com/hahmadia/mattermost-server@v5.11.1+incompatible/model/group_member.go (about) 1 // Copyright (c) 2018-present Mattermost, Inc. All Rights Reserved. 2 // See License.txt for license information. 3 4 package model 5 6 import "net/http" 7 8 type GroupMember struct { 9 GroupId string `json:"group_id"` 10 UserId string `json:"user_id"` 11 CreateAt int64 `json:"create_at"` 12 DeleteAt int64 `json:"delete_at"` 13 } 14 15 func (gm *GroupMember) IsValid() *AppError { 16 if !IsValidId(gm.GroupId) { 17 return NewAppError("GroupMember.IsValid", "model.group_member.group_id.app_error", nil, "", http.StatusBadRequest) 18 } 19 if !IsValidId(gm.UserId) { 20 return NewAppError("GroupMember.IsValid", "model.group_member.user_id.app_error", nil, "", http.StatusBadRequest) 21 } 22 return nil 23 }