作者 yangfu

我的机会

@@ -36,8 +36,8 @@ @@ -36,8 +36,8 @@
36 |用户评分配置| | | | 36 |用户评分配置| | | |
37 |用户机会权限| | | | 37 |用户机会权限| | | |
38 |机会池| | | | 38 |机会池| | | |
39 -|消息-点赞|进行中| |v1/message/msgInteractive|  
40 -|消息-评论|进行中| |v1/message/msgInteractive| 39 +|消息-点赞| | |v1/message/msgInteractive|
  40 +|消息-评论| | |v1/message/msgInteractive|
41 |机会评论列表| | |/v1/chance/comments| 41 |机会评论列表| | |/v1/chance/comments|
42 |点赞/取消点赞| | |v1/chance/sympathyAction| 42 |点赞/取消点赞| | |v1/chance/sympathyAction|
43 |评论详情-继续评论|完成|2019.11.26|/v1/chance/commentDetailsMulti| 43 |评论详情-继续评论|完成|2019.11.26|/v1/chance/commentDetailsMulti|
@@ -272,3 +272,38 @@ func (this *ChanceController) MySubmitChance() { @@ -272,3 +272,38 @@ func (this *ChanceController) MySubmitChance() {
272 header := controllers.GetRequestHeader(this.Ctx) 272 header := controllers.GetRequestHeader(this.Ctx)
273 msg = protocol.NewReturnResponse(chance.MySubmitChance(header, request)) 273 msg = protocol.NewReturnResponse(chance.MySubmitChance(header, request))
274 } 274 }
  275 +
  276 +//ChanceApprove 机会审核
  277 +//func(this *ChanceController)ChanceApprove(){
  278 +// var msg *protocol.ResponseMessage
  279 +// defer func() {
  280 +// this.Resp(msg)
  281 +// }()
  282 +// var request *protocol.ChanceApproveRequest
  283 +// if err:=json.Unmarshal(this.ByteBody,&request);err!=nil{
  284 +// log.Error(err)
  285 +// msg = protocol.BadRequestParam(1)
  286 +// return
  287 +// }
  288 +// if b,m :=this.Valid(request);!b{
  289 +// msg = m
  290 +// return
  291 +// }
  292 +// header := controllers.GetRequestHeader(this.Ctx)
  293 +// msg = protocol.NewReturnResponse(chance.ChanceApprove(header,request))
  294 +//}
  295 +//
  296 +///*ChanceApprove */
  297 +//type ChanceApproveRequest struct {
  298 +// Xxx string`json:"xxx" valid:"Required"`
  299 +//}
  300 +//type ChanceApproveResponse struct {
  301 +//}
  302 +//
  303 +//func ChanceApprove(header *protocol.RequestHeader,request *protocol.ChanceApproveRequest)(rsp *protocol.ChanceApproveResponse,err error){
  304 +// var (
  305 +//
  306 +// )
  307 +// rsp =&protocol.ChanceApproveResponse{}
  308 +// return
  309 +//}
@@ -16,13 +16,15 @@ type CommendInfo struct { @@ -16,13 +16,15 @@ type CommendInfo struct {
16 Content string `json:"content"` //表彰内容 16 Content string `json:"content"` //表彰内容
17 Company string `json:"company"` //公司名 17 Company string `json:"company"` //公司名
18 CommendAt int64 `json:"getTime"` //表彰时间 18 CommendAt int64 `json:"getTime"` //表彰时间
19 - Honored BaseUserInfo `json:"honored"` //证书获得者 信息 19 + Honored *BaseUserInfo `json:"honored"` //证书获得者 信息
20 } 20 }
21 21
22 type BaseUserInfo struct { 22 type BaseUserInfo struct {
23 UserId int64 `json:"uid"` //用户id 23 UserId int64 `json:"uid"` //用户id
24 NickName string `json:"uname"` //用户名 24 NickName string `json:"uname"` //用户名
25 - Department string `json:"department"` //部门  
26 - Position string `json:"position"` //岗位 25 + Job Job `json:"job"`
  26 + Dep Dep `json:"dep"`
  27 + //Department string `json:"department"` //部门
  28 + //Position string `json:"position"` //岗位
27 CompanyName string `json:"-"` 29 CompanyName string `json:"-"`
28 } 30 }
@@ -61,13 +61,30 @@ func GetUserBaseInfo(uid int64, companyId int64) (v *protocol.BaseUserInfo, err @@ -61,13 +61,30 @@ func GetUserBaseInfo(uid int64, companyId int64) (v *protocol.BaseUserInfo, err
61 if agg, err = GetUserBaseInfoAggregation(uid, companyId); err != nil { 61 if agg, err = GetUserBaseInfoAggregation(uid, companyId); err != nil {
62 return 62 return
63 } 63 }
  64 + v = SetBaseInfoFrom(agg)
  65 + return
  66 +}
  67 +
  68 +func SetBaseInfoFrom(agg *protocol.UserBaseInfoAggregation) (v *protocol.BaseUserInfo) {
  69 + dep := GetTopDepartment(agg.Department)
  70 + job := GetTopPosition(agg.Position)
64 v = &protocol.BaseUserInfo{ 71 v = &protocol.BaseUserInfo{
65 UserId: agg.User.Id, 72 UserId: agg.User.Id,
66 NickName: agg.User.NickName, 73 NickName: agg.User.NickName,
67 - Department: GetTopDepartment(agg.Department).Name,  
68 - Position: GetTopPosition(agg.Position).Name,  
69 CompanyName: agg.Company.Name, 74 CompanyName: agg.Company.Name,
70 } 75 }
  76 + if job.PositionId != 0 {
  77 + v.Job = protocol.Job{
  78 + Id: job.PositionId,
  79 + Name: job.Name,
  80 + }
  81 + }
  82 + if dep.DepartmentId != 0 {
  83 + v.Dep = protocol.Dep{
  84 + Id: dep.DepartmentId,
  85 + Name: dep.Name,
  86 + }
  87 + }
71 return 88 return
72 } 89 }
73 90
@@ -615,7 +615,7 @@ func MySubmitChance(header *protocol.RequestHeader, request *protocol.MySubmitCh @@ -615,7 +615,7 @@ func MySubmitChance(header *protocol.RequestHeader, request *protocol.MySubmitCh
615 item := protocol.ChanceItem{ 615 item := protocol.ChanceItem{
616 Id: chance.Id, 616 Id: chance.Id,
617 Provider: provider, 617 Provider: provider,
618 - CreateTime: chance.CreateTime.Unix(), 618 + CreateTime: chance.CreateTime.Unix() * 1000,
619 } 619 }
620 jsonUnmarshal(chance.SourceContent, &item.FormList) 620 jsonUnmarshal(chance.SourceContent, &item.FormList)
621 jsonUnmarshal(chance.Images, &item.Pictures) 621 jsonUnmarshal(chance.Images, &item.Pictures)
@@ -10,14 +10,14 @@ import ( @@ -10,14 +10,14 @@ import (
10 func Commend(header *protocol.RequestHeader, request *protocol.CommendRequest) (rsp *protocol.CommendResponse, err error) { 10 func Commend(header *protocol.RequestHeader, request *protocol.CommendRequest) (rsp *protocol.CommendResponse, err error) {
11 var ( 11 var (
12 userBaseInfo *protocol.UserBaseInfoAggregation 12 userBaseInfo *protocol.UserBaseInfoAggregation
13 - user *models.User 13 + //user *models.User
14 commends []*models.Commend 14 commends []*models.Commend
15 ) 15 )
16 rsp = &protocol.CommendResponse{} 16 rsp = &protocol.CommendResponse{}
17 - user, err = models.GetUsersById(header.Uid)  
18 - if err != nil {  
19 - return  
20 - } 17 + //user, err = models.GetUsersById(header.Uid)
  18 + //if err != nil {
  19 + // return
  20 + //}
21 if commends, rsp.Total, err = models.GetCommends(header.CompanyId, request.LastId, request.PageSize); err != nil { 21 if commends, rsp.Total, err = models.GetCommends(header.CompanyId, request.LastId, request.PageSize); err != nil {
22 return 22 return
23 } 23 }
@@ -27,18 +27,13 @@ func Commend(header *protocol.RequestHeader, request *protocol.CommendRequest) ( @@ -27,18 +27,13 @@ func Commend(header *protocol.RequestHeader, request *protocol.CommendRequest) (
27 if err != nil { 27 if err != nil {
28 continue 28 continue
29 } 29 }
30 - user = userBaseInfo.User 30 + //user = userBaseInfo.User
31 cInfo := protocol.CommendInfo{ 31 cInfo := protocol.CommendInfo{
32 Id: c.Id, 32 Id: c.Id,
33 Content: c.Content, 33 Content: c.Content,
34 Company: userBaseInfo.Company.Name, 34 Company: userBaseInfo.Company.Name,
35 CommendAt: time.GetUnixTimeByNDayUnix(c.CommendAt.Unix(), 0), 35 CommendAt: time.GetUnixTimeByNDayUnix(c.CommendAt.Unix(), 0),
36 - Honored: protocol.BaseUserInfo{  
37 - UserId: c.UserId,  
38 - NickName: user.NickName,  
39 - Department: agg.GetTopDepartment(userBaseInfo.Department).Name,  
40 - Position: agg.GetTopPosition(userBaseInfo.Position).Name,  
41 - }, 36 + Honored: agg.SetBaseInfoFrom(userBaseInfo),
42 } 37 }
43 rsp.Lists = append(rsp.Lists, cInfo) 38 rsp.Lists = append(rsp.Lists, cInfo)
44 } 39 }