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