作者 yangfu

我的机会

... ... @@ -36,8 +36,8 @@
|用户评分配置| | | |
|用户机会权限| | | |
|机会池| | | |
|消息-点赞|进行中| |v1/message/msgInteractive|
|消息-评论|进行中| |v1/message/msgInteractive|
|消息-点赞| | |v1/message/msgInteractive|
|消息-评论| | |v1/message/msgInteractive|
|机会评论列表| | |/v1/chance/comments|
|点赞/取消点赞| | |v1/chance/sympathyAction|
|评论详情-继续评论|完成|2019.11.26|/v1/chance/commentDetailsMulti|
... ...
... ... @@ -272,3 +272,38 @@ func (this *ChanceController) MySubmitChance() {
header := controllers.GetRequestHeader(this.Ctx)
msg = protocol.NewReturnResponse(chance.MySubmitChance(header, request))
}
//ChanceApprove 机会审核
//func(this *ChanceController)ChanceApprove(){
// var msg *protocol.ResponseMessage
// defer func() {
// this.Resp(msg)
// }()
// var request *protocol.ChanceApproveRequest
// if err:=json.Unmarshal(this.ByteBody,&request);err!=nil{
// log.Error(err)
// msg = protocol.BadRequestParam(1)
// return
// }
// if b,m :=this.Valid(request);!b{
// msg = m
// return
// }
// header := controllers.GetRequestHeader(this.Ctx)
// msg = protocol.NewReturnResponse(chance.ChanceApprove(header,request))
//}
//
///*ChanceApprove */
//type ChanceApproveRequest struct {
// Xxx string`json:"xxx" valid:"Required"`
//}
//type ChanceApproveResponse struct {
//}
//
//func ChanceApprove(header *protocol.RequestHeader,request *protocol.ChanceApproveRequest)(rsp *protocol.ChanceApproveResponse,err error){
// var (
//
// )
// rsp =&protocol.ChanceApproveResponse{}
// return
//}
... ...
... ... @@ -12,17 +12,19 @@ type CommendResponse struct {
}
type CommendInfo struct {
Id int64 `json:"cid"` //表彰编号
Content string `json:"content"` //表彰内容
Company string `json:"company"` //公司名
CommendAt int64 `json:"getTime"` //表彰时间
Honored BaseUserInfo `json:"honored"` //证书获得者 信息
Id int64 `json:"cid"` //表彰编号
Content string `json:"content"` //表彰内容
Company string `json:"company"` //公司名
CommendAt int64 `json:"getTime"` //表彰时间
Honored *BaseUserInfo `json:"honored"` //证书获得者 信息
}
type BaseUserInfo struct {
UserId int64 `json:"uid"` //用户id
NickName string `json:"uname"` //用户名
Department string `json:"department"` //部门
Position string `json:"position"` //岗位
UserId int64 `json:"uid"` //用户id
NickName string `json:"uname"` //用户名
Job Job `json:"job"`
Dep Dep `json:"dep"`
//Department string `json:"department"` //部门
//Position string `json:"position"` //岗位
CompanyName string `json:"-"`
}
... ...
... ... @@ -61,13 +61,30 @@ func GetUserBaseInfo(uid int64, companyId int64) (v *protocol.BaseUserInfo, err
if agg, err = GetUserBaseInfoAggregation(uid, companyId); err != nil {
return
}
v = SetBaseInfoFrom(agg)
return
}
func SetBaseInfoFrom(agg *protocol.UserBaseInfoAggregation) (v *protocol.BaseUserInfo) {
dep := GetTopDepartment(agg.Department)
job := GetTopPosition(agg.Position)
v = &protocol.BaseUserInfo{
UserId: agg.User.Id,
NickName: agg.User.NickName,
Department: GetTopDepartment(agg.Department).Name,
Position: GetTopPosition(agg.Position).Name,
CompanyName: agg.Company.Name,
}
if job.PositionId != 0 {
v.Job = protocol.Job{
Id: job.PositionId,
Name: job.Name,
}
}
if dep.DepartmentId != 0 {
v.Dep = protocol.Dep{
Id: dep.DepartmentId,
Name: dep.Name,
}
}
return
}
... ...
... ... @@ -615,7 +615,7 @@ func MySubmitChance(header *protocol.RequestHeader, request *protocol.MySubmitCh
item := protocol.ChanceItem{
Id: chance.Id,
Provider: provider,
CreateTime: chance.CreateTime.Unix(),
CreateTime: chance.CreateTime.Unix() * 1000,
}
jsonUnmarshal(chance.SourceContent, &item.FormList)
jsonUnmarshal(chance.Images, &item.Pictures)
... ...
... ... @@ -10,14 +10,14 @@ import (
func Commend(header *protocol.RequestHeader, request *protocol.CommendRequest) (rsp *protocol.CommendResponse, err error) {
var (
userBaseInfo *protocol.UserBaseInfoAggregation
user *models.User
commends []*models.Commend
//user *models.User
commends []*models.Commend
)
rsp = &protocol.CommendResponse{}
user, err = models.GetUsersById(header.Uid)
if err != nil {
return
}
//user, err = models.GetUsersById(header.Uid)
//if err != nil {
// return
//}
if commends, rsp.Total, err = models.GetCommends(header.CompanyId, request.LastId, request.PageSize); err != nil {
return
}
... ... @@ -27,18 +27,13 @@ func Commend(header *protocol.RequestHeader, request *protocol.CommendRequest) (
if err != nil {
continue
}
user = userBaseInfo.User
//user = userBaseInfo.User
cInfo := protocol.CommendInfo{
Id: c.Id,
Content: c.Content,
Company: userBaseInfo.Company.Name,
CommendAt: time.GetUnixTimeByNDayUnix(c.CommendAt.Unix(), 0),
Honored: protocol.BaseUserInfo{
UserId: c.UserId,
NickName: user.NickName,
Department: agg.GetTopDepartment(userBaseInfo.Department).Name,
Position: agg.GetTopPosition(userBaseInfo.Position).Name,
},
Honored: agg.SetBaseInfoFrom(userBaseInfo),
}
rsp.Lists = append(rsp.Lists, cInfo)
}
... ...