-
Notifications
You must be signed in to change notification settings - Fork 9
/
KcQaSolution.go
58 lines (53 loc) · 1.68 KB
/
KcQaSolution.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
56
57
58
package kclub
import (
"sync"
)
// KcQaSolution 结构体
type KcQaSolution struct {
// 子知识答案摘要
Summary string `json:"summary,omitempty" xml:"summary,omitempty"`
// 子知识答案额外内容
ExtraContent string `json:"extra_content,omitempty" xml:"extra_content,omitempty"`
// 子知识答案视角,逗号分隔
ContentView string `json:"content_view,omitempty" xml:"content_view,omitempty"`
// 子知识答案
Content string `json:"content,omitempty" xml:"content,omitempty"`
// 子知识答案编辑时间
GmtModified string `json:"gmt_modified,omitempty" xml:"gmt_modified,omitempty"`
// 子知识答案创建时间
GmtCreate string `json:"gmt_create,omitempty" xml:"gmt_create,omitempty"`
// 子知识答案纯文本
PlainText string `json:"plain_text,omitempty" xml:"plain_text,omitempty"`
// 子知识答案视角
Type int64 `json:"type,omitempty" xml:"type,omitempty"`
// 子知识答案类型
ContentType int64 `json:"content_type,omitempty" xml:"content_type,omitempty"`
// 子知识问题id
QuestionId int64 `json:"question_id,omitempty" xml:"question_id,omitempty"`
// 子知识答案id
Id int64 `json:"id,omitempty" xml:"id,omitempty"`
}
var poolKcQaSolution = sync.Pool{
New: func() any {
return new(KcQaSolution)
},
}
// GetKcQaSolution() 从对象池中获取KcQaSolution
func GetKcQaSolution() *KcQaSolution {
return poolKcQaSolution.Get().(*KcQaSolution)
}
// ReleaseKcQaSolution 释放KcQaSolution
func ReleaseKcQaSolution(v *KcQaSolution) {
v.Summary = ""
v.ExtraContent = ""
v.ContentView = ""
v.Content = ""
v.GmtModified = ""
v.GmtCreate = ""
v.PlainText = ""
v.Type = 0
v.ContentType = 0
v.QuestionId = 0
v.Id = 0
poolKcQaSolution.Put(v)
}