Эх сурвалжийг харах

fix:首页消息滚动时间配置

duxin 2 жил өмнө
parent
commit
9c007401a0

+ 2 - 0
api/etc/message-api.yaml

@@ -12,3 +12,5 @@ MessageCenter:
     Hosts:
       - 127.0.0.1:2379
     Key: message.rpc
+
+RollingTiming: 10

+ 1 - 0
api/internal/config/config.go

@@ -11,5 +11,6 @@ type Config struct {
 		ServerCode string
 		Etcd       []string
 	}
+	RollingTiming int64
 	MessageCenter zrpc.RpcClientConf
 }

+ 2 - 1
api/internal/logic/messagelistlogic.go

@@ -3,6 +3,7 @@ package logic
 import (
 	"app.yhyue.com/moapp/MessageCenter/api/internal/svc"
 	"app.yhyue.com/moapp/MessageCenter/api/internal/types"
+	"app.yhyue.com/moapp/MessageCenter/entity"
 	"app.yhyue.com/moapp/MessageCenter/rpc/messageclient"
 	"context"
 
@@ -120,7 +121,7 @@ func (l *MessageListLogic) MessageList(req *types.MessageListReq) (resp *types.M
 		}
 		result.Column = columns
 	}
-
+	result.RollingTiming = entity.RollingTiming
 	return result, nil
 
 }

+ 0 - 3
api/internal/logic/unreadmessageslogic.go

@@ -5,8 +5,6 @@ import (
 	"app.yhyue.com/moapp/MessageCenter/api/internal/types"
 	"app.yhyue.com/moapp/MessageCenter/rpc/messageclient"
 	"context"
-	"log"
-
 	"github.com/zeromicro/go-zero/core/logx"
 )
 
@@ -52,7 +50,6 @@ func (l *UnreadMessagesLogic) UnreadMessages(req *types.UnreadMessageReq) (resp
 			})
 		}
 	}
-	log.Println(result.Data)
 	result.Code = res.Code
 	result.Message = res.Message
 	result.Total = res.Count

+ 8 - 7
api/internal/types/types.go

@@ -110,13 +110,14 @@ type MessageListReq struct {
 }
 
 type MessageListResp struct {
-	Code    int64                    `json:"code"`
-	Message string                   `json:"message"`
-	Data    []map[string]interface{} `json:"data"`
-	Last    map[string]interface{}   `json:"last"`
-	Total   int64                    `json:"total"`
-	Column  []map[string]interface{} `json:"column"`
-	Unread  int64                    `json:"unread"`
+	Code          int64                    `json:"code"`
+	Message       string                   `json:"message"`
+	Data          []map[string]interface{} `json:"data"`
+	Last          map[string]interface{}   `json:"last"`
+	Total         int64                    `json:"total"`
+	Column        []map[string]interface{} `json:"column"`
+	Unread        int64                    `json:"unread"`
+	RollingTiming int64                    `json:"rollingTiming"`
 }
 
 type UnreadMessageReq struct {

+ 8 - 8
api/message.api

@@ -112,13 +112,14 @@ type MessageListReq {
 }
 
 type MessageListResp {
-	Code    int64                    `json:"code"`
-	Message string                   `json:"message"`
-	Data    []map[string]interface{} `json:"data"`
-	Last    map[string]interface{}   `json:"last"`
-	Total   int64                    `json:"total"`
-	Column  []map[string]interface{} `json:"column"`
-	Unread  int64                    `json:"unread"`
+	Code          int64                    `json:"code"`
+	Message       string                   `json:"message"`
+	Data          []map[string]interface{} `json:"data"`
+	Last          map[string]interface{}   `json:"last"`
+	Total         int64                    `json:"total"`
+	Column        []map[string]interface{} `json:"column"`
+	Unread        int64                    `json:"unread"`
+	RollingTiming int64                    `json:"rollingTiming"`
 }
 type UnreadMessageReq {
 	UserId   string `header:"mgoUserId"`
@@ -150,7 +151,6 @@ type WxTmplMessageResponse {
 }
 
 service message-api {
-	
 	//查询消息详情
 	@handler MessageDetailHandler
 	get /messageCenter/messageDetail (MessageDetailReq) returns (MessageDetailResp)

+ 2 - 2
api/message.go

@@ -4,8 +4,8 @@ import (
 	"app.yhyue.com/moapp/MessageCenter/entity"
 	"flag"
 	"fmt"
-	"github.com/zeromicro/go-zero/core/logx"
 	"github.com/zeromicro/go-zero/core/conf"
+	"github.com/zeromicro/go-zero/core/logx"
 	"os"
 	"os/signal"
 	"syscall"
@@ -28,7 +28,7 @@ func main() {
 
 	var c config.Config
 	conf.MustLoad(*configFile, &c)
-
+	entity.RollingTiming = c.RollingTiming
 	//注册代理服务
 	closeNotify, err := node.NewNode(c.Gateway.Etcd...).Register(c.Gateway.ServerCode, fmt.Sprint(c.Port))
 	if err != nil {

+ 1 - 0
entity/message.go

@@ -19,6 +19,7 @@ var MessageColumn []map[string]interface{}
 var MQFW m.MongodbSim
 var GmailAuth []*mail.GmailAuth
 var SurvivalTime int
+var RollingTiming int64
 var SaveConcurrencyChan chan int //  定义保存消息并发
 
 type Message struct {