admin dynamic!@#eos
负责大B业务管理API
负责小B业务管理API
负责工具类API
负责微信小程序API
主要存放客户端的信息 前6个DB存放一些配置类的信息
- db0:存放手机号短信码验证
- db1:存放客户端菜单
- db2:存放客户端首页
- db3:存放客户端商品分类
- db4:存放小B购物车内容
- db5:存放我的菜单配置信息 后3个DB存放订单
- db6:存放订单
- db7:存放订单
- db8:存放订单
1.项目初始化,数据库初始化
./go-admin migrate -c config/settings.yml
2.项目启动
./go-admin server -c config/settings.yml
3.生成migrate模板
./go-admin migrate -c config/settings.yml -g false -a true
4.创建app
./go-admin app -n test
- 有时候MySQL不支持datetime为0的情况,设置db允许时间为空
[mysqld]
sql_mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
测试服务器 sudo CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X main.Version=2.1" -o dynamic-store && scp -P 26622 -i ~/.ssh/id_rsa -r dynamic-store [email protected]:/home/chaoqun
线上服务器 sudo CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X main.Version=2.3" -o dynamic-store && scp -P 26622 -i ~/.ssh/id_rsa -r dynamic-store [email protected]:/home/chaoqun
- 获取本机公钥地址:/Users/zhaichaoqun/.ssh/id_rsa.pub
- 在github settings中SSH keys / Add new
- 在本机ssh-add /Users/zhaichaoqun/.ssh/id_rsa 添加私钥尝试访问github
- ssh [email protected] 测试是否可访问
cat > /etc/systemd/system/dc-store.service << "END"
[Unit]
Description=DcStore
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/data/dynamic-store
## 注:根据可执行文件路径修改
ExecStart=/data/dynamic-store/dynamic-store server -c config/settings.yml
# auto restart
StartLimitIntervalSec=0
Restart=always
RestartSec=1
[Install]
WantedBy=multi-user.target
END
systemctl daemon-reload
systemctl start dc-store.service
systemctl status dc-store.service
systemctl enable dc-store.service