作者 yangfu

用户职位 部门

... ... @@ -16,17 +16,18 @@
|我的评论|完成|2019.11.21|/v1/chance/iComments|
|评论详情-继续评论|完成|2019.11.26|/v1/chance/commentDetailsMulti|
|评论详情-不能评论|完成|2019.11.26|/v1/chance/commentDetailsSingle|
|我的点赞| |2019.11.|v1/chance/favorite|
|我的收藏| |2019.11.|v1/chance/favorite|
|点赞/取消点赞| |2019.11.|v1/chance/sympathyAction|
|消息中心|完成|2019.11.|v1/message/messageCenter|
|标记已读|完成|2019.11.|v1/message/msgCenterRead|
|标记全部已读|完成|2019.11.|v1/message/msgCenterAllRead|
|互动消息-点赞| |2019.11.|v1/message/msgInteractive|
|互动消息-评论| |2019.11.|v1/message/msgInteractive|
|我提交的机会| |2019.11.| |
|我审核的机会| |2019.11.| |
|待抓住机会列表| |2019.11. |
|机会池| |2019.11.| |
|提交机会| |2019.11.| |
|机会审核消息| |2019.11.|v1/message/msgInteractive|
|我的点赞|进行中| |v1/chance/favorite|
|我的收藏|进行中| |v1/chance/favorite|
|点赞/取消点赞| | |v1/chance/sympathyAction|
|消息中心|完成|2019.11.22|v1/message/messageCenter|
|标记已读|完成|2019.11.22|v1/message/msgCenterRead|
|标记全部已读|完成|2019.11.22|v1/message/msgCenterAllRead|
|互动消息-点赞|进行中| |v1/message/msgInteractive|
|互动消息-评论|进行中| |v1/message/msgInteractive|
|机会审核消息|进行中| |v1/message/msgInteractive|
|我提交的机会| | | |
|我审核的机会| | | |
|待抓住机会列表| | |
|机会池| | | |
|提交机会| | | |
... ...
... ... @@ -13,3 +13,13 @@ type DepartmentRepository struct{}
func (r *DepartmentRepository) GetDepartmentById(id int) (v *models.Department, err error) {
return models.GetDepartmentById(id)
}
type IUserDepartmentRepository interface {
GetUserDepartment(userId int64, companyId int64, v interface{}) (err error)
}
type UserDepartmentRepository struct{}
func (r *UserDepartmentRepository) GetUserDepartment(userId int64, companyId int64, v interface{}) (err error) {
return models.GetUserDepartments(userId, companyId, v)
}
... ...
... ... @@ -13,3 +13,13 @@ type PositionRepository struct{}
func (r *PositionRepository) GetPositionById(id int) (v *models.Position, err error) {
return models.GetPositionById(id)
}
type IUserPositionRepository interface {
GetUserPositions(userId int64, companyId int64, v interface{}) (err error)
}
type UserPositionRepository struct{}
func (r *UserPositionRepository) GetUserPositions(userId int64, companyId int64, v interface{}) (err error) {
return models.GetUserPositions(userId, companyId, v)
}
... ...
... ... @@ -16,6 +16,8 @@ var (
Comment ICommentRepository
Message IMessageRepository
UserCompany IUserCompanyRepository
UserPosition IUserPositionRepository
UserDepartment IUserDepartmentRepository
)
func init() {
... ... @@ -34,6 +36,8 @@ func InitRepository() {
Message = &MessageRepository{}
ChanceFavorite = &ChanceFavoriteRepository{}
UserCompany = &UserCompanyRepository{}
UserPosition = &UserPositionRepository{}
UserDepartment = &UserDepartmentRepository{}
}
func InitRepositoryMock() {
... ...
... ... @@ -8,7 +8,17 @@ import "opp/models"
type UserBaseInfoAggregation struct {
User *models.User
Company *models.Company
Department *models.Department
Position *models.Position
Department []*Department
Position []*Position
UserCompany *models.UserCompany
}
type Department struct {
DepartmentId int `orm:"column(department_id)`
Name string `orm:"column(name)`
}
type Position struct {
PositionId int `orm:"column(position_id)`
Name string `orm:"column(name)`
}
... ...
... ... @@ -24,4 +24,5 @@ type BaseUserInfo struct {
NickName string `json:"uname"` //用户名
Department string `json:"department"` //部门
Position string `json:"position"` //岗位
CompanyName string `json:"-"`
}
... ...
... ... @@ -30,7 +30,7 @@ func GetUserBaseInfoAggregation(uid int64, companyId int64) (v *protocol.UserBas
go func() {
defer wg.Done()
if v.Department, err = repository.Department.GetDepartmentById(v.UserCompany.DepartmentId); err != nil {
if err = repository.UserDepartment.GetUserDepartment(uid, companyId, &v.Department); err != nil {
log.Error(err)
return
}
... ... @@ -38,7 +38,7 @@ func GetUserBaseInfoAggregation(uid int64, companyId int64) (v *protocol.UserBas
go func() {
defer wg.Done()
if v.Position, err = repository.Position.GetPositionById(v.UserCompany.PositionId); err != nil {
if err = repository.UserPosition.GetUserPositions(uid, companyId, &v.Position); err != nil {
log.Error(err)
return
}
... ... @@ -57,8 +57,9 @@ func GetUserBaseInfo(uid int64, companyId int64) (v *protocol.BaseUserInfo, err
v = &protocol.BaseUserInfo{
UserId: agg.User.Id,
NickName: agg.User.NickName,
Department: agg.Department.Name,
Position: agg.Position.Name,
Department: agg.Department[0].Name,
Position: agg.Position[0].Name,
CompanyName: agg.Company.Name,
}
return
}
... ...
... ... @@ -26,28 +26,10 @@ import (
comm_time "gitlab.fjmaimaimai.com/mmm-go/gocomm/time"
)
//type IAuthService interface {
// Login(request *protocol.LoginRequest) (rsp *protocol.LoginResponse, err error)
// AccessToken(request *protocol.AccessTokenRequest) (rsp *protocol.AccessTokenResponse, err error)
// RefreshToken(request *protocol.RefreshTokenRequest) (rsp *protocol.RefreshTokenResponse, err error)
// UpdateDevice(request *protocol.UpdateDeviceRequest) (rsp *protocol.UpdateDeviceResponse, err error)
// CheckToken(request *protocol.CheckTokenRequest) (rsp *protocol.CheckTokenResponse, err error)
// CheckUuid(request *protocol.CheckUuidRequest) (rsp *protocol.CheckUuidResponse, err error)
// SmsCode(request *protocol.SmsCodeRequest) (rsp *protocol.SmsCodeResponse, err error)
//}
type AuthService struct{}
//func assertImplement() {
// var _ IAuthService = (*AuthService)(nil)
//}
var (
//服务
sms s_sms.ISmsService = &s_sms.YunPianSmsService{}
//ConfigRepository repository.IConfigRepository = &repository.ConfigRepository{}
////仓储
//UserRepository repository.IUserRepository = &repository.UserRepository{}
)
//登录
... ...
... ... @@ -37,8 +37,9 @@ func Commend(header *protocol.RequestHeader, request *protocol.CommendRequest) (
Honored: protocol.BaseUserInfo{
UserId: c.UserId,
NickName: user.NickName,
Department: userBaseInfo.Department.Name,
Position: userBaseInfo.Position.Name,
//TODO:out index
Department: userBaseInfo.Department[0].Name,
Position: userBaseInfo.Position[1].Name,
},
}
rsp.Lists = append(rsp.Lists, cInfo)
... ...