animeic 2 years ago
parent
commit
720c3a38ae

+ 5 - 5
boxcost/Dockerfile

@@ -10,13 +10,13 @@ RUN echo -e https://mirrors.ustc.edu.cn/alpine/v3.15/main > /etc/apk/repositorie
 # 由于alpine镜像使用的是musl libc而不是gnu libc,/lib64/ 是不存在的。但他们是兼容的,可以创建个软连接
   && mkdir /lib64 \
   && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 \
-  && mkdir -p /root/boxcost
+  && mkdir -p /root/box-cost
 
-WORKDIR /root/boxcost
+WORKDIR /root/box-cost
 
 ADD ./app.yaml ./app.yaml
-ADD ./boxcost-service ./boxcost-service
+ADD ./box-cost-service ./box-cost-service
 
-EXPOSE 8902
+EXPOSE 8888
 
-ENTRYPOINT ["./boxcost-service"]
+ENTRYPOINT ["./box-cost-service"]

+ 3 - 3
boxcost/api/api.go

@@ -1,9 +1,9 @@
 package api
 
 import (
-	"boxcost/conf"
-	"boxcost/db"
-	"boxcost/db/repo"
+	"box-cost/conf"
+	"box-cost/db"
+	"box-cost/db/repo"
 	"context"
 	"fmt"
 

+ 1 - 1
boxcost/api/controller.go

@@ -1,7 +1,7 @@
 package api
 
 import (
-	"boxcost/log"
+	"box-cost/log"
 	"crypto/md5"
 	"encoding/json"
 	"fmt"

+ 1 - 1
boxcost/api/jwt.go

@@ -1,7 +1,7 @@
 package api
 
 import (
-	"boxcost/conf"
+	"box-cost/conf"
 	"fmt"
 	"log"
 	"time"

+ 1 - 1
boxcost/api/service-array.go

@@ -1,7 +1,7 @@
 package api
 
 import (
-	"boxcost/db/repo"
+	"box-cost/db/repo"
 	"fmt"
 
 	"github.com/gin-gonic/gin"

+ 1 - 1
boxcost/api/service.go

@@ -1,7 +1,7 @@
 package api
 
 import (
-	"boxcost/db/repo"
+	"box-cost/db/repo"
 	"encoding/hex"
 	"fmt"
 	"reflect"

+ 4 - 4
boxcost/build.sh

@@ -2,11 +2,11 @@
 
 # 编译应用
 echo "building..."
-go build -o boxcost-service
+go build -o box-cost-service
 
 # 命名镜像
-local_imge="pack-boxcost:v1.0.0"
-repository_image="registry.cn-chengdu.aliyuncs.com/infish/pack-boxcost:v1.0.0"
+local_imge="pack-box-cost:v1.0.0"
+repository_image="registry.cn-chengdu.aliyuncs.com/infish/pack-box-cost:v1.0.0"
 
 # 删除本地已存在的镜像
 docker rmi $repository_image
@@ -21,7 +21,7 @@ docker tag $local_imge $repository_image
 docker push $repository_image
 
 # 删除编译的文件
-rm -rf boxcost-service
+rm -rf box-cost-service
 
 # 运行示例
 # docker run  -itd -p 20001:20001 --name comm-pay-service pay-service:1.0.0

+ 1 - 1
boxcost/bus/main.go

@@ -1,7 +1,7 @@
 package bus
 
 import (
-	"boxcost/conf"
+	"box-cost/conf"
 
 	"infish.cn/comm"
 )

+ 1 - 1
boxcost/conf/app.go

@@ -4,7 +4,7 @@ import (
 	"fmt"
 	"os"
 
-	"boxcost/log"
+	"box-cost/log"
 
 	"github.com/spf13/viper"
 )

+ 2 - 2
boxcost/db/repo/repo.go

@@ -1,8 +1,8 @@
 package repo
 
 import (
-	"boxcost/db"
-	"boxcost/log"
+	"box-cost/db"
+	"box-cost/log"
 	"context"
 	"fmt"
 

+ 2 - 2
boxcost/go.mod

@@ -1,4 +1,4 @@
-module boxcost
+module box-cost
 
 go 1.19
 
@@ -9,7 +9,6 @@ require (
 	github.com/gin-gonic/gin v1.7.4
 	github.com/go-redis/redis/v8 v8.11.5
 	github.com/natefinch/lumberjack v2.0.0+incompatible
-	github.com/nats-io/nats.go v1.13.1-0.20220308171302-2f2f6968e98d
 	github.com/spf13/viper v1.9.0
 	go.mongodb.org/mongo-driver v1.9.1
 	go.uber.org/dig v1.12.0
@@ -45,6 +44,7 @@ require (
 	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
 	github.com/modern-go/reflect2 v1.0.2 // indirect
 	github.com/nats-io/jwt/v2 v2.3.0 // indirect
+	github.com/nats-io/nats.go v1.13.1-0.20220308171302-2f2f6968e98d // indirect
 	github.com/nats-io/nkeys v0.3.0 // indirect
 	github.com/nats-io/nuid v1.0.1 // indirect
 	github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect

+ 5 - 5
boxcost/main.go

@@ -1,11 +1,11 @@
 package main
 
 import (
-	"boxcost/api"
-	"boxcost/bus"
-	"boxcost/conf"
-	"boxcost/db"
-	"boxcost/log"
+	"box-cost/api"
+	"box-cost/bus"
+	"box-cost/conf"
+	"box-cost/db"
+	"box-cost/log"
 	"flag"
 
 	"go.uber.org/dig"