fix: product price float
CI / changes (push) Successful in 13s
CI / ad (push) Successful in 3s
CI / admin (push) Successful in 2s
CI / bff (push) Successful in 2s
CI / chore (push) Successful in 1s
CI / express (push) Successful in 2s
CI / product (push) Successful in 31s
CI / sale (push) Successful in 2s
CI / user (push) Successful in 2s
CI / wecom (push) Successful in 2s

This commit is contained in:
zzw
2026-08-31 11:55:34 +08:00
parent c4af0f481a
commit 90a195c9ca
3 changed files with 24 additions and 27 deletions
+16 -20
View File
@@ -76,28 +76,20 @@ jobs:
docker: docker:
needs: changes needs: changes
runs-on: runner runs-on: runner
name: ${{ matrix.name }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
include: name:
- name: bff - bff
dockerfile: bff/Dockerfile - product
- name: product - admin
dockerfile: services/product/Dockerfile - user
- name: admin - ad
dockerfile: services/admin/Dockerfile - chore
- name: user - express
dockerfile: services/user/Dockerfile - sale
- name: ad - wecom
dockerfile: services/ad/Dockerfile
- name: chore
dockerfile: services/chore/Dockerfile
- name: express
dockerfile: services/express/Dockerfile
- name: sale
dockerfile: services/sale/Dockerfile
- name: wecom
dockerfile: services/wecom/Dockerfile
env: env:
BUILD_LIST: ${{ needs.changes.outputs.build_list }} BUILD_LIST: ${{ needs.changes.outputs.build_list }}
NAME: lone/${{ matrix.name }} NAME: lone/${{ matrix.name }}
@@ -124,8 +116,12 @@ jobs:
- name: Docker build - name: Docker build
if: steps.check.outputs.build == 'yes' if: steps.check.outputs.build == 'yes'
run: | run: |
case "${{ matrix.name }}" in
bff) dockerfile="bff/Dockerfile" ;;
*) dockerfile="services/${{ matrix.name }}/Dockerfile" ;;
esac
docker buildx use default docker buildx use default
docker buildx build --builder default --load -f "${{ matrix.dockerfile }}" -t "${{ vars.REGISTRY }}/$NAME:latest" . docker buildx build --builder default --load -f "$dockerfile" -t "${{ vars.REGISTRY }}/$NAME:latest" .
- name: Docker push - name: Docker push
if: steps.check.outputs.build == 'yes' if: steps.check.outputs.build == 'yes'
+2 -1
View File
@@ -12,7 +12,8 @@ rpc/scripts/gen-rpc.sh order
3.nacos 加配置 3.nacos 加配置
4.增加 etc/order.yaml 配置文件 4.增加 etc/order.yaml 配置文件
5.Dockerfile 文件 5.Dockerfile 文件
6.gitea 配置,修改这行。SERVICES="bff product admin user ad chore express sale wecom" 6.changes 里的 SERVICES="..."
docker.strategy.matrix.include 加一行 { name: xxx, dockerfile: services/xxx/Dockerfile }
``` ```
+6 -6
View File
@@ -22,16 +22,16 @@ func toProductItem(row dao.Info) *product.Item {
Subhead: row.Subhead, Subhead: row.Subhead,
Content: row.Content, Content: row.Content,
ModelCode: row.ModelCode, ModelCode: row.ModelCode,
Price: float64(row.Price), Price: utils.RoundFloat(float64(row.Price)),
StorePrice: float64(row.StorePrice), StorePrice: utils.RoundFloat(float64(row.StorePrice)),
SalePrice: float64(row.SalePrice), SalePrice: utils.RoundFloat(float64(row.SalePrice)),
SharePrice: float64(row.SharePrice), SharePrice: utils.RoundFloat(float64(row.SharePrice)),
AgentPrice: float64(row.AgentPrice), AgentPrice: utils.RoundFloat(float64(row.AgentPrice)),
SaleReward: row.SaleReward, SaleReward: row.SaleReward,
SalesModel: uint32(row.SalesModel), SalesModel: uint32(row.SalesModel),
Waybill: row.Waybill, Waybill: row.Waybill,
Status: uint32(row.Status), Status: uint32(row.Status),
Weight: float64(row.Weight), Weight: utils.RoundFloat(float64(row.Weight)),
IsIndex: uint32(row.IsIndex), IsIndex: uint32(row.IsIndex),
IndexImage: row.IndexImage, IndexImage: row.IndexImage,
Cubage: row.Cubage, Cubage: row.Cubage,