-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcms.go
47 lines (40 loc) · 1.07 KB
/
cms.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package main
import (
"net/http"
)
type MessageResponse struct {
CAuthor string `json:"cauthor"`
CTime string `json:"ctime"`
UAuthor string `json:"uauthor"`
UTime string `json:"utime"`
Title string `json:"title"`
Content string `json:"content"`
Language string `json:"lang"`
MessageID int `json:"message_id"`
PlatformID int `json:"platform_id"`
ProductID int `json:"product_id"`
Public int `json:"public"`
TypeID int `json:"type_id"`
Version string `json:"version"`
}
func Message(w http.ResponseWriter, _ *http.Request) {
resp := []*MessageResponse{
&MessageResponse{
CAuthor: "Contentful",
CTime: "2018-11-13T11:19:27.839000+00:00",
UAuthor: "Contentful",
UTime: "2018-11-13T11:19:27.839000+00:00",
Content: `{"pre-login":"Hello! FO 78 yo!","main-menu":"FO78"}`,
Title: "Fallout 78 Lunch",
Language: "en",
PlatformID: 0,
MessageID: 1,
ProductID: 10,
Public: 1,
TypeID: 1,
Version: "10",
},
}
fullResp := buildPlatformSuccess(resp)
DefaultJSONEncoder(w, fullResp)
}