diff --git a/business/controller/order.go b/business/controller/order.go index facd39d29..641a6067e 100644 --- a/business/controller/order.go +++ b/business/controller/order.go @@ -47,6 +47,7 @@ func (c *OrderController) LoadPendingOrders() []*model.GoodsOrder { // msgVendorStatus的意思是事件本身的类型,类似有时收到NewOrder事件去取,订单状态不一定就是New的 // OnOrderAdjust也类似,而OrderStatus要记录的是消息,所以添加这个 func (c *OrderController) OnOrderNew(order *model.GoodsOrder, msgVendorStatus string) (err error) { + // todo transaction db := orm.NewOrm() if order.Status == model.OrderStatusUnknown { order.Status = model.OrderStatusNew @@ -66,6 +67,7 @@ func (c *OrderController) OnOrderNew(order *model.GoodsOrder, msgVendorStatus st // todo 调整单的处理可能还需要再细化一点,当前只是简单的删除重建 func (c *OrderController) OnOrderAdjust(order *model.GoodsOrder, msgVendorStatus string) (err error) { + // todo transaction db := orm.NewOrm() if order.Status == model.OrderStatusUnknown { order.Status = model.OrderStatusNew diff --git a/deploy/ansible.yml b/deploy/ansible.yml new file mode 100644 index 000000000..5413fd494 --- /dev/null +++ b/deploy/ansible.yml @@ -0,0 +1,13 @@ +--- +- hosts: {{ deploy_hosts }} + remote_user: ubuntu + tasks: + - name: copy execute file to dest + copy: + src: jx-callback + dest: /jxdata/jx-callback/jx-callback + owner: ubuntu + group: ubuntu + mode: u=rwx, g=rx, o=r + - name: shell + shell: sudo systemctl restart jx-callback diff --git a/deploy/jx-callback.service b/deploy/jx-callback.service new file mode 100644 index 000000000..0d00e2d8b --- /dev/null +++ b/deploy/jx-callback.service @@ -0,0 +1,20 @@ +[Unit] +Description=jx-callback service +Requires=mysql.service +After=network.target +After=mysql.service + +[Service] +Environment="GOPATH=/home/ubuntu/go/" +Type=simple +User=ubuntu +Group=ubuntu + +Restart=always +RestartSec=500ms + +WorkingDirectory=/jxdata/jx-callback +ExecStart=/bin/sh -c '/jxdata/jx-callback/jx-callback >> /jxdata/jx-callback/jx-callback.log 2>&1' + +[Install] +WantedBy=multi-user.target \ No newline at end of file