参考资料:点餐的功能要求如下。 1、用户登录,注册,搜索美食,浏览菜单,点击美食,跳转美食详情页,可加入购物车,可删除购物车,可收藏美食,可取消收藏。 2、用户下单(可以选择商品,比如购物车有三个商品,可以任意选两个下单),然后填个人信息(包括:配送方式 外卖或堂食,手机号),然后支付。可以催单。 3、用户支付时,需要选择支付方式(微信,支付宝,银行卡(储蓄卡,信用卡)),并确认支付。支付后系统扣除用户账户余额。 4、用户可以查看历史订单,可以查看余额,可以修改昵称。 5、VIP用户所有商品可以打八折。 6、管理员添加用户信息,删除用户信息,修改用户信息,设置VIP用户。(所有操作都需要登录)。 7、商家添加美食信息,删除美食信息,修改美食信息,提现。(所有操作都需要登录)。 根据这些画组件图使用 PlantUML 代码
时间: 2024-03-18 13:45:11 浏览: 125
以下是使用PlantUML代码画出的组件图:
```
@startuml
!define AWSPUML https://raw.githubusercontent.com/awslabs/aws-icons-for-plantuml/v14.0.2/dist
!includeurl AWSPUML/CustomerEngagement/amazon-pinpoint-communications.puml
!includeurl AWSPUML/AppIntegration/amazon-appflow.puml
!includeurl AWSPUML/ApplicationIntegration/amazon-sns.puml
!includeurl AWSPUML/Compute/amazon-ec2.puml
!includeurl AWSPUML/Compute/amazon-lightsail.puml
!includeurl AWSPUML/Compute/amazon-ecs.puml
!includeurl AWSPUML/Compute/amazon-elastic-container-registry.puml
!includeurl AWSPUML/Compute/amazon-elastic-kubernetes-service.puml
!includeurl AWSPUML/Compute/amazon-elastic-beanstalk.puml
!includeurl AWSPUML/Database/amazon-rds.puml
!includeurl AWSPUML/Database/amazon-dynamodb.puml
!includeurl AWSPUML/Database/amazon-documentdb.puml
!includeurl AWSPUML/Database/amazon-elasticache.puml
!includeurl AWSPUML/Database/amazon-neptune.puml
!includeurl AWSPUML/Database/amazon-qldb.puml
!includeurl AWSPUML/Database/amazon-redshift.puml
!includeurl AWSPUML/Database/amazon-timestream.puml
!includeurl AWSPUML/DeveloperTools/amazon-codebuild.puml
!includeurl AWSPUML/DeveloperTools/amazon-codecommit.puml
!includeurl AWSPUML/DeveloperTools/amazon-codedeploy.puml
!includeurl AWSPUML/DeveloperTools/amazon-codepipeline.puml
!includeurl AWSPUML/DeveloperTools/amazon-xray.puml
!includeurl AWSPUML/GameDevelopment/amazon-gamelift.puml
!includeurl AWSPUML/InternetOfThings/amazon-freertos.puml
!includeurl AWSPUML/InternetOfThings/amazon-iot.puml
!includeurl AWSPUML/InternetOfThings/amazon-iot-analytics.puml
!includeurl AWSPUML/InternetOfThings/amazon-iot-device-defender.puml
!includeurl AWSPUML/InternetOfThings/amazon-iot-device-management.puml
!includeurl AWSPUML/InternetOfThings/amazon-iot-events.puml
!includeurl AWSPUML/InternetOfThings/amazon-iot-sitewise.puml
!includeurl AWSPUML/InternetOfThings/amazon-iot-things-graph.puml
!includeurl AWSPUML/InternetOfThings/amazon-iot-greengrass.puml
!includeurl AWSPUML/MachineLearning/amazon-sagemaker.puml
!includeurl AWSPUML/ManagementAndGovernance/amazon-cloudwatch.puml
!includeurl AWSPUML/ManagementAndGovernance/amazon-cloudformation.puml
!includeurl AWSPUML/ManagementAndGovernance/amazon-cloudtrail.puml
!includeurl AWSPUML/ManagementAndGovernance/amazon-config.puml
!includeurl AWSPUML/ManagementAndGovernance/amazon-control-tower.puml
!includeurl AWSPUML/ManagementAndGovernance/amazon-service-catalog.puml
!includeurl AWSPUML/MessagingAndTargeting/amazon-ses.puml
!includeurl AWSPUML/MessagingAndTargeting/amazon-sms-and-voice.puml
!includeurl AWSPUML/MessagingAndTargeting/amazon-pinpoint.puml
!includeurl AWSPUML/MigrationAndTransfer/amazon-s3-transfer-acceleration.puml
!includeurl AWSPUML/MigrationAndTransfer/amazon-snowball.puml
!includeurl AWSPUML/MigrationAndTransfer/amazon-snowmobile.puml
!includeurl AWSPUML/Mobile/amazon-mobile-analytics.puml
!includeurl AWSPUML/Mobile/amazon-pinpoint-mobile.puml
!includeurl AWSPUML/NetworkAndContentDelivery/amazon-cloudfront.puml
!includeurl AWSPUML/NetworkAndContentDelivery/amazon-vpc.puml
!includeurl AWSPUML/QuantumTechnologies/amazon-braket.puml
!includeurl AWSPUML/Robotics/amazon-robomaker.puml
!includeurl AWSPUML/Satellite/amazon-ground-station.puml
!includeurl AWSPUML/SecurityIdentityAndCompliance/amazon-iam.puml
!includeurl AWSPUML/SecurityIdentityAndCompliance/amazon-cognito.puml
!includeurl AWSPUML/SecurityIdentityAndCompliance/amazon-guardduty.puml
!includeurl AWSPUML/SecurityIdentityAndCompliance/amazon-macie.puml
!includeurl AWSPUML/SecurityIdentityAndCompliance/amazon-secret-manager.puml
!includeurl AWSPUML/SecurityIdentityAndCompliance/amazon-security-hub.puml
!includeurl AWSPUML/SecurityIdentityAndCompliance/amazon-shield.puml
!includeurl AWSPUML/SecurityIdentityAndCompliance/amazon-waf.puml
!includeurl AWSPUML/Storage/amazon-s3.puml
!includeurl AWSPUML/Storage/amazon-ebs.puml
!includeurl AWSPUML/Storage/amazon-efs.puml
!includeurl AWSPUML/Storage/amazon-glacier.puml
!includeurl AWSPUML/Storage/amazon-storage-gateway.puml
title 点餐系统组件图
actor User
actor VIPUser
actor Admin
actor Merchant
package "User Functionality" {
[Login/Register]
[Search Food]
[Browse Menu]
[View Food Details]
[Add to Cart]
[Remove from Cart]
[Favorite Food]
[Unfavorite Food]
[Place Order]
[Fill in Personal Information]
[Pay]
[View Order History]
[View Balance]
[Edit Nickname]
[View Discounted Prices]
User --> [Login/Register] : Performs
User --> [Search Food] : Performs
User --> [Browse Menu] : Performs
User --> [View Food Details] : Performs
User --> [Add to Cart] : Performs
User --> [Remove from Cart] : Performs
User --> [Favorite Food] : Performs
User --> [Unfavorite Food] : Performs
User --> [Place Order] : Performs
User --> [Fill in Personal Information] : Performs
User --> [Pay] : Performs
User --> [View Order History] : Performs
User --> [View Balance] : Performs
User --> [Edit Nickname] : Performs
VIPUser --> [View Discounted Prices] : Performs
}
package "Admin Functionality" {
[Add User Information]
[Delete User Information]
[Modify User Information]
[Set VIP User]
Admin --> [Add User Information] : Performs
Admin --> [Delete User Information] : Performs
Admin --> [Modify User Information] : Performs
Admin --> [Set VIP User] : Performs
}
package "Merchant Functionality" {
[Add Food Information]
[Delete Food Information]
[Modify Food Information]
[Withdraw]
Merchant --> [Add Food Information] : Performs
Merchant --> [Delete Food Information] : Performs
Merchant --> [Modify Food Information] : Performs
Merchant --> [Withdraw] : Performs
}
[Login/Register] --> [Amazon Cognito]
[Search Food] --> [Amazon Elasticsearch]
[Browse Menu] --> [Amazon S3]
[View Food Details] --> [Amazon S3]
[Add to Cart] --> [Amazon DynamoDB]
[Remove from Cart] --> [Amazon DynamoDB]
[Favorite Food] --> [Amazon DynamoDB]
[Unfavorite Food] --> [Amazon DynamoDB]
[Place Order] --> [Amazon EC2]
[Fill in Personal Information] --> [Amazon Pinpoint]
[Pay] --> [Amazon SNS]
[View Order History] --> [Amazon DynamoDB]
[View Balance] --> [Amazon RDS]
[Edit Nickname] --> [Amazon RDS]
@enduml
```
解释:
- 客户端使用Amazon Cognito进行用户登录/注册。
- 搜索美食和浏览菜单使用Amazon Elasticsearch和Amazon S3。
- 美食详情页使用Amazon S3。
- 购物车、收藏美食、加入购物车、从购物车中删除美食使用Amazon DynamoDB。
- 下单和支付使用Amazon EC2和Amazon SNS。
- 个人信息填写使用Amazon Pinpoint。
- 历史订单使用Amazon DynamoDB。
- 用户余额和昵称使用Amazon RDS。
- VIP用户打折功能使用条件语句。
- 管理员和商家功能使用PlantUML库中的图标表示。
阅读全文