forked from hjqhezgh/lessgo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
comp_blankpanel.go
55 lines (41 loc) · 962 Bytes
/
comp_blankpanel.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
48
49
50
51
52
53
54
55
// Title:空白页面方便用户可以自己填词内容
//
// Description:
//
// Author:black
//
// Createtime:2013-08-09 16:48
//
// Version:1.0
//
// 修改历史:版本号 修改日期 修改人 修改说明
//
// 1.0 2013-08-09 16:48 black 创建文档
package lessgo
import (
"bytes"
"text/template"
)
type blankPanel struct {
Content string `xml:"content"`
}
func (blankPanel blankPanel) generate(terminal, packageName string, employee Employee) []byte {
var t *template.Template
var buf bytes.Buffer
t = template.New("blankpanel.html")
t, err := t.ParseFiles("../lessgo/template/component/" + terminal + "/blankpanel.html")
if err != nil {
Log.Error(err.Error())
return []byte{}
}
data := make(map[string]interface{})
data["BlankPanel"] = blankPanel
data["Terminal"] = terminal
data["Employee"] = employee
err = t.Execute(&buf, data)
if err != nil {
Log.Error(err.Error())
return []byte{}
}
return buf.Bytes()
}