1 Star 0 Fork 0

andrew7baker/jdl-samples

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
microservice-ecommerce-store-istio-deployment.jdl 4.65 KB
一键复制 编辑 原始数据 按行查看 历史
/*
* This is a microservice e-commerce store sample with Gateway and three microservice applications
* This uses Istio for native kubernetes service discovery and JWT authentication
* This also creates the required Kubernetes deployment manifests and Istio routes
*/
application {
config {
baseName store
applicationType gateway
packageName com.jhipster.demo.store
serviceDiscoveryType no
authenticationType jwt
prodDatabaseType mysql
cacheProvider hazelcast
buildTool gradle
clientFramework react
useSass true
testFrameworks [protractor]
}
entities *
}
application {
config {
baseName product
applicationType microservice
packageName com.jhipster.demo.product
serviceDiscoveryType no
authenticationType jwt
prodDatabaseType mysql
cacheProvider hazelcast
buildTool gradle
serverPort 8081
}
entities Product, ProductCategory, ProductOrder, OrderItem
}
application {
config {
baseName invoice
applicationType microservice
packageName com.jhipster.demo.invoice
serviceDiscoveryType no
authenticationType jwt
prodDatabaseType mysql
buildTool gradle
serverPort 8082
}
entities Invoice, Shipment
}
application {
config {
baseName notification
applicationType microservice
packageName com.jhipster.demo.notification
serviceDiscoveryType no
authenticationType jwt
databaseType mongodb
cacheProvider no
enableHibernateCache false
buildTool gradle
serverPort 8083
}
entities Notification
}
/**
* Entities for Store Gateway
*/
// Customer for the store
entity Customer {
firstName String required
lastName String required
gender Gender required
email String required pattern(/^[^@\s]+@[^@\s]+\.[^@\s]+$/)
phone String required
addressLine1 String required
addressLine2 String
city String required
country String required
}
enum Gender {
MALE, FEMALE, OTHER
}
relationship OneToOne {
Customer{user(login) required} to User
}
service Customer with serviceClass
paginate Customer with pagination
/**
* Entities for product microservice
*/
// Product sold by the Online store
entity Product {
name String required
description String
price BigDecimal required min(0)
size Size required
image ImageBlob
}
enum Size {
S, M, L, XL, XXL
}
entity ProductCategory {
name String required
description String
}
entity ProductOrder {
placedDate Instant required
status OrderStatus required
code String required
invoiceId Long
customer String required
}
enum OrderStatus {
COMPLETED, PENDING, CANCELLED
}
entity OrderItem {
quantity Integer required min(0)
totalPrice BigDecimal required min(0)
status OrderItemStatus required
}
enum OrderItemStatus {
AVAILABLE, OUT_OF_STOCK, BACK_ORDER
}
relationship ManyToOne {
OrderItem{product(name) required} to Product
}
relationship OneToMany {
ProductOrder{orderItem} to OrderItem{order(code) required} ,
ProductCategory{product} to Product{productCategory(name)}
}
service Product, ProductCategory, ProductOrder, OrderItem with serviceClass
paginate Product, ProductOrder, OrderItem with pagination
microservice Product, ProductOrder, ProductCategory, OrderItem with product
/**
* Entities for Invoice microservice
*/
// Invoice for sales
entity Invoice {
code String required
date Instant required
details String
status InvoiceStatus required
paymentMethod PaymentMethod required
paymentDate Instant required
paymentAmount BigDecimal required
}
enum InvoiceStatus {
PAID, ISSUED, CANCELLED
}
entity Shipment {
trackingCode String
date Instant required
details String
}
enum PaymentMethod {
CREDIT_CARD, CASH_ON_DELIVERY, PAYPAL
}
relationship OneToMany {
Invoice{shipment} to Shipment{invoice(code) required}
}
service Invoice, Shipment with serviceClass
paginate Invoice, Shipment with pagination
microservice Invoice, Shipment with invoice
/**
* Entities for notification microservice
*/
entity Notification {
date Instant required
details String
sentDate Instant required
format NotificationType required
userId Long required
productId Long required
}
enum NotificationType {
EMAIL, SMS, PARCEL
}
microservice Notification with notification
/**
* Deployments
*/
deployment {
deploymentType kubernetes
appsFolders [store, invoice, notification, product]
dockerRepositoryName "@Replace With Your Docker repo name@"
serviceDiscoveryType no
istio true
kubernetesServiceType Ingress
kubernetesNamespace jhipster
ingressDomain "@Replace with your Istio IngressGateway's external IP@.nip.io"
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/andrew7baker/jdl-samples.git
git@gitee.com:andrew7baker/jdl-samples.git
andrew7baker
jdl-samples
jdl-samples
master

搜索帮助