Skip to content

Feat/sample at ecommerce platform - #95

Merged
thunguo merged 18 commits into
apache:mainfrom
AsperforMias:feat/sample-AT-Ecommerce-platform
Jul 4, 2026
Merged

Feat/sample at ecommerce platform#95
thunguo merged 18 commits into
apache:mainfrom
AsperforMias:feat/sample-AT-Ecommerce-platform

Conversation

@AsperforMias

@AsperforMias AsperforMias commented May 27, 2026

Copy link
Copy Markdown
Contributor

What this PR does:
implement the #90 , E-commerce[AT] platform sample
Which issue(s) this PR fixes:
Fixes #
nil
The related PR of seata-go

You should pay attention to items below to ensure your pr passes our ci test
We do not merge pr with ci tests failed

  • All ut passed (run 'go test ./...' in project root)
  • After go-fmt ed , run 'go fmt project' using goland.
  • Golangci-lint passed, run 'sudo golangci-lint run' in project root.
  • Your new-created file needs to have apache license at the top, like other existed file does.

@AsperforMias
AsperforMias marked this pull request as ready for review May 27, 2026 07:07
@thunguo
thunguo requested a review from Copilot May 30, 2026 10:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new AT-mode “e-commerce platform” sample (issue #90) to this repo, consisting of three HTTP services (order/inventory/account) coordinated by a Seata global transaction, plus the required MySQL schema/seed data and a docker-compose environment.

Changes:

  • Add MySQL initialization SQL for three service databases (order/inventory/account) including undo_log tables and seed data.
  • Add runnable order, inventory, and account Go services implementing the create-order / deduct-stock / deduct-balance flow using Seata-go AT.
  • Add docker-compose.yml and a README with run instructions and success/rollback scenarios.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
at/ecommerce/sql/mysql_ecommerce.sql Creates the three databases, tables, undo_log, and seeds inventory/account data.
at/ecommerce/README.md Documents how to start infra/services and exercise commit/rollback scenarios.
at/ecommerce/docker-compose.yml Brings up MySQL and Seata Server for the sample.
at/ecommerce/order/main.go Boots the order service HTTP API and config/env setup.
at/ecommerce/order/create.go Implements global transaction + order insert + HTTP calls to inventory/account.
at/ecommerce/inventory/main.go Boots the inventory service and installs Seata Gin transaction middleware.
at/ecommerce/inventory/deduct.go Implements stock deduction SQL update.
at/ecommerce/account/main.go Boots the account service and installs Seata Gin transaction middleware.
at/ecommerce/account/deduct.go Implements balance deduction SQL update.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread at/ecommerce/README.md Outdated
Comment thread at/ecommerce/inventory/deduct.go
Comment thread at/ecommerce/account/deduct.go
Comment thread at/ecommerce/order/create.go
@AsperforMias

Copy link
Copy Markdown
Contributor Author

ask for open a CI workflow and review

@ssshr-66
ssshr-66 self-requested a review June 6, 2026 12:12
@AsperforMias
AsperforMias requested a review from Copilot June 10, 2026 02:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 11 comments.

Comment thread at/ecommerce/order/create.go Outdated
Comment thread at/ecommerce/order/create.go Outdated
Comment thread at/ecommerce/inventory/deduct.go Outdated
Comment thread at/ecommerce/account/deduct.go Outdated
Comment thread at/ecommerce/sql/mysql_ecommerce.sql Outdated
Comment thread at/ecommerce/sql/mysql_ecommerce.sql Outdated
Comment thread at/ecommerce/docker-compose.yml Outdated
Comment thread at/ecommerce/docker-compose.yml Outdated
Comment thread at/ecommerce/order/main.go Outdated
Comment thread at/ecommerce/order/main.go Outdated
@AsperforMias
AsperforMias requested a review from Copilot June 10, 2026 02:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.

Comment thread util/env.go Outdated
Comment thread at/ecommerce/order/main.go
Comment thread at/ecommerce/inventory/deduct.go
Comment thread at/ecommerce/account/deduct.go
Comment thread at/ecommerce/order/create.go Outdated
Comment thread at/ecommerce/README.md Outdated
Comment thread at/ecommerce/docker-compose.yml Outdated
@AsperforMias
AsperforMias requested a review from Copilot June 10, 2026 02:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.

Comment thread util/env.go Outdated
Comment thread util/http.go
Comment thread util/db.go Outdated
Comment thread at/ecommerce/order/main.go
Comment thread at/ecommerce/README.md
@AsperforMias
AsperforMias requested a review from Copilot June 10, 2026 02:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.

Comment thread at/ecommerce/order/create.go Outdated
Comment thread at/ecommerce/order/create.go Outdated
Comment thread at/ecommerce/sql/mysql_ecommerce.sql Outdated
Comment thread at/ecommerce/sql/mysql_ecommerce.sql Outdated
Comment thread util/http.go

@thunguo thunguo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

确认下这些comment是不是需要修改

Comment thread at/ecommerce/order/create.go Outdated
Comment thread at/ecommerce/order/create.go Outdated
Comment thread util/env.go Outdated
@thunguo

thunguo commented Jun 13, 2026

Copy link
Copy Markdown

处理下CI问题

@AsperforMias

AsperforMias commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

ci问题也处理了,at/ecommerce/.env.example的ASF license header已补回

@thunguo thunguo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AsperforMias

Copy link
Copy Markdown
Contributor Author

are there any other flaws that need to be improved here?

@thunguo

thunguo commented Jun 25, 2026

Copy link
Copy Markdown

辛苦解决下冲突~

@AsperforMias
AsperforMias force-pushed the feat/sample-AT-Ecommerce-platform branch 2 times, most recently from 7fd2316 to a1aa65d Compare June 27, 2026 11:14
@thunguo
thunguo merged commit 8c80750 into apache:main Jul 4, 2026
11 checks passed
@AsperforMias
AsperforMias deleted the feat/sample-AT-Ecommerce-platform branch July 4, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants