WH01243 3 жил өмнө
parent
commit
9adfca28b9

+ 4 - 1
rpc/messagecenter/internal/logic/userlistlogic.go

@@ -2,8 +2,10 @@ package logic
 
 import (
 	"app.yhyue.com/moapp/jybase/encrypt"
+	util "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/entity"
 	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/service"
 	"context"
+	"time"
 
 	quitl "app.yhyue.com/moapp/jybase/common"
 	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/internal/svc"
@@ -36,13 +38,14 @@ func (l *UserListLogic) UserList(in *messagecenter.UserReq) (*messagecenter.User
 	}
 	var result = []*messagecenter.UserEntity{}
 	for _, v := range *data {
+		tim, _ := time.ParseInLocation(util.Date_Full_Layout, quitl.InterfaceToStr(v["create_time"]), time.Local)
 		userResp := messagecenter.UserEntity{
 			Name:       quitl.ObjToString(v["name"]),
 			Title:      quitl.ObjToString(v["title"]),
 			Type:       quitl.Int64All(v["type"]),
 			Link:       quitl.ObjToString(v["link"]),
 			Content:    quitl.ObjToString(v["content"]),
-			CreateTime: quitl.ObjToString(v["create_time"]),
+			CreateTime: tim.Unix(),
 			UserType:   quitl.Int64All(v["userType"]),
 			Number:     quitl.Int64All(v["number"]),
 			UserId:     encrypt.SE.Encode2Hex(quitl.InterfaceToStr(v["id"])),

+ 1 - 1
rpc/messagecenter/messagecenter.proto

@@ -35,7 +35,7 @@ message UserEntity {
   string link = 5;
   string content= 6;
   int64 userType = 7;
-  string create_time= 8;
+  int64 create_time= 8;
   int64 number= 9;
   string headimg=11;
 }

+ 4 - 4
rpc/messagecenter/messagecenter/messagecenter.pb.go

@@ -316,7 +316,7 @@ type UserEntity struct {
 	Link       string `protobuf:"bytes,5,opt,name=link,proto3" json:"link,omitempty"`
 	Content    string `protobuf:"bytes,6,opt,name=content,proto3" json:"content,omitempty"`
 	UserType   int64  `protobuf:"varint,7,opt,name=userType,proto3" json:"userType,omitempty"`
-	CreateTime string `protobuf:"bytes,8,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
+	CreateTime int64  `protobuf:"varint,8,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
 	Number     int64  `protobuf:"varint,9,opt,name=number,proto3" json:"number,omitempty"`
 	Headimg    string `protobuf:"bytes,11,opt,name=headimg,proto3" json:"headimg,omitempty"`
 }
@@ -402,11 +402,11 @@ func (x *UserEntity) GetUserType() int64 {
 	return 0
 }
 
-func (x *UserEntity) GetCreateTime() string {
+func (x *UserEntity) GetCreateTime() int64 {
 	if x != nil {
 		return x.CreateTime
 	}
-	return ""
+	return 0
 }
 
 func (x *UserEntity) GetNumber() int64 {
@@ -1313,7 +1313,7 @@ var file_messageCenter_proto_rawDesc = []byte{
 	0x74, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65,
 	0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65,
 	0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18,
-	0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d,
+	0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d,
 	0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28,
 	0x03, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x65, 0x61,
 	0x64, 0x69, 0x6d, 0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64,

+ 1 - 1
service/message_mail_box.go

@@ -70,7 +70,7 @@ func (b MessaggeService) UserList(in *messagecenter.UserReq) (data *[]map[string
 		if data != nil {
 			customerMessageId := util.Inhandle(data)
 			//客服的用户列表
-			sqlStr = "SELECT  IF  ( b.nickname = '', CONCAT(SUBSTR( b.phone, 1, 3 ),'****',SUBSTR( b.phone, 8, 11)), b.nickname ) AS name,  b.id,  e.title,  b.headimg,  e.type,  e.link,  e.content,  a.create_time,  (  SELECT   count( h.id )   FROM   socialize_message_mailbox h  left join socialize_chat_session i ON h.own_type = 1 AND h.own_id = i.id     WHERE     h.own_type = 1     AND i.ent_id=f.ent_id and  i.user_id=f.user_id       AND h.isread = 0   ) AS number   FROM  socialize_message_mailbox a  LEFT JOIN base_user b ON if (a.send_user_type=1 ,a.receive_user_id=b.id,a.send_user_id=b.id)   LEFT JOIN socialize_message e ON e.id = a.messag_id  LEFT JOIN socialize_chat_session f ON a.own_type=1 and  a.own_id=f.id   WHERE  a.id IN  (" + customerMessageId + ")" + phoneSql + "   ORDER BY  a.create_time DESC"
+			sqlStr = "SELECT  IF  ( b.nickname = '', CONCAT(SUBSTR( b.phone, 1, 3 ),'****',SUBSTR( b.phone, 8, 11)), b.nickname ) AS name,  b.id,  e.title,  b.headimg,  e.type,  e.link,  e.content,  a.create_time,  (  SELECT   count( h.id )   FROM   socialize_message_mailbox h  left join socialize_chat_session i ON h.own_type = 1 AND h.own_id = i.id     WHERE     h.own_type = 1     AND i.ent_id=f.ent_id and  i.user_id=f.user_id       AND h.isread = 0    and  i.customer_service_id=" + quitl.InterfaceToStr(in.EntUserId) + " ) AS number   FROM  socialize_message_mailbox a  LEFT JOIN base_user b ON if (a.send_user_type=1 ,a.receive_user_id=b.id,a.send_user_id=b.id)   LEFT JOIN socialize_message e ON e.id = a.messag_id  LEFT JOIN socialize_chat_session f ON a.own_type=1 and  a.own_id=f.id   WHERE  a.id IN  (" + customerMessageId + ")" + phoneSql + "   ORDER BY  a.create_time DESC"
 			fmt.Println(in.EntUserId)
 			v = make([]interface{}, 0)
 		}