global.go
1.9 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package protocol
/*
全局变量声明
*/
//机会点赞收藏
const (
MarkFlagZan = 1 //点赞标记
MarkFlagCollect = 2 //收藏标记
)
//标记状态
const (
UnMarkFlag = 0 //取消标记
MarkFlag = 1 //标记 /点赞 /收藏
)
//有效状态
const (
InValid = 0 //无效
Valid = 1 //有效
)
//统计 注意:只能往后面加,不然会乱序
const (
CollectStatic = 1 << iota //收藏
ZanStatic //点赞
CommentStatic //评论
MyCommitChance //我提交的机会
MyCommitChanceWait //我提交的机会-待审批
MyCommitChanceReturn //我提交的机会-退回
MyCommitChancePass //我提交的机会-已通过
MyAuditChance //我审核的机会
MyAuditChanceWait //我审核的机会-待我审批
MyAuditChancePass //我审核的机会-已通过
MyAuditChanceReturn //我审核的机会-已退回
)
var MapStaticName map[int64]string
func init() {
MapStaticName = make(map[int64]string)
MapStaticName[CollectStatic] = "收藏"
MapStaticName[ZanStatic] = "点赞"
MapStaticName[CommentStatic] = "评论"
MapStaticName[MyCommitChance] = "我提交的机会"
MapStaticName[MyCommitChanceWait] = "我提交的机会-待审批"
MapStaticName[MyCommitChanceReturn] = "我提交的机会-退回"
MapStaticName[MyCommitChancePass] = "我提交的机会-已通过"
MapStaticName[MyAuditChance] = "我审核的机会"
MapStaticName[MyAuditChanceWait] = "我审核的机会-待我审批"
MapStaticName[MyAuditChancePass] = "我审核的机会-已通过"
MapStaticName[MyAuditChanceReturn] = "我审核的机会-已退回"
}
//用户项
type UserItem struct {
Uid int64 `json:"uid"`
Name string `json:"name"`
}
//角色项
type Role struct {
Id int `json:"id"`
Name string `json:"name"`
}
type NameItem struct {
Id int `json:"id"`
Name string `json:"name"`
}