...
|
...
|
@@ -326,7 +326,6 @@ func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) |
|
|
Phone: userBaseAgg.User.Phone,
|
|
|
Image: protocol.Picture{
|
|
|
Path: userBaseAgg.User.Icon,
|
|
|
//TODO:图片裁剪
|
|
|
H: 0,
|
|
|
W: 0,
|
|
|
},
|
...
|
...
|
@@ -337,6 +336,8 @@ func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) |
|
|
Name: userBaseAgg.Company.Name,
|
|
|
CId: userBaseAgg.Company.UserCenterId,
|
|
|
},
|
|
|
Departments: make([]protocol.Dep, 0),
|
|
|
Positions: make([]protocol.Job, 0),
|
|
|
},
|
|
|
}
|
|
|
for i := range companys {
|
...
|
...
|
@@ -346,18 +347,30 @@ func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) |
|
|
CId: companys[i].UserCenterId,
|
|
|
})
|
|
|
}
|
|
|
if topDep := agg.GetTopDepartment(userBaseAgg.Department); topDep.DepartmentId != 0 {
|
|
|
rsp.User.Department = protocol.Dep{
|
|
|
Id: topDep.DepartmentId,
|
|
|
Name: topDep.Name,
|
|
|
newDep := func(item *protocol.Department) protocol.Dep {
|
|
|
return protocol.Dep{
|
|
|
Id: item.DepartmentId,
|
|
|
Name: item.Name,
|
|
|
}
|
|
|
}
|
|
|
if topPos := agg.GetTopPosition(userBaseAgg.Position); topPos.PositionId != 0 {
|
|
|
rsp.User.Position = protocol.Job{
|
|
|
Id: topPos.PositionId,
|
|
|
Name: topPos.Name,
|
|
|
newPos := func(item *protocol.Position) protocol.Job {
|
|
|
return protocol.Job{
|
|
|
Id: item.PositionId,
|
|
|
Name: item.Name,
|
|
|
}
|
|
|
}
|
|
|
for i := range userBaseAgg.Departments {
|
|
|
rsp.User.Departments = append(rsp.User.Departments, newDep(userBaseAgg.Departments[i]))
|
|
|
}
|
|
|
for i := range userBaseAgg.Positions {
|
|
|
rsp.User.Positions = append(rsp.User.Positions, newPos(userBaseAgg.Positions[i]))
|
|
|
}
|
|
|
if topDep := agg.GetTopDepartment(userBaseAgg.Departments); topDep.DepartmentId != 0 {
|
|
|
rsp.User.Department = newDep(topDep)
|
|
|
}
|
|
|
if topPos := agg.GetTopPosition(userBaseAgg.Positions); topPos.PositionId != 0 {
|
|
|
rsp.User.Position = newPos(topPos)
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
|
...
|
...
|
|