Merge branch 'develop' of https://gitee.com/fusenpack/fusenapi into develop
This commit is contained in:
commit
ae27baa79b
|
@ -8,9 +8,6 @@ cp /opt/server.fusen.3718.cn.pem ./
|
|||
cp /opt/server.fusen.3718.cn.key ./
|
||||
#构建二进制文件
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o ./bin/api-$name-srv ./$name.go
|
||||
#删除之前旧的镜像
|
||||
docker rmi -f api-$name-srv:latest
|
||||
docker rmi -f registry.cn-hangzhou.aliyuncs.com/fusen-test/fusen_docker_hub:latest
|
||||
#打包docker镜像
|
||||
docker build -t api-$name-srv:latest .
|
||||
#删除临时复制进来的文件
|
||||
|
@ -21,3 +18,6 @@ rm ./server.fusen.3718.cn.key
|
|||
docker tag api-$name-srv:latest registry.cn-hangzhou.aliyuncs.com/fusen-test/$name:latest
|
||||
#推送到阿里云镜像库(测试环境,正式把命名空间fusentest改成fusen)
|
||||
docker push registry.cn-hangzhou.aliyuncs.com/fusen-test/$name:latest
|
||||
#上传了的镜像
|
||||
docker rmi -f api-$name-srv:latest
|
||||
docker rmi -f registry.cn-hangzhou.aliyuncs.com/fusen-test/$name:latest
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
FROM alpine
|
||||
|
||||
WORKDIR /www/fusenapi/
|
||||
COPY ./bin/api-assistant-srv /www/fusenapi/
|
||||
COPY ./bin/api-auth-srv /www/fusenapi/
|
||||
COPY ./env.yaml /opt/
|
||||
COPY ./server.fusen.3718.cn.pem /opt/
|
||||
COPY ./server.fusen.3718.cn.key /opt/
|
||||
CMD ["/www/fusenapi/api-assistant-srv"]
|
||||
CMD ["/www/fusenapi/api-auth-srv"]
|
||||
|
|
8
server/base/Dockerfile
Executable file
8
server/base/Dockerfile
Executable file
|
@ -0,0 +1,8 @@
|
|||
FROM alpine
|
||||
|
||||
WORKDIR /www/fusenapi/
|
||||
COPY ./bin/api-base-srv /www/fusenapi/
|
||||
COPY ./env.yaml /opt/
|
||||
COPY ./server.fusen.3718.cn.pem /opt/
|
||||
COPY ./server.fusen.3718.cn.key /opt/
|
||||
CMD ["/www/fusenapi/api-base-srv"]
|
|
@ -27,6 +27,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|||
Path: "/api/collection/get_collect_product_list",
|
||||
Handler: GetCollectProductListHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/api/collection/test_ai",
|
||||
Handler: TestAiHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
35
server/collection/internal/handler/testaihandler.go
Normal file
35
server/collection/internal/handler/testaihandler.go
Normal file
|
@ -0,0 +1,35 @@
|
|||
package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"reflect"
|
||||
|
||||
"fusenapi/utils/basic"
|
||||
|
||||
"fusenapi/server/collection/internal/logic"
|
||||
"fusenapi/server/collection/internal/svc"
|
||||
"fusenapi/server/collection/internal/types"
|
||||
)
|
||||
|
||||
func TestAiHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
var req types.TestAiReq
|
||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// 创建一个业务逻辑层实例
|
||||
l := logic.NewTestAiLogic(r.Context(), svcCtx)
|
||||
|
||||
rl := reflect.ValueOf(l)
|
||||
basic.BeforeLogic(w, r, rl)
|
||||
|
||||
resp := l.TestAi(&req, userinfo)
|
||||
|
||||
if !basic.AfterLogic(w, r, rl, resp) {
|
||||
basic.NormalAfterLogic(w, r, resp)
|
||||
}
|
||||
}
|
||||
}
|
96
server/collection/internal/logic/testailogic.go
Normal file
96
server/collection/internal/logic/testailogic.go
Normal file
File diff suppressed because one or more lines are too long
|
@ -40,6 +40,10 @@ type GetCollectProductListRspItem struct {
|
|||
IsDeleted int64 `json:"is_deleted"`
|
||||
}
|
||||
|
||||
type TestAiReq struct {
|
||||
Num int `form:"num"`
|
||||
}
|
||||
|
||||
type Request struct {
|
||||
}
|
||||
|
||||
|
|
8
server/info/Dockerfile
Executable file
8
server/info/Dockerfile
Executable file
|
@ -0,0 +1,8 @@
|
|||
FROM alpine
|
||||
|
||||
WORKDIR /www/fusenapi/
|
||||
COPY ./bin/api-info-srv /www/fusenapi/
|
||||
COPY ./env.yaml /opt/
|
||||
COPY ./server.fusen.3718.cn.pem /opt/
|
||||
COPY ./server.fusen.3718.cn.key /opt/
|
||||
CMD ["/www/fusenapi/api-info-srv"]
|
8
server/order/Dockerfile
Executable file
8
server/order/Dockerfile
Executable file
|
@ -0,0 +1,8 @@
|
|||
FROM alpine
|
||||
|
||||
WORKDIR /www/fusenapi/
|
||||
COPY ./bin/api-order-srv /www/fusenapi/
|
||||
COPY ./env.yaml /opt/
|
||||
COPY ./server.fusen.3718.cn.pem /opt/
|
||||
COPY ./server.fusen.3718.cn.key /opt/
|
||||
CMD ["/www/fusenapi/api-order-srv"]
|
8
server/resource/Dockerfile
Executable file
8
server/resource/Dockerfile
Executable file
|
@ -0,0 +1,8 @@
|
|||
FROM alpine
|
||||
|
||||
WORKDIR /www/fusenapi/
|
||||
COPY ./bin/api-resource-srv /www/fusenapi/
|
||||
COPY ./env.yaml /opt/
|
||||
COPY ./server.fusen.3718.cn.pem /opt/
|
||||
COPY ./server.fusen.3718.cn.key /opt/
|
||||
CMD ["/www/fusenapi/api-resource-srv"]
|
|
@ -18,6 +18,9 @@ service collection {
|
|||
//获取收藏列表
|
||||
@handler GetCollectProductListHandler
|
||||
get /api/collection/get_collect_product_list(GetCollectProductListReq) returns (response);
|
||||
//测试
|
||||
@handler TestAiHandler
|
||||
get /api/collection/test_ai(TestAiReq) returns (response);
|
||||
}
|
||||
|
||||
//收藏产品
|
||||
|
@ -52,4 +55,8 @@ type GetCollectProductListRspItem {
|
|||
MinPrice string `json:"min_price"`
|
||||
IsShelf int64 `json:"is_shelf"`
|
||||
IsDeleted int64 `json:"is_deleted"`
|
||||
}
|
||||
//测试
|
||||
type TestAiReq {
|
||||
Num int `form:"num"`
|
||||
}
|
Loading…
Reference in New Issue
Block a user