├── application-module
├── mall-module
│ ├── mall-service-order
│ │ ├── src
│ │ │ ├── test
│ │ │ │ ├── resources
│ │ │ │ │ ├── generate_config.properties
│ │ │ │ │ └── config
│ │ │ │ │ │ └── mall_order.yaml
│ │ │ │ └── java
│ │ │ │ │ └── org
│ │ │ │ │ └── smartframework
│ │ │ │ │ └── cloud
│ │ │ │ │ └── examples
│ │ │ │ │ └── mall
│ │ │ │ │ └── order
│ │ │ │ │ └── test
│ │ │ │ │ ├── SuiteTest.java
│ │ │ │ │ └── code
│ │ │ │ │ └── generate
│ │ │ │ │ └── CodeFileGenerateUtilTest.java
│ │ │ └── main
│ │ │ │ ├── resources
│ │ │ │ ├── i18n
│ │ │ │ │ ├── order_messages.properties
│ │ │ │ │ ├── order_messages_zh_CN.properties
│ │ │ │ │ └── order_messages_en_US.properties
│ │ │ │ ├── bootstrap.yaml
│ │ │ │ ├── META-INF
│ │ │ │ │ └── services
│ │ │ │ │ │ └── org.apache.shardingsphere.sharding.spi.ShardingAlgorithm
│ │ │ │ └── application.yaml
│ │ │ │ └── java
│ │ │ │ └── org
│ │ │ │ └── smartframework
│ │ │ │ └── cloud
│ │ │ │ └── examples
│ │ │ │ └── mall
│ │ │ │ └── order
│ │ │ │ ├── constants
│ │ │ │ └── OrderReturnCodes.java
│ │ │ │ ├── shardingjdbc
│ │ │ │ ├── BaseShardingAlgorithm.java
│ │ │ │ └── ShardingAlgorithmsType.java
│ │ │ │ ├── mapper
│ │ │ │ ├── OrderBillMapper.java
│ │ │ │ └── OrderDeliveryInfoMapper.java
│ │ │ │ ├── exception
│ │ │ │ └── UpdateStockException.java
│ │ │ │ ├── OrderApplication.java
│ │ │ │ └── mq
│ │ │ │ └── OrderMqConstants.java
│ │ └── .gitignore
│ ├── mall-service-product
│ │ ├── src
│ │ │ ├── main
│ │ │ │ ├── resources
│ │ │ │ │ ├── i18n
│ │ │ │ │ │ ├── product_messages.properties
│ │ │ │ │ │ ├── product_messages_zh_CN.properties
│ │ │ │ │ │ └── product_messages_en_US.properties
│ │ │ │ │ ├── application.yml
│ │ │ │ │ ├── org
│ │ │ │ │ │ └── smartframework
│ │ │ │ │ │ │ └── cloud
│ │ │ │ │ │ │ └── examples
│ │ │ │ │ │ │ └── mall
│ │ │ │ │ │ │ └── product
│ │ │ │ │ │ │ └── mapper
│ │ │ │ │ │ │ └── rpc
│ │ │ │ │ │ │ └── ProductInfoMapper.xml
│ │ │ │ │ └── application-db-product.yml
│ │ │ │ └── java
│ │ │ │ │ └── org
│ │ │ │ │ └── smartframework
│ │ │ │ │ └── cloud
│ │ │ │ │ └── examples
│ │ │ │ │ └── mall
│ │ │ │ │ └── product
│ │ │ │ │ ├── constants
│ │ │ │ │ └── ProductReturnCodes.java
│ │ │ │ │ ├── ProductApplication.java
│ │ │ │ │ └── mapper
│ │ │ │ │ └── ProductInfoMapper.java
│ │ │ └── test
│ │ │ │ ├── resources
│ │ │ │ ├── generate_config.properties
│ │ │ │ └── config
│ │ │ │ │ └── mall_product.yaml
│ │ │ │ └── java
│ │ │ │ └── org
│ │ │ │ └── smartframework
│ │ │ │ └── cloud
│ │ │ │ └── examples
│ │ │ │ └── mall
│ │ │ │ └── product
│ │ │ │ └── test
│ │ │ │ ├── SuiteTest.java
│ │ │ │ └── code
│ │ │ │ └── generate
│ │ │ │ └── CodeFileGenerateUtilTest.java
│ │ └── .gitignore
│ └── .gitignore
├── basic-module
│ ├── basic-service-auth
│ │ ├── src
│ │ │ ├── main
│ │ │ │ ├── resources
│ │ │ │ │ ├── i18n
│ │ │ │ │ │ ├── auth_messages.properties
│ │ │ │ │ │ ├── auth_messages_zh_CN.properties
│ │ │ │ │ │ └── auth_messages_en_US.properties
│ │ │ │ │ ├── bootstrap.yaml
│ │ │ │ │ ├── application.yaml
│ │ │ │ │ └── application-db-auth.yaml
│ │ │ │ └── java
│ │ │ │ │ └── org
│ │ │ │ │ └── smartframework
│ │ │ │ │ └── cloud
│ │ │ │ │ └── examples
│ │ │ │ │ └── basic
│ │ │ │ │ └── auth
│ │ │ │ │ ├── constants
│ │ │ │ │ └── AuthReturnCodes.java
│ │ │ │ │ ├── mapper
│ │ │ │ │ ├── RoleInfoMapper.java
│ │ │ │ │ ├── PermissionInfoMapper.java
│ │ │ │ │ └── UserRoleRelaMapper.java
│ │ │ │ │ ├── pojo
│ │ │ │ │ ├── RoleDO.java
│ │ │ │ │ ├── param
│ │ │ │ │ │ ├── PermissionReqDO.java
│ │ │ │ │ │ └── PageRolePermissonReqDO.java
│ │ │ │ │ └── PermissionDO.java
│ │ │ │ │ └── AuthApplication.java
│ │ │ └── test
│ │ │ │ ├── resources
│ │ │ │ ├── generate_config.properties
│ │ │ │ └── config
│ │ │ │ │ └── basic_auth.yaml
│ │ │ │ └── java
│ │ │ │ └── org
│ │ │ │ └── smartframework
│ │ │ │ └── cloud
│ │ │ │ └── examples
│ │ │ │ └── basic
│ │ │ │ └── auth
│ │ │ │ └── test
│ │ │ │ ├── SuiteTest.java
│ │ │ │ └── code
│ │ │ │ └── generate
│ │ │ │ └── CodeFileGenerateUtilTest.java
│ │ └── .gitignore
│ ├── basic-service-user
│ │ ├── src
│ │ │ ├── test
│ │ │ │ ├── resources
│ │ │ │ │ ├── generate_config.properties
│ │ │ │ │ └── config
│ │ │ │ │ │ └── basic_user.yaml
│ │ │ │ └── java
│ │ │ │ │ └── org
│ │ │ │ │ └── smartframework
│ │ │ │ │ └── cloud
│ │ │ │ │ └── examples
│ │ │ │ │ └── basic
│ │ │ │ │ └── user
│ │ │ │ │ └── test
│ │ │ │ │ ├── SuiteTest.java
│ │ │ │ │ └── code
│ │ │ │ │ └── generate
│ │ │ │ │ └── CodeFileGenerateUtilTest.java
│ │ │ └── main
│ │ │ │ ├── resources
│ │ │ │ ├── bootstrap.yaml
│ │ │ │ ├── i18n
│ │ │ │ │ ├── user_messages_en_US.properties
│ │ │ │ │ ├── user_messages.properties
│ │ │ │ │ └── user_messages_zh_CN.properties
│ │ │ │ ├── application.yaml
│ │ │ │ └── application-db-user.yaml
│ │ │ │ └── java
│ │ │ │ └── org
│ │ │ │ └── smartframework
│ │ │ │ └── cloud
│ │ │ │ └── examples
│ │ │ │ └── basic
│ │ │ │ └── user
│ │ │ │ ├── event
│ │ │ │ ├── LoginSuccessEventCache.java
│ │ │ │ └── RegisterSuccessEventCache.java
│ │ │ │ ├── service
│ │ │ │ └── TokenService.java
│ │ │ │ ├── mapper
│ │ │ │ ├── UserInfoMapper.java
│ │ │ │ └── LoginInfoMapper.java
│ │ │ │ ├── pojo
│ │ │ │ └── login
│ │ │ │ │ └── LoginInfoInsertDO.java
│ │ │ │ ├── UserApplication.java
│ │ │ │ └── constants
│ │ │ │ └── UserReturnCodes.java
│ │ ├── .gitignore
│ │ └── pom.xml
│ └── .gitignore
├── api-ac-core
│ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ └── META-INFO
│ │ │ │ └── spring.factories
│ │ │ └── java
│ │ │ └── org
│ │ │ └── smartframework
│ │ │ └── cloud
│ │ │ └── examples
│ │ │ └── api
│ │ │ └── ac
│ │ │ └── core
│ │ │ ├── constants
│ │ │ └── ApiMetaConstants.java
│ │ │ ├── vo
│ │ │ ├── ApiMetaFetchRespVO.java
│ │ │ ├── RepeatSubmitCheckMetaRespVO.java
│ │ │ ├── DataSecurityMetaRespVO.java
│ │ │ └── AuthMetaRespVO.java
│ │ │ └── properties
│ │ │ └── ApiAccessProperties.java
│ └── .gitignore
├── .gitignore
├── rpc-module
│ ├── .gitignore
│ ├── basic-service-rpc
│ │ ├── .gitignore
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── org
│ │ │ └── smartframework
│ │ │ └── cloud
│ │ │ └── examples
│ │ │ └── basic
│ │ │ └── rpc
│ │ │ ├── enums
│ │ │ └── user
│ │ │ │ ├── UserStateEnum.java
│ │ │ │ ├── PwdStateEnum.java
│ │ │ │ ├── SexEnum.java
│ │ │ │ └── ChannelEnum.java
│ │ │ ├── constant
│ │ │ └── RpcConstants.java
│ │ │ ├── user
│ │ │ ├── response
│ │ │ │ └── api
│ │ │ │ │ ├── register
│ │ │ │ │ └── RegisterUserRespVO.java
│ │ │ │ │ └── login
│ │ │ │ │ └── LoginRespVO.java
│ │ │ └── request
│ │ │ │ └── api
│ │ │ │ ├── login
│ │ │ │ └── ExitReqVO.java
│ │ │ │ └── token
│ │ │ │ └── RenewReqVO.java
│ │ │ └── auth
│ │ │ ├── request
│ │ │ └── oms
│ │ │ │ ├── role
│ │ │ │ └── PageRoleReqVO.java
│ │ │ │ └── permisson
│ │ │ │ └── PagePermissionReqVO.java
│ │ │ └── response
│ │ │ ├── rpc
│ │ │ └── AuthRespDTO.java
│ │ │ ├── entity
│ │ │ ├── RoleInfoEntityRespVO.java
│ │ │ ├── PermissionInfoEntityRespVO.java
│ │ │ ├── UserRoleRelaEntityRespVO.java
│ │ │ └── RolePermissionRelaEntityRespVO.java
│ │ │ └── oms
│ │ │ ├── user
│ │ │ └── role
│ │ │ │ └── PermissionInfoRespVO.java
│ │ │ └── role
│ │ │ └── permisson
│ │ │ └── PermissionInfoRespVO.java
│ ├── mall-service-rpc
│ │ ├── .gitignore
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── org
│ │ │ └── smartframework
│ │ │ └── cloud
│ │ │ └── examples
│ │ │ └── mall
│ │ │ └── rpc
│ │ │ ├── product
│ │ │ ├── request
│ │ │ │ ├── oms
│ │ │ │ │ ├── PageProductReqVO.java
│ │ │ │ │ └── ProductDeleteReqVO.java
│ │ │ │ ├── api
│ │ │ │ │ └── PageProductReqVO.java
│ │ │ │ └── rpc
│ │ │ │ │ ├── QryProductByIdsReqDTO.java
│ │ │ │ │ └── QryProductByIdReqDTO.java
│ │ │ └── response
│ │ │ │ ├── rpc
│ │ │ │ └── QryProductByIdsRespDTO.java
│ │ │ │ └── entity
│ │ │ │ └── ProductInfoEntityRespVO.java
│ │ │ ├── constant
│ │ │ └── RpcConstants.java
│ │ │ └── order
│ │ │ ├── response
│ │ │ └── api
│ │ │ │ └── OrderDeliveryRespVO.java
│ │ │ └── request
│ │ │ └── api
│ │ │ ├── SubmitOrderReqVO.java
│ │ │ └── SubmitOrderProductInfoReqVO.java
│ ├── support-service-rpc
│ │ ├── .gitignore
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── java
│ │ │ │ └── org
│ │ │ │ └── smartframework
│ │ │ │ └── cloud
│ │ │ │ └── examples
│ │ │ │ └── support
│ │ │ │ └── rpc
│ │ │ │ ├── constant
│ │ │ │ └── RpcConstants.java
│ │ │ │ └── gateway
│ │ │ │ ├── response
│ │ │ │ └── api
│ │ │ │ │ ├── GenerateAesKeyRespVO.java
│ │ │ │ │ └── GenerateClientPubKeyRespVO.java
│ │ │ │ └── request
│ │ │ │ └── rpc
│ │ │ │ ├── NotifyFetchReqDTO.java
│ │ │ │ ├── GatewayAuthUpdateReqDTO.java
│ │ │ │ ├── GatewayAuthUploadReqDTO.java
│ │ │ │ └── ExitLoginReqDTO.java
│ │ └── pom.xml
│ └── pom.xml
├── support-module
│ ├── .gitignore
│ ├── support-service-admin
│ │ ├── .gitignore
│ │ └── src
│ │ │ └── main
│ │ │ ├── resources
│ │ │ ├── bootstrap.yaml
│ │ │ └── application.yaml
│ │ │ └── java
│ │ │ └── org
│ │ │ └── smartframework
│ │ │ └── cloud
│ │ │ └── examples
│ │ │ └── support
│ │ │ └── admin
│ │ │ └── AdminApplication.java
│ └── support-service-gateway
│ │ ├── .gitignore
│ │ └── src
│ │ ├── main
│ │ ├── resources
│ │ │ ├── bootstrap.yaml
│ │ │ ├── bootstrap.properties
│ │ │ ├── application-sentinel.yaml
│ │ │ └── i18n
│ │ │ │ ├── gateway_messages_en_US.properties
│ │ │ │ ├── gateway_messages_zh_CN.properties
│ │ │ │ └── gateway_messages.properties
│ │ └── java
│ │ │ └── org
│ │ │ └── smartframework
│ │ │ └── cloud
│ │ │ └── examples
│ │ │ └── support
│ │ │ └── gateway
│ │ │ ├── configure
│ │ │ └── SmartGatewayConfiguration.java
│ │ │ ├── exception
│ │ │ ├── RequestNonceException.java
│ │ │ ├── RequestTimestampException.java
│ │ │ ├── UnsupportedFunctionException.java
│ │ │ ├── AesKeyNotFoundException.java
│ │ │ ├── AuthenticationException.java
│ │ │ ├── WhiteListException.java
│ │ │ ├── BlackListException.java
│ │ │ ├── GenerateSignFailException.java
│ │ │ ├── GenerateSignKeyFailException.java
│ │ │ └── RequestSignCheckFailException.java
│ │ │ ├── constants
│ │ │ ├── DataSecurityConstants.java
│ │ │ ├── GatewayConstants.java
│ │ │ ├── RedisTtl.java
│ │ │ └── ResponseFields.java
│ │ │ ├── properties
│ │ │ └── BlackWhiteListProperties.java
│ │ │ ├── GatewayApplication.java
│ │ │ ├── dto
│ │ │ └── DataSecurityParamDTO.java
│ │ │ ├── cache
│ │ │ └── AuthCache.java
│ │ │ └── filter
│ │ │ └── FilterContext.java
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── smartframework
│ │ └── cloud
│ │ └── examples
│ │ └── support
│ │ └── gateway
│ │ └── test
│ │ ├── prepare
│ │ └── dto
│ │ │ ├── GetDTO.java
│ │ │ ├── GetBodyDTO.java
│ │ │ └── PostBodyDTO.java
│ │ └── SuiteTest.java
├── app-common-config
│ ├── .gitignore
│ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ ├── application-discovery.yaml
│ │ │ ├── application-feign.yaml
│ │ │ └── application-common-config.yaml
│ │ │ └── java
│ │ │ └── org
│ │ │ └── smartframework
│ │ │ └── cloud
│ │ │ └── examples
│ │ │ └── common
│ │ │ └── config
│ │ │ └── constants
│ │ │ └── DataSourceName.java
│ └── pom.xml
├── app-auth-core
│ └── src
│ │ └── main
│ │ └── java
│ │ └── org
│ │ └── smartframework
│ │ └── cloud
│ │ └── examples
│ │ └── app
│ │ └── auth
│ │ └── core
│ │ ├── MySmartUser.java
│ │ └── exception
│ │ └── SmartUserMissingException.java
└── pom.xml
├── docs
├── images
│ ├── wechat_cp.png
│ ├── api_meta_upload.png
│ ├── nacos_config_detail.png
│ ├── nacos_config_list.png
│ ├── encrypt_decrypt_sign.png
│ ├── nacos_sentinel_config.png
│ ├── service_architecture.png
│ └── smart-cloud-examples.jpg
├── nacos
│ ├── supportServiceGateway.yaml
│ ├── gateway-redis.yaml
│ ├── gateway-route.yaml
│ └── gateway-sentinel
└── puml
│ ├── encrypt_decrypt_sign.puml
│ └── api_meta_upload.puml
├── merge-module
├── merge-basic
│ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ ├── bootstrap.yaml
│ │ │ └── application.yaml
│ │ │ └── java
│ │ │ └── org
│ │ │ └── smartframework
│ │ │ └── cloud
│ │ │ └── examples
│ │ │ └── merge
│ │ │ └── basic
│ │ │ └── Application.java
│ ├── .gitignore
│ └── pom.xml
├── merge-mall
│ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ ├── bootstrap.yaml
│ │ │ └── application.yaml
│ │ │ └── java
│ │ │ └── org
│ │ │ └── smartframework
│ │ │ └── cloud
│ │ │ └── examples
│ │ │ └── merge
│ │ │ └── mall
│ │ │ └── Application.java
│ ├── .gitignore
│ └── pom.xml
└── .gitignore
├── system-test
├── .gitignore
└── src
│ ├── main
│ └── java
│ │ └── org
│ │ └── smartframework
│ │ └── cloud
│ │ └── examples
│ │ └── system
│ │ └── test
│ │ ├── enums
│ │ └── SytemTestEnv.java
│ │ ├── config
│ │ ├── ISystemTestConfig.java
│ │ └── AbstractSystemTestConfig.java
│ │ └── util
│ │ └── HttpHeaderUtil.java
│ └── test
│ └── java
│ └── org
│ └── smartframework
│ └── cloud
│ └── examples
│ └── system
│ └── test
│ ├── SuiteTest.java
│ └── module
│ └── mall
│ └── util
│ └── TokenUtilSystemTest.java
├── .gitignore
└── smart-cloud-example-framework
└── .gitignore
/application-module/mall-module/mall-service-order/src/test/resources/generate_config.properties:
--------------------------------------------------------------------------------
1 | config.yaml=mall_order
--------------------------------------------------------------------------------
/docs/images/wechat_cp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/smart-cloud/smart-cloud-examples/HEAD/docs/images/wechat_cp.png
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-product/src/main/resources/i18n/product_messages.properties:
--------------------------------------------------------------------------------
1 | 300001=库存不足,操作失败
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-product/src/test/resources/generate_config.properties:
--------------------------------------------------------------------------------
1 | config.yaml=mall_product
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-product/src/main/resources/i18n/product_messages_zh_CN.properties:
--------------------------------------------------------------------------------
1 | 300001=库存不足,操作失败
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-order/src/main/resources/i18n/order_messages.properties:
--------------------------------------------------------------------------------
1 | 200001=库存更新失败
2 | 200002=商品不存在
--------------------------------------------------------------------------------
/docs/images/api_meta_upload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/smart-cloud/smart-cloud-examples/HEAD/docs/images/api_meta_upload.png
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-order/src/main/resources/i18n/order_messages_zh_CN.properties:
--------------------------------------------------------------------------------
1 | 200001=库存更新失败
2 | 200002=商品不存在
--------------------------------------------------------------------------------
/docs/images/nacos_config_detail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/smart-cloud/smart-cloud-examples/HEAD/docs/images/nacos_config_detail.png
--------------------------------------------------------------------------------
/docs/images/nacos_config_list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/smart-cloud/smart-cloud-examples/HEAD/docs/images/nacos_config_list.png
--------------------------------------------------------------------------------
/docs/images/encrypt_decrypt_sign.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/smart-cloud/smart-cloud-examples/HEAD/docs/images/encrypt_decrypt_sign.png
--------------------------------------------------------------------------------
/docs/images/nacos_sentinel_config.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/smart-cloud/smart-cloud-examples/HEAD/docs/images/nacos_sentinel_config.png
--------------------------------------------------------------------------------
/docs/images/service_architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/smart-cloud/smart-cloud-examples/HEAD/docs/images/service_architecture.png
--------------------------------------------------------------------------------
/docs/images/smart-cloud-examples.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/smart-cloud/smart-cloud-examples/HEAD/docs/images/smart-cloud-examples.jpg
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/src/main/resources/i18n/auth_messages.properties:
--------------------------------------------------------------------------------
1 | 110001=权限编码已存在,请换一个!
2 | 110002=角色编码已存在,请换一个!
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/src/main/resources/i18n/auth_messages_zh_CN.properties:
--------------------------------------------------------------------------------
1 | 110001=权限编码已存在,请换一个!
2 | 110002=角色编码已存在,请换一个!
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-product/src/main/resources/i18n/product_messages_en_US.properties:
--------------------------------------------------------------------------------
1 | 300001=Stock does not enough, operation failed
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-order/src/main/resources/i18n/order_messages_en_US.properties:
--------------------------------------------------------------------------------
1 | 200001=Update stock fail
2 | 200002=Product does not exist
--------------------------------------------------------------------------------
/merge-module/merge-basic/src/main/resources/bootstrap.yaml:
--------------------------------------------------------------------------------
1 | spring:
2 | cloud:
3 | nacos:
4 | config:
5 | server-addr: 127.0.0.1:8848
6 | prefix: merge-basic
7 | file-extension: yaml
--------------------------------------------------------------------------------
/merge-module/merge-mall/src/main/resources/bootstrap.yaml:
--------------------------------------------------------------------------------
1 | spring:
2 | cloud:
3 | nacos:
4 | config:
5 | server-addr: 127.0.0.1:8848
6 | prefix: merge-mall
7 | file-extension: yaml
--------------------------------------------------------------------------------
/application-module/api-ac-core/src/main/resources/META-INFO/spring.factories:
--------------------------------------------------------------------------------
1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
2 | org.smartframework.cloud.examples.api.ac.core.configure.ApiAcessAutoConfigure
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/src/test/resources/generate_config.properties:
--------------------------------------------------------------------------------
1 | ###\u914D\u7F6E\u6587\u4EF6\u540E\u7F00\u201C.yaml\u201D\u53EF\u4E0D\u52A0
2 |
3 | #basic module
4 | config.yaml=basic_auth
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/src/test/resources/generate_config.properties:
--------------------------------------------------------------------------------
1 | ###\u914D\u7F6E\u6587\u4EF6\u540E\u7F00\u201C.yaml\u201D\u53EF\u4E0D\u52A0
2 |
3 | #basic module
4 | config.yaml=basic_user
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/src/main/resources/i18n/auth_messages_en_US.properties:
--------------------------------------------------------------------------------
1 | 110001=The permission code already exists, please change one!
2 | 110002=The role code already exists, please change one!
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/src/main/resources/bootstrap.yaml:
--------------------------------------------------------------------------------
1 | spring:
2 | cloud:
3 | nacos:
4 | config:
5 | server-addr: 127.0.0.1:8848
6 | prefix: basicServiceAuth
7 | file-extension: yaml
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/src/main/resources/bootstrap.yaml:
--------------------------------------------------------------------------------
1 | spring:
2 | cloud:
3 | nacos:
4 | config:
5 | server-addr: 127.0.0.1:8848
6 | prefix: basicServiceUser
7 | file-extension: yaml
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-order/src/main/resources/bootstrap.yaml:
--------------------------------------------------------------------------------
1 | spring:
2 | cloud:
3 | nacos:
4 | config:
5 | server-addr: 127.0.0.1:8848
6 | prefix: mallServiceOrder
7 | file-extension: yaml
--------------------------------------------------------------------------------
/docs/nacos/supportServiceGateway.yaml:
--------------------------------------------------------------------------------
1 | smart:
2 | apiLog:
3 | enable: true
4 | level: info
5 | slow-api-min-cost: 2500
6 | feign:
7 | log:
8 | enable: true
9 | level: info
10 | slow-api-min-cost: 2500
--------------------------------------------------------------------------------
/merge-module/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/system-test/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/application-module/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
18 | !/.idea/
19 | *.iml
--------------------------------------------------------------------------------
/merge-module/merge-basic/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/merge-module/merge-mall/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/application-module/api-ac-core/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/application-module/mall-module/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/application-module/rpc-module/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/smart-cloud-example-framework/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/application-module/basic-module/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/application-module/support-module/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/application-module/app-common-config/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-order/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/application-module/rpc-module/mall-service-rpc/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/application-module/rpc-module/support-service-rpc/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-product/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/application-module/support-module/support-service-admin/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | target
4 | .settings
5 | .metadata
6 | .springBeans
7 | .git
8 | bin
9 | lib
10 | build
11 | .settings
12 | *.class
13 | *.jar
14 | *.log
15 | mvnw
16 | .apt_generated
17 | .factorypath
--------------------------------------------------------------------------------
/application-module/support-module/support-service-admin/src/main/resources/bootstrap.yaml:
--------------------------------------------------------------------------------
1 | spring:
2 | cloud:
3 | nacos:
4 | discovery:
5 | register-enabled: false
6 | config:
7 | server-addr: 127.0.0.1:8848
8 | prefix: supportServiceAdmin
9 | file-extension: yaml
--------------------------------------------------------------------------------
/docs/nacos/gateway-redis.yaml:
--------------------------------------------------------------------------------
1 | spring:
2 | redis:
3 | host: localhost
4 | port: 6379
5 | password: 123456
6 | database: 0
7 | timeout: 10000ms
8 | lettuce:
9 | pool:
10 | max-active: 1000
11 | min-idle: 0
12 | max-idle: 100
13 | max-wait: 10000ms
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/resources/bootstrap.yaml:
--------------------------------------------------------------------------------
1 | spring:
2 | cloud:
3 | nacos:
4 | config:
5 | server-addr: 127.0.0.1:8848
6 | extensionConfigs:
7 | - dataId: gateway-route.yaml
8 | refresh: true
9 | - dataId: gateway-redis.yaml
10 | refresh: true
11 |
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/src/main/resources/i18n/user_messages_en_US.properties:
--------------------------------------------------------------------------------
1 | 100001=Account does not exist
2 | 100002=User is disabled
3 | 100003=User is deleted
4 | 100004=Username or password is error
5 | 100005=The phone number already exists, please re-register with another one
6 | 100006=The user name already exists, please re-register with another one
7 | 100007=rsa key pair generation error
8 | 100008=salt value generation failed
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/resources/bootstrap.properties:
--------------------------------------------------------------------------------
1 | spring.cloud.nacos.config.server-addr=127.0.0.1:8848
2 | spring.cloud.nacos.config.file-extension=yaml
3 | spring.cloud.nacos.config.extensionConfigs[0].dataId=gateway-route.yaml
4 | spring.cloud.nacos.config.extensionConfigs[0].refresh=true
5 | spring.cloud.nacos.config.extensionConfigs[1].dataId=gateway-redis.yaml
6 | spring.cloud.nacos.config.extensionConfigs[1].refresh=true
--------------------------------------------------------------------------------
/application-module/app-common-config/src/main/resources/application-discovery.yaml:
--------------------------------------------------------------------------------
1 | #eureka:
2 | # instance:
3 | # prefer-ip-address: true
4 | # client:
5 | # registerWithEureka: true
6 | # fetchRegistry: true
7 | # service-url:
8 | # defaultZone: http://127.0.0.1:10001/eureka/
9 | #defaultZone: http://nodeA:10001/eureka/,http://nodeB:10002/eureka/
10 |
11 | spring:
12 | cloud:
13 | nacos:
14 | discovery:
15 | server-addr: 127.0.0.1:8848
--------------------------------------------------------------------------------
/application-module/app-common-config/src/main/resources/application-feign.yaml:
--------------------------------------------------------------------------------
1 | feign:
2 | hystrix:
3 | enabled: false
4 | httpclient:
5 | enabled: true
6 | compression:
7 | request:
8 | enabled: true
9 | mime-types: text/xml,application/xml,application/json
10 | min-request-size: 2048
11 | response:
12 | enabled: true
13 | client:
14 | config:
15 | default:
16 | connectTimeout: 10000
17 | readTimeout: 10000
--------------------------------------------------------------------------------
/merge-module/merge-basic/src/main/resources/application.yaml:
--------------------------------------------------------------------------------
1 | smart:
mybatis:
cryptKey: 123456
basicServiceAuth: ${spring.application.name}
basicServiceUser: ${spring.application.name}
server:
port: 30001
management:
server:
port: 31001
spring:
application:
name: merge-basic
redis:
host: localhost
port: 6379
password: 123456
database: 0
timeout: 10000ms
lettuce:
pool:
max-active: 1000
min-idle: 0
max-idle: 100
max-wait: 10000ms
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/src/main/resources/application.yaml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 20032
3 |
4 | management:
5 | server:
6 | port: 21032
7 |
8 | spring:
9 | application:
10 | name: basicServiceAuth
11 | redis:
12 | host: localhost
13 | port: 6379
14 | password: 123456
15 | database: 0
16 | timeout: 10000ms
17 | lettuce:
18 | pool:
19 | max-active: 1000
20 | min-idle: 0
21 | max-idle: 100
22 | max-wait: 10000ms
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/src/main/resources/application.yaml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 20031
3 |
4 | management:
5 | server:
6 | port: 21031
7 |
8 | spring:
9 | application:
10 | name: basicServiceUser
11 | redis:
12 | host: localhost
13 | port: 6379
14 | password: 123456
15 | database: 0
16 | timeout: 10000ms
17 | lettuce:
18 | pool:
19 | max-active: 1000
20 | min-idle: 0
21 | max-idle: 100
22 | max-wait: 10000ms
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-order/src/main/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAlgorithm:
--------------------------------------------------------------------------------
1 | org.smartframework.cloud.examples.mall.order.shardingjdbc.OrderBillDatabaseShardingAlgorithm
2 | org.smartframework.cloud.examples.mall.order.shardingjdbc.OrderBillTableShardingAlgorithm
3 | org.smartframework.cloud.examples.mall.order.shardingjdbc.OrderDeliveryInfoDatabaseShardingAlgorithm
4 | org.smartframework.cloud.examples.mall.order.shardingjdbc.OrderDeliveryInfoTableShardingAlgorithm
--------------------------------------------------------------------------------
/docs/nacos/gateway-route.yaml:
--------------------------------------------------------------------------------
1 | spring:
2 | cloud:
3 | gateway:
4 | routes:
5 | - id: user
6 | uri: lb://basicServiceUser
7 | predicates:
8 | - Path=/user/**,/test/**
9 | - id: auth
10 | uri: lb://basicServiceAuth
11 | predicates:
12 | - Path=/auth/**
13 | - id: product
14 | uri: lb://mallServiceProduct
15 | predicates:
16 | - Path=/product/**
17 | - id: order
18 | uri: lb://mallServiceOrder
19 | predicates:
20 | - Path=/order/**
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/src/main/resources/i18n/user_messages.properties:
--------------------------------------------------------------------------------
1 | 100001=\u8D26\u53F7\u4E0D\u5B58\u5728
2 | 100002=\u7528\u6237\u88AB\u7981\u7528
3 | 100003=\u7528\u6237\u5DF2\u88AB\u5220\u9664
4 | 100004=\u7528\u6237\u540D\u6216\u5BC6\u7801\u9519\u8BEF
5 | 100005=\u8BE5\u624B\u673A\u53F7\u5DF2\u5B58\u5728\uFF0C\u8BF7\u6362\u4E00\u4E2A\u91CD\u65B0\u6CE8\u518C
6 | 100006=\u8BE5\u7528\u6237\u540D\u5DF2\u5B58\u5728\uFF0C\u8BF7\u6362\u4E00\u4E2A\u91CD\u65B0\u6CE8\u518C
7 | 100007=rsa\u5BC6\u94A5\u5BF9\u751F\u6210\u51FA\u9519
8 | 100008=\u76D0\u503C\u751F\u6210\u5931\u8D25
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/src/main/resources/i18n/user_messages_zh_CN.properties:
--------------------------------------------------------------------------------
1 | 100001=\u8D26\u53F7\u4E0D\u5B58\u5728
2 | 100002=\u7528\u6237\u88AB\u7981\u7528
3 | 100003=\u7528\u6237\u5DF2\u88AB\u5220\u9664
4 | 100004=\u7528\u6237\u540D\u6216\u5BC6\u7801\u9519\u8BEF
5 | 100005=\u8BE5\u624B\u673A\u53F7\u5DF2\u5B58\u5728\uFF0C\u8BF7\u6362\u4E00\u4E2A\u91CD\u65B0\u6CE8\u518C
6 | 100006=\u8BE5\u7528\u6237\u540D\u5DF2\u5B58\u5728\uFF0C\u8BF7\u6362\u4E00\u4E2A\u91CD\u65B0\u6CE8\u518C
7 | 100007=rsa\u5BC6\u94A5\u5BF9\u751F\u6210\u51FA\u9519
8 | 100008=\u76D0\u503C\u751F\u6210\u5931\u8D25
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/resources/application-sentinel.yaml:
--------------------------------------------------------------------------------
1 | spring:
2 | cloud:
3 | # 参考SentinelProperties
4 | sentinel:
5 | enabled: true
6 | transport:
7 | # sentinel控制台地址
8 | dashboard: localhost:8080
9 | # 跟sentinel控制台交流的端口,随意指定一个未使用的端口即可,默认是8719
10 | port: 8719
11 | datasource:
12 | ds1:
13 | nacos:
14 | server-addr: 127.0.0.1:8848
15 | data-id: gateway-sentinel
16 | group-Id: DEFAULT_GROUP
17 | rule-type: flow
18 | data-type: json
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-product/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
port: 20021
management:
server:
port: 21021
seata:
tx-service-group: smartcloud_tx_group
enable-auto-data-source-proxy: false
service:
grouplist:
smartcloud: 127.0.0.1:8091
vgroup-mapping:
smartcloud_tx_group: smartcloud
spring:
application:
name: mallServiceProduct
cloud:
alibaba:
seata:
tx-service-group: smart-cloud
redis:
host: localhost
port: 6379
password: 123456
database: 0
timeout: 10000ms
lettuce:
pool:
max-active: 1000
min-idle: 0
max-idle: 100
max-wait: 10000ms
--------------------------------------------------------------------------------
/application-module/app-common-config/src/main/resources/application-common-config.yaml:
--------------------------------------------------------------------------------
1 | logging:
2 | config: classpath:logback-spring.xml
3 |
4 | smart:
5 | api:
6 | apiVersion: 1.0.0
7 |
8 | jasypt:
9 | encryptor:
10 | password: 123456
11 |
12 | server:
13 | servlet:
14 | context-path: /
15 | compression:
16 | enabled: true
17 |
18 | # 监控跟踪
19 | management:
20 | health:
21 | diskspace:
22 | threshold: 10GB
23 | endpoint:
24 | health:
25 | show-details: always
26 | endpoints:
27 | web:
28 | exposure:
29 | include: 'health,info'
30 |
31 | spring:
32 | jmx:
33 | enabled: false
34 | sleuth:
35 | enabled: true
--------------------------------------------------------------------------------
/merge-module/merge-mall/src/main/resources/application.yaml:
--------------------------------------------------------------------------------
1 | mallServiceProduct: ${spring.application.name}
mallServiceOrder: ${spring.application.name}
server:
port: 30002
management:
server:
port: 31002
seata:
tx-service-group: smartcloud_tx_group
enable-auto-data-source-proxy: false
service:
grouplist:
smartcloud: 127.0.0.1:8091
vgroup-mapping:
smartcloud_tx_group: smartcloud
spring:
application:
name: merge-mall
cloud:
alibaba:
seata:
tx-service-group: ${spring.application.name}
redis:
host: localhost
port: 6379
password: 123456
database: 0
timeout: 10000ms
lettuce:
pool:
max-active: 1000
min-idle: 0
max-idle: 100
max-wait: 10000ms
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-product/src/main/resources/org/smartframework/cloud/examples/mall/product/mapper/rpc/ProductInfoMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | UPDATE t_product_info
9 | SET f_stock = f_stock - #{item.count}
10 | WHERE f_id = #{item.id}
11 | AND f_stock-#{item.count} >= 0
12 | AND f_sys_del_state = 1
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/src/test/resources/config/basic_auth.yaml:
--------------------------------------------------------------------------------
1 | #db config
2 | db:
3 | url: jdbc:mysql://127.0.0.1:3306/demo_auth?serverTimezone=Asia/Shanghai
4 | username: root
5 | password: 123456
6 |
7 | #code generate config
8 | code:
9 | author: collin
10 | #生成类型:1、数据库整个表全部生成;2、只生成指定的表;3、除了指定的表,全部生成
11 | type: 3
12 | #指定要生成的表,多个表用英文逗号(,)隔开
13 | specifiedTables: undo_log
14 | #启动类包名
15 | mainClassPackage: org.smartframework.cloud.examples.basic.auth
16 | project:
17 | path:
18 | #rpc生成路径
19 | rpc: D:/myself/github/smart-cloud-examples/application-module/rpc-module/basic-service-rpc
20 | #服务生成路径
21 | service: D:/myself/github/smart-cloud-examples/application-module/basic-module/basic-service-auth
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-product/src/test/resources/config/mall_product.yaml:
--------------------------------------------------------------------------------
1 | #db config
2 | db:
3 | url: jdbc:mysql://127.0.0.1:3306/demo_product?serverTimezone=Asia/Shanghai
4 | username: root
5 | password: 123456
6 |
7 | #code generate config
8 | code:
9 | author: collin
10 | #生成类型:1、数据库整个表全部生成;2、只生成指定的表;3、除了指定的表,全部生成
11 | type: 3
12 | #指定要生成的表,多个表用英文逗号(,)隔开
13 | specifiedTables: undo_log
14 | #启动类包名
15 | mainClassPackage: org.smartframework.cloud.examples.mall.product
16 | project:
17 | path:
18 | #rpc生成路径
19 | rpc: D:/myself/github/smart-cloud-examples/application-module/rpc-module/mall-service-rpc
20 | #服务生成路径
21 | service: D:/myself/github/smart-cloud-examples/application-module/mall-module/mall-service-product
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-order/src/test/resources/config/mall_order.yaml:
--------------------------------------------------------------------------------
1 | #db config
2 | db:
3 | url: jdbc:mysql://127.0.0.1:3306/demo_order_0?serverTimezone=Asia/Shanghai
4 | username: root
5 | password: 123456
6 |
7 | #code generate config
8 | code:
9 | author: collin
10 | #生成类型:1、数据库整个表全部生成;2、只生成指定的表;3、除了指定的表,全部生成
11 | type: 2
12 | #指定要生成的表,多个表用英文逗号(,)隔开
13 | specifiedTables: t_order_bill_0,t_order_delivery_info_0
14 | #启动类包名
15 | mainClassPackage: org.smartframework.cloud.examples.mall.order
16 | project:
17 | path:
18 | #rpc生成路径
19 | rpc: D:/myself/github/smart-cloud-examples/application-module/rpc-module/mall-service-rpc
20 | #服务生成路径
21 | service: D:/myself/github/smart-cloud-examples/application-module/mall-module/mall-service-order
--------------------------------------------------------------------------------
/docs/nacos/gateway-sentinel:
--------------------------------------------------------------------------------
1 | [{
2 | "id": 7,
3 | "app": "supportServiceGateway",
4 | "ip": "192.168.0.107",
5 | "port": 8720,
6 |
7 | "limitApp": "default",
8 | "resource": "/test",
9 | "grade": 1,
10 | "count": 1.0,
11 | "strategy": 0,
12 | "refResource": null,
13 | "controlBehavior": 0,
14 | "warmUpPeriodSec": 10,
15 | "maxQueueingTimeMs": 500,
16 | "clusterMode": true,
17 | "clusterConfig": {
18 | "flowId": 7,
19 | "thresholdType": 0,
20 | "fallbackToLocalWhenFail": true,
21 | "strategy": 0,
22 | "sampleCount": 10,
23 | "windowIntervalMs": 1000,
24 | "resourceTimeout": 2000,
25 | "resourceTimeoutStrategy": 0,
26 | "acquireRefuseStrategy": 0,
27 | "clientOfflineTime": 2000
28 | },
29 | "gmtCreate": null,
30 | "gmtModified": null
31 | }
32 | ]
--------------------------------------------------------------------------------
/docs/puml/encrypt_decrypt_sign.puml:
--------------------------------------------------------------------------------
1 | @startuml
2 | skinparam sequenceMessageAlign center
3 | skinparam responseMessageBelowArrow true
4 |
5 | participant 客户端 as c
6 | participant 服务端 as s
7 |
8 | autonumber 1.1
9 | activate c
10 | group 服务端生成RSA秘钥
11 | c -> s: 请求生成RSA秘钥
12 | activate s
13 | s->s:生成一对RSA公、私秘钥(PK1、SK1)
14 | c<-s:返回RSA公钥PK1
15 | deactivate s
16 | end
17 |
18 | autonumber 2.1
19 | group 服务端生成AES秘钥
20 | c ->c: 生成一对RSA公、私秘钥(PK2、SK2)
21 | c->s:用PK1将PK2加密传给服务端
22 | activate s
23 | s->s:生成AES加密的key
24 | c<-s:用PK2加密key返回客户端
25 | deactivate s
26 | c ->c: 将key存储至本地
27 | end
28 |
29 | autonumber 3.1
30 | loop 客户端与服务端后续每一次通信
31 | c ->c: 使用key加密,SK2签名
32 | c->s:发起请求
33 | activate s
34 | s->s:使用PK2验签,key解密
35 | s->s:使用key加密,SK1签名
36 | c<-s:响应请求
37 | deactivate s
38 | c ->c:使用PK1验签,key解密
39 | end
40 | deactivate c
41 | @enduml
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/configure/SmartGatewayConfiguration.java:
--------------------------------------------------------------------------------
1 | package org.smartframework.cloud.examples.support.gateway.configure;
2 |
3 | import org.smartframework.cloud.examples.support.gateway.properties.BlackWhiteListProperties;
4 | import org.springframework.cloud.context.config.annotation.RefreshScope;
5 | import org.springframework.context.annotation.Bean;
6 | import org.springframework.context.annotation.Configuration;
7 |
8 | /**
9 | * 网关配置
10 | *
11 | * @author collin
12 | * @date 2024-03-27
13 | */
14 | @Configuration
15 | public class SmartGatewayConfiguration {
16 |
17 | @Bean
18 | @RefreshScope
19 | public BlackWhiteListProperties blackWhiteListProperties() {
20 | return new BlackWhiteListProperties();
21 | }
22 |
23 | }
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-order/src/main/resources/application.yaml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 20011
3 |
4 | management:
5 | server:
6 | port: 21011
7 |
8 | seata:
9 | tx-service-group: smartcloud_tx_group
10 | enable-auto-data-source-proxy: false
11 | service:
12 | grouplist:
13 | smartcloud: 127.0.0.1:8091
14 | vgroup-mapping:
15 | smartcloud_tx_group: smartcloud
16 |
17 | spring:
18 | application:
19 | name: mallServiceOrder
20 | redis:
21 | host: localhost
22 | port: 6379
23 | password: 123456
24 | database: 0
25 | timeout: 10000ms
26 | lettuce:
27 | pool:
28 | max-active: 1000
29 | min-idle: 0
30 | max-idle: 100
31 | max-wait: 10000ms
32 | rabbitmq:
33 | host: localhost
34 | port: 5672
35 | virtual-host: /
36 | username: guest
37 | password: guest
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/resources/i18n/gateway_messages_en_US.properties:
--------------------------------------------------------------------------------
1 | 400001=fetch api meta fail
2 | 400002=rsa key pair generation error
3 | 400003=Token expires before login
4 | 400004=Token expires after login sucess
5 | 400005=Token is missing in request parameters
6 | 400006=The sign of request is missing
7 | 400007=Failed to request parameter signature verification. Procedure
8 | 400008=Failed to generate signature
9 | 400009=Failed to generate a signature key
10 | 400010=The request timestamp cannot be empty!
11 | 400011=Request timestamp format error!
12 | 400012=Illegal request timestamp!
13 | 400013=Security key expired!
14 | 400015=Matches the blacklist list, and the access is prohibited
15 | 400016=The access is not in the whitelist
16 | 400017=Only application/json supports interface signature verification, encryption and decryption
17 | 400018=The request nonce is missing
--------------------------------------------------------------------------------
/application-module/support-module/support-service-admin/src/main/resources/application.yaml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: supportServiceAdmin
4 | profiles:
5 | include: common-config,discovery
6 | security:
7 | user:
8 | name: admin
9 | password: ZD3jbvwv5Luvnwvk
10 |
11 | server:
12 | port: 10011
13 |
14 | management:
15 | server:
16 | port: 11011
17 |
18 | smart:
19 | monitor:
20 | robotKey: 15228554-fc8e-481f-83bc-1e0992f87aea
21 | serviceInfos:
22 | mallServiceOrder:
23 | id: 16
24 | robotKey: 15228554-fc8e-481f-83bc-1e0992f87aea
25 | remindTagMinDiffTs: 2400000
26 | reminders:
27 | - Redzhang
28 | - Markliu
29 | mallServiceProduct:
30 | id: 17
31 | robotKey: 15228554-fc8e-481f-83bc-1edfgs587aea
32 | remindTagMinDiffTs: 1800000
33 | reminders:
34 | - Redzhang
35 | - Collin
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/src/main/resources/application-db-auth.yaml:
--------------------------------------------------------------------------------
1 | spring:
2 | datasource:
3 | dynamic:
4 | primary: basic-auth-master
5 | strict: true
6 | datasource:
7 | basic-auth-master:
8 | url: jdbc:mysql://127.0.0.1:3306/demo_auth?characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
9 | username: root
10 | password: 123456
11 | driver-class-name: com.mysql.cj.jdbc.Driver
12 | type: com.zaxxer.hikari.HikariDataSource
13 | basic-auth-slave:
14 | url: jdbc:mysql://127.0.0.1:3306/demo_auth?characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
15 | username: root
16 | password: 123456
17 | driver-class-name: com.mysql.cj.jdbc.Driver
18 | type: com.zaxxer.hikari.HikariDataSource
19 | mybatis-plus:
20 | mapper-locations:
21 | - classpath*:/org/smartframework/cloud/examples/basic/auth/mapper/**/*.xml
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/src/test/resources/config/basic_user.yaml:
--------------------------------------------------------------------------------
1 | #db config
2 | db:
3 | url: jdbc:mysql://127.0.0.1:3306/demo_user?serverTimezone=Asia/Shanghai
4 | username: root
5 | password: 123456
6 |
7 | #code generate config
8 | code:
9 | author: collin
10 | #生成类型:1、数据库整个表全部生成;2、只生成指定的表;3、除了指定的表,全部生成
11 | type: 1
12 | #指定要生成的表,多个表用英文逗号(,)隔开
13 | specifiedTables:
14 | mask:
15 | # 表名
16 | t_login_info :
17 | # 字段
18 | f_password: PASSWROD
19 | f_salt: DEFAULT
20 | t_user_info:
21 | f_mobile: MOBILE
22 | f_real_name: NAME
23 | encrypts:
24 | # 表名
25 | t_user_info :
26 | - f_mobile
27 | - f_real_name
28 | #启动类包名
29 | mainClassPackage: org.smartframework.cloud.examples.basic.user
30 | project:
31 | path:
32 | #rpc生成路径
33 | rpc: D:/myself/github/smart-cloud-examples/application-module/rpc-module/basic-service-rpc
34 | #服务生成路径
35 | service: D:/myself/github/smart-cloud-examples/application-module/basic-module/basic-service-user
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-product/src/main/resources/application-db-product.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | datasource:
3 | dynamic:
4 | primary: mall-product-master
5 | strict: true
6 | seata: true
7 | datasource:
8 | mall-product-master:
9 | url: jdbc:mysql://127.0.0.1:3306/demo_product?characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
10 | username: root
11 | password: 123456
12 | driver-class-name: com.mysql.cj.jdbc.Driver
13 | type: com.zaxxer.hikari.HikariDataSource
14 | mall-product-slave:
15 | url: jdbc:mysql://127.0.0.1:3306/demo_product?characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
16 | username: root
17 | password: 123456
18 | driver-class-name: com.mysql.cj.jdbc.Driver
19 | type: com.zaxxer.hikari.HikariDataSource
20 | mybatis-plus:
21 | mapper-locations:
22 | - classpath*:/org/smartframework/cloud/examples/mall/product/mapper/**/*.xml
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-product/src/main/java/org/smartframework/cloud/examples/mall/product/constants/ProductReturnCodes.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.product.constants;
17 |
18 | /**
19 | * 商品服务状态码
20 | *
21 | * @author collin
22 | * @date 2019-04-07
23 | */
24 | public interface ProductReturnCodes {
25 |
26 | /**
27 | * 库存不足,操作失败
28 | */
29 | String STOCK_NOT_ENOUGH = "300001";
30 |
31 | }
--------------------------------------------------------------------------------
/system-test/src/main/java/org/smartframework/cloud/examples/system/test/enums/SytemTestEnv.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.system.test.enums;
17 |
18 | /**
19 | * 系统测试环境
20 | *
21 | * @author collin
22 | * @date 2019-06-14
23 | */
24 | public enum SytemTestEnv {
25 |
26 | /** 本地环境 */
27 | LOCAL,
28 | /** 单元测试环境 */
29 | UNIT,
30 | /** 开发环境 */
31 | DEV,
32 | /** 测试环境 */
33 | TEST,
34 | /** 预演环境 */
35 | STAGE,
36 | /** 生产环境 */
37 | PROD;
38 |
39 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/src/main/resources/application-db-user.yaml:
--------------------------------------------------------------------------------
1 | smart:
2 | mybatis:
3 | cryptKeys:
4 | 'io.github.smart.cloud.starter.mybatis.plus.common.CryptField': 123456
5 | spring:
6 | datasource:
7 | dynamic:
8 | primary: basic-user-master
9 | strict: true
10 | datasource:
11 | basic-user-master:
12 | url: jdbc:mysql://127.0.0.1:3306/demo_user?characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
13 | username: root
14 | password: 123456
15 | driver-class-name: com.mysql.cj.jdbc.Driver
16 | type: com.zaxxer.hikari.HikariDataSource
17 | basic-user-slave:
18 | url: jdbc:mysql://127.0.0.1:3306/demo_user?characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
19 | username: root
20 | password: 123456
21 | driver-class-name: com.mysql.cj.jdbc.Driver
22 | type: com.zaxxer.hikari.HikariDataSource
23 | mybatis-plus:
24 | mapper-locations:
25 | - classpath*:/org/smartframework/cloud/examples/basic/user/mapper/**/*.xml
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/resources/i18n/gateway_messages_zh_CN.properties:
--------------------------------------------------------------------------------
1 | 400001=\u83B7\u53D6api meta\u5931\u8D25
2 | 400002=rsa\u5BC6\u94A5\u5BF9\u751F\u6210\u51FA\u9519
3 | 400003=\u767B\u5F55\u524Dtoken\u5931\u6548
4 | 400004=\u767B\u5F55\u6210\u529F\u540Etoken\u5931\u6548
5 | 400005=\u8BF7\u6C42\u53C2\u6570\u4E2Dtoken\u7F3A\u5931
6 | 400006=\u8BF7\u6C42\u7B7E\u540D\u7F3A\u5931
7 | 400007=\u8BF7\u6C42\u53C2\u6570\u7B7E\u540D\u6821\u9A8C\u5931\u8D25
8 | 400008=\u751F\u6210\u7B7E\u540D\u5931\u8D25
9 | 400009=\u751F\u6210\u7B7E\u540Dkey\u5931\u8D25
10 | 400010=\u8BF7\u6C42\u65F6\u95F4\u6233\u4E0D\u80FD\u4E3A\u7A7A\uFF01
11 | 400011=\u8BF7\u6C42\u65F6\u95F4\u6233\u683C\u5F0F\u9519\u8BEF\uFF01
12 | 400012=\u8BF7\u6C42\u65F6\u95F4\u6233\u975E\u6CD5\uFF01
13 | 400013=security key\u8FC7\u671F\uFF01
14 | 400015=\u547D\u4E2D\u9ED1\u540D\u5355\u5217\u8868\uFF0C\u7981\u6B62\u8BBF\u95EE
15 | 400016=\u4E0D\u5728\u767D\u540D\u5355\u4E2D\uFF0C\u7981\u6B62\u8BBF\u95EE
16 | 400017=\u53EA\u6709application/json\u624D\u652F\u6301\u63A5\u53E3\u7B7E\u540D\u6821\u9A8C\u3001\u52A0\u89E3\u5BC6
17 | 400018=\u8BF7\u6C42nonce\u7F3A\u5931
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/test/java/org/smartframework/cloud/examples/support/gateway/test/prepare/dto/GetDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.test.prepare.dto;
17 |
18 | import lombok.Getter;
19 | import lombok.Setter;
20 | import lombok.ToString;
21 |
22 | @Getter
23 | @Setter
24 | @ToString
25 | public class GetDTO {
26 |
27 | private int age;
28 | private String name;
29 | private int height;
30 |
31 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/test/java/org/smartframework/cloud/examples/support/gateway/test/prepare/dto/GetBodyDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.test.prepare.dto;
17 |
18 | import lombok.Getter;
19 | import lombok.Setter;
20 | import lombok.ToString;
21 |
22 | @Getter
23 | @Setter
24 | @ToString
25 | public class GetBodyDTO {
26 |
27 | private int age;
28 | private String name;
29 | private int height;
30 |
31 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/test/java/org/smartframework/cloud/examples/support/gateway/test/prepare/dto/PostBodyDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.test.prepare.dto;
17 |
18 | import lombok.Getter;
19 | import lombok.Setter;
20 | import lombok.ToString;
21 |
22 | @Getter
23 | @Setter
24 | @ToString
25 | public class PostBodyDTO {
26 |
27 | private Long id;
28 | private String name;
29 | private int length;
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/system-test/src/test/java/org/smartframework/cloud/examples/system/test/SuiteTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.system.test;
17 |
18 | import org.junit.jupiter.api.Disabled;
19 | import org.junit.platform.runner.JUnitPlatform;
20 | import org.junit.platform.suite.api.SelectPackages;
21 | import org.junit.runner.RunWith;
22 |
23 | @Disabled
24 | @RunWith(JUnitPlatform.class)
25 | @SelectPackages({"org.smartframework.cloud.examples.system.test"})
26 | public class SuiteTest {
27 |
28 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/resources/i18n/gateway_messages.properties:
--------------------------------------------------------------------------------
1 | 400001=\u83B7\u53D6api meta\u5931\u8D25
2 | 400002=rsa\u5BC6\u94A5\u5BF9\u751F\u6210\u51FA\u9519
3 | 400003=\u767B\u5F55\u524Dtoken\u5931\u6548
4 | 400004=\u767B\u5F55\u6210\u529F\u540Etoken\u5931\u6548
5 | 400005=\u8BF7\u6C42\u53C2\u6570\u4E2Dtoken\u7F3A\u5931
6 | 400006=\u8BF7\u6C42\u7B7E\u540D\u7F3A\u5931
7 | 400007=\u8BF7\u6C42\u53C2\u6570\u7B7E\u540D\u6821\u9A8C\u5931\u8D25
8 | 400008=\u751F\u6210\u7B7E\u540D\u5931\u8D25
9 | 400009=\u751F\u6210\u7B7E\u540Dkey\u5931\u8D25
10 | 400010=\u8BF7\u6C42\u65F6\u95F4\u6233\u4E0D\u80FD\u4E3A\u7A7A\uFF01
11 | 400011=\u8BF7\u6C42\u65F6\u95F4\u6233\u683C\u5F0F\u9519\u8BEF\uFF01
12 | 400012=\u8BF7\u6C42\u65F6\u95F4\u6233\u975E\u6CD5\uFF01
13 | 400013=security key\u8FC7\u671F\uFF01
14 | 400014=AES key\u83B7\u53D6\u5931\u8D25\uFF01
15 | 400015=\u547D\u4E2D\u9ED1\u540D\u5355\u5217\u8868\uFF0C\u7981\u6B62\u8BBF\u95EE
16 | 400016=\u4E0D\u5728\u767D\u540D\u5355\u4E2D\uFF0C\u7981\u6B62\u8BBF\u95EE
17 | 400017=\u53EA\u6709application/json\u624D\u652F\u6301\u63A5\u53E3\u7B7E\u540D\u6821\u9A8C\u3001\u52A0\u89E3\u5BC6
18 | 400018=\u8BF7\u6C42nonce\u7F3A\u5931
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-order/src/main/java/org/smartframework/cloud/examples/mall/order/constants/OrderReturnCodes.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.order.constants;
17 |
18 | /**
19 | * 订单服务状态码
20 | *
21 | * @author collin
22 | * @date 2019-04-16
23 | */
24 | public interface OrderReturnCodes {
25 |
26 | /**
27 | * 库存更新失败
28 | */
29 | String UPDATE_STOCK_FAIL = "200001";
30 | /**
31 | * 商品不存在
32 | */
33 | String PRODUCT_NOT_EXIST = "200002";
34 |
35 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/src/main/java/org/smartframework/cloud/examples/basic/auth/constants/AuthReturnCodes.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.auth.constants;
17 |
18 | /**
19 | * 权限服务状态码
20 | *
21 | * @author collin
22 | * @date 2019-04-16
23 | */
24 | public interface AuthReturnCodes {
25 |
26 | /**
27 | * 权限编码已存在
28 | */
29 | String PERMISSION_CODE_EXIST = "110001";
30 | /**
31 | * 角色编码已存在
32 | */
33 | String ROLE_CODE_EXIST = "110002";
34 |
35 | }
--------------------------------------------------------------------------------
/application-module/app-auth-core/src/main/java/org/smartframework/cloud/examples/app/auth/core/MySmartUser.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.app.auth.core;
17 |
18 | import io.github.smart.cloud.api.core.user.context.SmartUser;
19 | import lombok.Getter;
20 | import lombok.Setter;
21 | import lombok.ToString;
22 |
23 | /**
24 | * 用户信息
25 | *
26 | * @author collin
27 | * @date 2020-09-10
28 | */
29 | @Getter
30 | @Setter
31 | @ToString
32 | public class MySmartUser extends SmartUser {
33 |
34 | // 各应用用户信息
35 |
36 | }
--------------------------------------------------------------------------------
/application-module/api-ac-core/src/main/java/org/smartframework/cloud/examples/api/ac/core/constants/ApiMetaConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.api.ac.core.constants;
17 |
18 | /**
19 | * 接口元数据相关常量
20 | *
21 | * @author collin
22 | * @date 2020-09-18
23 | */
24 | public interface ApiMetaConstants {
25 |
26 | /**
27 | * 收集api meta数据接口数据
28 | */
29 | String FETCH_URL = "/apiMeta/fetch";
30 | /**
31 | * 服务名key
32 | */
33 | String SERVICE_NAME_KEY = "spring.application.name";
34 |
35 | }
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-order/src/main/java/org/smartframework/cloud/examples/mall/order/shardingjdbc/BaseShardingAlgorithm.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.order.shardingjdbc;
17 |
18 | import java.util.Collection;
19 |
20 | /**
21 | * @author collin
22 | * @date 2021-02-09
23 | */
24 | public abstract class BaseShardingAlgorithm {
25 |
26 | protected static final String SHARDING_COLUMN_UID = "f_buyer";
27 |
28 | protected static final String SHARDING_COLUMN_ORDER_NO = "f_order_no";
29 |
30 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/src/test/java/org/smartframework/cloud/examples/basic/auth/test/SuiteTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.auth.test;
17 |
18 | import org.junit.jupiter.api.Disabled;
19 | import org.junit.platform.runner.JUnitPlatform;
20 | import org.junit.platform.suite.api.SelectPackages;
21 | import org.junit.runner.RunWith;
22 |
23 | @Disabled
24 | @RunWith(JUnitPlatform.class)
25 | @SelectPackages({"org.smartframework.cloud.examples.basic.auth.test"})
26 | public class SuiteTest {
27 |
28 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/src/test/java/org/smartframework/cloud/examples/basic/user/test/SuiteTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.user.test;
17 |
18 | import org.junit.jupiter.api.Disabled;
19 | import org.junit.platform.runner.JUnitPlatform;
20 | import org.junit.platform.suite.api.SelectPackages;
21 | import org.junit.runner.RunWith;
22 |
23 | @Disabled
24 | @RunWith(JUnitPlatform.class)
25 | @SelectPackages({"org.smartframework.cloud.examples.basic.user.test"})
26 | public class SuiteTest {
27 |
28 | }
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-order/src/test/java/org/smartframework/cloud/examples/mall/order/test/SuiteTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.order.test;
17 |
18 | import org.junit.jupiter.api.Disabled;
19 | import org.junit.platform.runner.JUnitPlatform;
20 | import org.junit.platform.suite.api.SelectPackages;
21 | import org.junit.runner.RunWith;
22 |
23 | @Disabled
24 | @RunWith(JUnitPlatform.class)
25 | @SelectPackages({"org.smartframework.cloud.examples.mall.order.test"})
26 | public class SuiteTest {
27 |
28 | }
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-product/src/test/java/org/smartframework/cloud/examples/mall/product/test/SuiteTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.product.test;
17 |
18 | import org.junit.jupiter.api.Disabled;
19 | import org.junit.platform.runner.JUnitPlatform;
20 | import org.junit.platform.suite.api.SelectPackages;
21 | import org.junit.runner.RunWith;
22 |
23 | @Disabled
24 | @RunWith(JUnitPlatform.class)
25 | @SelectPackages({"org.smartframework.cloud.examples.mall.product.test"})
26 | public class SuiteTest {
27 |
28 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/support-service-rpc/src/main/java/org/smartframework/cloud/examples/support/rpc/constant/RpcConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.rpc.constant;
17 |
18 | /**
19 | * 网关rpc常量
20 | *
21 | * @author collin
22 | * @date 2021-07-05
23 | */
24 | public interface RpcConstants {
25 |
26 | interface Gateway {
27 | String SERVICE_NAME = "supportServiceGateway";
28 | String FEIGN_CLIENT_NAME = "${" + SERVICE_NAME + ":" + SERVICE_NAME + "}";
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/src/test/java/org/smartframework/cloud/examples/basic/auth/test/code/generate/CodeFileGenerateUtilTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.auth.test.code.generate;
17 |
18 | import io.github.smart.cloud.code.generate.core.CodeGenerateUtil;
19 | import org.junit.jupiter.api.Disabled;
20 | import org.junit.jupiter.api.Test;
21 |
22 | @Disabled
23 | class CodeFileGenerateUtilTest {
24 |
25 | @Test
26 | void testInit() throws Exception {
27 | CodeGenerateUtil.init();
28 | }
29 |
30 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/src/test/java/org/smartframework/cloud/examples/basic/user/test/code/generate/CodeFileGenerateUtilTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.user.test.code.generate;
17 |
18 | import io.github.smart.cloud.code.generate.core.CodeGenerateUtil;
19 | import org.junit.jupiter.api.Disabled;
20 | import org.junit.jupiter.api.Test;
21 |
22 | @Disabled
23 | class CodeFileGenerateUtilTest {
24 |
25 | @Test
26 | void testInit() throws Exception {
27 | CodeGenerateUtil.init();
28 | }
29 |
30 | }
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-order/src/test/java/org/smartframework/cloud/examples/mall/order/test/code/generate/CodeFileGenerateUtilTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.order.test.code.generate;
17 |
18 | import io.github.smart.cloud.code.generate.core.CodeGenerateUtil;
19 | import org.junit.jupiter.api.Disabled;
20 | import org.junit.jupiter.api.Test;
21 |
22 | @Disabled
23 | class CodeFileGenerateUtilTest {
24 |
25 | @Test
26 | void testInit() throws Exception {
27 | CodeGenerateUtil.init();
28 | }
29 |
30 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/exception/RequestNonceException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.exception;
17 |
18 | import io.github.smart.cloud.exception.AbstractBaseException;
19 |
20 | /**
21 | * 请求nonce异常
22 | *
23 | * @author collin
24 | * @date 2024-04-11
25 | */
26 | public class RequestNonceException extends AbstractBaseException {
27 |
28 | public RequestNonceException(String code) {
29 | super(code);
30 | }
31 |
32 | }
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-product/src/test/java/org/smartframework/cloud/examples/mall/product/test/code/generate/CodeFileGenerateUtilTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.product.test.code.generate;
17 |
18 | import io.github.smart.cloud.code.generate.core.CodeGenerateUtil;
19 | import org.junit.jupiter.api.Disabled;
20 | import org.junit.jupiter.api.Test;
21 |
22 | @Disabled
23 | class CodeFileGenerateUtilTest {
24 |
25 | @Test
26 | void testInit() throws Exception {
27 | CodeGenerateUtil.init();
28 | }
29 |
30 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/test/java/org/smartframework/cloud/examples/support/gateway/test/SuiteTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.test;
17 |
18 | import org.junit.jupiter.api.Disabled;
19 | import org.junit.platform.runner.JUnitPlatform;
20 | import org.junit.platform.suite.api.SelectPackages;
21 | import org.junit.runner.RunWith;
22 |
23 | @Disabled
24 | @RunWith(JUnitPlatform.class)
25 | @SelectPackages({"org.smartframework.cloud.examples.support.gateway.test"})
26 | public class SuiteTest {
27 |
28 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/exception/RequestTimestampException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.exception;
17 |
18 | import io.github.smart.cloud.exception.AbstractBaseException;
19 |
20 | /**
21 | * 请求时间异常
22 | *
23 | * @author collin
24 | * @date 2021-07-17
25 | */
26 | public class RequestTimestampException extends AbstractBaseException {
27 |
28 | public RequestTimestampException(String code) {
29 | super(code);
30 | }
31 |
32 | }
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-order/src/main/java/org/smartframework/cloud/examples/mall/order/shardingjdbc/ShardingAlgorithmsType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.order.shardingjdbc;
17 |
18 | public interface ShardingAlgorithmsType {
19 | String ORDER_BILL_DATABASE_TYPE = "ORDER_BILL_DATABASE_TYPE";
20 | String ORDER_BILL_TABLE_TYPE = "ORDER_BILL_TABLE_TYPE";
21 |
22 | String ORDER_DELIVERY_INFO_DATABASE_TYPE = "ORDER_DELIVERY_INFO_DATABASE_TYPE";
23 | String ORDER_DELIVERY_INFO_TABLE_TYPE = "ORDER_DELIVERY_INFO_TABLE_TYPE";
24 |
25 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
23 | 4.0.0
24 |
25 | io.github.smart-cloud
26 | rpc-module
27 | 0.0.1-SNAPSHOT
28 |
29 | basic-service-rpc
30 |
--------------------------------------------------------------------------------
/application-module/rpc-module/mall-service-rpc/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
23 | 4.0.0
24 |
25 | io.github.smart-cloud
26 | rpc-module
27 | 0.0.1-SNAPSHOT
28 |
29 | mall-service-rpc
30 |
31 |
--------------------------------------------------------------------------------
/application-module/rpc-module/support-service-rpc/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
23 | 4.0.0
24 |
25 | io.github.smart-cloud
26 | rpc-module
27 | 0.0.1-SNAPSHOT
28 |
29 | support-service-rpc
30 |
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/constants/DataSecurityConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.constants;
17 |
18 | /**
19 | * 数据安全常量
20 | *
21 | * @author collin
22 | * @date 2024-04-11
23 | */
24 | public class DataSecurityConstants {
25 |
26 | /**
27 | * url参数名
28 | */
29 | public static final String URL_PARAM_NAME = "q";
30 | /**
31 | * rsa加密、签名keySize
32 | */
33 | public static final int RSA_KEY_SIZE = 512;
34 |
35 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/exception/UnsupportedFunctionException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.exception;
17 |
18 | import io.github.smart.cloud.exception.AbstractBaseException;
19 |
20 | /**
21 | * 不支持的功能
22 | *
23 | * @author collin
24 | * @date 2024-04-10
25 | */
26 | public class UnsupportedFunctionException extends AbstractBaseException {
27 |
28 | public UnsupportedFunctionException(String code) {
29 | super(code);
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/properties/BlackWhiteListProperties.java:
--------------------------------------------------------------------------------
1 | package org.smartframework.cloud.examples.support.gateway.properties;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 | import lombok.ToString;
6 |
7 | import java.util.LinkedHashMap;
8 | import java.util.LinkedHashSet;
9 | import java.util.Map;
10 | import java.util.Set;
11 |
12 | /**
13 | * ip黑白名单配置
14 | *
15 | * @author collin
16 | * @date 2024-03-27
17 | */
18 | @Getter
19 | @Setter
20 | @ToString
21 | public class BlackWhiteListProperties {
22 |
23 | /**
24 | * 黑白名单是否可用
25 | */
26 | private boolean enable;
27 | /**
28 | * 黑名单
29 | */
30 | private IpList blackIpList = new IpList();
31 | /**
32 | * 白名单
33 | */
34 | private IpList whiteIpList = new IpList();
35 |
36 | @Getter
37 | @Setter
38 | public static class IpList {
39 | /**
40 | * 全局ip名单
41 | */
42 | private Set ipList = new LinkedHashSet<>();
43 |
44 | /**
45 | * url名单
46 | */
47 | private Map> urlIpList = new LinkedHashMap<>();
48 | }
49 |
50 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/src/main/java/org/smartframework/cloud/examples/basic/user/event/LoginSuccessEventCache.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.user.event;
17 |
18 | import lombok.Getter;
19 | import lombok.Setter;
20 | import lombok.ToString;
21 |
22 | /**
23 | * 登录成功事件
24 | *
25 | * @author collin
26 | * @date 2022-03-01
27 | */
28 | @Getter
29 | @Setter
30 | @ToString
31 | public class LoginSuccessEventCache extends CacheSessionEvent {
32 |
33 | public LoginSuccessEventCache(Object source) {
34 | super(source);
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/src/main/java/org/smartframework/cloud/examples/basic/user/service/TokenService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.user.service;
17 |
18 | import org.springframework.stereotype.Service;
19 |
20 | /**
21 | * token相关
22 | *
23 | * @author collin
24 | * @date 2019-06-29
25 | */
26 | @Service
27 | public class TokenService {
28 |
29 | /**
30 | * token续期
31 | *
32 | * @param token
33 | */
34 | public boolean renew(String token) {
35 | // TODO:token续期
36 | return true;
37 | }
38 |
39 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/exception/AesKeyNotFoundException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.exception;
17 |
18 | import io.github.smart.cloud.exception.AbstractBaseException;
19 |
20 | /**
21 | * AES加密key未找到异常
22 | *
23 | * @author collin
24 | * @date 2021-07-21
25 | */
26 | public class AesKeyNotFoundException extends AbstractBaseException {
27 |
28 | public AesKeyNotFoundException() {
29 | super();
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/src/main/java/org/smartframework/cloud/examples/basic/auth/mapper/RoleInfoMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.auth.mapper;
17 |
18 | import io.github.smart.cloud.starter.mybatis.plus.common.mapper.SmartMapper;
19 | import org.apache.ibatis.annotations.Mapper;
20 | import org.smartframework.cloud.examples.basic.auth.entity.RoleInfoEntity;
21 |
22 | /**
23 | * 角色表base mapper
24 | *
25 | * @author collin
26 | * @date 2021-12-12
27 | */
28 | @Mapper
29 | public interface RoleInfoMapper extends SmartMapper {
30 |
31 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/src/main/java/org/smartframework/cloud/examples/basic/user/event/RegisterSuccessEventCache.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.user.event;
17 |
18 | import lombok.Getter;
19 | import lombok.Setter;
20 | import lombok.ToString;
21 |
22 | /**
23 | * 注册成功事件
24 | *
25 | * @author collin
26 | * @date 2022-03-01
27 | */
28 | @Getter
29 | @Setter
30 | @ToString
31 | public class RegisterSuccessEventCache extends CacheSessionEvent {
32 |
33 | public RegisterSuccessEventCache(Object source) {
34 | super(source);
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/src/main/java/org/smartframework/cloud/examples/basic/user/mapper/UserInfoMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.user.mapper;
17 |
18 | import io.github.smart.cloud.starter.mybatis.plus.common.mapper.SmartMapper;
19 | import org.apache.ibatis.annotations.Mapper;
20 | import org.smartframework.cloud.examples.basic.user.entity.UserInfoEntity;
21 |
22 | /**
23 | * 用户信息base mapper
24 | *
25 | * @author collin
26 | * @date 2021-12-12
27 | */
28 | @Mapper
29 | public interface UserInfoMapper extends SmartMapper {
30 |
31 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/src/main/java/org/smartframework/cloud/examples/basic/user/mapper/LoginInfoMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.user.mapper;
17 |
18 | import io.github.smart.cloud.starter.mybatis.plus.common.mapper.SmartMapper;
19 | import org.apache.ibatis.annotations.Mapper;
20 | import org.smartframework.cloud.examples.basic.user.entity.LoginInfoEntity;
21 |
22 | /**
23 | * 登录信息base mapper
24 | *
25 | * @author collin
26 | * @date 2021-12-12
27 | */
28 | @Mapper
29 | public interface LoginInfoMapper extends SmartMapper {
30 |
31 | }
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-order/src/main/java/org/smartframework/cloud/examples/mall/order/mapper/OrderBillMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.order.mapper;
17 |
18 | import io.github.smart.cloud.starter.mybatis.plus.common.mapper.SmartMapper;
19 | import org.apache.ibatis.annotations.Mapper;
20 | import org.smartframework.cloud.examples.mall.order.entity.OrderBillEntity;
21 |
22 | /**
23 | * 订单信息base mapper
24 | *
25 | * @author collin
26 | * @date 2021-12-12
27 | */
28 | @Mapper
29 | public interface OrderBillMapper extends SmartMapper {
30 |
31 | }
--------------------------------------------------------------------------------
/application-module/app-auth-core/src/main/java/org/smartframework/cloud/examples/app/auth/core/exception/SmartUserMissingException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.app.auth.core.exception;
17 |
18 | import io.github.smart.cloud.constants.CommonReturnCodes;
19 | import io.github.smart.cloud.exception.AbstractBaseException;
20 |
21 | /**
22 | * 用户信息获取不到异常
23 | *
24 | * @author collin
25 | * @date 2020-09-10
26 | */
27 | public class SmartUserMissingException extends AbstractBaseException {
28 |
29 | public SmartUserMissingException() {
30 | super(CommonReturnCodes.NOT_LOGGED_IN);
31 | }
32 |
33 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/src/main/java/org/smartframework/cloud/examples/basic/auth/mapper/PermissionInfoMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.auth.mapper;
17 |
18 | import io.github.smart.cloud.starter.mybatis.plus.common.mapper.SmartMapper;
19 | import org.apache.ibatis.annotations.Mapper;
20 | import org.smartframework.cloud.examples.basic.auth.entity.PermissionInfoEntity;
21 |
22 | /**
23 | * 权限表base mapper
24 | *
25 | * @author collin
26 | * @date 2021-12-12
27 | */
28 | @Mapper
29 | public interface PermissionInfoMapper extends SmartMapper {
30 |
31 | }
--------------------------------------------------------------------------------
/merge-module/merge-mall/src/main/java/org/smartframework/cloud/examples/merge/mall/Application.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.merge.mall;
17 |
18 | import org.smartframework.cloud.examples.framework.annotation.SmartApplication;
19 | import org.springframework.boot.SpringApplication;
20 | import org.springframework.transaction.annotation.EnableTransactionManagement;
21 |
22 | @SmartApplication
23 | @EnableTransactionManagement
24 | public class Application {
25 |
26 | public static void main(String[] args) {
27 | SpringApplication.run(Application.class, args);
28 | }
29 |
30 | }
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-order/src/main/java/org/smartframework/cloud/examples/mall/order/mapper/OrderDeliveryInfoMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.order.mapper;
17 |
18 | import io.github.smart.cloud.starter.mybatis.plus.common.mapper.SmartMapper;
19 | import org.apache.ibatis.annotations.Mapper;
20 | import org.smartframework.cloud.examples.mall.order.entity.OrderDeliveryInfoEntity;
21 |
22 | /**
23 | * 运单信息base mapper
24 | *
25 | * @author collin
26 | * @date 2021-12-12
27 | */
28 | @Mapper
29 | public interface OrderDeliveryInfoMapper extends SmartMapper {
30 |
31 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/GatewayApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway;
17 |
18 | import org.smartframework.cloud.examples.framework.annotation.SmartApplication;
19 | import org.springframework.boot.SpringApplication;
20 |
21 | /**
22 | * 网关启动类
23 | *
24 | * @author collin
25 | * @date 2020-05-13
26 | */
27 | @SmartApplication
28 | public class GatewayApplication {
29 |
30 | public static void main(String[] args) {
31 | SpringApplication.run(GatewayApplication.class, args);
32 | }
33 |
34 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/exception/AuthenticationException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.exception;
17 |
18 | import io.github.smart.cloud.exception.AbstractBaseException;
19 | import io.github.smart.cloud.constants.CommonReturnCodes;
20 |
21 | /**
22 | * 无权限访问
23 | *
24 | * @author collin
25 | * @date 2021-07-15
26 | */
27 | public class AuthenticationException extends AbstractBaseException {
28 |
29 | public AuthenticationException() {
30 | super(CommonReturnCodes.NO_ACCESS);
31 | }
32 |
33 | }
--------------------------------------------------------------------------------
/merge-module/merge-basic/src/main/java/org/smartframework/cloud/examples/merge/basic/Application.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.merge.basic;
17 |
18 | import org.smartframework.cloud.examples.framework.annotation.SmartApplication;
19 | import org.springframework.boot.SpringApplication;
20 | import org.springframework.transaction.annotation.EnableTransactionManagement;
21 |
22 | @SmartApplication
23 | @EnableTransactionManagement
24 | public class Application {
25 |
26 | public static void main(String[] args) {
27 | SpringApplication.run(Application.class, args);
28 | }
29 |
30 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/exception/WhiteListException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.exception;
17 |
18 | import io.github.smart.cloud.exception.AbstractBaseException;
19 | import org.smartframework.cloud.examples.support.gateway.constants.GatewayReturnCodes;
20 |
21 | /**
22 | * 白名单异常
23 | *
24 | * @author collin
25 | * @date 2024-03-26
26 | */
27 | public class WhiteListException extends AbstractBaseException {
28 |
29 | public WhiteListException() {
30 | super(GatewayReturnCodes.NOT_IN_WHITE_LIST);
31 | }
32 |
33 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/exception/BlackListException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.exception;
17 |
18 | import io.github.smart.cloud.exception.AbstractBaseException;
19 | import org.smartframework.cloud.examples.support.gateway.constants.GatewayReturnCodes;
20 |
21 | /**
22 | * 黑名单异常
23 | *
24 | * @author collin
25 | * @date 2024-03-26
26 | */
27 | public class BlackListException extends AbstractBaseException {
28 |
29 | public BlackListException() {
30 | super(GatewayReturnCodes.BLACK_LIST_FORBIDDEN_ACCSS);
31 | }
32 |
33 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/exception/GenerateSignFailException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.exception;
17 |
18 | import io.github.smart.cloud.exception.AbstractBaseException;
19 | import org.smartframework.cloud.examples.support.gateway.constants.GatewayReturnCodes;
20 |
21 | /**
22 | * 生成签名失败
23 | *
24 | * @author collin
25 | * @date 2021-07-25
26 | */
27 | public class GenerateSignFailException extends AbstractBaseException {
28 |
29 | public GenerateSignFailException() {
30 | super(GatewayReturnCodes.GENERATE_SIGN_FAIL);
31 | }
32 |
33 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/src/main/java/org/smartframework/cloud/examples/basic/user/pojo/login/LoginInfoInsertDO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.user.pojo.login;
17 |
18 | import lombok.Getter;
19 | import lombok.NoArgsConstructor;
20 | import lombok.Setter;
21 | import lombok.experimental.SuperBuilder;
22 |
23 | /**
24 | * 插入登陆信息
25 | *
26 | * @author collin
27 | * @date 2019-07-01
28 | */
29 | @Getter
30 | @Setter
31 | @NoArgsConstructor
32 | @SuperBuilder
33 | public class LoginInfoInsertDO extends LoginInfoInsertBO {
34 |
35 | private static final long serialVersionUID = 1L;
36 |
37 | /** md5盐值 */
38 | private String salt;
39 |
40 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/src/main/java/org/smartframework/cloud/examples/basic/rpc/enums/user/UserStateEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.rpc.enums.user;
17 |
18 | import lombok.AccessLevel;
19 | import lombok.AllArgsConstructor;
20 | import lombok.Getter;
21 |
22 | /**
23 | * 用户状态=={"1":"启用","2":"禁用"}
24 | *
25 | * @author collin
26 | * @date 2019-06-29
27 | */
28 | @Getter
29 | @AllArgsConstructor(access = AccessLevel.PRIVATE)
30 | public enum UserStateEnum {
31 |
32 | /**
33 | * 启用
34 | */
35 | ENABLE((byte) 1),
36 | /**
37 | * 禁用
38 | */
39 | UNENABLE((byte) 2);
40 |
41 | private byte value;
42 |
43 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/src/main/java/org/smartframework/cloud/examples/basic/auth/pojo/RoleDO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.auth.pojo;
17 |
18 | import lombok.*;
19 |
20 | import java.io.Serializable;
21 |
22 | @Getter
23 | @Setter
24 | @ToString
25 | @NoArgsConstructor
26 | @AllArgsConstructor
27 | public class RoleDO implements Serializable {
28 |
29 | private static final long serialVersionUID = 1L;
30 |
31 | /**
32 | * 角色id
33 | */
34 | private Long roleId;
35 | /**
36 | * 角色编码
37 | */
38 | private String roleCode;
39 | /**
40 | * 角色描述
41 | */
42 | private String roleDesc;
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/src/main/java/org/smartframework/cloud/examples/basic/rpc/constant/RpcConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.rpc.constant;
17 |
18 | /**
19 | * 基础模块rpc常量
20 | *
21 | * @author collin
22 | * @date 2021-07-05
23 | */
24 | public interface RpcConstants {
25 |
26 | interface User {
27 | String SERVICE_NAME = "basicServiceUser";
28 | String FEIGN_CLIENT_NAME = "${" + SERVICE_NAME + ":" + SERVICE_NAME + "}";
29 | }
30 |
31 | interface Auth {
32 | String SERVICE_NAME = "basicServiceAuth";
33 | String FEIGN_CLIENT_NAME = "${" + SERVICE_NAME + ":" + SERVICE_NAME + "}";
34 | }
35 |
36 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/src/main/java/org/smartframework/cloud/examples/basic/rpc/enums/user/PwdStateEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.rpc.enums.user;
17 |
18 | import lombok.AccessLevel;
19 | import lombok.AllArgsConstructor;
20 | import lombok.Getter;
21 |
22 | /**
23 | * 密码状态=={"1":"未设置","2":"已设置"}
24 | *
25 | * @author collin
26 | * @date 2019-07-13
27 | */
28 | @Getter
29 | @AllArgsConstructor(access = AccessLevel.PRIVATE)
30 | public enum PwdStateEnum {
31 |
32 | /**
33 | * 未设置
34 | */
35 | NOT_SETTING((byte) 1),
36 | /**
37 | * 已设置
38 | */
39 | DONE_SETTING((byte) 2);
40 |
41 | private byte value;
42 |
43 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/exception/GenerateSignKeyFailException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.exception;
17 |
18 | import io.github.smart.cloud.exception.AbstractBaseException;
19 | import org.smartframework.cloud.examples.support.gateway.constants.GatewayReturnCodes;
20 |
21 | /**
22 | * 生成签名key失败
23 | *
24 | * @author collin
25 | * @date 2021-07-25
26 | */
27 | public class GenerateSignKeyFailException extends AbstractBaseException {
28 |
29 | public GenerateSignKeyFailException() {
30 | super(GatewayReturnCodes.GENERATE_SIGN_KEY_FAIL);
31 | }
32 |
33 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/exception/RequestSignCheckFailException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.exception;
17 |
18 | import io.github.smart.cloud.exception.AbstractBaseException;
19 | import org.smartframework.cloud.examples.support.gateway.constants.GatewayReturnCodes;
20 |
21 | /**
22 | * 请求参数签名校验失败
23 | *
24 | * @author collin
25 | * @date 2021-07-25
26 | */
27 | public class RequestSignCheckFailException extends AbstractBaseException {
28 |
29 | public RequestSignCheckFailException() {
30 | super(GatewayReturnCodes.REQUEST_SIGN_CHECK_FAIL);
31 | }
32 |
33 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/mall-service-rpc/src/main/java/org/smartframework/cloud/examples/mall/rpc/product/request/oms/PageProductReqVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.rpc.product.request.oms;
17 |
18 | import io.github.smart.cloud.common.pojo.BasePageRequest;
19 | import lombok.Getter;
20 | import lombok.Setter;
21 | import lombok.ToString;
22 |
23 | /**
24 | * 分页查询商品信息请求参数
25 | *
26 | * @author collin
27 | * @date 2020-09-10
28 | */
29 | @Getter
30 | @Setter
31 | @ToString
32 | public class PageProductReqVO extends BasePageRequest {
33 |
34 | private static final long serialVersionUID = 1L;
35 |
36 | /**
37 | * 商品名称
38 | */
39 | private String name;
40 |
41 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/mall-service-rpc/src/main/java/org/smartframework/cloud/examples/mall/rpc/product/request/api/PageProductReqVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.rpc.product.request.api;
17 |
18 | import io.github.smart.cloud.common.pojo.BasePageRequest;
19 | import lombok.Getter;
20 | import lombok.Setter;
21 | import lombok.ToString;
22 |
23 | /**
24 | * 分页查询商品信息请求参数
25 | *
26 | * @author collin
27 | * @date 2020-09-10
28 | */
29 | @Getter
30 | @Setter
31 | @ToString
32 | public class PageProductReqVO extends BasePageRequest {
33 |
34 | private static final long serialVersionUID = 1L;
35 |
36 | /**
37 | * 商品名称(模糊匹配)
38 | */
39 | private String name;
40 |
41 | }
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-order/src/main/java/org/smartframework/cloud/examples/mall/order/exception/UpdateStockException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.order.exception;
17 |
18 | import io.github.smart.cloud.exception.AbstractBaseException;
19 | import org.smartframework.cloud.examples.mall.order.constants.OrderReturnCodes;
20 |
21 | /**
22 | * 库存更新异常
23 | *
24 | * @author collin
25 | * @date 2019-04-16
26 | */
27 | public class UpdateStockException extends AbstractBaseException {
28 |
29 | private static final long serialVersionUID = 1L;
30 |
31 | public UpdateStockException() {
32 | super(OrderReturnCodes.UPDATE_STOCK_FAIL);
33 | }
34 |
35 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/mall-service-rpc/src/main/java/org/smartframework/cloud/examples/mall/rpc/constant/RpcConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.rpc.constant;
17 |
18 | /**
19 | * 电商模块rpc常量
20 | *
21 | * @author collin
22 | * @date 2021-07-05
23 | */
24 | public interface RpcConstants {
25 |
26 | interface Order {
27 | String SERVICE_NAME = "mallServiceOrder";
28 | String FEIGN_CLIENT_NAME = "${" + SERVICE_NAME + ":" + SERVICE_NAME + "}";
29 | }
30 |
31 | interface Product {
32 | String SERVICE_NAME = "mallServiceProduct";
33 | String FEIGN_CLIENT_NAME = "${" + SERVICE_NAME + ":" + SERVICE_NAME + "}";
34 | }
35 |
36 | }
--------------------------------------------------------------------------------
/application-module/api-ac-core/src/main/java/org/smartframework/cloud/examples/api/ac/core/vo/ApiMetaFetchRespVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.api.ac.core.vo;
17 |
18 | import lombok.*;
19 |
20 | import java.io.Serializable;
21 | import java.util.Map;
22 |
23 | /**
24 | * Api访问控制元数据信息
25 | *
26 | * @author collin
27 | * @date 2020-09-10
28 | */
29 | @Getter
30 | @Setter
31 | @ToString
32 | @NoArgsConstructor
33 | @AllArgsConstructor
34 | public class ApiMetaFetchRespVO implements Serializable {
35 |
36 | private static final long serialVersionUID = 1L;
37 |
38 | /**
39 | * Api访问控制信息
40 | */
41 | private Map apiAccessMap;
42 |
43 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/dto/DataSecurityParamDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.dto;
17 |
18 | import lombok.Getter;
19 | import lombok.Setter;
20 | import lombok.ToString;
21 |
22 | /**
23 | * 接口安全参数DTO
24 | *
25 | * @author collin
26 | * @date 2020-09-10
27 | */
28 | @Getter
29 | @Setter
30 | @ToString
31 | public class DataSecurityParamDTO {
32 |
33 | /**
34 | * 请求头
35 | */
36 | private String headers;
37 | /**
38 | * url参数(base64)
39 | */
40 | private String urlParamsBase64;
41 | /**
42 | * body参数(base64)
43 | */
44 | private String bodyBase64;
45 |
46 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/src/main/java/org/smartframework/cloud/examples/basic/rpc/enums/user/SexEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.rpc.enums.user;
17 |
18 | import lombok.AccessLevel;
19 | import lombok.AllArgsConstructor;
20 | import lombok.Getter;
21 |
22 | /**
23 | * 性别=={"1":"男","2":"女","3":"未知"}
24 | *
25 | * @author collin
26 | * @date 2019-06-29
27 | */
28 | @Getter
29 | @AllArgsConstructor(access = AccessLevel.PRIVATE)
30 | public enum SexEnum {
31 |
32 | /**
33 | * 男
34 | */
35 | MALE((byte) 1),
36 | /**
37 | * 女
38 | */
39 | FEMALE((byte) 2),
40 | /**
41 | * 未知
42 | */
43 | UNKNOWN((byte) 3);
44 |
45 | private byte value;
46 |
47 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/src/main/java/org/smartframework/cloud/examples/basic/auth/AuthApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.auth;
17 |
18 | import org.smartframework.cloud.examples.framework.annotation.SmartApplication;
19 | import org.springframework.boot.SpringApplication;
20 | import org.springframework.transaction.annotation.EnableTransactionManagement;
21 |
22 | /**
23 | * 鉴权服务启动类
24 | *
25 | * @author collin
26 | * @date 2019-07-12
27 | */
28 | @SmartApplication
29 | @EnableTransactionManagement
30 | public class AuthApplication {
31 |
32 | public static void main(String[] args) {
33 | SpringApplication.run(AuthApplication.class, args);
34 | }
35 |
36 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/src/main/java/org/smartframework/cloud/examples/basic/auth/pojo/param/PermissionReqDO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.auth.pojo.param;
17 |
18 | import lombok.*;
19 |
20 | import java.io.Serializable;
21 | import java.util.Set;
22 |
23 | @Getter
24 | @Setter
25 | @ToString
26 | @NoArgsConstructor
27 | @AllArgsConstructor
28 | public class PermissionReqDO implements Serializable {
29 |
30 | private static final long serialVersionUID = 1L;
31 |
32 | /**
33 | * 角色id
34 | */
35 | private Set roleIds;
36 | /**
37 | * 权限编码
38 | */
39 | private String permissonCode;
40 | /**
41 | * 权限描述
42 | */
43 | private String permissonDesc;
44 |
45 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/src/main/java/org/smartframework/cloud/examples/basic/user/UserApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.user;
17 |
18 | import org.smartframework.cloud.examples.framework.annotation.SmartApplication;
19 | import org.springframework.boot.SpringApplication;
20 | import org.springframework.transaction.annotation.EnableTransactionManagement;
21 |
22 | /**
23 | * 用户服务启动类
24 | *
25 | * @author collin
26 | * @date 2019-07-12
27 | */
28 | @SmartApplication
29 | @EnableTransactionManagement
30 | public class UserApplication {
31 |
32 | public static void main(String[] args) {
33 | SpringApplication.run(UserApplication.class, args);
34 | }
35 |
36 | }
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-order/src/main/java/org/smartframework/cloud/examples/mall/order/OrderApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.order;
17 |
18 | import org.smartframework.cloud.examples.framework.annotation.SmartApplication;
19 | import org.springframework.boot.SpringApplication;
20 | import org.springframework.transaction.annotation.EnableTransactionManagement;
21 |
22 | /**
23 | * 订单服务启动类
24 | *
25 | * @author collin
26 | * @date 2019-07-12
27 | */
28 | @SmartApplication
29 | @EnableTransactionManagement
30 | public class OrderApplication {
31 |
32 | public static void main(String[] args) {
33 | SpringApplication.run(OrderApplication.class, args);
34 | }
35 |
36 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/src/main/java/org/smartframework/cloud/examples/basic/rpc/enums/user/ChannelEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.rpc.enums.user;
17 |
18 | import lombok.AccessLevel;
19 | import lombok.AllArgsConstructor;
20 | import lombok.Getter;
21 |
22 | /**
23 | * 所在平台=={"1":"app","2":"web后台","3":"微信"}
24 | *
25 | * @author collin
26 | * @date 2019-06-29
27 | */
28 | @Getter
29 | @AllArgsConstructor(access = AccessLevel.PRIVATE)
30 | public enum ChannelEnum {
31 |
32 | /**
33 | * app
34 | */
35 | APP((byte) 1),
36 | /**
37 | * web后台
38 | */
39 | WEB((byte) 2),
40 | /**
41 | * 微信
42 | */
43 | WEIXIN((byte) 3);
44 |
45 | private byte value;
46 |
47 | }
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-product/src/main/java/org/smartframework/cloud/examples/mall/product/ProductApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.product;
17 |
18 | import org.smartframework.cloud.examples.framework.annotation.SmartApplication;
19 | import org.springframework.boot.SpringApplication;
20 | import org.springframework.transaction.annotation.EnableTransactionManagement;
21 |
22 | /**
23 | * 商品服务启动类
24 | *
25 | * @author collin
26 | * @date 2019-07-12
27 | */
28 | @SmartApplication
29 | @EnableTransactionManagement
30 | public class ProductApplication {
31 |
32 | public static void main(String[] args) {
33 | SpringApplication.run(ProductApplication.class, args);
34 | }
35 |
36 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/support-service-rpc/src/main/java/org/smartframework/cloud/examples/support/rpc/gateway/response/api/GenerateAesKeyRespVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.rpc.gateway.response.api;
17 |
18 | import lombok.*;
19 | import lombok.experimental.SuperBuilder;
20 |
21 | import java.io.Serializable;
22 |
23 | /**
24 | * 生成AES秘钥响应信息
25 | *
26 | * @author collin
27 | * @date 2020-09-07
28 | */
29 | @Getter
30 | @Setter
31 | @ToString
32 | @NoArgsConstructor
33 | @AllArgsConstructor
34 | @SuperBuilder
35 | public class GenerateAesKeyRespVO implements Serializable {
36 |
37 | private static final long serialVersionUID = 1L;
38 |
39 | /**
40 | * 被客户端公钥加密的AES加解密key
41 | */
42 | private String encryptedAesKey;
43 |
44 | }
--------------------------------------------------------------------------------
/system-test/src/test/java/org/smartframework/cloud/examples/system/test/module/mall/util/TokenUtilSystemTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.system.test.module.mall.util;
17 |
18 | import io.github.smart.cloud.test.core.AbstractSystemTest;
19 | import org.assertj.core.api.Assertions;
20 | import org.junit.jupiter.api.Test;
21 | import org.smartframework.cloud.examples.system.test.util.TokenUtil;
22 |
23 | import java.io.IOException;
24 |
25 | class TokenUtilSystemTest extends AbstractSystemTest {
26 |
27 | @Test
28 | void testGetToken() throws IOException {
29 | TokenUtil.Context context = TokenUtil.getContext();
30 | Assertions.assertThat(context).isNotNull();
31 | Assertions.assertThat(context.getToken()).isNotBlank();
32 | }
33 |
34 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/src/main/java/org/smartframework/cloud/examples/basic/auth/pojo/PermissionDO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.auth.pojo;
17 |
18 | import lombok.*;
19 |
20 | import java.io.Serializable;
21 |
22 | @Getter
23 | @Setter
24 | @ToString
25 | @NoArgsConstructor
26 | @AllArgsConstructor
27 | public class PermissionDO implements Serializable {
28 |
29 | private static final long serialVersionUID = 1L;
30 |
31 | /**
32 | * 角色id
33 | */
34 | private Long roleId;
35 | /**
36 | * 权限id
37 | */
38 | private Long permissonId;
39 | /**
40 | * 权限编码
41 | */
42 | private String permissonCode;
43 | /**
44 | * 权限描述
45 | */
46 | private String permissonDesc;
47 |
48 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/support-service-rpc/src/main/java/org/smartframework/cloud/examples/support/rpc/gateway/request/rpc/NotifyFetchReqDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.rpc.gateway.request.rpc;
17 |
18 | import lombok.*;
19 | import lombok.experimental.SuperBuilder;
20 |
21 | import javax.validation.constraints.NotBlank;
22 | import java.io.Serializable;
23 |
24 | /**
25 | * 通知网关获取api meta请求参数
26 | *
27 | * @author collin
28 | * @date 2020-09-18
29 | */
30 | @Getter
31 | @Setter
32 | @ToString
33 | @NoArgsConstructor
34 | @AllArgsConstructor
35 | @SuperBuilder
36 | public class NotifyFetchReqDTO implements Serializable {
37 |
38 | private static final long serialVersionUID = 1L;
39 |
40 | @NotBlank
41 | private String serviceName;
42 |
43 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/cache/AuthCache.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.cache;
17 |
18 | import lombok.Getter;
19 | import lombok.Setter;
20 | import lombok.ToString;
21 |
22 | import java.io.Serializable;
23 | import java.util.Set;
24 |
25 | /**
26 | * 权限cache
27 | *
28 | * @author collin
29 | * @date 2020-09-10
30 | */
31 | @Getter
32 | @Setter
33 | @ToString
34 | public class AuthCache implements Serializable {
35 |
36 | private static final long serialVersionUID = 1L;
37 |
38 | /**
39 | * 用户所拥有的角色
40 | */
41 | private Set roles;
42 | /**
43 | * 用户所拥有的权限
44 | */
45 | private Set permissions;
46 |
47 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/src/main/java/org/smartframework/cloud/examples/basic/rpc/user/response/api/register/RegisterUserRespVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.rpc.user.response.api.register;
17 |
18 | import lombok.Getter;
19 | import lombok.NoArgsConstructor;
20 | import lombok.Setter;
21 | import lombok.ToString;
22 | import lombok.experimental.SuperBuilder;
23 | import org.smartframework.cloud.examples.basic.rpc.user.response.api.login.LoginRespVO;
24 |
25 | /**
26 | * 用户注册响应信息
27 | *
28 | * @author collin
29 | * @date 2020-09-10
30 | */
31 | @Setter
32 | @Getter
33 | @ToString
34 | @NoArgsConstructor
35 | @SuperBuilder
36 | public class RegisterUserRespVO extends LoginRespVO {
37 |
38 | private static final long serialVersionUID = 1L;
39 |
40 | }
--------------------------------------------------------------------------------
/system-test/src/main/java/org/smartframework/cloud/examples/system/test/config/ISystemTestConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.system.test.config;
17 |
18 | /**
19 | * 系统测试配置
20 | *
21 | * @author collin
22 | * @date 2020-09-29
23 | */
24 | public interface ISystemTestConfig {
25 |
26 | /**
27 | * 获取用户服务请求base url
28 | *
29 | * @return
30 | */
31 | String getUserBaseUrl();
32 |
33 | /**
34 | * 获取订单服务请求base url
35 | *
36 | * @return
37 | */
38 | String getOrderBaseUrl();
39 |
40 | /**
41 | * 获取商品服务请求base url
42 | *
43 | * @return
44 | */
45 | String getProductBaseUrl();
46 |
47 | /**
48 | * 获取网关服务请求base url
49 | *
50 | * @return
51 | */
52 | String getGatewayBaseUrl();
53 |
54 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/mall-service-rpc/src/main/java/org/smartframework/cloud/examples/mall/rpc/product/request/oms/ProductDeleteReqVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.rpc.product.request.oms;
17 |
18 | import lombok.Getter;
19 | import lombok.Setter;
20 | import lombok.ToString;
21 |
22 | import javax.validation.constraints.Min;
23 | import javax.validation.constraints.NotNull;
24 | import java.io.Serializable;
25 |
26 | /**
27 | * 逻辑删除请求字段
28 | *
29 | * @author collin
30 | * @date 2020-09-10
31 | */
32 | @Getter
33 | @Setter
34 | @ToString
35 | public class ProductDeleteReqVO implements Serializable {
36 |
37 | private static final long serialVersionUID = 1L;
38 |
39 | /**
40 | * 商品id
41 | */
42 | @NotNull
43 | @Min(1)
44 | private Long id;
45 |
46 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/mall-service-rpc/src/main/java/org/smartframework/cloud/examples/mall/rpc/product/response/rpc/QryProductByIdsRespDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.rpc.product.response.rpc;
17 |
18 | import lombok.*;
19 | import lombok.experimental.SuperBuilder;
20 |
21 | import java.io.Serializable;
22 | import java.util.List;
23 |
24 | /**
25 | * 根据ids查询商品信息响应信息
26 | *
27 | * @author collin
28 | * @date 2020-09-10
29 | */
30 | @Setter
31 | @Getter
32 | @ToString
33 | @NoArgsConstructor
34 | @AllArgsConstructor
35 | @SuperBuilder
36 | public class QryProductByIdsRespDTO implements Serializable {
37 |
38 | private static final long serialVersionUID = 1L;
39 |
40 | /**
41 | * 商品信息
42 | */
43 | private List productInfos;
44 |
45 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-admin/src/main/java/org/smartframework/cloud/examples/support/admin/AdminApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.admin;
17 |
18 | import de.codecentric.boot.admin.server.config.EnableAdminServer;
19 | import org.springframework.boot.SpringApplication;
20 | import org.springframework.boot.autoconfigure.SpringBootApplication;
21 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
22 |
23 | /**
24 | * 服务监控启动类
25 | *
26 | * @author collin
27 | * @date 2020-05-13
28 | */
29 | @EnableAdminServer
30 | @EnableDiscoveryClient
31 | @SpringBootApplication
32 | public class AdminApplication {
33 |
34 | public static void main(String[] args) {
35 | SpringApplication.run(AdminApplication.class, args);
36 | }
37 |
38 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/src/main/java/org/smartframework/cloud/examples/basic/rpc/auth/request/oms/role/PageRoleReqVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.rpc.auth.request.oms.role;
17 |
18 | import io.github.smart.cloud.common.pojo.BasePageRequest;
19 | import lombok.Getter;
20 | import lombok.Setter;
21 | import lombok.ToString;
22 |
23 | /**
24 | * 分页查询角色信息请求参数
25 | *
26 | * @author collin
27 | * @date 2021-07-04
28 | */
29 | @Getter
30 | @Setter
31 | @ToString
32 | public class PageRoleReqVO extends BasePageRequest {
33 |
34 | private static final long serialVersionUID = 1L;
35 |
36 | /**
37 | * 角色编码
38 | */
39 | private String code;
40 | /**
41 | * 角色描述
42 | */
43 | private String desc;
44 |
45 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/support-service-rpc/src/main/java/org/smartframework/cloud/examples/support/rpc/gateway/request/rpc/GatewayAuthUpdateReqDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.rpc.gateway.request.rpc;
17 |
18 | import lombok.*;
19 | import lombok.experimental.SuperBuilder;
20 |
21 | import javax.validation.constraints.NotNull;
22 | import java.io.Serializable;
23 |
24 | /**
25 | * 修改权限信息
26 | *
27 | * @author collin
28 | * @date 2020-09-10
29 | */
30 | @Getter
31 | @Setter
32 | @ToString
33 | @NoArgsConstructor
34 | @AllArgsConstructor
35 | @SuperBuilder
36 | public class GatewayAuthUpdateReqDTO implements Serializable {
37 |
38 | private static final long serialVersionUID = 1L;
39 |
40 | /**
41 | * 用户uid
42 | */
43 | @NotNull
44 | private Long userId;
45 |
46 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/support-service-rpc/src/main/java/org/smartframework/cloud/examples/support/rpc/gateway/request/rpc/GatewayAuthUploadReqDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.rpc.gateway.request.rpc;
17 |
18 | import lombok.*;
19 | import lombok.experimental.SuperBuilder;
20 |
21 | import javax.validation.constraints.NotBlank;
22 | import java.io.Serializable;
23 |
24 | /**
25 | * 上传权限信息
26 | *
27 | * @author collin
28 | * @date 2020-09-10
29 | */
30 | @Getter
31 | @Setter
32 | @ToString
33 | @NoArgsConstructor
34 | @AllArgsConstructor
35 | @SuperBuilder
36 | public class GatewayAuthUploadReqDTO implements Serializable {
37 |
38 | private static final long serialVersionUID = 1L;
39 |
40 | /**
41 | * 用户token
42 | */
43 | @NotBlank
44 | private String token;
45 |
46 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/constants/GatewayConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.constants;
17 |
18 | import org.smartframework.cloud.examples.support.gateway.filter.FilterContext;
19 |
20 | /**
21 | * gateway常量
22 | *
23 | * @author collin
24 | * @date 2020-08-07
25 | */
26 | public interface GatewayConstants {
27 |
28 | /**
29 | * gateway接口url前缀
30 | */
31 | String GATEWAY_API_URL_PREFIX = "/gateway";
32 | /**
33 | * 过滤器上下文key
34 | */
35 | String FILTER_CONTEXT_KEY = FilterContext.class.getSimpleName();
36 | /**
37 | * http get、post(application/x-www-form-urlencoded)请求参数加密后的key名
38 | */
39 | String REQUEST_ENCRYPT_PARAM_NAME = "q";
40 |
41 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/filter/FilterContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.filter;
17 |
18 | import lombok.Getter;
19 | import lombok.Setter;
20 | import lombok.experimental.Accessors;
21 | import org.smartframework.cloud.examples.support.gateway.cache.ApiAccessMetaCache;
22 |
23 | /**
24 | * 网关过滤器内部请求参数
25 | *
26 | * @author collin
27 | * @date 2021-07-21
28 | */
29 | @Getter
30 | @Setter
31 | @Accessors(chain = true)
32 | public class FilterContext {
33 |
34 | /**
35 | * token
36 | */
37 | private String token;
38 | /**
39 | * 接口注解信息
40 | */
41 | ApiAccessMetaCache apiAccessMetaCache;
42 | /**
43 | * 用于重复提交
44 | */
45 | private String urlMethod;
46 |
47 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/constants/RedisTtl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.constants;
17 |
18 | /**
19 | * redis 缓存有效数
20 | *
21 | * @author collin
22 | * @date 2020-09-10
23 | */
24 | public interface RedisTtl {
25 |
26 | /**
27 | * 未登录用户security key有效期
28 | */
29 | long SECURITY_KEY_NON_LOGIN = 5 * 60 * 1000L;
30 |
31 | /**
32 | * 登录成功后security key有效期
33 | */
34 | long SECURITY_KEY_LOGIN_SUCCESS = 7 * 24 * 60 * 60 * 1000L;
35 |
36 | /**
37 | * 登录成功后用户信息有效期(单位:毫秒)
38 | */
39 | long USER_LOGIN_SUCCESS = SECURITY_KEY_LOGIN_SUCCESS;
40 |
41 | /**
42 | * 用户缓存刷新阈值
43 | */
44 | long USER_CACHE_REFRESH_THRESHOLD = USER_LOGIN_SUCCESS / 4;
45 |
46 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/src/main/java/org/smartframework/cloud/examples/basic/rpc/auth/request/oms/permisson/PagePermissionReqVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.rpc.auth.request.oms.permisson;
17 |
18 | import io.github.smart.cloud.common.pojo.BasePageRequest;
19 | import lombok.Getter;
20 | import lombok.Setter;
21 | import lombok.ToString;
22 |
23 | /**
24 | * 分页查询权限信息请求参数
25 | *
26 | * @author collin
27 | * @date 2021-07-04
28 | */
29 | @Getter
30 | @Setter
31 | @ToString
32 | public class PagePermissionReqVO extends BasePageRequest {
33 |
34 | private static final long serialVersionUID = 1L;
35 |
36 | /**
37 | * 权限编码
38 | */
39 | private String code;
40 | /**
41 | * 权限描述
42 | */
43 | private String desc;
44 |
45 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/src/main/java/org/smartframework/cloud/examples/basic/rpc/user/request/api/login/ExitReqVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.rpc.user.request.api.login;
17 |
18 | import lombok.Getter;
19 | import lombok.NoArgsConstructor;
20 | import lombok.Setter;
21 | import lombok.ToString;
22 | import lombok.experimental.SuperBuilder;
23 |
24 | import javax.validation.constraints.NotBlank;
25 | import java.io.Serializable;
26 |
27 | /**
28 | * @author collin
29 | * @date 2020-09-11
30 | */
31 | @Setter
32 | @Getter
33 | @ToString
34 | @NoArgsConstructor
35 | @SuperBuilder
36 | public class ExitReqVO implements Serializable {
37 |
38 | private static final long serialVersionUID = 1L;
39 |
40 | /**
41 | * 访问令牌
42 | */
43 | @NotBlank
44 | private String token;
45 |
46 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/mall-service-rpc/src/main/java/org/smartframework/cloud/examples/mall/rpc/order/response/api/OrderDeliveryRespVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.rpc.order.response.api;
17 |
18 | import lombok.Getter;
19 | import lombok.Setter;
20 | import lombok.ToString;
21 |
22 | import java.io.Serializable;
23 |
24 | /**
25 | * 运单信息
26 | *
27 | * @author collin
28 | * @date 2021-02-07
29 | */
30 | @Getter
31 | @Setter
32 | @ToString
33 | public class OrderDeliveryRespVO implements Serializable {
34 |
35 | private static final long serialVersionUID = 1L;
36 |
37 | /**
38 | * 商品名称
39 | */
40 | private String productName;
41 | /**
42 | * 商品购买价格(单位:万分之一元)
43 | */
44 | private Long price;
45 | /**
46 | * 购买数量
47 | */
48 | private Integer buyCount;
49 |
50 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/mall-service-rpc/src/main/java/org/smartframework/cloud/examples/mall/rpc/product/request/rpc/QryProductByIdsReqDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.rpc.product.request.rpc;
17 |
18 | import lombok.*;
19 | import lombok.experimental.SuperBuilder;
20 |
21 | import javax.validation.constraints.NotEmpty;
22 | import java.io.Serializable;
23 | import java.util.List;
24 |
25 | /**
26 | * 根据ids查询商品信息请求参数
27 | *
28 | * @author collin
29 | * @date 2020-09-10
30 | */
31 | @Getter
32 | @Setter
33 | @ToString
34 | @NoArgsConstructor
35 | @AllArgsConstructor
36 | @SuperBuilder
37 | public class QryProductByIdsReqDTO implements Serializable {
38 |
39 | private static final long serialVersionUID = 1L;
40 |
41 | /**
42 | * 商品id
43 | */
44 | @NotEmpty
45 | private List ids;
46 |
47 | }
--------------------------------------------------------------------------------
/application-module/api-ac-core/src/main/java/org/smartframework/cloud/examples/api/ac/core/vo/RepeatSubmitCheckMetaRespVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.api.ac.core.vo;
17 |
18 | import lombok.*;
19 | import lombok.experimental.SuperBuilder;
20 |
21 | import java.io.Serializable;
22 |
23 | /**
24 | * 接口重复提交校验meta
25 | *
26 | * @author collin
27 | * @date 2021-05-01
28 | */
29 | @Getter
30 | @Setter
31 | @ToString
32 | @NoArgsConstructor
33 | @AllArgsConstructor
34 | @SuperBuilder
35 | public class RepeatSubmitCheckMetaRespVO implements Serializable {
36 |
37 | private static final long serialVersionUID = 1L;
38 |
39 | /**
40 | * 是否需要重复提交校验
41 | */
42 | private Boolean check;
43 |
44 | /**
45 | * 缓存有效期
46 | */
47 | private Long expireMillis;
48 |
49 | }
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-order/src/main/java/org/smartframework/cloud/examples/mall/order/mq/OrderMqConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.order.mq;
17 |
18 | import io.github.smart.cloud.starter.rabbitmq.MqConstants;
19 |
20 | /**
21 | * mq常量
22 | *
23 | * @author collin
24 | * @date 2021-02-06
25 | */
26 | public interface OrderMqConstants {
27 |
28 | interface SubmitOrder {
29 | String PREFIX = "submitOrder";
30 | /**
31 | * 提交订单
32 | */
33 | String QUEUE = PREFIX + "queue";
34 | /**
35 | * 提交授信订单
36 | */
37 | String EXCHANGE = PREFIX + MqConstants.EXCHANGE_SUFFIX;
38 | /**
39 | * 提交授信订单
40 | */
41 | String ROUTEKEY = PREFIX + "routekey";
42 | }
43 |
44 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/src/main/java/org/smartframework/cloud/examples/basic/rpc/auth/response/rpc/AuthRespDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.rpc.auth.response.rpc;
17 |
18 | import lombok.*;
19 | import lombok.experimental.SuperBuilder;
20 |
21 | import java.io.Serializable;
22 | import java.util.Set;
23 |
24 | /**
25 | * 根据uid查询用户拥有的权限信息
26 | *
27 | * @author collin
28 | * @date 2021-12-12
29 | */
30 | @Setter
31 | @Getter
32 | @ToString
33 | @NoArgsConstructor
34 | @AllArgsConstructor
35 | @SuperBuilder
36 | public class AuthRespDTO implements Serializable {
37 |
38 | private static final long serialVersionUID = 1L;
39 |
40 | /**
41 | * 用户所拥有的角色
42 | */
43 | private Set roles;
44 | /**
45 | * 用户所拥有的权限
46 | */
47 | private Set permissions;
48 |
49 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/mall-service-rpc/src/main/java/org/smartframework/cloud/examples/mall/rpc/order/request/api/SubmitOrderReqVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.rpc.order.request.api;
17 |
18 | import lombok.Getter;
19 | import lombok.Setter;
20 | import lombok.ToString;
21 |
22 | import javax.validation.Valid;
23 | import javax.validation.constraints.NotEmpty;
24 | import java.io.Serializable;
25 | import java.util.List;
26 |
27 | /**
28 | * 提交订单请求参数
29 | *
30 | * @author collin
31 | * @date 2020-09-10
32 | */
33 | @Getter
34 | @Setter
35 | @ToString
36 | public class SubmitOrderReqVO implements Serializable {
37 |
38 | private static final long serialVersionUID = 1L;
39 |
40 | /**
41 | * 商品信息
42 | */
43 | @NotEmpty
44 | @Valid
45 | private List products;
46 |
47 | }
--------------------------------------------------------------------------------
/docs/puml/api_meta_upload.puml:
--------------------------------------------------------------------------------
1 | @startuml
2 | skinparam sequenceMessageAlign center
3 | skinparam responseMessageBelowArrow true
4 |
5 | participant 应用服务 as app_service
6 | participant gateway as gw
7 | participant 注册中心 as register
8 | database redis as redis
9 |
10 | autonumber 1.1
11 | activate app_service
12 | app_service->register: 注册服务
13 | activate app_service
14 | activate register
15 | app_service<-register:返回结果
16 | deactivate register
17 | deactivate app_service
18 |
19 | app_service->app_service: 监听服务启动事件
20 | app_service->gw:通知网关获取服务meta
21 | activate gw
22 | autonumber 2.1
23 | group 获取接口mata信息
24 | gw->register:根据服务名获取服务的ip、port
25 | activate gw
26 | activate register
27 | gw<-register:返回结果
28 | deactivate register
29 | deactivate gw
30 |
31 | gw->app_service:发送http请求,获取接口meta
32 | activate gw
33 | activate app_service
34 | app_service->app_service:通过反射收集接口meta信息
35 | gw<-app_service:返回结果
36 | deactivate app_service
37 | deactivate gw
38 | end
39 | autonumber 3.1
40 | group 缓存接口mata信息
41 | gw->redis:缓存接口meta信息
42 | activate gw
43 | activate redis
44 | gw<-redis:返回结果
45 | deactivate redis
46 | deactivate gw
47 | end
48 | autonumber 4
49 | app_service<-gw:返回结果
50 | deactivate gw
51 | deactivate app_service
52 | @enduml
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/src/main/java/org/smartframework/cloud/examples/basic/rpc/auth/response/entity/RoleInfoEntityRespVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.rpc.auth.response.entity;
17 |
18 | import io.github.smart.cloud.common.pojo.EntityResponse;
19 | import lombok.Getter;
20 | import lombok.NoArgsConstructor;
21 | import lombok.Setter;
22 | import lombok.ToString;
23 | import lombok.experimental.SuperBuilder;
24 |
25 | /**
26 | * 角色表
27 | *
28 | * @author collin
29 | * @date 2021-12-12
30 | */
31 | @Setter
32 | @Getter
33 | @ToString
34 | @NoArgsConstructor
35 | @SuperBuilder
36 | public class RoleInfoEntityRespVO extends EntityResponse {
37 |
38 | private static final long serialVersionUID = 1L;
39 |
40 | /** 角色编码 */
41 | private String code;
42 |
43 | /** 角色描述 */
44 | private String description;
45 |
46 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/mall-service-rpc/src/main/java/org/smartframework/cloud/examples/mall/rpc/product/request/rpc/QryProductByIdReqDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.rpc.product.request.rpc;
17 |
18 | import lombok.*;
19 | import lombok.experimental.SuperBuilder;
20 |
21 | import javax.validation.constraints.Min;
22 | import javax.validation.constraints.NotNull;
23 | import java.io.Serializable;
24 |
25 | /**
26 | * 根据id查询商品信息请求参数
27 | *
28 | * @author collin
29 | * @date 2020-09-10
30 | */
31 | @Getter
32 | @Setter
33 | @ToString
34 | @NoArgsConstructor
35 | @AllArgsConstructor
36 | @SuperBuilder
37 | public class QryProductByIdReqDTO implements Serializable {
38 |
39 | private static final long serialVersionUID = 1L;
40 |
41 | /**
42 | * 商品id
43 | */
44 | @NotNull
45 | @Min(1)
46 | private Long id;
47 |
48 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/src/main/java/org/smartframework/cloud/examples/basic/rpc/user/request/api/token/RenewReqVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.rpc.user.request.api.token;
17 |
18 | import lombok.Getter;
19 | import lombok.NoArgsConstructor;
20 | import lombok.Setter;
21 | import lombok.ToString;
22 | import lombok.experimental.SuperBuilder;
23 |
24 | import javax.validation.constraints.NotBlank;
25 | import java.io.Serializable;
26 |
27 | /**
28 | * token续期请求参数
29 | *
30 | * @author collin
31 | * @date 2020-09-10
32 | */
33 | @Setter
34 | @Getter
35 | @ToString
36 | @NoArgsConstructor
37 | @SuperBuilder
38 | public class RenewReqVO implements Serializable {
39 |
40 | private static final long serialVersionUID = 1L;
41 |
42 | /**
43 | * 访问令牌
44 | */
45 | @NotBlank
46 | private String token;
47 |
48 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/src/main/java/org/smartframework/cloud/examples/basic/rpc/auth/response/entity/PermissionInfoEntityRespVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.rpc.auth.response.entity;
17 |
18 | import io.github.smart.cloud.common.pojo.EntityResponse;
19 | import lombok.Getter;
20 | import lombok.NoArgsConstructor;
21 | import lombok.Setter;
22 | import lombok.ToString;
23 | import lombok.experimental.SuperBuilder;
24 |
25 | /**
26 | * 权限表
27 | *
28 | * @author collin
29 | * @date 2021-12-12
30 | */
31 | @Setter
32 | @Getter
33 | @ToString
34 | @NoArgsConstructor
35 | @SuperBuilder
36 | public class PermissionInfoEntityRespVO extends EntityResponse {
37 |
38 | private static final long serialVersionUID = 1L;
39 |
40 | /** 权限编码 */
41 | private String code;
42 |
43 | /** 权限描述 */
44 | private String description;
45 |
46 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/support-service-rpc/src/main/java/org/smartframework/cloud/examples/support/rpc/gateway/request/rpc/ExitLoginReqDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.rpc.gateway.request.rpc;
17 |
18 | import lombok.Getter;
19 | import lombok.NoArgsConstructor;
20 | import lombok.Setter;
21 | import lombok.ToString;
22 | import lombok.experimental.SuperBuilder;
23 |
24 | import javax.validation.constraints.NotBlank;
25 | import java.io.Serializable;
26 |
27 | /**
28 | * 退出登录请求参数
29 | *
30 | * @author collin
31 | * @date 2020-09-11
32 | */
33 | @Setter
34 | @Getter
35 | @ToString
36 | @NoArgsConstructor
37 | @SuperBuilder
38 | public class ExitLoginReqDTO implements Serializable {
39 |
40 | private static final long serialVersionUID = 1L;
41 |
42 | /**
43 | * 访问令牌
44 | */
45 | @NotBlank
46 | private String token;
47 |
48 | }
--------------------------------------------------------------------------------
/merge-module/merge-basic/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
23 | 4.0.0
24 |
25 | io.github.smart-cloud
26 | merge-module
27 | 0.0.1-SNAPSHOT
28 |
29 | merge-basic
30 |
31 |
32 |
33 | io.github.smart-cloud
34 | basic-service-user
35 |
36 |
37 |
38 | io.github.smart-cloud
39 | basic-service-auth
40 |
41 |
42 |
--------------------------------------------------------------------------------
/merge-module/merge-mall/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
23 | 4.0.0
24 |
25 | io.github.smart-cloud
26 | merge-module
27 | 0.0.1-SNAPSHOT
28 |
29 | merge-mall
30 |
31 |
32 |
33 | io.github.smart-cloud
34 | mall-service-product
35 |
36 |
37 |
38 | io.github.smart-cloud
39 | mall-service-order
40 |
41 |
42 |
--------------------------------------------------------------------------------
/application-module/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 | 4.0.0
21 |
22 | io.github.smart-cloud
23 | smart-cloud-examples
24 | 0.0.1-SNAPSHOT
25 |
26 | application-module
27 | pom
28 |
29 |
30 | api-ac-core
31 | app-auth-core
32 | app-common-config
33 | basic-module
34 | mall-module
35 | rpc-module
36 | support-module
37 |
38 |
39 |
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
23 | 4.0.0
24 |
25 | io.github.smart-cloud
26 | basic-module
27 | 0.0.1-SNAPSHOT
28 |
29 | basic-service-user
30 |
31 |
32 |
33 | io.github.smart-cloud
34 | smart-cloud-test-core
35 |
36 |
37 | io.github.smart-cloud
38 | smart-code-generate
39 |
40 |
41 |
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/src/main/java/org/smartframework/cloud/examples/basic/rpc/auth/response/entity/UserRoleRelaEntityRespVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.rpc.auth.response.entity;
17 |
18 | import io.github.smart.cloud.common.pojo.EntityResponse;
19 | import lombok.Getter;
20 | import lombok.NoArgsConstructor;
21 | import lombok.Setter;
22 | import lombok.ToString;
23 | import lombok.experimental.SuperBuilder;
24 |
25 | /**
26 | * 用户角色表
27 | *
28 | * @author collin
29 | * @date 2021-12-12
30 | */
31 | @Setter
32 | @Getter
33 | @ToString
34 | @NoArgsConstructor
35 | @SuperBuilder
36 | public class UserRoleRelaEntityRespVO extends EntityResponse {
37 |
38 | private static final long serialVersionUID = 1L;
39 |
40 | /** demo_user库t_user_info表id */
41 | private Long userInfoId;
42 |
43 | /** t_role_info表id */
44 | private Long roleInfoId;
45 |
46 | }
--------------------------------------------------------------------------------
/application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/constants/ResponseFields.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.gateway.constants;
17 |
18 | import io.github.smart.cloud.common.pojo.Response;
19 |
20 | /**
21 | * 返回体字段名
22 | *
23 | * @author collin
24 | * @date 2024-04-23
25 | * @see {@link Response}
26 | */
27 | public class ResponseFields {
28 |
29 | /**
30 | * @see {@link Response#nonce}
31 | */
32 | public static final String NONCE = "nonce";
33 | /**
34 | * @see {@link Response#timestamp}
35 | */
36 | public static final String TIMESTAMP = "timestamp";
37 | /**
38 | * @see {@link Response#body}
39 | */
40 | public static final String BODY = "body";
41 | /**
42 | * @see {@link Response#sign}
43 | */
44 | public static final String SIGN = "sign";
45 |
46 | }
--------------------------------------------------------------------------------
/application-module/app-common-config/src/main/java/org/smartframework/cloud/examples/common/config/constants/DataSourceName.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.common.config.constants;
17 |
18 | /**
19 | * 数据源名称
20 | *
21 | * @author collin
22 | * @date 2020-09-28
23 | */
24 | public interface DataSourceName {
25 |
26 | /**
27 | * 权限主库
28 | */
29 | String BASIC_AUTH_MASTER = "basic-auth-master";
30 | /**
31 | * 权限从库
32 | */
33 | String BASIC_AUTH_SLAVE = "basic-auth-slave";
34 | /**
35 | * 用户主库
36 | */
37 | String BASIC_USER_MASTER = "basic-user-master";
38 | /**
39 | * 用户从库
40 | */
41 | String BASIC_USER_SLAVE = "basic-user-slave";
42 | /**
43 | * 商品主库
44 | */
45 | String MALL_PRODUCT_MASTER = "mall-product-master";
46 | /**
47 | * 商品从库
48 | */
49 | String MALL_PRODUCT_SLAVE = "mall-product-slave";
50 |
51 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/src/main/java/org/smartframework/cloud/examples/basic/rpc/auth/response/entity/RolePermissionRelaEntityRespVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.rpc.auth.response.entity;
17 |
18 | import io.github.smart.cloud.common.pojo.EntityResponse;
19 | import lombok.Getter;
20 | import lombok.NoArgsConstructor;
21 | import lombok.Setter;
22 | import lombok.ToString;
23 | import lombok.experimental.SuperBuilder;
24 |
25 | /**
26 | * 角色权限关系表
27 | *
28 | * @author collin
29 | * @date 2021-12-12
30 | */
31 | @Setter
32 | @Getter
33 | @ToString
34 | @NoArgsConstructor
35 | @SuperBuilder
36 | public class RolePermissionRelaEntityRespVO extends EntityResponse {
37 |
38 | private static final long serialVersionUID = 1L;
39 |
40 | /** t_role_info表id */
41 | private Long roleInfoId;
42 |
43 | /** t_permission_info表id */
44 | private Long permissionInfoId;
45 |
46 | }
--------------------------------------------------------------------------------
/system-test/src/main/java/org/smartframework/cloud/examples/system/test/util/HttpHeaderUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.system.test.util;
17 |
18 | import io.github.smart.cloud.common.web.constants.SmartHttpHeaders;
19 | import org.apache.http.Header;
20 | import org.apache.http.message.BasicHeader;
21 |
22 | import java.util.UUID;
23 |
24 | /**
25 | * http header工具类
26 | *
27 | * @author collin
28 | * @date 2020-10-10
29 | */
30 | public class HttpHeaderUtil {
31 |
32 | public static Header[] build() {
33 | Header[] headers = new Header[3];
34 | headers[0] = new BasicHeader(SmartHttpHeaders.TIMESTAMP, String.valueOf(System.currentTimeMillis()));
35 | headers[1] = new BasicHeader(SmartHttpHeaders.NONCE, UUID.randomUUID().toString());
36 | headers[2] = new BasicHeader(SmartHttpHeaders.TOKEN, TokenUtil.getContext().getToken());
37 | return headers;
38 | }
39 |
40 | }
--------------------------------------------------------------------------------
/application-module/api-ac-core/src/main/java/org/smartframework/cloud/examples/api/ac/core/properties/ApiAccessProperties.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.api.ac.core.properties;
17 |
18 | import io.github.smart.cloud.starter.configure.constants.ConfigureConstant;
19 | import lombok.Getter;
20 | import lombok.Setter;
21 | import lombok.ToString;
22 | import org.springframework.boot.context.properties.ConfigurationProperties;
23 |
24 | import java.io.Serializable;
25 |
26 | /**
27 | * 接口元数据相关配置
28 | *
29 | * @author collin
30 | * @date 2022-02-03
31 | */
32 | @Getter
33 | @Setter
34 | @ToString
35 | @ConfigurationProperties(prefix = ConfigureConstant.SMART_PROPERTIES_PREFIX)
36 | public class ApiAccessProperties implements Serializable {
37 |
38 | private static final long serialVersionUID = 1L;
39 |
40 | /**
41 | * 是否上传api meta信息(默认上传)
42 | */
43 | private boolean uploadApiMeta = true;
44 |
45 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/mall-service-rpc/src/main/java/org/smartframework/cloud/examples/mall/rpc/product/response/entity/ProductInfoEntityRespVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.rpc.product.response.entity;
17 |
18 | import io.github.smart.cloud.common.pojo.EntityResponse;
19 | import lombok.Getter;
20 | import lombok.NoArgsConstructor;
21 | import lombok.Setter;
22 | import lombok.ToString;
23 | import lombok.experimental.SuperBuilder;
24 |
25 | /**
26 | * 商品信息
27 | *
28 | * @author collin
29 | * @date 2021-12-12
30 | */
31 | @Setter
32 | @Getter
33 | @ToString
34 | @NoArgsConstructor
35 | @SuperBuilder
36 | public class ProductInfoEntityRespVO extends EntityResponse {
37 |
38 | private static final long serialVersionUID = 1L;
39 |
40 | /** 商品名称 */
41 | private String name;
42 |
43 | /** 销售价格(单位:万分之一元) */
44 | private Long sellPrice;
45 |
46 | /** 库存 */
47 | private Long stock;
48 |
49 | }
--------------------------------------------------------------------------------
/system-test/src/main/java/org/smartframework/cloud/examples/system/test/config/AbstractSystemTestConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.system.test.config;
17 |
18 | /**
19 | * 系统测试配置抽象类
20 | *
21 | * @author collin
22 | * @date 2020-09-29
23 | */
24 | public abstract class AbstractSystemTestConfig {
25 |
26 | /**
27 | * 获取base url
28 | *
29 | * @param singleBaseUrl 单体服务base url
30 | * @return
31 | */
32 | protected String getBaseUrl(String singleBaseUrl) {
33 | if (isGateway()) {
34 | return getGatewayBaseUrl();
35 | } else {
36 | return singleBaseUrl;
37 | }
38 | }
39 |
40 | /**
41 | * 是否走网关
42 | *
43 | * @return
44 | */
45 | public abstract boolean isGateway();
46 |
47 | /**
48 | * 网关地址前缀
49 | *
50 | * @return
51 | */
52 | public abstract String getGatewayBaseUrl();
53 |
54 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/mall-service-rpc/src/main/java/org/smartframework/cloud/examples/mall/rpc/order/request/api/SubmitOrderProductInfoReqVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.rpc.order.request.api;
17 |
18 | import lombok.Getter;
19 | import lombok.Setter;
20 | import lombok.ToString;
21 |
22 | import javax.validation.constraints.Min;
23 | import javax.validation.constraints.NotNull;
24 | import java.io.Serializable;
25 |
26 | /**
27 | * 提交订单商品请求参数
28 | *
29 | * @author collin
30 | * @date 2020-09-10
31 | */
32 | @Getter
33 | @Setter
34 | @ToString
35 | public class SubmitOrderProductInfoReqVO implements Serializable {
36 |
37 | private static final long serialVersionUID = 1L;
38 | /**
39 | * 商品id
40 | */
41 | @NotNull
42 | @Min(1)
43 | private Long productId;
44 |
45 | /**
46 | * 购买数量
47 | */
48 | @NotNull
49 | @Min(1)
50 | private Integer buyCount;
51 |
52 | }
--------------------------------------------------------------------------------
/application-module/api-ac-core/src/main/java/org/smartframework/cloud/examples/api/ac/core/vo/DataSecurityMetaRespVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.api.ac.core.vo;
17 |
18 | import lombok.*;
19 | import lombok.experimental.SuperBuilder;
20 |
21 | import java.io.Serializable;
22 |
23 | /**
24 | * 接口安全(加解密、签名)meta
25 | *
26 | * @author collin
27 | * @date 2021-05-01
28 | */
29 | @Getter
30 | @Setter
31 | @ToString
32 | @NoArgsConstructor
33 | @AllArgsConstructor
34 | @SuperBuilder
35 | public class DataSecurityMetaRespVO implements Serializable {
36 |
37 | private static final long serialVersionUID = 1L;
38 |
39 | /**
40 | * 请求参数是否需要解密
41 | */
42 | private Boolean requestDecrypt;
43 |
44 | /**
45 | * 响应信息是否需要加密
46 | */
47 | private Boolean responseEncrypt;
48 |
49 | /**
50 | * 接口签名类型
51 | */
52 | private Byte sign;
53 |
54 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/src/main/java/org/smartframework/cloud/examples/basic/auth/pojo/param/PageRolePermissonReqDO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.auth.pojo.param;
17 |
18 | import io.github.smart.cloud.common.pojo.dataobject.BasePageRequestDO;
19 | import lombok.AllArgsConstructor;
20 | import lombok.Getter;
21 | import lombok.NoArgsConstructor;
22 | import lombok.Setter;
23 |
24 | @Getter
25 | @Setter
26 | @NoArgsConstructor
27 | @AllArgsConstructor
28 | public class PageRolePermissonReqDO extends BasePageRequestDO {
29 |
30 | private static final long serialVersionUID = 1L;
31 |
32 | /**
33 | * 角色编码
34 | */
35 | private String roleCode;
36 | /**
37 | * 角色描述
38 | */
39 | private String roleDesc;
40 |
41 | /**
42 | * 权限编码
43 | */
44 | private String permissonCode;
45 | /**
46 | * 权限描述
47 | */
48 | private String permissonDesc;
49 |
50 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
22 | 4.0.0
23 |
24 | io.github.smart-cloud
25 | application-module
26 | 0.0.1-SNAPSHOT
27 |
28 | rpc-module
29 | pom
30 |
31 |
32 |
33 | io.github.smart-cloud
34 | smart-cloud-starter-feign
35 |
36 |
37 |
38 |
39 | basic-service-rpc
40 | mall-service-rpc
41 | support-service-rpc
42 |
43 |
--------------------------------------------------------------------------------
/application-module/app-common-config/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
23 | 4.0.0
24 |
25 | io.github.smart-cloud
26 | application-module
27 | 0.0.1-SNAPSHOT
28 |
29 | app-common-config
30 | jar
31 |
32 |
33 |
34 | org.springframework.cloud
35 | spring-cloud-starter-bootstrap
36 |
37 |
38 |
39 | com.github.ulisesbocchio
40 | jasypt-spring-boot-starter
41 |
42 |
43 |
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-auth/src/main/java/org/smartframework/cloud/examples/basic/auth/mapper/UserRoleRelaMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.auth.mapper;
17 |
18 | import io.github.smart.cloud.starter.mybatis.plus.common.mapper.SmartMapper;
19 | import org.apache.ibatis.annotations.Mapper;
20 | import org.apache.ibatis.annotations.Param;
21 | import org.smartframework.cloud.examples.basic.auth.entity.UserRoleRelaEntity;
22 | import org.smartframework.cloud.examples.basic.rpc.auth.response.oms.user.role.UserRoleRespVO;
23 |
24 | import java.util.List;
25 |
26 | /**
27 | * 用户角色表base mapper
28 | *
29 | * @author collin
30 | * @date 2021-12-12
31 | */
32 | @Mapper
33 | public interface UserRoleRelaMapper extends SmartMapper {
34 |
35 | /**
36 | * 查询用户所拥有的角色权限
37 | *
38 | * @param uid
39 | * @return
40 | */
41 | List listRole(@Param("uid") Long uid);
42 |
43 | }
--------------------------------------------------------------------------------
/application-module/api-ac-core/src/main/java/org/smartframework/cloud/examples/api/ac/core/vo/AuthMetaRespVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.api.ac.core.vo;
17 |
18 | import lombok.*;
19 | import lombok.experimental.SuperBuilder;
20 |
21 | import java.io.Serializable;
22 |
23 | /**
24 | * 接口鉴权meta
25 | *
26 | * @author collin
27 | * @date 2021-05-01
28 | */
29 | @Getter
30 | @Setter
31 | @ToString
32 | @NoArgsConstructor
33 | @AllArgsConstructor
34 | @SuperBuilder
35 | public class AuthMetaRespVO implements Serializable {
36 |
37 | private static final long serialVersionUID = 1L;
38 |
39 | /**
40 | * 是否需要登陆校验(false则不需要校验)
41 | */
42 | private Boolean requireUser;
43 |
44 | /**
45 | * 访问接口需要的角色(为空则不需要校验)
46 | */
47 | private String[] requireRoles;
48 |
49 | /**
50 | * 访问接口需要的权限(为空则不需要校验)
51 | */
52 | private String[] requirePermissions;
53 |
54 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/src/main/java/org/smartframework/cloud/examples/basic/rpc/user/response/api/login/LoginRespVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.rpc.user.response.api.login;
17 |
18 | import lombok.*;
19 | import lombok.experimental.SuperBuilder;
20 |
21 | import java.io.Serializable;
22 |
23 | /**
24 | * 登陆响应信息
25 | *
26 | * @author collin
27 | * @date 2020-09-10
28 | */
29 | @Setter
30 | @Getter
31 | @ToString
32 | @NoArgsConstructor
33 | @AllArgsConstructor
34 | @SuperBuilder
35 | public class LoginRespVO implements Serializable {
36 |
37 | private static final long serialVersionUID = 1L;
38 |
39 | /**
40 | * 用户id
41 | */
42 | private Long userId;
43 |
44 | /**
45 | * 用户名
46 | */
47 | private String username;
48 |
49 | /**
50 | * 真实姓名
51 | */
52 | private String realName;
53 |
54 | /**
55 | * 手机号
56 | */
57 | private String mobile;
58 |
59 | }
--------------------------------------------------------------------------------
/application-module/mall-module/mall-service-product/src/main/java/org/smartframework/cloud/examples/mall/product/mapper/ProductInfoMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.mall.product.mapper;
17 |
18 | import io.github.smart.cloud.starter.mybatis.plus.common.mapper.SmartMapper;
19 | import org.apache.ibatis.annotations.Mapper;
20 | import org.apache.ibatis.annotations.Param;
21 | import org.smartframework.cloud.examples.mall.product.entity.ProductInfoEntity;
22 | import org.smartframework.cloud.examples.mall.rpc.product.request.rpc.UpdateStockReqDTO;
23 |
24 | import java.util.List;
25 |
26 | /**
27 | * 商品信息base mapper
28 | *
29 | * @author collin
30 | * @date 2021-12-12
31 | */
32 | @Mapper
33 | public interface ProductInfoMapper extends SmartMapper {
34 |
35 | /**
36 | * 扣减库存
37 | *
38 | * @param list
39 | * @return
40 | */
41 | int updateStock(@Param("list") List list);
42 |
43 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/src/main/java/org/smartframework/cloud/examples/basic/rpc/auth/response/oms/user/role/PermissionInfoRespVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.rpc.auth.response.oms.user.role;
17 |
18 | import lombok.Getter;
19 | import lombok.NoArgsConstructor;
20 | import lombok.Setter;
21 | import lombok.ToString;
22 | import lombok.experimental.SuperBuilder;
23 |
24 | import java.io.Serializable;
25 |
26 | /**
27 | * 权限信息
28 | *
29 | * @author collin
30 | * @date 2021-07-02
31 | */
32 | @Setter
33 | @Getter
34 | @ToString
35 | @NoArgsConstructor
36 | @SuperBuilder
37 | public class PermissionInfoRespVO implements Serializable {
38 |
39 | private static final long serialVersionUID = 1L;
40 |
41 | /**
42 | * 权限id
43 | */
44 | private Long permissonId;
45 | /**
46 | * 权限编码
47 | */
48 | private String permissonCode;
49 | /**
50 | * 权限描述
51 | */
52 | private String permissonDesc;
53 |
54 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/basic-service-rpc/src/main/java/org/smartframework/cloud/examples/basic/rpc/auth/response/oms/role/permisson/PermissionInfoRespVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.rpc.auth.response.oms.role.permisson;
17 |
18 | import lombok.Getter;
19 | import lombok.NoArgsConstructor;
20 | import lombok.Setter;
21 | import lombok.ToString;
22 | import lombok.experimental.SuperBuilder;
23 |
24 | import java.io.Serializable;
25 |
26 | /**
27 | * 权限信息
28 | *
29 | * @author collin
30 | * @date 2021-07-02
31 | */
32 | @Setter
33 | @Getter
34 | @ToString
35 | @NoArgsConstructor
36 | @SuperBuilder
37 | public class PermissionInfoRespVO implements Serializable {
38 |
39 | private static final long serialVersionUID = 1L;
40 |
41 | /**
42 | * 权限id
43 | */
44 | private Long permissonId;
45 | /**
46 | * 权限编码
47 | */
48 | private String permissonCode;
49 | /**
50 | * 权限描述
51 | */
52 | private String permissonDesc;
53 |
54 | }
--------------------------------------------------------------------------------
/application-module/rpc-module/support-service-rpc/src/main/java/org/smartframework/cloud/examples/support/rpc/gateway/response/api/GenerateClientPubKeyRespVO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.support.rpc.gateway.response.api;
17 |
18 | import lombok.*;
19 | import lombok.experimental.SuperBuilder;
20 |
21 | import java.io.Serializable;
22 |
23 | /**
24 | * 生成客户端公钥响应信息
25 | *
26 | * @author collin
27 | * @date 2020-09-07
28 | */
29 | @Getter
30 | @Setter
31 | @ToString
32 | @NoArgsConstructor
33 | @AllArgsConstructor
34 | @SuperBuilder
35 | public class GenerateClientPubKeyRespVO implements Serializable {
36 |
37 | private static final long serialVersionUID = 1L;
38 |
39 | /**
40 | * 访问令牌(登录校验前5分钟有效;登陆成功后7天有效)
41 | */
42 | private String token;
43 |
44 | /**
45 | * 服务端生成的公钥对应的系数,用于给客户端校验签名
46 | */
47 | private String pubKeyModulus;
48 |
49 | /**
50 | * 服务端生成的公钥对应的专用指数,用于给客户端校验签名
51 | */
52 | private String pubKeyExponent;
53 |
54 | }
--------------------------------------------------------------------------------
/application-module/basic-module/basic-service-user/src/main/java/org/smartframework/cloud/examples/basic/user/constants/UserReturnCodes.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 collin (1634753825@qq.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.smartframework.cloud.examples.basic.user.constants;
17 |
18 | public interface UserReturnCodes {
19 |
20 | /**
21 | * 账号不存在
22 | */
23 | String ACCOUNT_NOT_EXIST = "100001";
24 | /**
25 | * 用户被禁用
26 | */
27 | String USER_UNENABLE = "100002";
28 | /**
29 | * 用户已被删除
30 | */
31 | String USER_DELETED = "100003";
32 | /**
33 | * 用户或密码错误
34 | */
35 | String USERNAME_OR_PASSWORD_ERROR = "100004";
36 | /**
37 | * 该手机号已存在,请换一个重新注册
38 | */
39 | String REGISTER_MOBILE_EXSITED = "100005";
40 | /**
41 | * 该用户名已存在,请换一个重新注册
42 | */
43 | String REGISTER_USERNAME_EXSITED = "100006";
44 | /**
45 | * rsa密钥对生成出错
46 | */
47 | String GENERATE_RSAKEY_FAIL = "100007";
48 | /**
49 | * 盐值生成失败
50 | */
51 | String GENERATE_SALT_FAIL = "100008";
52 |
53 | }
--------------------------------------------------------------------------------