설명 없음

zoie 533c8d2c61 FIXBUG:用户登录后未获取到pid 8 달 전
configs 707d07306c first init 8 달 전
doc 707d07306c first init 8 달 전
docs b66e16c3fa 后台swagger添加 8 달 전
internal 533c8d2c61 FIXBUG:用户登录后未获取到pid 8 달 전
tools b3e555bcd7 UPDATE:同步内部库 8 달 전
.gitignore c5ddb614ee UPDATE:修改Makefile文件 8 달 전
Makefile c5ddb614ee UPDATE:修改Makefile文件 8 달 전
README.md e183b168b9 用户端接口添加 8 달 전
go.mod e183b168b9 用户端接口添加 8 달 전
go.sum b66e16c3fa 后台swagger添加 8 달 전
main.go e183b168b9 用户端接口添加 8 달 전

README.md

项目名称

  • 冷链物流系统

功能特性

  • 用户端下单
  • 司机端装货
  • 平台管理仓库,订单,车辆

快速开始

依赖检查

  • 本项目使用golang开发,安装版本>= 1.21
  • 本项目使用Mysql数据库,安装版本>=

构建

  • 本项目使用Makefile进行构建
  • 在项目目录下执行make,将在./cmd目录下生成对应二进制执行文件(以项目目录名命名)
  • 也可使用命令构建 go build -ldflags "-X gogs.baozhida.cn/Cold_Logistic_libs/pkg/contrib/version.Version=1.0 -X gogs.baozhida.cn/Cold_Logistic_libs/pkg/contrib/version.BuildTime=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -o ./cmd/cclogisticserver/cclogistic_6270 -v ./cmd/cclogisticserver/main.go
  • Linux运行需要加 GOOS=linux GOARCH=amd64 go bulid

    运行

    # 项目目录下执行
    # 编译
    make
    # 查看版本
    ./cmd/<执行文件> version
    # 启动api服务
    ./cmd/<执行文件> run --profile=./configs/test.yml
    
  • 配置文件请参考

  • 前后端整体部署时需安装Nginx,相关conf文件参考如下:

    upstream cold-logistic {
       server <cold-logistic进程ip:port> fail_timeout=0;
    }
    
    
    server {
    listen       443 ssl http2;
    server_name  cold.coldbaozhida.com;
    ssl_certificate     <xxxxx.cn_bundle.crt>;
    ssl_certificate_key  <xxxxx..cn.key>;
    
    error_log /var/log/nginx/error_Cold_Logistic.log;
    access_log /var/log/nginx/access_Cold_Logistic.log main;
    
    location /iblfront/Cold_Logistic {
        if ($request_filename ~* .*\.(?:htm|html|exe|yaml|yml|exe.blockmap|json|mp3)$){
            add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
        }
        alias <前端静态文件目录>;
       }
    
        location /Cold_Logistic/download/ {
        add_header Access-Control-Allow-Methods *;
        add_header Access-Control-Max-Age 3600;
        add_header Access-Control-Allow-Credentials true;
        add_header Access-Control-Allow-Origin *;
        add_header Access-Control-Allow-Headers
        $http_access_control_request_headers;
        if ($request_method = OPTIONS){
            return 200;
        }
        # add_header  Content-Type    "application/octet-stream";
        alias <配置文件中storage.localstorage.rootFilepath>;
       }
    
        location /Cold_Logistic/api/ {
        if ($request_method = OPTIONS){
            return 200;
            }
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto https;
        proxy_redirect off;
        proxy_connect_timeout      240;
        proxy_send_timeout         240;
        proxy_read_timeout         240;
        proxy_pass http://Cold_Logistic;
       }
    
    }
    
    location / {
        client_max_body_size 10m;
        add_header Access-Control-Allow-Methods *;
        add_header Access-Control-Max-Age 3600;
        add_header Access-Control-Allow-Credentials true;
        add_header Access-Control-Allow-Origin $http_origin;
        add_header Access-Control-Allow-Headers
        $http_access_control_request_headers;
        if ($request_method = OPTIONS){
            return 200;
        }
    
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto https;
        proxy_redirect off;
        proxy_connect_timeout      240;
        proxy_send_timeout         240;
        proxy_read_timeout         240;
        proxy_pass http://Cold_Logistic;
    }
    }
    

使用指南

# 查看命令帮助信息
./cmd/<二进制执行文件> --help 

【内部项目/非开源】

  • 未经授权严禁公开

引入本地包

配置ssh ssh-keygen -t rsa -b 4096 -C "example@example.com" git config --global url."git@gogs.baozhida.cn/Cold_Logistic_libs.git".insteadof "https://gogs.baozhida.cn/zoie/Cold_Logistic_libs.git" go get "gogs.baozhida.cn/zoie/Cold_Logistic_libs.git@master"