master
wangshuai 5 years ago
parent 694f99b171
commit 4dc99e5c7f

@ -16,6 +16,23 @@ import (
"net/http"
)
type CurrentUserInfo struct {
Name string `json:"name" example:"管理员"`
Avatar string `json:"avatar" example:"admin.png"`
Userid string `json:"userid" example:"00000001"`
Email string `json:"email" example:"admin@edusoa.com"`
Signature string `json:"signature" example:"海纳百川,有容乃大"`
Title string `json:"title" 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:海纳百川}]"`
NotifyCount int `json:"notifyCount" example:"12"`
UnreadCount int `json:"unreadCount" example:"11"`
Country string `json:"country" example:"China"`
Geographic string `json:"geographic" example:"{province:{label:吉林省,key:130000},city:{label:长春市,key:130000}}"`
Address string `json:"address" example:"净月开发区"`
Phone string `json:"phone" example:"400-0400-662"`
}
// 后台登陆 godoc
// @Summary 后台登陆
// @Description json:"username" xorm:"not null comment('账号') VARCHAR(100)" example:"example"
@ -72,12 +89,27 @@ func Login(c *gin.Context) {
// @Router /v1/openapi/account/currentUser [post]
func CurrentUser(c *gin.Context) {
success, message := AccountService.CurrentUser()
success, _ := AccountService.CurrentUser()
if success {
c.JSON(http.StatusOK, gin.H{
"status" : "ok",
"message" : message,
"message" : CurrentUserInfo{
Name: "管理员",
Avatar: "admin.png",
Userid: "00000001",
Email: "admin@edusoa.com",
Signature: "海纳百川,有容乃大",
Title: "大数据专家",
Group: "东北师大理想股份有限公司-数智创新中心",
Tags: "[{key:0,label:大数据},{key:1,label:人工智能},{key:2,label:物联网},{key:3,label:架构},{key:4,label:数据分析},{key:5,label:海纳百川}]",
NotifyCount: 12,
UnreadCount: 11,
Country: "China",
Geographic: "{province:{label:吉林省,key:130000},city:{label:长春市,key:130000}}",
Address: "净月开发区",
Phone: "400-0400-662",
},
})
return

Loading…
Cancel
Save