...
|
...
|
@@ -8,6 +8,7 @@ import ( |
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/user/query"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/cache"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_basic"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/sms_serve"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
|
...
|
...
|
@@ -167,36 +168,44 @@ func (srv UserService) DepartmentsUsers(departmentsUsersQuery *query.Departments |
|
|
|
|
|
//MessagesList 消息列表
|
|
|
func (srv UserService) MessagesList(cmd *query.MessagesListQuery) (int64, interface{}, error) {
|
|
|
gateway := allied_creation_basic.NewHttplibAlliedCreationBasic(
|
|
|
cmd.Operator)
|
|
|
messages, err := gateway.NoticePersonal(allied_creation_basic.ReqNoticePersonal{
|
|
|
PageIndex: cmd.PageNumber,
|
|
|
PageSize: cmd.PageSize,
|
|
|
UserBaseId: cmd.Operator.UserBaseId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
var results []*dto.MessageDto
|
|
|
for i := 0; i < 5; i++ {
|
|
|
results = append(results, dto.NewMessageDto())
|
|
|
for i := 0; i < len(messages.List); i++ {
|
|
|
mItem := messages.List[i]
|
|
|
message := &dto.MessageDto{
|
|
|
MsgId: mItem.NoticePersonalID,
|
|
|
MsgContent: mItem.Content,
|
|
|
MsgTime: mItem.CreatedAt.Unix() * 1000,
|
|
|
Read: mItem.IsRead,
|
|
|
}
|
|
|
message.MsgType = message.LoadMsgType(mItem.Module, mItem.ModuleAction)
|
|
|
results = append(results, message)
|
|
|
}
|
|
|
|
|
|
//gateway := allied_creation_basic.NewHttplibAlliedCreationBasic(
|
|
|
// cmd.Operator)
|
|
|
//_,err:= gateway.NoticePersonal(allied_creation_basic.ReqNoticePersonal{
|
|
|
// PageIndex: cmd.PageNumber,
|
|
|
// PageSize: cmd.PageSize,
|
|
|
// UserId: cmd.Operator.UserId,
|
|
|
//})
|
|
|
//if err!=nil{
|
|
|
// return 0,nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
//}
|
|
|
return 2, results, nil
|
|
|
return messages.Count, results, nil
|
|
|
}
|
|
|
|
|
|
//MessagesList 消息列表
|
|
|
func (srv UserService) MessagesMarkRead(cmd *command.MessageMarkReadCommand) (interface{}, error) {
|
|
|
//gateway := allied_creation_basic.NewHttplibAlliedCreationBasic(
|
|
|
// cmd.Operator)
|
|
|
//_,err:= gateway.ReadNotice(allied_creation_basic.ReqReadNotice{
|
|
|
// MsgId: cmd.MsgId,
|
|
|
// ReadAll: cmd.ReadAll,
|
|
|
// UserId: cmd.Operator.UserId,
|
|
|
//})
|
|
|
//if err!=nil{
|
|
|
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
//}
|
|
|
gateway := allied_creation_basic.NewHttplibAlliedCreationBasic(
|
|
|
cmd.Operator)
|
|
|
_, err := gateway.ReadNotice(allied_creation_basic.ReqReadNotice{
|
|
|
MsgId: cmd.MsgId,
|
|
|
ReadAll: cmd.ReadAll,
|
|
|
UserBaseId: cmd.Operator.UserBaseId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
return struct{}{}, nil
|
|
|
}
|
|
|
|
...
|
...
|
|