添加mongodb使用,添加用户前端配置的上传及获取接口
This commit is contained in:
parent
e983317f5b
commit
60b76e5377
|
|
@ -463,8 +463,6 @@ func GetUserInfoByToken(token string) (dao.User, error) {
|
||||||
func GetUserUIConfigInfo(userID int) proto.UserUIConfigInfo {
|
func GetUserUIConfigInfo(userID int) proto.UserUIConfigInfo {
|
||||||
userConfig, err := dao.GetUserUIConfigInfo(userID)
|
userConfig, err := dao.GetUserUIConfigInfo(userID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("GetUserUIConfigInfo error:", err)
|
|
||||||
} else {
|
|
||||||
userConfig.UserID = userID
|
userConfig.UserID = userID
|
||||||
//没有则插入
|
//没有则插入
|
||||||
id, err2 := dao.CreateUserUIConfigInfo(userConfig)
|
id, err2 := dao.CreateUserUIConfigInfo(userConfig)
|
||||||
|
|
@ -474,6 +472,7 @@ func GetUserUIConfigInfo(userID int) proto.UserUIConfigInfo {
|
||||||
log.Println("InsertUserUIConfigInfo success, id:", id, "config:", userConfig)
|
log.Println("InsertUserUIConfigInfo success, id:", id, "config:", userConfig)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
userConfig, err = dao.GetUserUIConfigInfo(userID)
|
||||||
return userConfig
|
return userConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue