Selaa lähdekoodia

update

master
DengBiao 2 vuotta sitten
vanhempi
commit
177acf4a6b
7 muutettua tiedostoa jossa 22 lisäystä ja 13 poistoa
  1. +1
    -1
      chart/templates/server/business.yaml
  2. +4
    -0
      cmd/business/main.go
  3. +5
    -2
      cmd/connect/main.go
  4. +4
    -0
      cmd/logic/main.go
  5. +6
    -8
      config/config.go
  6. +1
    -1
      internal/business/api/business_ext_test.go
  7. +1
    -1
      pkg/db/db.go

+ 1
- 1
chart/templates/server/business.yaml Näytä tiedosto

@@ -18,7 +18,7 @@ spec:
spec:
containers:
- name: business
image: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/zyos-gim-business:202209020-02'
image: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/zyos-gim-business:202209020-03'
imagePullPolicy: Always
ports:
- containerPort: 8000


+ 4
- 0
cmd/business/main.go Näytä tiedosto

@@ -3,6 +3,7 @@ package main
import (
"gim/config"
"gim/internal/business/api"
"gim/pkg/db"
"gim/pkg/interceptor"
"gim/pkg/logger"
"gim/pkg/pb"
@@ -17,6 +18,9 @@ import (
)

func main() {
config.Init()
db.Init()

server := grpc.NewServer(grpc.UnaryInterceptor(interceptor.NewInterceptor("business_interceptor", urlwhitelist.Business)))
// 监听服务关闭信号,服务平滑重启
go func() {


+ 5
- 2
cmd/connect/main.go Näytä tiedosto

@@ -4,21 +4,24 @@ import (
"context"
"gim/config"
"gim/internal/connect"
"gim/pkg/db"
"gim/pkg/interceptor"
"gim/pkg/logger"
"gim/pkg/pb"
"gim/pkg/rpc"
"google.golang.org/grpc"
"net"
"os"
"os/signal"
"syscall"

"google.golang.org/grpc"

"go.uber.org/zap"
)

func main() {
config.Init()
db.Init()

// 启动TCP长链接服务器
go func() {
connect.StartTCPServer(config.TCPListenAddr)


+ 4
- 0
cmd/logic/main.go Näytä tiedosto

@@ -5,6 +5,7 @@ import (
"gim/internal/logic/api"
"gim/internal/logic/app"
"gim/internal/logic/proxy"
"gim/pkg/db"
"gim/pkg/interceptor"
"gim/pkg/logger"
"gim/pkg/pb"
@@ -24,6 +25,9 @@ func init() {
}

func main() {
config.Init()
db.Init()

server := grpc.NewServer(grpc.UnaryInterceptor(interceptor.NewInterceptor("logic_interceptor", urlwhitelist.Logic)))

// 监听服务关闭信号,服务平滑重启


+ 6
- 8
config/config.go Näytä tiedosto

@@ -4,12 +4,10 @@ import (
"context"
"gim/pkg/k8sutil"
"gim/pkg/logger"
"os"
"strconv"

"go.uber.org/zap"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"os"
"strconv"
)

const (
@@ -23,16 +21,16 @@ const (

var (
NameSpace string = "gim"
MySQL string
RedisIP string
RedisPassword string
MySQL string = "root:Fnuo123com@@tcp(119.23.182.117:3306)/gim?charset=utf8&parseTime=true"
RedisIP string = "120.24.28.6:32572"
RedisPassword string = ""

LocalAddr string
PushRoomSubscribeNum int
PushAllSubscribeNum int
)

func init() {
func Init() {
k8sClient, err := k8sutil.GetK8sClient()
if err != nil {
panic(err)


+ 1
- 1
internal/business/api/business_ext_test.go Näytä tiedosto

@@ -32,7 +32,7 @@ func getCtx() context.Context {

func TestUserExtServer_SignIn(t *testing.T) {
resp, err := getBusinessExtClient().SignIn(getCtx(), &pb.SignInReq{
PhoneNumber: "11111111111",
PhoneNumber: "18229775316",
Code: "1",
DeviceId: 1,
})


+ 1
- 1
pkg/db/db.go Näytä tiedosto

@@ -18,7 +18,7 @@ var (
RedisUtil *util.RedisUtil
)

func init() {
func Init() {
InitMysql(config.MySQL)
InitRedis(config.RedisIP, config.RedisPassword)
}


Ladataan…
Peruuta
Tallenna