summaryrefslogtreecommitdiffstats
path: root/model/compliance_post.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-03-10 09:39:05 -0800
committer=Corey Hulen <corey@hulen.com>2016-03-10 09:39:05 -0800
commit6d21a339dc3aedd373faacd5163462c76263ab07 (patch)
tree3fcbe39b4268a5bb45d93992e7bff7e1788eadd7 /model/compliance_post.go
parentcbf84c8beaa0896daaf82ecdb63f236da4d64c0e (diff)
downloadchat-6d21a339dc3aedd373faacd5163462c76263ab07.tar.gz
chat-6d21a339dc3aedd373faacd5163462c76263ab07.tar.bz2
chat-6d21a339dc3aedd373faacd5163462c76263ab07.zip
PLT-2115 adding compliance feature to enterprise
Diffstat (limited to 'model/compliance_post.go')
-rw-r--r--model/compliance_post.go92
1 files changed, 92 insertions, 0 deletions
diff --git a/model/compliance_post.go b/model/compliance_post.go
new file mode 100644
index 000000000..636be8f17
--- /dev/null
+++ b/model/compliance_post.go
@@ -0,0 +1,92 @@
+// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+package model
+
+import (
+ "time"
+)
+
+type CompliancePost struct {
+
+ // From Team
+ TeamName string
+ TeamDisplayName string
+
+ // From Channel
+ ChannelName string
+ ChannelDisplayName string
+
+ // From User
+ UserUsername string
+ UserEmail string
+ UserNickname string
+
+ // From Post
+ PostId string
+ PostCreateAt int64
+ PostUpdateAt int64
+ PostDeleteAt int64
+ PostRootId string
+ PostParentId string
+ PostOriginalId string
+ PostMessage string
+ PostType string
+ PostProps string
+ PostHashtags string
+ PostFilenames string
+}
+
+func CompliancePostHeader() []string {
+ return []string{
+ "TeamName",
+ "TeamDisplayName",
+
+ "ChannelName",
+ "ChannelDisplayName",
+
+ "UserUsername",
+ "UserEmail",
+ "UserNickname",
+
+ "PostId",
+ "PostCreateAt",
+ "PostUpdateAt",
+ "PostDeleteAt",
+ "PostRootId",
+ "PostParentId",
+ "PostOriginalId",
+ "PostMessage",
+ "PostType",
+ "PostProps",
+ "PostHashtags",
+ "PostFilenames",
+ }
+}
+
+func (me *CompliancePost) Row() []string {
+ return []string{
+ me.TeamName,
+ me.TeamDisplayName,
+
+ me.ChannelName,
+ me.ChannelDisplayName,
+
+ me.UserUsername,
+ me.UserEmail,
+ me.UserNickname,
+
+ me.PostId,
+ time.Unix(0, me.PostCreateAt*1000).Format(time.RFC3339),
+ time.Unix(0, me.PostUpdateAt*1000).Format(time.RFC3339),
+ time.Unix(0, me.PostDeleteAt*1000).Format(time.RFC3339),
+ me.PostRootId,
+ me.PostParentId,
+ me.PostOriginalId,
+ me.PostMessage,
+ me.PostType,
+ me.PostProps,
+ me.PostHashtags,
+ me.PostFilenames,
+ }
+}