master
wangshuai 5 years ago
parent 75a05744b6
commit 6d836a1f29

@ -24,11 +24,11 @@ type CurrentUserInfo struct {
Signature string `json:"signature" example:"海纳百川,有容乃大"` Signature string `json:"signature" example:"海纳百川,有容乃大"`
Title string `json:"title" example:"大数据专家"` Title string `json:"title" example:"大数据专家"`
Group string `json:"group" example:"东北师大理想股份有限公司-数智创新中心"` Group string `json:"group" example:"东北师大理想股份有限公司-数智创新中心"`
Tags string `json:"tags" example:"[{key:0,label:大数据},{key:1,label:人工智能},{key:2,label:物联网},{key:3,label:架构},{key:4,label:数据分析},{key:5,label:海纳百川}]"` Tags []map[string]interface{} `json:"tags" example:"[{key:0,label:大数据},{key:1,label:人工智能},{key:2,label:物联网},{key:3,label:架构},{key:4,label:数据分析},{key:5,label:海纳百川}]"`
NotifyCount int `json:"notifyCount" example:"12"` NotifyCount int `json:"notifyCount" example:"12"`
UnreadCount int `json:"unreadCount" example:"11"` UnreadCount int `json:"unreadCount" example:"11"`
Country string `json:"country" example:"China"` Country string `json:"country" example:"China"`
Geographic string `json:"geographic" example:"{province:{label:吉林省,key:130000},city:{label:长春市,key:130000}}"` Geographic map[string]interface{} `json:"geographic" example:"{province:{label:吉林省,key:130000},city:{label:长春市,key:130000}}"`
Address string `json:"address" example:"净月开发区"` Address string `json:"address" example:"净月开发区"`
Phone string `json:"phone" example:"400-0400-662"` Phone string `json:"phone" example:"400-0400-662"`
} }
@ -90,26 +90,56 @@ func Login(c *gin.Context) {
func CurrentUser(c *gin.Context) { func CurrentUser(c *gin.Context) {
success, _ := AccountService.CurrentUser() success, _ := AccountService.CurrentUser()
tags := make([]map[string]interface{}, 6)
tags[0] = make(map[string]interface{}, 1)
tags[0]["key"] = 0
tags[0]["label"] = "大数据"
tags[1] = make(map[string]interface{}, 2)
tags[1]["key"] = 1
tags[1]["label"] = "人工智能"
tags[2] = make(map[string]interface{}, 3)
tags[2]["key"] = 2
tags[2]["label"] = "物联网"
tags[3] = make(map[string]interface{}, 4)
tags[3]["key"] = 3
tags[3]["label"] = "架构"
tags[4] = make(map[string]interface{}, 5)
tags[4]["key"] = 4
tags[4]["label"] = "数据分析"
tags[5] = make(map[string]interface{}, 6)
tags[5]["key"] = 5
tags[5]["label"] = "海纳百川"
geographic := make(map[string]interface{})
geographic["province"] = make(map[string]interface{})
province := make(map[string]interface{})
province["label"] = "吉林省"
province["key"] = "130000"
geographic["province"] = province
geographic["city"] = make(map[string]interface{})
city := make(map[string]interface{})
city["label"] = "长春市"
city["key"] = "130000"
geographic["city"] = city
if success { if success {
c.JSON(http.StatusOK, gin.H{ c.JSON(http.StatusOK, CurrentUserInfo{
"status" : "ok", Name: "管理员",
"message" : CurrentUserInfo{ Avatar: "admin.png",
Name: "管理员", Userid: "00000001",
Avatar: "admin.png", Email: "admin@edusoa.com",
Userid: "00000001", Signature: "海纳百川,有容乃大",
Email: "admin@edusoa.com", Title: "大数据专家",
Signature: "海纳百川,有容乃大", Group: "东北师大理想股份有限公司-数智创新中心",
Title: "大数据专家", Tags: tags,
Group: "东北师大理想股份有限公司-数智创新中心", NotifyCount: 12,
Tags: "[{key:0,label:大数据},{key:1,label:人工智能},{key:2,label:物联网},{key:3,label:架构},{key:4,label:数据分析},{key:5,label:海纳百川}]", UnreadCount: 11,
NotifyCount: 12, Country: "China",
UnreadCount: 11, Geographic: geographic,
Country: "China", Address: "净月开发区",
Geographic: "{province:{label:吉林省,key:130000},city:{label:长春市,key:130000}}", Phone: "400-0400-662",
Address: "净月开发区",
Phone: "400-0400-662",
},
}) })
return return

Loading…
Cancel
Save