github.com/haalcala/mattermost-server-change-repo@v0.0.0-20210713015153-16753fbeee5f/services/searchengine/bleveengine/testlib.go (about)

     1  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
     2  // See LICENSE.txt for license information.
     3  
     4  package bleveengine
     5  
     6  import (
     7  	"fmt"
     8  
     9  	"github.com/mattermost/mattermost-server/v5/model"
    10  )
    11  
    12  func createPost(userId string, channelId string, message string) *model.Post {
    13  	post := &model.Post{
    14  		Message:       message,
    15  		ChannelId:     channelId,
    16  		PendingPostId: model.NewId() + ":" + fmt.Sprint(model.GetMillis()),
    17  		UserId:        userId,
    18  		CreateAt:      1000000,
    19  	}
    20  	post.PreSave()
    21  
    22  	return post
    23  }