/* * This is a microservice e-commerce store sample with Gateway and three microservice applications * This uses Consul for service discovery and JWT authentication */ application { config { baseName store applicationType gateway packageName com.jhipster.demo.store serviceDiscoveryType consul authenticationType jwt databaseType sql prodDatabaseType mysql devDatabaseType mysql cacheProvider no buildTool maven clientFramework vue clientTheme none enableHibernateCache false enableSwaggerCodegen false enableTranslation false jhiPrefix sys messageBroker false nativeLanguage zh-cn searchEngine elasticsearch serverPort 8080 testFrameworks [gatling, cypress] websocket false // reactive true } entities * } application { config { baseName product applicationType microservice packageName com.jhipster.demo.product serviceDiscoveryType consul authenticationType jwt prodDatabaseType mysql devDatabaseType mysql cacheProvider redis buildTool maven // clientFramework vue // testFrameworks [cypress] databaseType sql // clientTheme no enableHibernateCache true enableSwaggerCodegen false enableTranslation false jhiPrefix union messageBroker false nativeLanguage zh-cn searchEngine elasticsearch serverPort 8081 // testFrameworks [gatling, cypress] websocket false // skipUserManagement true // reactive false } entities Product, ProductCategory, ProductOrder, OrderItem, ProductType } application { config { baseName invoice applicationType microservice packageName com.jhipster.demo.invoice serviceDiscoveryType consul authenticationType jwt prodDatabaseType mysql devDatabaseType mysql cacheProvider redis buildTool maven // clientFramework vue // testFrameworks [cypress] databaseType sql // clientTheme no enableHibernateCache true enableSwaggerCodegen true enableTranslation false jhiPrefix union messageBroker kafka nativeLanguage zh-cn searchEngine elasticsearch serverPort 8082 // testFrameworks [gatling, cypress] websocket false // skipUserManagement true // reactive false } entities Invoice, Shipment } application { config { baseName notification applicationType microservice packageName com.jhipster.demo.notification serviceDiscoveryType consul authenticationType jwt databaseType mongodb prodDatabaseType mongodb devDatabaseType mongodb enableTranslation false cacheProvider no enableHibernateCache false buildTool maven serverPort 8083 skipUserManagement true } entities Notification } /* Entities for Store Gateway */ /**可视权限 */ @EntityClassHumanized("可视权限") entity SysViewPermission { id Long /** 权限名称 */ @FieldNameHumanized("权限名称") name String required /** 权限类型 */ @FieldNameHumanized("权限类型") type ViewPermissionType required /** 多语言Key */ @FieldNameHumanized("多语言Key") localeKey String /** 显示分组名 */ @FieldNameHumanized("显示分组名") group Boolean /** 路由 */ @FieldNameHumanized("路由") link String /** 外部链接 */ @FieldNameHumanized("外部链接") externalLink String /** 链接目标 */ @FieldNameHumanized("链接目标") target TargetType /** 图标 */ @FieldNameHumanized("图标") icon String /** 禁用菜单 */ @FieldNameHumanized("禁用菜单") disabled Boolean /** 隐藏菜单 */ @FieldNameHumanized("隐藏菜单") hide Boolean /** 隐藏面包屑 */ @FieldNameHumanized("隐藏面包屑") hideInBreadcrumb Boolean /** 快捷菜单项 */ @FieldNameHumanized("快捷菜单项") shortcut Boolean /** 菜单根节点 */ @FieldNameHumanized("菜单根节点") shortcutRoot Boolean /** 允许复用 */ @FieldNameHumanized("允许复用") reuse Boolean /** 权限代码 */ @FieldNameHumanized("权限代码") code String required /** 权限描述 */ @FieldNameHumanized("权限描述") description String /** 排序 */ @FieldNameHumanized("排序") order Integer /** api权限标识串 */ @FieldNameHumanized("api权限标识串") apiPermissionCodes String /** 组件名称 */ @FieldNameHumanized("组件名称") componentName String /** 重定向路径 */ @FieldNameHumanized("重定向路径") redirect String } relationship ManyToMany { SysViewPermission {authority(name)} to Authority{viewPerssion(id)} with builtInEntity } /** 客户 */ @EntityAuthority(ROLE_TEACHER) @EntityReadAuthority(ROLE_STUDENT) @EntityClassHumanized("客户类1") entity Customer { id Long /** 名字 */ @FieldNameHumanized("公司名称1") firstName String required /** 姓氏 */ @FieldNameHumanized("公司名称2") lastName String required /** 性别 */ @FieldNameHumanized("公司名称3") gender Gender required /** 电子邮件 */ @FieldNameHumanized("公司名称4") email String required pattern(/^[^@\s]+@[^@\s]+\.[^@\s]+$/) /** 电话 */ @FieldNameHumanized("公司名称5") phone String required /** 地址1 */ @FieldNameHumanized("公司名称6") addressLine1 String required /** 地址2 */ @FieldNameHumanized("公司名称7") addressLine2 String /** 城市 */ @FieldNameHumanized("公司名称") city String required /** 州 */ @FieldNameHumanized("公司名称") state String /** 国家 */ @FieldNameHumanized("公司名称") country String required } /** 可视权限类型 */ enum ViewPermissionType { /** 菜单 */ MENU, /** 按钮 */ BUTTON } /** 链接目标 */ enum TargetType { /** 新窗口 */ BLANK, /** 当前窗口 */ SELF, /** 父窗口 */ PARENT, /** 顶层窗口 */ TOP } /** 员工*/ entity Employee { id Long required /** 名字 */ firstName String required /** 姓氏 */ lastName String required /** 手机号码 */ mobileNo String maxlength(11) /** 性别 */ sex Gender } /** 公司 */ entity Company { id Long required /** 名称 */ name String /** 联系人 */ contact String } relationship ManyToMany { Company{employee(firstName)} to Employee{company(name)} } /** 性别 */ enum Gender { /** 男性 */ MALE, /** 女性 */ FEMALE, /** 其他 */ OTHER } relationship OneToOne { Customer{user(login) required} to User with builtInEntity // Customer{authority(name) required} to Authority with builtInEntity } //relationship ManyToMany { // Customer{authority(name) required} to Authority{customer(firstName)} with builtInEntity //} service Customer with serviceClass paginate Customer with pagination /** Product sold by the Online store */ entity Product { id Long name String required description String price BigDecimal required min(0) productSize Size required comment String image ImageBlob } /** 商品类型 */ entity ProductType { id Long /** 类型名称 */ name String required /** 类型描述 */ description String } enum Size { S, M, L, XL, XXL } entity ProductCategory { id Long name String required description String } /** 订单 */ entity ProductOrder { id UUID /** 下单日期 */ placedDate Instant required /** 订单状态 */ status OrderStatus required /** 订单编号 */ code String required /** 发票ID */ invoiceId Long /** 客户 */ customer String required } /** 订单 */ entity ProductOrderTest { id UUID /** 下单日期 */ placedDate Instant required /** 订单状态 */ status OrderStatus required /** 订单编号 */ code String required /** 发票ID */ invoiceId Long /** 客户 */ customer String required } /** 订单状态 */ enum OrderStatus { /** 完成 */ COMPLETED, /** 待处理 */ PENDING, /** 已取消 */ CANCELLED } entity OrderItem { id UUID 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)} } relationship ManyToMany { Product{productType(name)} to ProductType{product(name)} } service Product, ProductCategory, ProductOrder, OrderItem with serviceClass paginate Product, ProductOrder, OrderItem, Employee, Company with pagination microservice Product, ProductType, ProductOrder, ProductCategory, OrderItem with product /* Entities for Invoice microservice */ /** 发票 */ entity Invoice { id Long /** 发票号码 */ 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 { id Long 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 { id UUID /** 通知日期 */ date Instant required /** 通知详情 */ details String /** 发送日期 */ sentDate Instant required /** 通知类型 */ format NotificationType required /** 通知用户ID */ userId Long required /** 产品ID */ productId Long required } enum NotificationType { EMAIL, SMS, PARCEL } microservice Notification with notification dto * with mapstruct search * with elasticsearch