├── .codecov.yml ├── .gitignore ├── .travis.yml ├── Dockerfile ├── LICENSE ├── README.md ├── brcc-api ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── baidu │ │ └── brcc │ │ ├── controller │ │ ├── ApiAuthController.java │ │ ├── ApiConfigItemController.java │ │ ├── ApiEnvironmentController.java │ │ ├── ApiGroupController.java │ │ ├── ApiProjectController.java │ │ └── ApiVersionController.java │ │ └── service │ │ ├── ApiTokenCacheService.java │ │ └── impl │ │ └── ApiTokenCacheServiceImpl.java │ └── test │ └── java │ └── com │ └── baidu │ └── brcc │ ├── controller │ ├── ApiAuthControllerTest.java │ ├── ApiConfigItemControllerTest.java │ ├── ApiEnvironmentControllerTest.java │ └── ApiVersionControllerTest.java │ └── service │ └── impl │ └── ApiTokenCacheServiceImplTest.java ├── brcc-cache ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── baidu │ │ └── brcc │ │ ├── Cache.java │ │ ├── CacheKeyGenerator.java │ │ ├── RccCacheImpl.java │ │ ├── config │ │ └── CacheConfig.java │ │ ├── redis │ │ └── RedisCache.java │ │ └── retry │ │ ├── RetryActionWithOneParam.java │ │ ├── RetryActionWithThrParam.java │ │ ├── RetryActionWithTwoParam.java │ │ └── ThrFunction.java │ └── test │ └── java │ └── com │ └── baidu │ └── brcc │ ├── CacheKeyGeneratorTest.java │ ├── RccCacheImplTest.java │ ├── RccReflectionUtils.java │ ├── config │ └── CacheConfigTest.java │ ├── redis │ └── RedisCacheTest.java │ └── retry │ ├── RetryActionWithOneParamTest.java │ ├── RetryActionWithThrParamTest.java │ └── RetryActionWithTwoParamTest.java ├── brcc-console ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── baidu │ │ │ └── brcc │ │ │ └── controller │ │ │ ├── AdminController.java │ │ │ ├── BrccInstanceController.java │ │ │ ├── ConfigItemController.java │ │ │ ├── EnvironmentController.java │ │ │ ├── GetParentController.java │ │ │ ├── GroupController.java │ │ │ ├── HealthCheckController.java │ │ │ ├── IndexController.java │ │ │ ├── LoginController.java │ │ │ ├── OperatorLogController.java │ │ │ ├── ProductController.java │ │ │ ├── ProjectController.java │ │ │ ├── UserController.java │ │ │ └── VersionController.java │ └── resources │ │ └── static │ │ ├── css │ │ ├── app.1b03f141.css │ │ ├── chunk-0735ac96.a00143a2.css │ │ ├── chunk-18ced7ca.f3b3b26a.css │ │ ├── chunk-312559fb.0753c057.css │ │ ├── chunk-34207bb5.dcbe4da7.css │ │ ├── chunk-4d01c778.fc80c3c7.css │ │ ├── chunk-51cbf3f5.66ea9c76.css │ │ └── chunk-vendors.0fb40e41.css │ │ ├── favicon.png │ │ ├── img │ │ ├── background.5825f033.svg │ │ └── logo.587c3748.png │ │ ├── index.html │ │ └── js │ │ ├── app.6771e85e.js │ │ ├── chunk-0735ac96.6c8d2b65.js │ │ ├── chunk-0eeade4b.e7c91556.js │ │ ├── chunk-18ced7ca.34d2c2f5.js │ │ ├── chunk-2d0e95df.61db30c1.js │ │ ├── chunk-2d207ebb.f7ecdb53.js │ │ ├── chunk-2d20866d.5d2e1c00.js │ │ ├── chunk-2d21f2ed.29def1c4.js │ │ ├── chunk-312559fb.baebb1e3.js │ │ ├── chunk-34207bb5.d04008fd.js │ │ ├── chunk-4d01c778.3d67f4c4.js │ │ ├── chunk-51cbf3f5.d8f21fc3.js │ │ ├── chunk-74aeca77.7dc078fa.js │ │ ├── chunk-78fbc9b1.d1832f0c.js │ │ ├── chunk-872ae574.ab0d94b0.js │ │ ├── chunk-vendors.f688b530.js │ │ ├── lang-en-US-breadcubmbs.68c60d93.js │ │ ├── lang-en-US-config.10c7a8a6.js │ │ ├── lang-en-US-env.881b7a3a.js │ │ ├── lang-en-US-group.029c1564.js │ │ ├── lang-en-US-index.7844aa67.js │ │ ├── lang-en-US-instance.1459ee2e.js │ │ ├── lang-en-US-log.5fa7668c.js │ │ ├── lang-en-US-permission.763f5dd0.js │ │ ├── lang-en-US-productline.eba836d8.js │ │ ├── lang-en-US-project.d45c421d.js │ │ ├── lang-en-US-user.ceacc797.js │ │ ├── lang-en-US-version.9e91b945.js │ │ └── lang-en-US.e89c325f.js │ └── test │ └── java │ └── com │ └── baidu │ └── brcc │ └── controller │ ├── AdminControllerTest.java │ ├── ConfigItemControllerTest.java │ ├── EnvironmentControllerTest.java │ ├── GroupControllerTest.java │ ├── HealthCheckControllerTest.java │ ├── IndexControllerTest.java │ ├── LoginControllerTest.java │ ├── OperatorLogControllerTest.java │ ├── ProductControllerTest.java │ ├── ProjectControllerTest.java │ ├── UserControllerTest.java │ └── VersionControllerTest.java ├── brcc-core ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── baidu │ │ │ └── brcc │ │ │ ├── annotation │ │ │ ├── LoginUser.java │ │ │ ├── MaskLog.java │ │ │ └── SaveLog.java │ │ │ ├── aop │ │ │ └── WebLogAspect.java │ │ │ ├── common │ │ │ ├── Constants.java │ │ │ ├── ErrorStatusMsg.java │ │ │ ├── InstanceEventType.java │ │ │ └── ThreadPoolUtils.java │ │ │ ├── config │ │ │ ├── CrossDomainFilter.java │ │ │ ├── GlobalControllerAdvice.java │ │ │ ├── LoginUserHandlerMethodArgumentResolver.java │ │ │ ├── SwaggerConfig.java │ │ │ ├── UriCostFilter.java │ │ │ ├── UserAuthFilter.java │ │ │ └── WebMvcConfig.java │ │ │ ├── dao │ │ │ ├── ApiCountMapper.java │ │ │ ├── ApiTokenMapper.java │ │ │ ├── BrccInstanceMapper.java │ │ │ ├── ConfigChangeLogMapper.java │ │ │ ├── ConfigGroupMapper.java │ │ │ ├── ConfigItemMapper.java │ │ │ ├── EnvironmentMapper.java │ │ │ ├── EnvironmentUserMapper.java │ │ │ ├── GrayInfoMapper.java │ │ │ ├── GrayRuleMapper.java │ │ │ ├── ItemTypeMapper.java │ │ │ ├── OperationLogMapper.java │ │ │ ├── ProductMapper.java │ │ │ ├── ProductUserMapper.java │ │ │ ├── ProjectMapper.java │ │ │ ├── ProjectUserMapper.java │ │ │ ├── UserMapper.java │ │ │ ├── VersionMapper.java │ │ │ ├── base │ │ │ │ ├── BaseMapper.java │ │ │ │ ├── BaseSQL.java │ │ │ │ ├── CommonMapper.java │ │ │ │ ├── CommonProvider.java │ │ │ │ └── SQLParam.java │ │ │ └── provider │ │ │ │ ├── ApiCountProvider.java │ │ │ │ ├── ApiTokenProvider.java │ │ │ │ ├── BrccInstanceProvider.java │ │ │ │ ├── ConfigChangeLogWithBLOBsProvider.java │ │ │ │ ├── ConfigGroupProvider.java │ │ │ │ ├── ConfigItemProvider.java │ │ │ │ ├── EnvironmentProvider.java │ │ │ │ ├── EnvironmentUserProvider.java │ │ │ │ ├── ItemTypeProvider.java │ │ │ │ ├── OperationLogProvider.java │ │ │ │ ├── ProductProvider.java │ │ │ │ ├── ProductUserProvider.java │ │ │ │ ├── ProjectProvider.java │ │ │ │ ├── ProjectUserProvider.java │ │ │ │ ├── UserProvider.java │ │ │ │ └── VersionProvider.java │ │ │ ├── domain │ │ │ ├── ApiCount.java │ │ │ ├── ApiCountExample.java │ │ │ ├── ApiToken.java │ │ │ ├── ApiTokenExample.java │ │ │ ├── BrccInstance.java │ │ │ ├── BrccInstanceExample.java │ │ │ ├── ConfigChangeLog.java │ │ │ ├── ConfigChangeLogExample.java │ │ │ ├── ConfigChangeLogWithBLOBs.java │ │ │ ├── ConfigGroup.java │ │ │ ├── ConfigGroupExample.java │ │ │ ├── ConfigItem.java │ │ │ ├── ConfigItemExample.java │ │ │ ├── Environment.java │ │ │ ├── EnvironmentExample.java │ │ │ ├── EnvironmentUser.java │ │ │ ├── EnvironmentUserExample.java │ │ │ ├── GrayInfo.java │ │ │ ├── GrayInfoExample.java │ │ │ ├── GrayRule.java │ │ │ ├── GrayRuleExample.java │ │ │ ├── ItemType.java │ │ │ ├── ItemTypeExample.java │ │ │ ├── OperationLog.java │ │ │ ├── OperationLogExample.java │ │ │ ├── Product.java │ │ │ ├── ProductExample.java │ │ │ ├── ProductUser.java │ │ │ ├── ProductUserExample.java │ │ │ ├── Project.java │ │ │ ├── ProjectExample.java │ │ │ ├── ProjectUser.java │ │ │ ├── ProjectUserExample.java │ │ │ ├── Role.java │ │ │ ├── TreeNode.java │ │ │ ├── User.java │ │ │ ├── UserExample.java │ │ │ ├── Version.java │ │ │ ├── VersionExample.java │ │ │ ├── base │ │ │ │ ├── BaseExample.java │ │ │ │ ├── BaseExampleBuilder.java │ │ │ │ ├── BaseQuery.java │ │ │ │ ├── Pagination.java │ │ │ │ └── R.java │ │ │ ├── em │ │ │ │ ├── ApiTokenExpireNever.java │ │ │ │ ├── Deleted.java │ │ │ │ ├── EnvironmentUserPriType.java │ │ │ │ ├── ErrorCode.java │ │ │ │ ├── FileFormat.java │ │ │ │ ├── FileImportType.java │ │ │ │ ├── Flag.java │ │ │ │ ├── GrayFlag.java │ │ │ │ ├── LoadType.java │ │ │ │ ├── ProductUserAdmin.java │ │ │ │ ├── ProjectType.java │ │ │ │ ├── ProjectUserAdmin.java │ │ │ │ ├── SortType.java │ │ │ │ ├── UserRole.java │ │ │ │ └── UserType.java │ │ │ ├── exception │ │ │ │ ├── BizException.java │ │ │ │ └── BrccException.java │ │ │ ├── meta │ │ │ │ ├── MetaApiToken.java │ │ │ │ ├── MetaBrccInstance.java │ │ │ │ ├── MetaConfigChangeLog.java │ │ │ │ ├── MetaConfigGroup.java │ │ │ │ ├── MetaConfigItem.java │ │ │ │ ├── MetaEnvironment.java │ │ │ │ ├── MetaEnvironmentUser.java │ │ │ │ ├── MetaGrayRule.java │ │ │ │ ├── MetaItemType.java │ │ │ │ ├── MetaOperationLog.java │ │ │ │ ├── MetaProduct.java │ │ │ │ ├── MetaProductUser.java │ │ │ │ ├── MetaProject.java │ │ │ │ ├── MetaProjectUser.java │ │ │ │ ├── MetaUser.java │ │ │ │ └── MetaVersion.java │ │ │ └── vo │ │ │ │ ├── APiItemAddReqVo.java │ │ │ │ ├── ApiAuthReqVo.java │ │ │ │ ├── ApiAuthVo.java │ │ │ │ ├── ApiBatchItemReqVo.java │ │ │ │ ├── ApiEnvironmentVo.java │ │ │ │ ├── ApiGroupVo.java │ │ │ │ ├── ApiItemDeleteVo.java │ │ │ │ ├── ApiItemEditVo.java │ │ │ │ ├── ApiItemVo.java │ │ │ │ ├── ApiProjectReqVo.java │ │ │ │ ├── ApiUserVo.java │ │ │ │ ├── ApiVersionVo.java │ │ │ │ ├── BatchConfigItemReq.java │ │ │ │ ├── BatchEditItemVo.java │ │ │ │ ├── ConfigGroupReq.java │ │ │ │ ├── ConfigGroupVo.java │ │ │ │ ├── ConfigItemForGroupVo.java │ │ │ │ ├── ConfigItemReq.java │ │ │ │ ├── ConfigItemVo.java │ │ │ │ ├── CountVo.java │ │ │ │ ├── DetailInfoVo.java │ │ │ │ ├── EnvironmentReq.java │ │ │ │ ├── FindTreeInfoReq.java │ │ │ │ ├── FindTreeInfoVo.java │ │ │ │ ├── GrayAddReq.java │ │ │ │ ├── GrayRuleReq.java │ │ │ │ ├── GrayRuleVo.java │ │ │ │ ├── GrayVersionReq.java │ │ │ │ ├── GrayVersionRuleVo.java │ │ │ │ ├── ItemReq.java │ │ │ │ ├── NoticeVo.java │ │ │ │ ├── ProductReq.java │ │ │ │ ├── ProductVo.java │ │ │ │ ├── ProjectListVo.java │ │ │ │ ├── ProjectReq.java │ │ │ │ ├── ProjectUserEnv.java │ │ │ │ ├── ProjectUserEnvItem.java │ │ │ │ ├── ResetApiPasswordVo.java │ │ │ │ ├── RestPasswordVo.java │ │ │ │ ├── UserLoginVo.java │ │ │ │ ├── UserVo.java │ │ │ │ ├── VersionNodeVo.java │ │ │ │ ├── VersionReq.java │ │ │ │ └── VersionVo.java │ │ │ ├── dto │ │ │ ├── BrccInstanceDto.java │ │ │ ├── CopyVersionDto.java │ │ │ ├── EnvPriDto.java │ │ │ ├── InstanceInfoEventDto.java │ │ │ ├── ProjectUserDto.java │ │ │ ├── RefProjectDto.java │ │ │ └── UserDto.java │ │ │ ├── interceptor │ │ │ └── ApiCountInterceptor.java │ │ │ ├── rule │ │ │ ├── ContainerIdHitRule.java │ │ │ ├── CountGrayHitRule.java │ │ │ ├── GrayExcutor.java │ │ │ ├── GrayHitRule.java │ │ │ ├── GrayHitRuleStrategy.java │ │ │ ├── IdcGrayHitRule.java │ │ │ └── IpGrayHitRule.java │ │ │ ├── service │ │ │ ├── ApiCountService.java │ │ │ ├── ApiTokenService.java │ │ │ ├── BrccInstanceService.java │ │ │ ├── ConfigChangeLogService.java │ │ │ ├── ConfigGroupService.java │ │ │ ├── ConfigItemService.java │ │ │ ├── EnvironmentService.java │ │ │ ├── EnvironmentUserService.java │ │ │ ├── GrayInfoService.java │ │ │ ├── GrayRuleService.java │ │ │ ├── ItemTypeService.java │ │ │ ├── OperationLogService.java │ │ │ ├── ProductService.java │ │ │ ├── ProductUserService.java │ │ │ ├── ProjectService.java │ │ │ ├── ProjectUserService.java │ │ │ ├── RccCache.java │ │ │ ├── UserCache.java │ │ │ ├── UserService.java │ │ │ ├── VersionService.java │ │ │ ├── base │ │ │ │ ├── GenericService.java │ │ │ │ └── GenericServiceImpl.java │ │ │ ├── impl │ │ │ │ ├── ApiCountServiceImpl.java │ │ │ │ ├── ApiTokenServiceImpl.java │ │ │ │ ├── BrccInstanceServiceImpl.java │ │ │ │ ├── ConfigChangeLogServiceImpl.java │ │ │ │ ├── ConfigGroupServiceImpl.java │ │ │ │ ├── ConfigItemServiceImpl.java │ │ │ │ ├── EnvironmentServiceImpl.java │ │ │ │ ├── EnvironmentUserServiceImpl.java │ │ │ │ ├── GrayInfoServiceImpl.java │ │ │ │ ├── GrayRuleServiceImpl.java │ │ │ │ ├── ItemTypeServiceImpl.java │ │ │ │ ├── OperationLogServiceImpl.java │ │ │ │ ├── ProductServiceImpl.java │ │ │ │ ├── ProductUserServiceImpl.java │ │ │ │ ├── ProjectServiceImpl.java │ │ │ │ ├── ProjectUserServiceImpl.java │ │ │ │ ├── UserCacheImpl.java │ │ │ │ ├── UserServiceImpl.java │ │ │ │ └── VersionServiceImpl.java │ │ │ └── interceptor │ │ │ │ └── MybatisLogPlugin.java │ │ │ └── utils │ │ │ ├── DataTransUtils.java │ │ │ ├── FileFormat │ │ │ └── FileFormatUtils.java │ │ │ ├── LogFilter.java │ │ │ ├── LogUtils.java │ │ │ ├── Name │ │ │ └── NameUtils.java │ │ │ ├── NameTreadFactory.java │ │ │ ├── RestTemplateUtils.java │ │ │ ├── SqlUtils.java │ │ │ ├── UserThreadLocal.java │ │ │ ├── bcrypt │ │ │ └── Md5Util.java │ │ │ ├── collections │ │ │ └── CollectionUtils.java │ │ │ ├── convert │ │ │ ├── ConvertFileUtil.java │ │ │ └── PropertiesUtil.java │ │ │ ├── gson │ │ │ ├── GsonDateDefaultAdapter.java │ │ │ ├── GsonFactory.java │ │ │ ├── GsonNumberDefaultAdapter.java │ │ │ └── GsonUtils.java │ │ │ └── time │ │ │ └── DateTimeUtils.java │ └── resources │ │ └── mybatis │ │ └── rcc │ │ ├── ApiCountMapper.xml │ │ ├── ApiTokenMapper.xml │ │ ├── BrccInstanceMapper.xml │ │ ├── ConfigChangeLogMapper.xml │ │ ├── ConfigGroupMapper.xml │ │ ├── ConfigItemMapper.xml │ │ ├── EnvironmentMapper.xml │ │ ├── EnvironmentUserMapper.xml │ │ ├── GrayInfoMapper.xml │ │ ├── GrayRuleMapper.xml │ │ ├── ItemTypeMapper.xml │ │ ├── OperationLogMapper.xml │ │ ├── ProductMapper.xml │ │ ├── ProductUserMapper.xml │ │ ├── ProjectMapper.xml │ │ ├── ProjectUserMapper.xml │ │ ├── UserMapper.xml │ │ ├── VersionMapper.xml │ │ └── ext │ │ ├── ExtApiTokenMapper.xml │ │ ├── ExtBrccInstanceMapper.xml │ │ ├── ExtConfigChangeLogMapper.xml │ │ ├── ExtConfigGroupMapper.xml │ │ ├── ExtConfigItemMapper.xml │ │ ├── ExtEnvironmentMapper.xml │ │ ├── ExtEnvironmentUserMapper.xml │ │ ├── ExtGrayInfoMapper.xml │ │ ├── ExtGrayRuleMapper.xml │ │ ├── ExtItemTypeMapper.xml │ │ ├── ExtOperationLogMapper.xml │ │ ├── ExtProductMapper.xml │ │ ├── ExtProductUserMapper.xml │ │ ├── ExtProjectMapper.xml │ │ ├── ExtProjectUserMapper.xml │ │ ├── ExtUserMapper.xml │ │ └── ExtVersionMapper.xml │ └── test │ └── java │ └── com │ └── baidu │ └── brcc │ ├── aop │ └── WebLogAspectTest.java │ ├── common │ ├── ConstantsTest.java │ └── ErrorStatusMsgTest.java │ ├── config │ ├── CrossDomainFilterTest.java │ ├── GlobalControllerAdviceTest.java │ ├── LoginUserHandlerMethodArgumentResolverTest.java │ ├── UriCostFilterTest.java │ ├── UserAuthFilterTest.java │ └── WebMvcConfigTest.java │ ├── domain │ ├── ApiTokenExampleCriterionGroupTest.java │ ├── ApiTokenExampleGeneratedCriteriaTest.java │ ├── ApiTokenExampleTest.java │ ├── ConfigChangeLogExampleCriteriaTest.java │ ├── ConfigChangeLogExampleCriterionGroupTest.java │ ├── ConfigChangeLogExampleTest.java │ ├── ConfigChangeLogWithBLOBsTest.java │ ├── ConfigGroupExampleCriteriaTest.java │ ├── ConfigGroupExampleCriterionGroupTest.java │ ├── ConfigGroupExampleTest.java │ ├── ConfigItemExampleCriteriaTest.java │ ├── ConfigItemExampleCriterionGroupTest.java │ ├── ConfigItemExampleTest.java │ ├── EnvironmentExampleCriteriaTest.java │ ├── EnvironmentExampleCriterionGroupTest.java │ ├── EnvironmentExampleTest.java │ ├── EnvironmentUserExampleCriteriaTest.java │ ├── EnvironmentUserExampleCriterionGroupTest.java │ ├── EnvironmentUserExampleTest.java │ ├── ItemTypeExampleCriteriaTest.java │ ├── ItemTypeExampleCriterionGroupTest.java │ ├── ItemTypeExampleTest.java │ ├── OperationLogExampleCriteriaTest.java │ ├── OperationLogExampleCriterionGroupTest.java │ ├── OperationLogExampleTest.java │ ├── ProductExampleCriteriaTest.java │ ├── ProductExampleCriterionGroupTest.java │ ├── ProductExampleTest.java │ ├── ProductUserExampleCriteriaTest.java │ ├── ProductUserExampleCriterionGroupTest.java │ ├── ProductUserExampleTest.java │ ├── ProjectExampleCriteriaTest.java │ ├── ProjectExampleCriterionGroupTest.java │ ├── ProjectExampleTest.java │ ├── ProjectUserExampleCriteriaTest.java │ ├── ProjectUserExampleCriterionGroupTest.java │ ├── ProjectUserExampleTest.java │ ├── UserExampleCriteriaTest.java │ ├── UserExampleCriterionGroupTest.java │ ├── UserExampleTest.java │ ├── VersionExampleCriteriaTest.java │ ├── VersionExampleCriterionGroupTest.java │ ├── VersionExampleTest.java │ └── vo │ │ ├── ResetApiPasswordVoTest.java │ │ └── UserVoTest.java │ ├── dto │ └── UserDtoTest.java │ ├── service │ └── impl │ │ ├── ApiTokenServiceImplTest.java │ │ ├── ConfigChangeLogServiceImplTest.java │ │ ├── ConfigGroupServiceImplTest.java │ │ └── UserServiceImplTest.java │ └── utils │ └── RccReflectionUtils.java ├── brcc-example ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── baidu │ │ │ └── brcc │ │ │ └── example │ │ │ ├── Application.java │ │ │ └── config │ │ │ ├── ExampleConfiguration.java │ │ │ └── ItemCallback.java │ └── resources │ │ ├── application.yml │ │ ├── log4j2.component.properties │ │ └── log4j2.xml │ └── test │ └── java │ └── com │ └── baidu │ └── brcc │ └── example │ └── config │ └── ExampleConfigurationTest.java ├── brcc-go-sdk ├── base_test.go ├── binding.go ├── binding_test.go ├── cache.go ├── cache_test.go ├── change.go ├── client.go ├── client_test.go ├── conf.go ├── conf_test.go ├── example_client_test.go ├── example_rcc_test.go ├── go.mod ├── go.sum ├── logutil │ └── log.go ├── mock.goconvey ├── poller.go ├── rcc.go ├── requester.go ├── testdata │ └── rcc.toml └── url.go ├── brcc-sdk-starter ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── baidu │ │ │ └── brcc │ │ │ ├── RccAutoConfig.java │ │ │ └── RccProperties.java │ └── resources │ │ └── META-INF │ │ └── spring.factories │ └── test │ └── java │ └── com │ └── baidu │ └── brcc │ ├── RccAutoConfigTest.java │ └── RccPropertiesTest.java ├── brcc-sdk ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── baidu │ │ └── brcc │ │ ├── ConfigChangedListener.java │ │ ├── ConfigItemChangedCallable.java │ │ ├── ConfigLoader.java │ │ ├── DefaultConfigItemChangedCallable.java │ │ ├── annotation │ │ └── ConfigChangeNotifer.java │ │ ├── exception │ │ └── RccException.java │ │ ├── model │ │ ├── AuthVo.java │ │ ├── ChangedConfigItem.java │ │ ├── EnvVo.java │ │ ├── ItemVo.java │ │ ├── R.java │ │ ├── RList.java │ │ └── VersionVo.java │ │ ├── spring │ │ └── ConfigCenterPropertyPlaceholderConfigurer.java │ │ └── utils │ │ ├── HttpClient.java │ │ ├── HutoolHttpClient.java │ │ ├── NetUtils.java │ │ ├── ServiceNameProvider.java │ │ ├── StringUtils.java │ │ └── gson │ │ ├── GsonDateDefaultAdapter.java │ │ ├── GsonFactory.java │ │ ├── GsonNumberDefaultAdapter.java │ │ └── GsonUtils.java │ └── test │ └── java │ └── com │ └── baidu │ └── brcc │ ├── ConfigChangedListenerTest.java │ ├── ConfigLoaderTest.java │ ├── DefaultConfigItemChangedCallableTest.java │ ├── exception │ └── RccExceptionTest.java │ ├── model │ ├── AuthVoTest.java │ ├── ChangedConfigItemTest.java │ ├── EnvVoTest.java │ ├── ItemVoTest.java │ ├── RListTest.java │ └── VersionVoTest.java │ └── spring │ └── ConfigCenterPropertyPlaceholderConfigurerTest.java ├── brcc-server ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── baidu │ │ └── brcc │ │ └── RccApplication.java │ └── resources │ ├── application-dev.yml │ ├── application-online.yml │ ├── application-test.yml │ ├── application.yml │ ├── log4j2.component.properties │ └── log4j2.xml ├── compile.sh ├── doc ├── README_en.md ├── database │ ├── data.sql │ ├── schema.sql │ └── tables.sql ├── deploy-guide.md ├── docker-deploy-guide.md ├── docker-guide.md ├── en-deploy-guide.md ├── en-go-sdk-guide.md ├── en-java-sdk-guide.md ├── en-manage-guide.md ├── en-open-api.md ├── en-quick-start.md ├── go-sdk-guide.md ├── img │ ├── account-create.png │ ├── account-create_en.png │ ├── account-entry.png │ ├── account-entry_en.png │ ├── account-list.png │ ├── account-list_en.png │ ├── arch.JPG │ ├── brcc-install-manage-enter.png │ ├── brcc-install-manage-enter_en.png │ ├── brcc-instance.png │ ├── brcc-instance_en.png │ ├── config-batch.png │ ├── config-batch_en.png │ ├── config-search.png │ ├── config-search_en.png │ ├── config-single.png │ ├── config-single_en.png │ ├── contact.jpg │ ├── environment.png │ ├── environment_en.png │ ├── gray-rule.png │ ├── gray-rule_en.png │ ├── gray-version.png │ ├── gray-version_en.png │ ├── group-list.png │ ├── group-list_en.png │ ├── import-export.png │ ├── import-export_en.png │ ├── login.png │ ├── login_en.png │ ├── product-member.png │ ├── product-member_en.png │ ├── product_create.png │ ├── product_create_en.png │ ├── product_entry.png │ ├── product_entry_en.png │ ├── product_update.png │ ├── product_update_en.png │ ├── project-manage.png │ ├── project-manage_en.png │ ├── project-member-edit.png │ ├── project-member-edit_en.png │ ├── project-member-entry.png │ ├── project-member-entry_en.png │ ├── quick-navigation.png │ ├── quick-navigation_en.png │ ├── reset-apipassword.png │ ├── rest-pwd-1.png │ ├── rest-pwd-1_en.png │ ├── rest-pwd-2.png │ ├── rest-pwd-2_en.png │ ├── version-change-log.png │ ├── version-change-log_en.png │ ├── version-copy.png │ ├── version-copy_en.png │ ├── version-list.png │ ├── version-list_en.png │ ├── version-push.png │ └── version-push_en.png ├── java-sdk-guide.md ├── k8s-guide.md ├── manage-guide.md ├── open-api.md └── quick-start.md ├── docker ├── Dockerfile ├── build.sh └── start.sh ├── k8s ├── brcc-config.yaml ├── brcc-namespace.yaml ├── brcc-server.yaml ├── brcc-service.yaml ├── start.sh └── stop.sh ├── pom.xml └── start.sh /.codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | patch: 4 | default: 5 | threshold: 0% 6 | ignore: 7 | - "brcc-core/src/main/java/com/baidu/brcc/dao/**/*" 8 | - "brcc-core/src/main/java/com/baidu/brcc/domain/**/*" 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | logs 7 | start.sh 8 | local-start.sh 9 | 10 | # BlueJ files 11 | *.ctxt 12 | 13 | # Mobile Tools for Java (J2ME) 14 | .mtj.tmp/ 15 | 16 | # Package Files # 17 | *.jar 18 | *.war 19 | *.nar 20 | *.ear 21 | *.zip 22 | *.tar.gz 23 | *.rar 24 | 25 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 26 | hs_err_pid* 27 | 28 | # eclipse ignore 29 | .settings/ 30 | .project 31 | .classpath 32 | 33 | 34 | # idea ignore 35 | .idea 36 | *.ipr 37 | *.iml 38 | *.iws 39 | 40 | # temp ignore 41 | *.cache 42 | *.diff 43 | *.patch 44 | *.tmp 45 | 46 | # system ignore 47 | .DS_Store 48 | Thumbs.db 49 | 50 | .mvn 51 | mvnw 52 | mvnw.cmd 53 | 54 | target/ 55 | output/ 56 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | matrix: 2 | include: 3 | - language: java 4 | jdk: 5 | - openjdk8 6 | cache: 7 | directories: 8 | - $HOME/.m2 9 | sudo: false 10 | install: "mvn clean cobertura:cobertura -Dmaven.javadoc.skip=true test" 11 | 12 | after_success: 13 | - bash <(curl -s https://codecov.io/bash) 14 | 15 | after_failure: 16 | - echo "build failed!" 17 | 18 | - language: go 19 | go: 20 | - 1.14.x 21 | before_script: 22 | - cd brcc-go-sdk 23 | script: 24 | - go test -gcflags="all=-N -l" -v ./... 25 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jre-alpine 2 | 3 | ENV MY_HOME=/app 4 | 5 | ARG JAVA_OPTS="" 6 | 7 | ENV OPTS=$JAVA_OPTS 8 | 9 | WORKDIR $MY_HOME 10 | 11 | EXPOSE 8088 12 | 13 | RUN apk add --update ttf-dejavu fontconfig 14 | 15 | ADD brcc-server/target/*.jar $MY_HOME/app.jar 16 | 17 | ENTRYPOINT ["sh","-c","java $OPTS -Djava.security.egd=file:/dev/urandom -jar app.jar"] 18 | -------------------------------------------------------------------------------- /brcc-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | brcc 10 | com.baidu.mapp 11 | 1.5.9-SNAPSHOT 12 | 13 | 4.0.0 14 | 15 | brcc-api 16 | 17 | 18 | org.springframework.boot 19 | spring-boot-starter-test 20 | 21 | 22 | junit 23 | junit 24 | 25 | 26 | com.baidu.mapp 27 | brcc-core 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /brcc-api/src/main/java/com/baidu/brcc/service/ApiTokenCacheService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.service; 20 | 21 | import com.baidu.brcc.domain.ApiToken; 22 | 23 | public interface ApiTokenCacheService { 24 | 25 | /** 26 | * 根据token获取ApiToken,并加载到缓存 27 | * @param token 28 | * @return 29 | */ 30 | ApiToken getApiToken(String token); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /brcc-cache/src/main/java/com/baidu/brcc/retry/ThrFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.retry; 20 | 21 | /** 22 | * 三参数功能接口定义 23 | * @param 24 | * @param 25 | * @param 26 | * @param 27 | */ 28 | @FunctionalInterface 29 | public interface ThrFunction { 30 | R apply(P1 p1, P2 p2, P3 p3); 31 | } 32 | -------------------------------------------------------------------------------- /brcc-console/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | brcc 10 | com.baidu.mapp 11 | 1.5.9-SNAPSHOT 12 | 13 | 4.0.0 14 | 15 | brcc-console 16 | 17 | 18 | 19 | org.springframework.boot 20 | spring-boot-starter-test 21 | 22 | 23 | junit 24 | junit 25 | 26 | 27 | com.baidu.mapp 28 | brcc-core 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /brcc-console/src/main/java/com/baidu/brcc/controller/HealthCheckController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.controller; 20 | 21 | import org.springframework.web.bind.annotation.GetMapping; 22 | import org.springframework.web.bind.annotation.RestController; 23 | 24 | import com.baidu.brcc.domain.base.R; 25 | 26 | /** 27 | * 服务存活检测探测 28 | */ 29 | @RestController 30 | public class HealthCheckController { 31 | @GetMapping("check") 32 | public R check() { 33 | return R.ok(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /brcc-console/src/main/resources/static/css/chunk-0735ac96.a00143a2.css: -------------------------------------------------------------------------------- 1 | .title[data-v-082ea41e]{display:inline-block}.title .font-menu[data-v-082ea41e]{font-size:16px;width:5px;height:30px;padding-left:8px;border-left:5px solid #378cff}.content .header-content[data-v-082ea41e]{font-size:14px;font-weight:700;line-height:40px} -------------------------------------------------------------------------------- /brcc-console/src/main/resources/static/css/chunk-18ced7ca.f3b3b26a.css: -------------------------------------------------------------------------------- 1 | .menu[data-v-593f7171]{height:39px;margin:0 20px;border-bottom:1px solid #ddd;line-height:50px;text-align:left}.content .header-content[data-v-593f7171]{font-size:14px;font-weight:700;line-height:40px}.content .header-content .add-btn[data-v-593f7171]{float:right} -------------------------------------------------------------------------------- /brcc-console/src/main/resources/static/css/chunk-312559fb.0753c057.css: -------------------------------------------------------------------------------- 1 | .login[data-v-ec533e6e]{min-height:100%;background:#f0f2f5 url(../img/background.5825f033.svg) no-repeat 50%;background-size:100%}.login .lang-header[data-v-ec533e6e]{text-align:right}.login .lang-header .ant-global[data-v-ec533e6e]{margin-right:24px;padding:12px}.login .lang-header .ant-global svg[data-v-ec533e6e]{font-size:16px}.login .contain[data-v-ec533e6e]{min-height:100%;padding:110px 0 144px;position:relative;box-sizing:border-box}.login .contain .top[data-v-ec533e6e]{text-align:center}.login .contain .top .header[data-v-ec533e6e]{height:44px;font-size:33px;line-height:44px}.login .contain .top .desc[data-v-ec533e6e]{font-size:14px;color:rgba(0,0,0,.45);margin-top:12px;margin:12px auto 40px;width:70%}.login .contain .main[data-v-ec533e6e]{min-width:260px;width:368px;margin:0 auto}.login .login-button[data-v-ec533e6e]{padding:0 15px;font-size:16px;height:40px;width:100%} -------------------------------------------------------------------------------- /brcc-console/src/main/resources/static/css/chunk-4d01c778.fc80c3c7.css: -------------------------------------------------------------------------------- 1 | .title[data-v-bccb6e60]{display:inline-block;height:30px;font-size:16px;line-height:30px}.title a[data-v-bccb6e60]{color:#000}.font-menu[data-v-bccb6e60]{width:5px;height:30px;padding-left:8px;border-left:5px solid #378cff}.btn[data-v-bccb6e60]{padding-left:100px}.btn button[data-v-bccb6e60]{margin-right:20px}.fr[data-v-bccb6e60]{float:right}.fl[data-v-bccb6e60]{float:left}.list[data-v-bccb6e60]{padding:10px}.list .list-title[data-v-bccb6e60]{font-weight:700}.list .list-title span[data-v-bccb6e60]{color:#000}.mb-10[data-v-bccb6e60]{margin-bottom:10px} -------------------------------------------------------------------------------- /brcc-console/src/main/resources/static/css/chunk-51cbf3f5.66ea9c76.css: -------------------------------------------------------------------------------- 1 | textarea[data-v-1ff54383]{min-width:100%;min-height:400px;background-color:#d5f1e4}.save-btn[data-v-1ff54383]{float:right;margin-bottom:16px}.editable-row-operations a[data-v-1ff54383]{margin-right:8px}.add-form[data-v-1ff54383]{margin-top:10px}.add-form .ant-form[data-v-1ff54383]{display:flex;justify-content:space-between}.config-disabled[data-v-1ff54383]{pointer-events:none;color:rgba(0,0,0,.25);background-color:transparent;border-color:transparent;text-shadow:none;box-shadow:none} -------------------------------------------------------------------------------- /brcc-console/src/main/resources/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/brcc-console/src/main/resources/static/favicon.png -------------------------------------------------------------------------------- /brcc-console/src/main/resources/static/img/logo.587c3748.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/brcc-console/src/main/resources/static/img/logo.587c3748.png -------------------------------------------------------------------------------- /brcc-console/src/main/resources/static/js/chunk-2d0e95df.61db30c1.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0e95df"],{"8cdb":function(t,e,n){"use strict";n.r(e);var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("a-result",{attrs:{status:"404",title:"404","sub-title":t.$t("404")},scopedSlots:t._u([{key:"extra",fn:function(){return[n("a-button",{attrs:{type:"primary"},on:{click:t.toHome}},[t._v("\n "+t._s(t.$t("header.user.goback"))+"\n ")])]},proxy:!0}])})},r=[],s={name:"Exception404",methods:{toHome:function(){this.$router.push({path:"/index"})}}},u=s,a=n("2877"),c=Object(a["a"])(u,o,r,!1,null,null,null);e["default"]=c.exports}}]); -------------------------------------------------------------------------------- /brcc-console/src/main/resources/static/js/lang-en-US-breadcubmbs.68c60d93.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["lang-en-US-breadcubmbs"],{"87f3":function(n,s,e){"use strict";e.r(s),s["default"]={crumbs:{index:"Homepage",productLine:"Products",project:"Projects",permission:"Permission",env:"Environments",version:"Versions",group:"Groups",instance:"Instances",config:"Configs",log:"Logs",configlist:"Configlists"},header:{title:"BRCC"}}}}]); -------------------------------------------------------------------------------- /brcc-console/src/main/resources/static/js/lang-en-US-config.10c7a8a6.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["lang-en-US-config"],{ef93:function(e,o,n){"use strict";n.r(o),o["default"]={"config.tab.single":"Single","config.tab.batch":"Batch","config.table.columns.name":"Key","config.table.columns.value":"Value","config.table.columns.memo":"Memo","config.table.columns.operation":"Operation","config.table.operation.edit":"Modify","config.table.operation.save":"Save","config.table.operation.delete":"Delete","config.table.operation.delete.tips":"Are you sure you want to delete?","config.table.operation.cancel.tips":"Are you sure you want to cancel?","config.table.operation.add":"Add","config.table.operation.submit":"Save submit","config.table.operation.cancel":"Cancel","config.table.batch.message":"Please enter a configuration item, one for each line","config.repeat.check":"Duplicate configuration key!","configlist.table.columns.product":"Product","configlist.table.columns.project":"Project","configlist.table.columns.env":"Env","configlist.table.columns.version":"Version","configlist.table.columns.group":"Group"}}}]); -------------------------------------------------------------------------------- /brcc-console/src/main/resources/static/js/lang-en-US-env.881b7a3a.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["lang-en-US-env"],{5819:function(e,n,o){"use strict";o.r(n),n["default"]={"env.table.columns.id":"Id","env.table.columns.name":"Name","env.table.columns.memo":"Introduction","env.table.columns.operation":"Operation","env.table.operation.edit":"Modify","env.table.operation.delete":"Delete","env.table.operation.delete.tips":"Are you sure you want to delete?","env.table.operation.version":"Version","env.btn.add":"Create Environment","env.btn.edit":"Modify Environment","env.modal.modify.form.name.message":"Name is required!"}}}]); -------------------------------------------------------------------------------- /brcc-console/src/main/resources/static/js/lang-en-US-group.029c1564.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["lang-en-US-group"],{1489:function(e,o,t){"use strict";t.r(o),o["default"]={"group.table.columns.id":"Id","group.table.columns.name":"Name","group.table.columns.memo":"Introduction","group.table.columns.operation":"Operation","group.table.operation.edit":"Modify","group.table.operation.delete":"Delete","group.table.operation.delete.tips":"Are you sure you want to delete?","group.table.operation.configitem":"Configitem","group.btn.add":"Create Group","group.btn.edit":"Modify Group","group.modal.name.placeholder":"Please enter a group name","group.modal.name.message":"Name is required!"}}}]); -------------------------------------------------------------------------------- /brcc-console/src/main/resources/static/js/lang-en-US-instance.1459ee2e.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["lang-en-US-instance"],{a77c:function(e,n,a){"use strict";a.r(n),n["default"]={"instance.expand.instances":"instances","instance.expand.actived":"actived","instance.expand.deactived":"deactived","instance.table.columns.ip":"ip","instance.table.columns.containerId":"containerId","instance.table.columns.idc":"idc","instance.table.columns.clientVersion":"clientVersion","instance.table.columns.appName":"appName","instance.table.columns.status":"status","instance.table.columns.status.actived":"actived","instance.table.columns.status.deactived":"deactived","instance.table.columns.enableUpdateCallback":"enableUpdateCallback","instance.table.columns.enableUpdateCallback.on":"on","instance.table.columns.enableUpdateCallback.off":"off","instance.table.columns.netCost":"netCost","instance.table.columns.heartbeatTime":"heartbeatTime","instance.table.columns.operation":"operation","instance.table.operation.delete":"Delete","instance.table.operation.delete.tips":"Are you sure you want to delete?"}}}]); -------------------------------------------------------------------------------- /brcc-console/src/main/resources/static/js/lang-en-US-log.5fa7668c.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["lang-en-US-log"],{da72:function(e,o,t){"use strict";t.r(o),o["default"]={"0000":"modify config","0001":"batch modify config","0002":"delete config","0003":"modify environment","0004":"delete environment","0005":"modify group","0006":"delete group","0007":"modify product","0008":"modify product member","0009":"modify project","0010":"reset api password","0011":"delete project","0012":"modify project dependency","0013":"add project member","0014":"delete project member","0015":"modify version","0016":"modify gray version","0017":"delete gray version","0018":"modify gray rule","0019":"delete version","0020":"push change","0021":"copy version","0022":"export configuration","0023":"import configuration","log.table.columns.operator":"Operator","log.table.columns.scene":"Scene","log.table.columns.createTime":"CreateTime","log.table.columns.request":"Request","log.table.columns.status":"Status"}}}]); -------------------------------------------------------------------------------- /brcc-console/src/main/resources/static/js/lang-en-US-permission.763f5dd0.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["lang-en-US-permission"],{bb91:function(e,s,n){"use strict";n.r(s),s["default"]={"permisson.btn.add":"Add Members","permisson.btn.edit":"Modify Members","permisson.btn.cancel":"Cancel","permisson.btn.submit":"Submit","permisson.table.columns.name":"Name","permisson.table.columns.name.placeholder":"Please enter username","permisson.table.columns.name.message":"Name is required!","permisson.table.columns.role":"Role","permisson.table.columns.role.admin":"admin","permisson.table.columns.role.member":"member","permisson.table.columns.operation":"Operation","permisson.table.columns.envname":"Env Name","permisson.table.columns.readable":"readable","permisson.table.columns.writeable":"writeable","permisson.table.operation.delete":"Delete","permisson.table.operation.edit":"Modify","permisson.table.operation.delete.tips":"Are you sure you want to delete?"}}}]); -------------------------------------------------------------------------------- /brcc-console/src/main/resources/static/js/lang-en-US-productline.eba836d8.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["lang-en-US-productline"],{1334:function(e,r,o){"use strict";o.r(r),r["default"]={productline:{table:{columns:{id:"id",name:"name",memo:"Introduction",members:"Members",operation:"Operation"},operation:{add:"Add Members",edit:"Modify",project:"Projects"}},btn:{add:"Create Product",app:"Developer center access",desc:"Access process"},modal:{modify:{title:{add:"Create Product",edit:"Modify Product"},form:{name:"Name",memo:"Introduction"},placeholder:{name:"Please enter a product name"},message:{name:"Name is required!"}},member:{title:"Modify Members",form:{members:"Members"},placeholder:{name:"Multiple members are separated by English commas"},message:{name:"Members is required!"}}}}}}}]); -------------------------------------------------------------------------------- /brcc-console/src/main/resources/static/js/lang-en-US-project.d45c421d.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["lang-en-US-project"],{"379d":function(e,o,r){"use strict";r.r(o),o["default"]={"project.table.columns.id":"Id","project.table.columns.name":"Name","project.table.columns.memo":"Introduction","project.table.columns.mailReceiver":"Mail Receiver","project.table.columns.operation":"Operation","project.table.operation.edit":"Modify","project.table.operation.role":"Permission","project.table.operation.delete":"Delete","project.table.operation.delete.tips":"Are you sure you want to delete?","project.table.operation.env":"env","project.table.operation.resetApiPassword":"Reset Password","project.modal.add.title":"Create Project","project.modal.modify.title":"Modify Project","project.modal.modify.password.title":"Reset Password","project.modal.modify.form.name":"Project","project.modal.modify.form.name.placeholder":"Please enter a project name","project.modal.modify.form.name.message":"Name is required!","project.modal.modify.form.memo":"Introduction","project.modal.modify.form.password":"Password","project.modal.modify.form.password.message":"Password is required!","project.modal.modify.form.password.placeholder":"Please enter a api password","project.modal.modify.form.mailReceiver":"Mail Receiver","project.modal.modify.form.projectType":"Project Type","project.modal.modify.form.projectType.common":"Common","project.modal.modify.form.projectType.normal":"Normal","project.btn.add":"Create Project"}}}]); -------------------------------------------------------------------------------- /brcc-console/src/main/resources/static/js/lang-en-US-user.ceacc797.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["lang-en-US-user"],{"928e":function(e,t,s){"use strict";s.r(t),t["default"]={"user.table.columns.id":"Id","user.table.columns.username":"UserName","user.table.columns.role":"Role","user.table.columns.role.admin":"Admin","user.table.columns.role.member":"Member","user.table.columns.role.project":"Project","user.table.columns.role.product":"Prodcut","user.table.columns.createtime":"CreateTime","user.table.columns.updatetime":"UpdateTime","user.table.columns.status":"Status","user.table.columns.status.normal":"Normal","user.table.columns.status.invalid":"Invalid","user.table.columns.operation":"Operation","user.table.operation.modify":"Modify","user.table.operation.reset":"Reset Password","user.table.operation.delete":"Delete","user.table.operation.delete.tips":"Are you sure you want to delete?","user.btn.add":"Create User","user.btn.search":"Search","user.btn.reset":"Reset"}}}]); -------------------------------------------------------------------------------- /brcc-console/src/test/java/com/baidu/brcc/controller/HealthCheckControllerTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.controller; 20 | 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | import com.baidu.brcc.domain.base.R; 25 | 26 | public class HealthCheckControllerTest { 27 | private static final int OK = 0; 28 | 29 | HealthCheckController healthCheckController = new HealthCheckController(); 30 | 31 | @Test 32 | public void testCheck() throws Exception { 33 | R result = healthCheckController.check(); 34 | Assert.assertEquals(OK, result.getStatus()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/annotation/LoginUser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.annotation; 20 | 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | @Target(ElementType.PARAMETER) 27 | @Retention(RetentionPolicy.RUNTIME) 28 | public @interface LoginUser { 29 | } 30 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/annotation/MaskLog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.annotation; 20 | 21 | /** 22 | * 用于实现日志记录注解中字段掩码实现 23 | */ 24 | public @interface MaskLog { 25 | // 需要掩码的参数位置 26 | int paramsIdx() default 0; 27 | 28 | // 参数位置对应对象的字段, 如果字段为空,此时整个参数以掩码形式打印,否则,对应的字段以掩码形式展现 29 | String[] fields() default {}; 30 | } 31 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/common/InstanceEventType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.common; 20 | 21 | public enum InstanceEventType { 22 | Heartbeat, ConfigPull 23 | } 24 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/config/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.config; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import springfox.documentation.builders.PathSelectors; 7 | import springfox.documentation.builders.RequestHandlerSelectors; 8 | import springfox.documentation.spi.DocumentationType; 9 | import springfox.documentation.spring.web.plugins.Docket; 10 | 11 | @Configuration 12 | public class SwaggerConfig { 13 | 14 | @Value("${swagger.enable:true}") 15 | private boolean enable; 16 | 17 | @Bean 18 | public Docket api(){ 19 | Docket docket = new Docket(DocumentationType.SWAGGER_2) 20 | .enable(enable) 21 | .select() 22 | .apis(RequestHandlerSelectors.basePackage("com.baidu.brcc.controller")) 23 | .paths(PathSelectors.any()) 24 | .build(); 25 | return docket; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/ApiCountMapper.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.dao; 2 | 3 | import com.baidu.brcc.domain.ApiCount; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import java.util.List; 8 | 9 | @Mapper 10 | public interface ApiCountMapper { 11 | 12 | List queryByProductCacheKey(@Param("productCacheKey") String productCacheKey); 13 | 14 | int updateApiCount(ApiCount apiCount); 15 | 16 | int insertApiCount(ApiCount apiCount); 17 | 18 | List queryByProductCacheKeys(@Param("productCacheKeys") List productCacheKeys); 19 | } 20 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/ApiTokenMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao; 20 | 21 | import org.apache.ibatis.annotations.Mapper; 22 | 23 | import com.baidu.brcc.dao.base.BaseMapper; 24 | import com.baidu.brcc.domain.ApiToken; 25 | import com.baidu.brcc.domain.ApiTokenExample; 26 | 27 | @Mapper 28 | public interface ApiTokenMapper extends BaseMapper { 29 | } 30 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/BrccInstanceMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao; 20 | 21 | import org.apache.ibatis.annotations.Mapper; 22 | 23 | import com.baidu.brcc.dao.base.BaseMapper; 24 | import com.baidu.brcc.domain.BrccInstance; 25 | import com.baidu.brcc.domain.BrccInstanceExample; 26 | 27 | @Mapper 28 | public interface BrccInstanceMapper extends BaseMapper { 29 | } 30 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/ConfigChangeLogMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao; 20 | 21 | import org.apache.ibatis.annotations.Mapper; 22 | 23 | import com.baidu.brcc.dao.base.BaseMapper; 24 | import com.baidu.brcc.domain.ConfigChangeLogExample; 25 | import com.baidu.brcc.domain.ConfigChangeLogWithBLOBs; 26 | 27 | @Mapper 28 | public interface ConfigChangeLogMapper extends BaseMapper { 29 | } 30 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/ConfigGroupMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao; 20 | 21 | import org.apache.ibatis.annotations.Mapper; 22 | 23 | import com.baidu.brcc.dao.base.BaseMapper; 24 | import com.baidu.brcc.domain.ConfigGroup; 25 | import com.baidu.brcc.domain.ConfigGroupExample; 26 | 27 | @Mapper 28 | public interface ConfigGroupMapper extends BaseMapper { 29 | } 30 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/ConfigItemMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao; 20 | 21 | import org.apache.ibatis.annotations.Mapper; 22 | 23 | import com.baidu.brcc.dao.base.BaseMapper; 24 | import com.baidu.brcc.domain.ConfigItem; 25 | import com.baidu.brcc.domain.ConfigItemExample; 26 | 27 | @Mapper 28 | public interface ConfigItemMapper extends BaseMapper { 29 | } 30 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/EnvironmentMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao; 20 | 21 | import org.apache.ibatis.annotations.Mapper; 22 | 23 | import com.baidu.brcc.dao.base.BaseMapper; 24 | import com.baidu.brcc.domain.Environment; 25 | import com.baidu.brcc.domain.EnvironmentExample; 26 | 27 | @Mapper 28 | public interface EnvironmentMapper extends BaseMapper { 29 | } 30 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/EnvironmentUserMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao; 20 | 21 | import org.apache.ibatis.annotations.Mapper; 22 | 23 | import com.baidu.brcc.dao.base.BaseMapper; 24 | import com.baidu.brcc.domain.EnvironmentUser; 25 | import com.baidu.brcc.domain.EnvironmentUserExample; 26 | 27 | @Mapper 28 | public interface EnvironmentUserMapper extends BaseMapper { 29 | } 30 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/GrayInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.dao; 2 | 3 | import com.baidu.brcc.dao.base.BaseMapper; 4 | import com.baidu.brcc.domain.GrayInfo; 5 | import com.baidu.brcc.domain.GrayInfoExample; 6 | import org.apache.ibatis.annotations.Mapper; 7 | 8 | @Mapper 9 | public interface GrayInfoMapper extends BaseMapper { 10 | } 11 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/GrayRuleMapper.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.dao; 2 | 3 | import com.baidu.brcc.dao.base.BaseMapper; 4 | import com.baidu.brcc.domain.GrayRule; 5 | import com.baidu.brcc.domain.GrayRuleExample; 6 | import org.apache.ibatis.annotations.Mapper; 7 | 8 | @Mapper 9 | public interface GrayRuleMapper extends BaseMapper { 10 | } 11 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/ItemTypeMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao; 20 | 21 | import org.apache.ibatis.annotations.Mapper; 22 | 23 | import com.baidu.brcc.dao.base.BaseMapper; 24 | import com.baidu.brcc.domain.ItemType; 25 | import com.baidu.brcc.domain.ItemTypeExample; 26 | 27 | @Mapper 28 | public interface ItemTypeMapper extends BaseMapper { 29 | } 30 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/OperationLogMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao; 20 | 21 | import org.apache.ibatis.annotations.Mapper; 22 | 23 | import com.baidu.brcc.dao.base.BaseMapper; 24 | import com.baidu.brcc.domain.OperationLog; 25 | import com.baidu.brcc.domain.OperationLogExample; 26 | 27 | @Mapper 28 | public interface OperationLogMapper extends BaseMapper { 29 | } 30 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/ProductMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao; 20 | 21 | import org.apache.ibatis.annotations.Mapper; 22 | 23 | import com.baidu.brcc.dao.base.BaseMapper; 24 | import com.baidu.brcc.domain.Product; 25 | import com.baidu.brcc.domain.ProductExample; 26 | 27 | @Mapper 28 | public interface ProductMapper extends BaseMapper { 29 | } 30 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/ProductUserMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao; 20 | 21 | import org.apache.ibatis.annotations.Mapper; 22 | 23 | import com.baidu.brcc.dao.base.BaseMapper; 24 | import com.baidu.brcc.domain.ProductUser; 25 | import com.baidu.brcc.domain.ProductUserExample; 26 | import org.apache.ibatis.annotations.Param; 27 | 28 | import java.util.List; 29 | 30 | @Mapper 31 | public interface ProductUserMapper extends BaseMapper { 32 | 33 | List queryProductIdsByUserNameAndAdmin(@Param("username") String username, @Param("isAdmin") byte isAdmin); 34 | } 35 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/ProjectMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao; 20 | 21 | import org.apache.ibatis.annotations.Mapper; 22 | 23 | import com.baidu.brcc.dao.base.BaseMapper; 24 | import com.baidu.brcc.domain.Project; 25 | import com.baidu.brcc.domain.ProjectExample; 26 | 27 | @Mapper 28 | public interface ProjectMapper extends BaseMapper { 29 | } 30 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/ProjectUserMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao; 20 | 21 | import org.apache.ibatis.annotations.Mapper; 22 | 23 | import com.baidu.brcc.dao.base.BaseMapper; 24 | import com.baidu.brcc.domain.ProjectUser; 25 | import com.baidu.brcc.domain.ProjectUserExample; 26 | 27 | @Mapper 28 | public interface ProjectUserMapper extends BaseMapper { 29 | } 30 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao; 20 | 21 | import org.apache.ibatis.annotations.Mapper; 22 | 23 | import com.baidu.brcc.dao.base.BaseMapper; 24 | import com.baidu.brcc.domain.User; 25 | import com.baidu.brcc.domain.UserExample; 26 | 27 | import java.util.List; 28 | 29 | @Mapper 30 | public interface UserMapper extends BaseMapper { 31 | 32 | 33 | List queryUsersByUserName (List users); 34 | 35 | 36 | 37 | } 38 | 39 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/VersionMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao; 20 | 21 | import org.apache.ibatis.annotations.Mapper; 22 | 23 | import com.baidu.brcc.dao.base.BaseMapper; 24 | import com.baidu.brcc.domain.Version; 25 | import com.baidu.brcc.domain.VersionExample; 26 | 27 | @Mapper 28 | public interface VersionMapper extends BaseMapper { 29 | } 30 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/base/CommonProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao.base; 20 | 21 | import java.util.Map; 22 | 23 | import org.springframework.util.Assert; 24 | 25 | public class CommonProvider { 26 | 27 | 28 | public String select(Map map) { 29 | Assert.notNull(map, "CommonProvider.select param error, map is null"); 30 | Assert.notNull(map.get("sql"), "CommonProvider.select param error, map is not containsKey 'sql'"); 31 | Object sql = map.get("sql"); 32 | return sql.toString(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/base/SQLParam.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao.base; 20 | 21 | import java.util.HashMap; 22 | 23 | public class SQLParam extends HashMap { 24 | 25 | 26 | public static SQLParam newInstance() { 27 | return new SQLParam(); 28 | } 29 | 30 | public SQLParam append(String key, Object value) { 31 | put(key, value); 32 | return this; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/provider/ApiCountProvider.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.dao.provider; 2 | 3 | public class ApiCountProvider { 4 | } 5 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/provider/ApiTokenProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao.provider; 20 | 21 | public class ApiTokenProvider { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/provider/BrccInstanceProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao.provider; 20 | 21 | public class BrccInstanceProvider { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/provider/ConfigChangeLogWithBLOBsProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao.provider; 20 | 21 | public class ConfigChangeLogWithBLOBsProvider { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/provider/ConfigGroupProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao.provider; 20 | 21 | public class ConfigGroupProvider { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/provider/ConfigItemProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao.provider; 20 | 21 | public class ConfigItemProvider { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/provider/EnvironmentProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao.provider; 20 | 21 | public class EnvironmentProvider { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/provider/EnvironmentUserProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao.provider; 20 | 21 | public class EnvironmentUserProvider { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/provider/ItemTypeProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao.provider; 20 | 21 | public class ItemTypeProvider { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/provider/OperationLogProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao.provider; 20 | 21 | public class OperationLogProvider { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/provider/ProductProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao.provider; 20 | 21 | public class ProductProvider { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/provider/ProductUserProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao.provider; 20 | 21 | public class ProductUserProvider { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/provider/ProjectProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao.provider; 20 | 21 | public class ProjectProvider { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/provider/ProjectUserProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao.provider; 20 | 21 | public class ProjectUserProvider { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/provider/UserProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao.provider; 20 | 21 | public class UserProvider { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dao/provider/VersionProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dao.provider; 20 | 21 | public class VersionProvider { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/ApiCountExample.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.domain; 2 | 3 | import com.baidu.brcc.domain.base.BaseExample; 4 | 5 | public class ApiCountExample extends BaseExample { 6 | 7 | 8 | } 9 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/Role.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain; 20 | 21 | public class Role { 22 | 23 | //管理员 24 | public static final String ADMIN = "ADMIN"; 25 | 26 | // 产品线拥有者 27 | public static final String PRODUCT_OWNER = "PRODUCT_OWNER"; 28 | 29 | // 工程拥有者 30 | public static final String PROJECT_OWNER = "PROJECT_OWNER"; 31 | 32 | // 工程写权限者, 写权限需要配合config配置,决定环境、版本的写入权限。 33 | public static final String PROJECT_WRITER = "PROJECT_WRITER"; 34 | 35 | // 工程读权限者 36 | public static final String PROJECT_READER = "PROJECT_READER"; 37 | } 38 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/em/Deleted.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.em; 20 | 21 | public enum Deleted { 22 | OK((byte) 0, "OK"), 23 | 24 | DELETE((byte) 1, "删除"); 25 | 26 | private Byte value; 27 | private String name; 28 | 29 | Deleted(Byte value, String name) { 30 | this.value = value; 31 | this.name = name; 32 | } 33 | 34 | public Byte getValue() { 35 | return value; 36 | } 37 | 38 | public void setValue(Byte value) { 39 | this.value = value; 40 | } 41 | 42 | public String getName() { 43 | return name; 44 | } 45 | 46 | public void setName(String name) { 47 | this.name = name; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/em/FileFormat.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.domain.em; 2 | 3 | public enum FileFormat { 4 | PROPERTIES((byte) 0, "properties"), 5 | 6 | YAML((byte) 1, "yaml"); 7 | 8 | private Byte value; 9 | private String name; 10 | 11 | FileFormat(Byte value, String name) { 12 | this.value = value; 13 | this.name = name; 14 | } 15 | 16 | public Byte getValue() { 17 | return value; 18 | } 19 | 20 | public void setValue(Byte value) { 21 | this.value = value; 22 | } 23 | 24 | public String getName() { 25 | return name; 26 | } 27 | 28 | public void setName(String name) { 29 | this.name = name; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/em/FileImportType.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.domain.em; 2 | 3 | public enum FileImportType { 4 | STOP((byte) 0, "终止导入"), 5 | 6 | OVERWRITE((byte) 1, "覆盖"); 7 | 8 | private Byte value; 9 | private String name; 10 | 11 | FileImportType(Byte value, String name) { 12 | this.value = value; 13 | this.name = name; 14 | } 15 | 16 | public Byte getValue() { 17 | return value; 18 | } 19 | 20 | public void setValue(Byte value) { 21 | this.value = value; 22 | } 23 | 24 | public String getName() { 25 | return name; 26 | } 27 | 28 | public void setName(String name) { 29 | this.name = name; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/em/SortType.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.domain.em; 2 | 3 | public enum SortType { 4 | DESC("desc", "降序"), 5 | 6 | ASC("asc", "升序"); 7 | 8 | private String value; 9 | private String name; 10 | 11 | SortType(String value, String name) { 12 | this.value = value; 13 | this.name = name; 14 | } 15 | 16 | public String getValue() { 17 | return value; 18 | } 19 | 20 | public void setValue(String value) { 21 | this.value = value; 22 | } 23 | 24 | public String getName() { 25 | return name; 26 | } 27 | 28 | public void setName(String name) { 29 | this.name = name; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/exception/BrccException.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.domain.exception; 2 | 3 | public class BrccException extends RuntimeException { 4 | 5 | private String msg; 6 | 7 | private int respCode; 8 | 9 | public String getMsg() { 10 | return msg; 11 | } 12 | 13 | public void setMsg(String msg) { 14 | this.msg = msg; 15 | } 16 | 17 | public int getRespCode() { 18 | return respCode; 19 | } 20 | 21 | public void setRespCode(int respCode) { 22 | this.respCode = respCode; 23 | } 24 | 25 | public BrccException(String msg, int respCode) { 26 | super(msg); 27 | this.msg = msg; 28 | this.respCode = respCode; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/APiItemAddReqVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class APiItemAddReqVo { 25 | 26 | //版本id 27 | private Long versionId; 28 | 29 | //配置key 30 | private String key; 31 | 32 | //配置value 33 | private String value; 34 | 35 | //分组ID 36 | private Long groupId; 37 | 38 | //配置简介 39 | private String memo; 40 | } 41 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/ApiAuthReqVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | /** 24 | * 工程登录认证 25 | */ 26 | @Data 27 | public class ApiAuthReqVo { 28 | 29 | // 工程名称 30 | private String projectName; 31 | 32 | // 工程的api password 33 | private String apiPassword; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/ApiAuthVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | /** 24 | * 工程登录认证 25 | */ 26 | @Data 27 | public class ApiAuthVo { 28 | 29 | // 工程ID 30 | private Long projectId; 31 | 32 | // 工程名称 33 | private String projectName; 34 | 35 | // 工程的api token 36 | private String token; 37 | 38 | // 是否永不过期 39 | private boolean neverExpired; 40 | 41 | // 过期时间戳 42 | private Long expiredTime; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/ApiBatchItemReqVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import java.util.List; 22 | 23 | import lombok.Data; 24 | 25 | @Data 26 | public class ApiBatchItemReqVo { 27 | 28 | // 版本ID 29 | private Long versionId; 30 | 31 | // 配置Key列表 32 | private List keys; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/ApiGroupVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class ApiGroupVo { 25 | // 分组ID 26 | private Long groupId; 27 | 28 | // 分组名称 29 | private String groupName; 30 | } 31 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/ApiItemDeleteVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class ApiItemDeleteVo { 25 | //版本id 26 | private Long versionId; 27 | 28 | //配置key 29 | private String key; 30 | } 31 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/ApiItemEditVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class ApiItemEditVo { 25 | 26 | //版本id 27 | private Long versionId; 28 | 29 | //配置key 30 | private String key; 31 | 32 | //配置value 33 | private String value; 34 | 35 | //配置简介 36 | private String memo; 37 | } 38 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/ApiItemVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import com.baidu.brcc.domain.ConfigItem; 22 | 23 | import lombok.Data; 24 | 25 | @Data 26 | public class ApiItemVo { 27 | 28 | // 配置KEY 29 | private String key; 30 | 31 | // 配置值 32 | private String value; 33 | 34 | //分组id 35 | private Long groupId; 36 | 37 | public ApiItemVo copy(ConfigItem item) { 38 | if (item == null) { 39 | return this; 40 | } 41 | setKey(item.getName()); 42 | setValue(item.getVal()); 43 | setGroupId(item.getGroupId()); 44 | return this; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/ApiProjectReqVo.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.domain.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | @Data 8 | public class ApiProjectReqVo { 9 | 10 | // 产品线名称 11 | private String productName; 12 | 13 | // 用户名 14 | private String userName; 15 | 16 | // 工程名称 17 | private String name; 18 | 19 | // 工程密码 20 | private String apiPassword; 21 | 22 | // 工程介绍 23 | private String memo; 24 | 25 | // 工程类型,0:公共 1:私有 26 | private Byte projectType; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/ApiUserVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class ApiUserVo { 25 | //用户id 26 | private Long userId; 27 | 28 | //用户名 29 | private String userName; 30 | 31 | //用户的token 32 | private String userToken; 33 | 34 | //角色 35 | private Byte userRole; 36 | 37 | //状态 38 | private Byte status; 39 | } 40 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/BatchConfigItemReq.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import java.util.List; 22 | 23 | import io.swagger.annotations.ApiModelProperty; 24 | import lombok.Data; 25 | 26 | @Data 27 | public class BatchConfigItemReq { 28 | 29 | // 配置项描述 30 | @ApiModelProperty(value = "组id", position = 1) 31 | private Long groupId; 32 | 33 | // 当前分组下的所有配置 34 | @ApiModelProperty(value = "分组下的配置列表", position = 2) 35 | private List items; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/BatchEditItemVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import java.util.List; 22 | 23 | import io.swagger.annotations.ApiModelProperty; 24 | import lombok.Data; 25 | 26 | @Data 27 | public class BatchEditItemVo { 28 | 29 | // 配置项分组 30 | @ApiModelProperty(value = "组id", position = 1) 31 | private Long groupId; 32 | 33 | //版本ID 34 | @ApiModelProperty(value = "版本id", position = 2) 35 | private Long versionId; 36 | 37 | // 当前分组下的所有配置 38 | @ApiModelProperty(value = "分组下的配置列表", position = 3) 39 | private List items; 40 | 41 | } -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/ConfigGroupReq.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class ConfigGroupReq { 25 | 26 | // 分组ID 27 | private Long id; 28 | 29 | // 分组名称 30 | private String name; 31 | 32 | // 分组描述 33 | private String memo; 34 | 35 | // 版本ID 36 | private Long versionId; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/ConfigGroupVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class ConfigGroupVo { 25 | 26 | // 分组ID 27 | private Long id; 28 | 29 | // 分组名称 30 | private String name; 31 | 32 | // 分组描述 33 | private String memo; 34 | 35 | // 版本ID 36 | private Long versionId; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/ConfigItemForGroupVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class ConfigItemForGroupVo { 25 | 26 | // 配置项ID 27 | private Long id; 28 | 29 | // 分组ID 30 | private Long groupId; 31 | 32 | // 分组名称 33 | private String groupName; 34 | 35 | // 配置项KEY 36 | private String name; 37 | 38 | // 配置项描述 39 | private String memo; 40 | 41 | // 配置项Val 42 | private String val; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/CountVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class CountVo { 25 | private Long projectCnt; 26 | 27 | private Long configCnt; 28 | } 29 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/DetailInfoVo.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.domain.vo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class DetailInfoVo { 7 | private String name; 8 | 9 | private String memo; 10 | } 11 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/EnvironmentReq.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class EnvironmentReq { 25 | 26 | // 环境ID 27 | private Long id; 28 | 29 | // 工程Id 30 | private Long projectId; 31 | 32 | // 环境名称 33 | private String name; 34 | 35 | // 环境介绍 36 | private String memo; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/FindTreeInfoReq.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class FindTreeInfoReq { 25 | // load type, 0-project, 1-environment, 2-version, 3-group 26 | private Byte type; 27 | 28 | // the chosen item id 29 | private Long id; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/FindTreeInfoVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class FindTreeInfoVo { 25 | private Long id; 26 | 27 | private String name; 28 | } 29 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/GrayAddReq.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | import java.util.List; 24 | 25 | @Data 26 | public class GrayAddReq { 27 | // 灰度版本ID 28 | private Long grayVersionId; 29 | 30 | // 灰度规则详情 31 | private List grayRuleReqs; 32 | } 33 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/GrayRuleReq.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class GrayRuleReq { 25 | // 规则ID 26 | private Long grayInfoId; 27 | 28 | // 规则名称 29 | private String ruleName; 30 | 31 | // 规则内容 32 | private String ruleContent; 33 | } 34 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/GrayRuleVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class GrayRuleVo { 25 | // 灰度规则ID 26 | private Long grayRuleId; 27 | 28 | // 灰度内容ID 29 | private Long grayInfoId; 30 | } 31 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/GrayVersionReq.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | import java.util.List; 24 | 25 | @Data 26 | public class GrayVersionReq { 27 | 28 | private String token; 29 | 30 | private Long environmentId; 31 | 32 | // containerId 33 | private String containerId; 34 | 35 | // idc 36 | private String idc; 37 | 38 | // instanceIps 39 | private String ip; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/GrayVersionRuleVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class GrayVersionRuleVo { 25 | 26 | // 灰度内容ID 27 | private Long grayInfoId; 28 | 29 | // 规则名称 30 | private String ruleName; 31 | 32 | // 规则内容 33 | private String ruleContent; 34 | } 35 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/ItemReq.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import io.swagger.annotations.ApiModelProperty; 22 | import lombok.Data; 23 | 24 | @Data 25 | public class ItemReq { 26 | 27 | // 配置项名称 28 | @ApiModelProperty(value = "配置项名称", position = 0) 29 | private String name; 30 | 31 | // 配置项描述 32 | @ApiModelProperty(value = "配置项描述", position = 1) 33 | private String memo; 34 | 35 | // 配置值 36 | @ApiModelProperty(value = "配置值", position = 2) 37 | private String val; 38 | } 39 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/ProductReq.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class ProductReq { 25 | 26 | // 产品线ID 27 | private Long id; 28 | 29 | // 产品线名称 30 | private String name; 31 | 32 | // 产品线介绍 33 | private String memo; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/ProductVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import java.util.List; 22 | 23 | import com.baidu.brcc.domain.Product; 24 | 25 | import lombok.Data; 26 | 27 | @Data 28 | public class ProductVo extends Product { 29 | 30 | // 成员 31 | private List members; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/ProjectListVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import com.baidu.brcc.domain.Project; 22 | 23 | import lombok.Data; 24 | 25 | import java.util.List; 26 | 27 | @Data 28 | public class ProjectListVo extends Project { 29 | /** 30 | * 是否管理员, 0-否,1-是 31 | */ 32 | private Boolean admin; 33 | 34 | private List members; 35 | 36 | private List managers; 37 | 38 | private Byte projectType; 39 | 40 | public ProjectListVo copyFrom(Project project) { 41 | return Project.copyFrom(project, this); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/ProjectReq.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class ProjectReq { 25 | 26 | // 工程ID 27 | private Long id; 28 | 29 | // 产品Id 30 | private Long productId; 31 | 32 | // 工程名称 33 | private String name; 34 | 35 | // 邮件接收 36 | private String mailReceiver; 37 | 38 | // 工程介绍 39 | private String memo; 40 | 41 | // 工程类型,0:公共 1:私有 42 | private Byte projectType; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/ResetApiPasswordVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class ResetApiPasswordVo { 25 | 26 | // 产品线ID 27 | private Long id; 28 | 29 | // 用户密码 30 | private String apiPassword; 31 | } 32 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/RestPasswordVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class RestPasswordVo { 25 | 26 | // 名称 27 | private String name; 28 | 29 | // 密码 30 | private String password; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/UserLoginVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class UserLoginVo { 25 | 26 | // 用户名称 27 | private String name; 28 | 29 | // 用户密码 30 | private String password; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/UserVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import java.util.Date; 22 | 23 | import lombok.Data; 24 | 25 | @Data 26 | public class UserVo { 27 | 28 | // 用户ID 29 | private Long userId; 30 | 31 | // 用户名 32 | private String userName; 33 | 34 | // 用户角色 35 | private Byte userRole; 36 | 37 | // 创建时间 38 | private Date createTime; 39 | 40 | // 更新时间 41 | private Date updateTime; 42 | 43 | // 状态 44 | private Byte status; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/VersionNodeVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class VersionNodeVo { 25 | 26 | // 产品线ID 27 | private Long productId; 28 | 29 | // 产品线名称 30 | private String productName; 31 | 32 | // 工程ID 33 | private Long projectId; 34 | 35 | // 工程名称 36 | private String projectName; 37 | 38 | // 环境ID 39 | private Long environmentId; 40 | 41 | // 环境名称 42 | private String environmentName; 43 | 44 | // 版本ID 45 | private Long versionId; 46 | 47 | // 版本名称 48 | private String versionName; 49 | 50 | } 51 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/VersionReq.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class VersionReq { 25 | 26 | // 主版本ID 27 | private Long id; 28 | 29 | // 版本名称 30 | private String name; 31 | 32 | // 版本描述 33 | private String memo; 34 | 35 | // 环境ID 36 | private Long environmentId; 37 | 38 | // 灰度版本ID 39 | private Long grayVersionId; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/domain/vo/VersionVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.domain.vo; 20 | 21 | import lombok.Data; 22 | 23 | import java.util.List; 24 | 25 | @Data 26 | public class VersionVo { 27 | 28 | // 版本ID 29 | private Long id; 30 | 31 | // 版本名称 32 | private String name; 33 | 34 | // 版本简介 35 | private String memo; 36 | 37 | // 环境ID 38 | private Long environmentId; 39 | 40 | // 是否灰度 41 | private Byte grayFlag; 42 | 43 | // 关联的主版本ID 44 | private Long mainVersionId; 45 | 46 | private List dependencyIds; 47 | 48 | private List dependencyInfos; 49 | 50 | } 51 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dto/BrccInstanceDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 Baidu, Inc. All Rights Reserved. 3 | */ 4 | package com.baidu.brcc.dto; 5 | 6 | import com.baidu.brcc.domain.BrccInstance; 7 | 8 | public class BrccInstanceDto extends BrccInstance { 9 | // 1 - 生效, 0-未生效 10 | private Byte status; 11 | 12 | public Byte getStatus() { 13 | return status; 14 | } 15 | 16 | public void setStatus(Byte status) { 17 | this.status = status; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dto/CopyVersionDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dto; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class CopyVersionDto { 25 | 26 | // 源版本ID 27 | private Long srcVersionId; 28 | 29 | // 目标版本ID 30 | private Long destVersionId; 31 | } 32 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dto/EnvPriDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dto; 20 | 21 | import lombok.Data; 22 | 23 | /** 24 | * 环境权限类 25 | */ 26 | @Data 27 | public class EnvPriDto { 28 | 29 | // 环境ID 30 | private Long envId; 31 | 32 | // 环境名称 33 | private String envName; 34 | 35 | // 权限,1-读,2-写 36 | private Byte priType; 37 | } 38 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dto/ProjectUserDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dto; 20 | 21 | import java.util.List; 22 | 23 | import lombok.Data; 24 | 25 | @Data 26 | public class ProjectUserDto { 27 | 28 | // 是否管理员 29 | private Byte isAdmin; 30 | 31 | // 成员列表 32 | private List memberNameList; 33 | 34 | // 权限列表 35 | private List envPriDtoList; 36 | } 37 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dto/RefProjectDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dto; 20 | 21 | import java.util.List; 22 | 23 | import lombok.Data; 24 | 25 | @Data 26 | public class RefProjectDto { 27 | 28 | private Long versionId; 29 | 30 | // 依赖版本ID列表 31 | private List refIds; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/dto/UserDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.dto; 20 | 21 | import lombok.Data; 22 | 23 | @Data 24 | public class UserDto { 25 | 26 | // 用户ID 27 | private Long userId; 28 | 29 | // 用户名称 30 | private String name; 31 | 32 | // 用户类型, 0-默认, 1-uuap 33 | private Byte type; 34 | 35 | // 管理类型, 0-普通, 1-工程, 2-产品线, 3-系统管理员 36 | private Byte role; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/rule/GrayHitRule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.rule; 20 | 21 | import java.util.Map; 22 | 23 | public interface GrayHitRule { 24 | 25 | boolean hit(Long grayVersionId, String ruleContent, Map content); 26 | } 27 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/service/ApiCountService.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.service; 2 | 3 | import com.baidu.brcc.domain.ApiCount; 4 | 5 | import java.util.List; 6 | import java.util.Map; 7 | import java.util.concurrent.atomic.AtomicLong; 8 | 9 | public interface ApiCountService { 10 | 11 | ApiCount queryByCacheKey(String cacheKey); 12 | 13 | boolean insertOrUpdateApiCount(String productName, String cacheKey, Map apiCountCache); 14 | 15 | boolean insertApiCount(String productName, String cacheKey, Map apiCountCache); 16 | 17 | List queryByProductCacheKeys(List productCacheKeys); 18 | } 19 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/service/EnvironmentUserService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.service; 20 | 21 | import com.baidu.brcc.domain.EnvironmentUser; 22 | import com.baidu.brcc.domain.EnvironmentUserExample; 23 | import com.baidu.brcc.domain.User; 24 | import com.baidu.brcc.service.base.GenericService; 25 | 26 | public interface EnvironmentUserService extends GenericService { 27 | 28 | EnvironmentUser selectByUserIdAndEnvironmentId(Long userId, Long projectId, Long environmentId); 29 | 30 | boolean checkAuth(Long productId, Long projectId, Long environmentId, User user); 31 | } 32 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/service/GrayInfoService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */package com.baidu.brcc.service; 19 | 20 | import com.baidu.brcc.domain.GrayInfo; 21 | import com.baidu.brcc.domain.GrayInfoExample; 22 | import com.baidu.brcc.domain.User; 23 | import com.baidu.brcc.domain.vo.GrayRuleReq; 24 | import com.baidu.brcc.service.base.GenericService; 25 | 26 | import java.util.List; 27 | 28 | public interface GrayInfoService extends GenericService { 29 | List selectByIds(List ids); 30 | 31 | Long saveGrayInfo(GrayRuleReq grayRuleReq, User loginUser); 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/service/GrayRuleService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.service; 20 | 21 | import com.baidu.brcc.domain.GrayRule; 22 | import com.baidu.brcc.domain.GrayRuleExample; 23 | import com.baidu.brcc.domain.User; 24 | import com.baidu.brcc.domain.vo.GrayRuleReq; 25 | import com.baidu.brcc.service.base.GenericService; 26 | import java.util.List; 27 | 28 | public interface GrayRuleService extends GenericService { 29 | Long saveGrayRule(Long grayVersionId, GrayRuleReq grayRuleReq, User loginUser); 30 | 31 | List selectByGrayVersionId(Long grayVersionId); 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/service/ItemTypeService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.service; 20 | 21 | import com.baidu.brcc.domain.ItemType; 22 | import com.baidu.brcc.domain.ItemTypeExample; 23 | import com.baidu.brcc.service.base.GenericService; 24 | 25 | public interface ItemTypeService extends GenericService { 26 | } 27 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/service/OperationLogService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.service; 20 | 21 | import com.baidu.brcc.service.base.GenericService; 22 | import com.baidu.brcc.domain.OperationLog; 23 | import com.baidu.brcc.domain.OperationLogExample; 24 | 25 | public interface OperationLogService extends GenericService { 26 | 27 | void saveLogWithBackground(Long userId, String operator, String scene, String request, String response, 28 | String remoteAddress); 29 | } 30 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/service/UserCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.service; 20 | 21 | import com.baidu.brcc.domain.User; 22 | 23 | public interface UserCache { 24 | 25 | User getUserByToken(String token); 26 | 27 | User getUserByName(String name); 28 | 29 | User reloadUserByToken(String token); 30 | 31 | void removeByName(String name); 32 | } 33 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/service/UserService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.service; 20 | 21 | import java.util.List; 22 | 23 | import com.baidu.brcc.domain.User; 24 | import com.baidu.brcc.domain.UserExample; 25 | import com.baidu.brcc.service.base.GenericService; 26 | 27 | public interface UserService extends GenericService { 28 | 29 | User selectUserByName(String name); 30 | 31 | User selectUserByToken(String token); 32 | 33 | User addUserIfNotExist(String name, Byte role, Byte userType); 34 | 35 | List getProjectIdsByUserId(Long userId); 36 | 37 | List queryUsersByUserName(List users); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/utils/LogFilter.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.utils; 2 | 3 | import org.apache.commons.lang3.StringUtils; 4 | import org.springframework.web.servlet.HandlerMapping; 5 | 6 | import javax.servlet.ServletRequest; 7 | import javax.servlet.http.HttpServletRequest; 8 | 9 | public class LogFilter { 10 | public static String getUrl (ServletRequest request) { 11 | String pattern = (String) request.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE); 12 | HttpServletRequest req = (HttpServletRequest) request; 13 | if (StringUtils.isEmpty(pattern)) { 14 | return req.getRequestURI(); 15 | } 16 | return pattern; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/utils/LogUtils.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.utils; 2 | 3 | import org.apache.commons.lang3.StringUtils; 4 | import org.springframework.web.servlet.HandlerMapping; 5 | 6 | import javax.servlet.ServletRequest; 7 | import javax.servlet.http.HttpServletRequest; 8 | 9 | public class LogUtils { 10 | public static String getUrl (ServletRequest request) { 11 | String pattern = (String) request.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE); 12 | HttpServletRequest req = (HttpServletRequest) request; 13 | if (StringUtils.isEmpty(pattern)) { 14 | return req.getRequestURI(); 15 | } 16 | return pattern; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/utils/Name/NameUtils.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.utils.Name; 2 | 3 | import com.baidu.brcc.domain.base.R; 4 | import com.baidu.brcc.domain.exception.BizException; 5 | 6 | import java.util.regex.Pattern; 7 | 8 | import static com.baidu.brcc.common.ErrorStatusMsg.CHINESE_NOT_ALLOWED_MSG; 9 | import static com.baidu.brcc.common.ErrorStatusMsg.CHINESE_NOT_ALLOWED_STATUS; 10 | import static com.baidu.brcc.common.ErrorStatusMsg.NAME_NULL_MSG; 11 | import static com.baidu.brcc.common.ErrorStatusMsg.NAME_NULL_STATUS; 12 | 13 | public class NameUtils { 14 | public static Boolean containsChinese(String name) { 15 | if (name == null || name.isEmpty()) { 16 | return false; 17 | } 18 | Pattern p = Pattern.compile("[\u4e00-\u9fa5]"); 19 | if (p.matcher(name).find()) { 20 | return true; 21 | } 22 | return false; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/utils/NameTreadFactory.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.utils; 2 | 3 | import java.util.concurrent.ThreadFactory; 4 | import java.util.concurrent.atomic.AtomicInteger; 5 | 6 | public class NameTreadFactory implements ThreadFactory { 7 | private final AtomicInteger mThreadNum = new AtomicInteger(1); 8 | 9 | @Override 10 | public Thread newThread(Runnable r) { 11 | Thread t = new Thread(r, "my-thread-" + mThreadNum.getAndIncrement()); 12 | System.out.println(t.getName() + " has been created"); 13 | return t; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/utils/SqlUtils.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.utils; 2 | 3 | import com.baidu.brcc.domain.base.R; 4 | import com.baidu.brcc.domain.em.SortType; 5 | 6 | import static com.baidu.brcc.common.ErrorStatusMsg.PARAM_ERROR_MSG; 7 | import static com.baidu.brcc.common.ErrorStatusMsg.PARAM_ERROR_STATUS; 8 | 9 | public class SqlUtils { 10 | public static boolean isValid(String sortBy) { 11 | return sortBy.equals(SortType.DESC.getValue()) || sortBy.equals(SortType.ASC.getValue()); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/utils/UserThreadLocal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.utils; 20 | 21 | import com.baidu.brcc.domain.User; 22 | 23 | public class UserThreadLocal { 24 | 25 | private static ThreadLocal userThreadLocal = new ThreadLocal<>(); 26 | 27 | public static void setUser(User user) { 28 | userThreadLocal.set(user); 29 | } 30 | 31 | public static User currentUser() { 32 | return userThreadLocal.get(); 33 | } 34 | 35 | public static void removeUser() { 36 | userThreadLocal.remove(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /brcc-core/src/main/java/com/baidu/brcc/utils/bcrypt/Md5Util.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.utils.bcrypt; 20 | 21 | import org.springframework.util.DigestUtils; 22 | 23 | public class Md5Util { 24 | 25 | public static String md5(String password) { 26 | return DigestUtils.md5DigestAsHex(password.getBytes()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /brcc-core/src/main/resources/mybatis/rcc/ext/ExtApiTokenMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /brcc-core/src/main/resources/mybatis/rcc/ext/ExtBrccInstanceMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /brcc-core/src/main/resources/mybatis/rcc/ext/ExtConfigChangeLogMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /brcc-core/src/main/resources/mybatis/rcc/ext/ExtConfigGroupMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /brcc-core/src/main/resources/mybatis/rcc/ext/ExtConfigItemMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /brcc-core/src/main/resources/mybatis/rcc/ext/ExtEnvironmentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /brcc-core/src/main/resources/mybatis/rcc/ext/ExtEnvironmentUserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /brcc-core/src/main/resources/mybatis/rcc/ext/ExtGrayInfoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /brcc-core/src/main/resources/mybatis/rcc/ext/ExtGrayRuleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /brcc-core/src/main/resources/mybatis/rcc/ext/ExtItemTypeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /brcc-core/src/main/resources/mybatis/rcc/ext/ExtOperationLogMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /brcc-core/src/main/resources/mybatis/rcc/ext/ExtProductMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /brcc-core/src/main/resources/mybatis/rcc/ext/ExtProductUserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /brcc-core/src/main/resources/mybatis/rcc/ext/ExtProjectMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /brcc-core/src/main/resources/mybatis/rcc/ext/ExtProjectUserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /brcc-core/src/main/resources/mybatis/rcc/ext/ExtUserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /brcc-core/src/main/resources/mybatis/rcc/ext/ExtVersionMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /brcc-core/src/test/java/com/baidu/brcc/domain/vo/ResetApiPasswordVoTest.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.domain.vo; 2 | import java.util.Calendar; 3 | import java.util.Date; 4 | import java.util.GregorianCalendar; 5 | 6 | import org.junit.Before; 7 | import org.junit.Test; 8 | import org.mockito.InjectMocks; 9 | import org.mockito.Mock; 10 | import org.mockito.MockitoAnnotations; 11 | 12 | public class ResetApiPasswordVoTest { 13 | @InjectMocks 14 | ResetApiPasswordVo resetApiPasswordVo; 15 | 16 | @Before 17 | public void setUp() { 18 | MockitoAnnotations.initMocks(this); 19 | } 20 | 21 | @Test 22 | public void testSetId() throws Exception{ 23 | resetApiPasswordVo.setId(Long.valueOf(1)); 24 | } 25 | 26 | @Test 27 | public void testSetApiPassword() throws Exception{ 28 | resetApiPasswordVo.setApiPassword("pws"); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /brcc-example/src/main/java/com/baidu/brcc/example/config/ItemCallback.java: -------------------------------------------------------------------------------- 1 | package com.baidu.brcc.example.config; 2 | 3 | import com.baidu.brcc.ConfigItemChangedCallable; 4 | import com.baidu.brcc.DefaultConfigItemChangedCallable; 5 | import com.baidu.brcc.model.ChangedConfigItem; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.util.CollectionUtils; 10 | 11 | import java.util.List; 12 | 13 | public class ItemCallback implements ConfigItemChangedCallable{ 14 | 15 | private static final Logger LOGGER = LoggerFactory.getLogger(ItemCallback.class); 16 | 17 | @Autowired 18 | private ExampleConfiguration exampleConfiguration; 19 | 20 | 21 | @Override 22 | public void changed(List items) { 23 | if (!CollectionUtils.isEmpty(items)) { 24 | for (ChangedConfigItem item : items) { 25 | LOGGER.info("changed key={} oldValue={} newValue={}", item.getKey(), item.getOldValue(), 26 | item.getNewValue()); 27 | 28 | if (item.getKey().equalsIgnoreCase("abc.name")) { 29 | exampleConfiguration.setA(item.getNewValue()); 30 | } 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /brcc-example/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | rcc: 2 | cc-server-url: http://180.76.36.149 3 | cc-password: 123456 4 | logProperties: true 5 | projectName: test-rcc 6 | env-name: dev 7 | cc-version-name: 1.0.0 8 | enableUpdateCallback: true 9 | appName: example 10 | 11 | spring: 12 | mvc: 13 | servlet: 14 | path: / 15 | server: 16 | servlet: 17 | context-path: / -------------------------------------------------------------------------------- /brcc-example/src/main/resources/log4j2.component.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 Baidu, Inc. All Rights Reserved. 3 | # 4 | log4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector 5 | log4j2.asyncLoggerRingBufferSize=262144 6 | log4j2.asyncLoggerWaitStrategy=Sleep 7 | AsyncLogger.SynchronizeEnqueueWhenQueueFull=false 8 | log4j2.asyncQueueFullPolicy=Discard 9 | log4j2.discardThreshold=OFF 10 | -------------------------------------------------------------------------------- /brcc-go-sdk/base_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: Malin Xie 3 | * @Description: 4 | * @Date: 2021-06-10 20:53:33 5 | */ 6 | package rcc 7 | 8 | const ( 9 | TestConfFile = "./testdata/rcc.toml" 10 | 11 | // mapping from confFile content 12 | projectName = "brcc-go-sdk" 13 | envName = "dev" 14 | versionName = "1.0" 15 | apiPassword = "123456" 16 | serverUrl = "localhost" 17 | enableCallback = true 18 | callbackInterval = 1 19 | requestTimeout = 2 20 | enableCache = true 21 | 22 | // Mock info 23 | AuthAPI = "api/auth" //Post 24 | Token = "f4fef7cd9fd143eb8c806c0506dd6ffd" 25 | 26 | EnvAPI = "api/environment" //Get 27 | EnvironmentId = 52 28 | 29 | VerionAPI = "api/version" //Get 30 | VersionId = 53 31 | CheckSum = "ace54738-9362-40c4-8eeb-98717a802aac" 32 | 33 | ItemAPI = "api/item" //Get 34 | EmptyItem = "[]" 35 | OneItem = `[{"key":"mykey", "value":"myvalue"}]` 36 | C_Key1 = "mykey" 37 | C_Value1 = "myvalue" 38 | 39 | GroupId = 481 40 | ) 41 | -------------------------------------------------------------------------------- /brcc-go-sdk/cache.go: -------------------------------------------------------------------------------- 1 | package rcc 2 | 3 | import ( 4 | "encoding/gob" 5 | "os" 6 | "sync" 7 | ) 8 | 9 | // 配置kv内存结构 10 | type Cache struct { 11 | kv sync.Map 12 | } 13 | 14 | func newCache() *Cache { 15 | return &Cache{ 16 | kv: sync.Map{}, 17 | } 18 | } 19 | 20 | func (c *Cache) set(key, val string) { 21 | c.kv.Store(key, val) 22 | } 23 | 24 | func (c *Cache) get(key string) (string, bool) { 25 | if val, ok := c.kv.Load(key); ok { 26 | if ret, ok := val.(string); ok { 27 | return ret, true 28 | } 29 | } 30 | return "", false 31 | } 32 | 33 | func (c *Cache) delete(key string) { 34 | c.kv.Delete(key) 35 | } 36 | 37 | func (c *Cache) dump() map[string]string { 38 | var ret = map[string]string{} 39 | c.kv.Range(func(key, val interface{}) bool { 40 | k, _ := key.(string) 41 | v, _ := val.(string) 42 | ret[k] = v 43 | 44 | return true 45 | }) 46 | return ret 47 | } 48 | 49 | func (c *Cache) store(name string) error { 50 | 51 | f, err := os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0755) 52 | if err != nil { 53 | return err 54 | } 55 | defer f.Close() 56 | 57 | var dumps = map[string]string{} 58 | dumps = c.dump() 59 | return gob.NewEncoder(f).Encode(&dumps) 60 | } 61 | 62 | func (c *Cache) load(name string) error { 63 | 64 | f, err := os.OpenFile(name, os.O_RDONLY, 0755) 65 | if err != nil { 66 | return err 67 | } 68 | defer f.Close() 69 | 70 | var dumps = map[string]string{} 71 | 72 | if err := gob.NewDecoder(f).Decode(&dumps); err != nil { 73 | return err 74 | } 75 | 76 | for k, v := range dumps { 77 | c.set(k, v) 78 | } 79 | 80 | return nil 81 | } 82 | -------------------------------------------------------------------------------- /brcc-go-sdk/cache_test.go: -------------------------------------------------------------------------------- 1 | package rcc 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | . "github.com/smartystreets/goconvey/convey" 8 | ) 9 | 10 | const testfile = "./testdata/cache.data" 11 | 12 | // tempfile returns a temporary file path. 13 | func Tempfile() error { 14 | _, err := os.Create(testfile) 15 | return err 16 | } 17 | 18 | // DeleteTempFile delete temp file for test 19 | func DeleteTempFile() error { 20 | err := os.Remove(testfile) 21 | if err != nil { 22 | return err 23 | } 24 | return nil 25 | } 26 | 27 | // TestCacheLoadStore test load and store from local test file 28 | func TestCacheLoadStore(t *testing.T) { 29 | Tempfile() 30 | defer DeleteTempFile() 31 | 32 | Convey("test cache store and load", t, func() { 33 | cache := newCache() 34 | cache.set("key1", "value1") 35 | 36 | err := cache.store(testfile) 37 | So(err, ShouldBeNil) 38 | 39 | cache2 := newCache() 40 | err = cache2.load(testfile) 41 | So(err, ShouldBeNil) 42 | 43 | v1, b1 := cache.get("key1") 44 | v2, b2 := cache2.get("key1") 45 | So(v1, ShouldEqual, v2) 46 | So(b1, ShouldEqual, b2) 47 | }) 48 | 49 | } 50 | -------------------------------------------------------------------------------- /brcc-go-sdk/change.go: -------------------------------------------------------------------------------- 1 | package rcc 2 | 3 | // ChangeType for a key 4 | type ChangeType int 5 | 6 | const ( 7 | // ADD a new value 8 | ADD ChangeType = iota 9 | // MODIFY a old value 10 | MODIFY 11 | // DELETE ... 12 | DELETE 13 | ) 14 | 15 | // String 16 | func (c ChangeType) String() string { 17 | switch c { 18 | case ADD: 19 | return "ADD" 20 | case MODIFY: 21 | return "MODIFY" 22 | case DELETE: 23 | return "DELETE" 24 | } 25 | 26 | return "UNKNOW" 27 | } 28 | 29 | // ChangeEvent change event 30 | type ChangeEvent struct { 31 | Changes map[string]*Change 32 | } 33 | 34 | // Change represent a single key change 35 | type Change struct { 36 | OldValue string 37 | NewValue string 38 | ChangeType ChangeType 39 | } 40 | 41 | func makeDeleteChange(_, value string) *Change { 42 | return &Change{ 43 | ChangeType: DELETE, 44 | OldValue: value, 45 | } 46 | } 47 | 48 | func makeModifyChange(_, oldValue, newValue string) *Change { 49 | return &Change{ 50 | ChangeType: MODIFY, 51 | OldValue: oldValue, 52 | NewValue: newValue, 53 | } 54 | } 55 | 56 | func makeAddChange(_, value string) *Change { 57 | return &Change{ 58 | ChangeType: ADD, 59 | NewValue: value, 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /brcc-go-sdk/example_client_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | @Time : 2021-06-11 3 | @Author : xiemalin 4 | */ 5 | package rcc 6 | 7 | import "fmt" 8 | 9 | // ExampleNewConf the example to show use client to connect server 10 | func ExampleClient() { 11 | 12 | client, err := NewClientWithConfFile(TestConfFile) 13 | if err != nil { 14 | return 15 | } 16 | 17 | err = client.Start() 18 | if err != nil { 19 | return 20 | } 21 | defer client.Stop() 22 | 23 | keys := client.GetAllKeys() 24 | for _, v := range keys { 25 | client.GetValue(v, "DefaultValue") 26 | } 27 | 28 | s := struct { 29 | Key string `rcc:"mykey"` 30 | }{} 31 | client.Bind(&s) 32 | 33 | } 34 | 35 | // ExampleClient_Watch he example to show use Watch function 36 | func ExampleClient_Watch() { 37 | 38 | client, err := NewClientWithConfFile(TestConfFile) 39 | if err != nil { 40 | return 41 | } 42 | 43 | err = client.Start() 44 | if err != nil { 45 | return 46 | } 47 | defer client.Stop() 48 | 49 | // define update callback for Watch function 50 | callback := func(ce *ChangeEvent) { 51 | // 建议defer捕获协程panic 52 | defer func() { 53 | if r := recover(); r != nil { 54 | fmt.Println("watch update callback panic") 55 | } 56 | }() 57 | 58 | for key, change := range ce.Changes { 59 | if change.ChangeType == ADD || change.ChangeType == MODIFY { 60 | fmt.Println("changed item", key, change.NewValue, change.OldValue) 61 | } 62 | } 63 | } 64 | client.Watch(callback) 65 | } 66 | -------------------------------------------------------------------------------- /brcc-go-sdk/example_rcc_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | @Time : 2021-06-11 3 | @Author : xiemalin 4 | */ 5 | 6 | package rcc 7 | 8 | import ( 9 | "context" 10 | "fmt" 11 | ) 12 | 13 | // DemoSet demo set 14 | type DemoSet struct { 15 | data map[string]string 16 | } 17 | 18 | // Update callback function while regitered in Watch method. 19 | func (d *DemoSet) Update(ce *ChangeEvent) { 20 | 21 | // 建议defer捕获协程panic 22 | defer func() { 23 | if r := recover(); r != nil { 24 | fmt.Println("watch update callback panic") 25 | } 26 | }() 27 | 28 | for key, change := range ce.Changes { 29 | if change.ChangeType == ADD || change.ChangeType == MODIFY { 30 | d.data[key] = change.NewValue 31 | } 32 | } 33 | } 34 | 35 | // Example_RCC example code to show how to use by default rcc client 36 | func Example_rcc() { 37 | 38 | conf, err := NewConf(TestConfFile) 39 | if err != nil { 40 | fmt.Printf("new conf fail, got :%v", err) 41 | return 42 | } 43 | 44 | err = StartWithConf(context.Background(), conf) 45 | if err != nil { 46 | fmt.Printf("start default cient fail, got :%v", err) 47 | return 48 | } 49 | 50 | a1 := GetValue("a1", "222") 51 | fmt.Println("get value", a1) 52 | 53 | keys := GetAllKeys() 54 | for _, key := range keys { 55 | fmt.Println("print out key", key) 56 | } 57 | 58 | d := DemoSet{data: map[string]string{}} 59 | d.data["a1"] = "a1" 60 | d.data["a2"] = "a2" 61 | 62 | // 监听变更 63 | Watch(d.Update) 64 | 65 | if err := Stop(); err != nil { 66 | fmt.Printf("Stop should return nil, got :%v", err) 67 | return 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /brcc-go-sdk/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/baidu/brcc/brcc-go-sdk 2 | 3 | go 1.14 4 | 5 | require ( 6 | github.com/BurntSushi/toml v0.3.1 7 | github.com/agiledragon/gomonkey/v2 v2.1.0 8 | github.com/pkg/errors v0.9.1 // indirect 9 | github.com/smartystreets/goconvey v1.6.4 10 | github.com/stretchr/testify v1.7.0 11 | go.uber.org/multierr v1.6.0 // indirect 12 | go.uber.org/zap v1.16.0 13 | ) 14 | -------------------------------------------------------------------------------- /brcc-go-sdk/logutil/log.go: -------------------------------------------------------------------------------- 1 | package logutil 2 | 3 | import ( 4 | "go.uber.org/zap" 5 | ) 6 | 7 | var defaultLogger *zap.Logger 8 | 9 | // initial logger struct 10 | func InitLog() { 11 | if defaultLogger == nil { 12 | defaultLogger, _ = zap.NewProduction() 13 | defer defaultLogger.Sync() 14 | } 15 | } 16 | 17 | // DefaultLogger 18 | func DefaultLogger() *zap.Logger { 19 | return defaultLogger 20 | } 21 | -------------------------------------------------------------------------------- /brcc-go-sdk/mock.goconvey: -------------------------------------------------------------------------------- 1 | -tags=-gcflags=all=-N -l -------------------------------------------------------------------------------- /brcc-go-sdk/testdata/rcc.toml: -------------------------------------------------------------------------------- 1 | projectName = "brcc-go-sdk" 2 | envName = "dev" 3 | versionName = "1.0" 4 | apiPassword = "123456" 5 | serverUrl = "localhost" 6 | enableCallback = true 7 | callbackInterval = 1 8 | requestTimeout = 2 9 | enableCache = true -------------------------------------------------------------------------------- /brcc-go-sdk/url.go: -------------------------------------------------------------------------------- 1 | package rcc 2 | 3 | import ( 4 | "fmt" 5 | "net/url" 6 | "strings" 7 | ) 8 | 9 | 10 | func httpUrl(ipOrAddr string) string { 11 | if strings.HasPrefix(ipOrAddr, "http://") || strings.HasPrefix(ipOrAddr, "https://") { 12 | return ipOrAddr 13 | } 14 | 15 | return fmt.Sprintf("http://%s", ipOrAddr) 16 | } 17 | 18 | func requestTokenUrl(conf *Conf) string { 19 | return fmt.Sprintf("%s/api/auth", 20 | httpUrl(conf.ServerUrl)) 21 | } 22 | 23 | func apiEnvironment(conf *Conf) string { 24 | return fmt.Sprintf("%s/api/environment/%s?token=%s", 25 | httpUrl(conf.ServerUrl), 26 | url.QueryEscape(conf.EnvName), 27 | url.QueryEscape(conf.Token)) 28 | } 29 | 30 | func apiVersion(conf *Conf) string { 31 | return fmt.Sprintf("%s/api/version/%s?token=%s&environmentId=%d&versionName=%s", 32 | httpUrl(conf.ServerUrl), 33 | url.QueryEscape(conf.VersionName), 34 | url.QueryEscape(conf.Token), 35 | conf.EnvId, 36 | url.QueryEscape(conf.VersionName), 37 | ) 38 | } 39 | 40 | func apiItems(conf *Conf, versionId int) string { 41 | return fmt.Sprintf("%s/api/item?token=%s&versionId=%d", 42 | httpUrl(conf.ServerUrl), 43 | url.QueryEscape(conf.Token), 44 | versionId) 45 | } 46 | -------------------------------------------------------------------------------- /brcc-sdk-starter/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.baidu.brcc.RccAutoConfig 2 | -------------------------------------------------------------------------------- /brcc-sdk/src/main/java/com/baidu/brcc/ConfigItemChangedCallable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc; 20 | 21 | import java.util.List; 22 | 23 | import com.baidu.brcc.model.ChangedConfigItem; 24 | 25 | public interface ConfigItemChangedCallable { 26 | void changed(List items); 27 | } 28 | -------------------------------------------------------------------------------- /brcc-sdk/src/main/java/com/baidu/brcc/annotation/ConfigChangeNotifer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.annotation; 20 | 21 | import java.lang.annotation.Documented; 22 | import java.lang.annotation.ElementType; 23 | import java.lang.annotation.Inherited; 24 | import java.lang.annotation.Retention; 25 | import java.lang.annotation.RetentionPolicy; 26 | import java.lang.annotation.Target; 27 | 28 | /** 29 | * Configuration changed notify annotation 30 | */ 31 | @Target({ElementType.METHOD}) 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Inherited 34 | @Documented 35 | public @interface ConfigChangeNotifer { 36 | 37 | /** 38 | * Key names to listened. 39 | */ 40 | String keys() default ""; 41 | } 42 | -------------------------------------------------------------------------------- /brcc-sdk/src/main/java/com/baidu/brcc/exception/RccException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.exception; 20 | 21 | public class RccException extends RuntimeException { 22 | 23 | public RccException() { 24 | } 25 | 26 | public RccException(String message) { 27 | super(message); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /brcc-sdk/src/main/java/com/baidu/brcc/model/ItemVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.model; 20 | 21 | public class ItemVo { 22 | 23 | // 配置key 24 | private String key; 25 | 26 | // 配置值 27 | private String value; 28 | 29 | public String getKey() { 30 | return key; 31 | } 32 | 33 | public void setKey(String key) { 34 | this.key = key; 35 | } 36 | 37 | public String getValue() { 38 | return value; 39 | } 40 | 41 | public void setValue(String value) { 42 | this.value = value; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /brcc-sdk/src/main/java/com/baidu/brcc/model/RList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.model; 20 | 21 | import java.util.List; 22 | 23 | public class RList extends R> { 24 | 25 | @Override 26 | public List getData() { 27 | return super.getData(); 28 | } 29 | 30 | @Override 31 | public void setData(List data) { 32 | super.setData(data); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /brcc-sdk/src/main/java/com/baidu/brcc/utils/ServiceNameProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.utils; 20 | 21 | import java.util.List; 22 | 23 | public interface ServiceNameProvider { 24 | 25 | /** 26 | * 返回提供服务地址 27 | * 28 | * @return 29 | */ 30 | List getServiceNames(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /brcc-sdk/src/test/java/com/baidu/brcc/exception/RccExceptionTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.exception; 20 | 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | public class RccExceptionTest { 25 | 26 | @Test 27 | public void test() { 28 | RccException exception = new RccException(); 29 | RccException exception1 = new RccException("rcc exception"); 30 | Assert.assertNotNull(exception); 31 | Assert.assertNotNull(exception1); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /brcc-sdk/src/test/java/com/baidu/brcc/model/ChangedConfigItemTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.model; 20 | 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | public class ChangedConfigItemTest { 25 | @Test 26 | public void test() { 27 | ChangedConfigItem vo = new ChangedConfigItem(); 28 | vo.setKey("1"); 29 | vo.setNewValue("1"); 30 | vo.setOldValue("2"); 31 | 32 | Assert.assertEquals("1", vo.getKey()); 33 | Assert.assertEquals("1", vo.getNewValue()); 34 | Assert.assertEquals("2", vo.getOldValue()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /brcc-sdk/src/test/java/com/baidu/brcc/model/EnvVoTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.model; 20 | 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | public class EnvVoTest { 25 | @Test 26 | public void test() { 27 | EnvVo vo = new EnvVo(); 28 | vo.setProjectId(1L); 29 | vo.setEnvironmentId(1L); 30 | vo.setEnvironmentName("1"); 31 | 32 | Assert.assertEquals(1, vo.getProjectId().intValue()); 33 | Assert.assertEquals(1, vo.getEnvironmentId().intValue()); 34 | Assert.assertEquals("1", vo.getEnvironmentName()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /brcc-sdk/src/test/java/com/baidu/brcc/model/ItemVoTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Baidu Inc. All rights reserved. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package com.baidu.brcc.model; 20 | 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | public class ItemVoTest { 25 | @Test 26 | public void test() { 27 | ItemVo vo = new ItemVo(); 28 | vo.setKey("key"); 29 | vo.setValue("value"); 30 | 31 | Assert.assertEquals("key", vo.getKey()); 32 | Assert.assertEquals("value", vo.getValue()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /brcc-server/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | redis: 2 | host: 127.0.0.1 3 | port: 6379 4 | password: 123456 5 | db: 6 | host: 127.0.0.1 7 | port: 3306 8 | username: xxx 9 | password: xxx 10 | -------------------------------------------------------------------------------- /brcc-server/src/main/resources/application-online.yml: -------------------------------------------------------------------------------- 1 | redis: 2 | host: 127.0.0.1 3 | port: 6379 4 | password: 123456 5 | db: 6 | host: 127.0.0.1 7 | port: 3306 8 | username: xxx 9 | password: xxx 10 | -------------------------------------------------------------------------------- /brcc-server/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | redis: 2 | host: 127.0.0.1 3 | port: 6379 4 | password: 123456 5 | db: 6 | host: 127.0.0.1 7 | port: 3306 8 | username: xxx 9 | password: xxx 10 | -------------------------------------------------------------------------------- /brcc-server/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | rcc: 2 | noauths: /,/api/**/*,/index.html,/check,/console/user/login,/user/loginByUuap,/rpc/ExtConfigServerService,/img/**/*,/js/**/*,/css/**/*,/swagger-ui.html,/webjars/**,/v2/**,/swagger-resources/**,/csrf 3 | user: 4 | type: 5 | default: 1 6 | spring: 7 | jackson: 8 | date-format: yyyy-MM-dd HH:mm:ss 9 | time-zone: GMT+8 10 | default-property-inclusion: NON_NULL 11 | resources: 12 | static-locations: classpath:/dist,classpath:/static,classpath:/public,classpath:/resources,classpath:/META-INF/resources 13 | datasource: 14 | driver-class-name: com.mysql.jdbc.Driver 15 | hikari: 16 | allow-pool-suspension: false 17 | connection-timeout: 30000 18 | idle-timeout: 600000 19 | max-lifetime: 1200000 20 | name: rcc-datasource 21 | type: com.zaxxer.hikari.HikariDataSource 22 | url: jdbc:mysql://${db.host}:${db.port}/brcc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false 23 | username: ${db.username} 24 | password: ${db.password} 25 | redis: 26 | host: ${redis.host} 27 | port: ${redis.port} 28 | mybatis: 29 | configuration: 30 | default-statement-timeout: 60 31 | mapper-locations: classpath*:mybatis/**/*.xml 32 | type-aliases-package: com.baidu.brcc.domain 33 | management: 34 | endpoints: 35 | web: 36 | exposure: 37 | include: '*' 38 | jmx: 39 | exposure: 40 | include: '*' 41 | metrics: 42 | distribution: 43 | percentiles-histogram.http.server.requests: false 44 | 45 | -------------------------------------------------------------------------------- /brcc-server/src/main/resources/log4j2.component.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 Baidu, Inc. All Rights Reserved. 3 | # 4 | log4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector 5 | log4j2.asyncLoggerRingBufferSize=262144 6 | log4j2.asyncLoggerWaitStrategy=Sleep 7 | AsyncLogger.SynchronizeEnqueueWhenQueueFull=false 8 | log4j2.asyncQueueFullPolicy=Discard 9 | log4j2.discardThreshold=OFF 10 | log4j2.formatMsgNoLookups=true -------------------------------------------------------------------------------- /compile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | mvn clean package -DskipTests -Dgpg.skip 3 | -------------------------------------------------------------------------------- /doc/database/data.sql: -------------------------------------------------------------------------------- 1 | use brcc; 2 | -- 插入admin管理员,密码为默认为admin 3 | INSERT INTO `rcc_user` (`name`, `password`, `status`, `role`, `update_time`, `api_password`, `create_time`, `type`, `token` ) VALUES ('admin', '21232f297a57a5a743894a0e4a801fc3', '0', '3', '2021-01-07 15:53:55', '', '2021-01-07 15:53:55', '0', '5af6f454-bd8d-414e-badf-02baeed8c0e9'); 4 | -------------------------------------------------------------------------------- /doc/database/schema.sql: -------------------------------------------------------------------------------- 1 | drop database if exists brcc; 2 | drop user 'brcc'@'%'; 3 | create database brcc default character set utf8mb4 collate utf8mb4_unicode_ci; 4 | use brcc; 5 | create user 'brcc'@'%' identified by 'brcc123456'; 6 | grant all privileges on brcc.* to 'brcc'@'%'; 7 | flush privileges; 8 | -------------------------------------------------------------------------------- /doc/deploy-guide.md: -------------------------------------------------------------------------------- 1 | # 一、准备工作 2 | 配置中心服务端依赖jdk、mysql数据库和Redis。 3 | ## 1.1 Java 4 | 由于配置中心服务端采用了大量java8的新特性, 所以需要在本地安装java1.8+。 5 | 6 | 可以通过以下命令查看安装的jdk版本 7 | 8 | ```bazaar 9 | java -version 10 | ``` 11 | 12 | 样例输出: 13 | 14 | ```bazaar 15 | java version "1.8.0_261" 16 | Java(TM) SE Runtime Environment (build 1.8.0_261-b12) 17 | Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode) 18 | ``` 19 | 20 | ## 1.2 Mysql 21 | 22 | + 版本要求 5.6+ 23 | 24 | ## 1.3 Redis 25 | 26 | + 版本要求 3.2+ 27 | 28 | ## 1.4 编译服务端运行包 29 | 30 | 1. 下载代码库 31 | 2. 编译(***依赖maven3.3.9+***)执行如下命令: 32 | cd 到项目的根目录后执行 sh compile.sh。 33 | 34 | # 二、 安装步骤 35 | 36 | ## 2.1 创建数据库 37 | 38 | + 创建数据库及用户 39 | 40 | 下面以MySQL原生客户端为例: 41 | ```bazaar 42 | source doc/database/schema.sql 43 | ``` 44 | 45 | + 创建数据库表 46 | 47 | 48 | 下面以MySQL原生客户端为例: 49 | ```bazaar 50 | source doc/database/tables.sql 51 | ``` 52 | 53 | + 插入初始化数据 54 | ```bazaar 55 | source doc/database/data.sql 56 | ``` 57 | 58 | ## 2.2 安装redis 59 | 60 | [redis下载](https://redis.io/download/) 61 | 62 | 63 | ## 2.3 编译 64 | 65 | ```bazaar 66 | 1. cd到项目根目录 67 | 2. 执行:sh compile.sh 68 | 69 | 注意: 观察编译有无报错 70 | ``` 71 | 72 | ## 2.4 运行 73 | 74 | ```bazaar 75 | 在项目根目录下,编辑start.sh执行脚本,分别指定好环境参数 76 | SERVER_PORT=web服务监听端口 77 | REDIS_HOST=Redis服务地址 78 | REDIS_PORT=Redis服务端口 79 | DB_HOST=数据库地址 80 | DB_PORT=数据库端口 81 | DB_USERNAME=数据库用户名 82 | DB_PASSWORD=数据库密码 83 | 84 | 保存后执行: 85 | sh start.sh 86 | 87 | ``` 88 | 管理端访问入口 89 | http://ip:port 其中IP为服务启动的IP,Port为web服务监听端口,例如 http://localhost:8080/ 90 | 91 | # 三、 容器化部署 92 | - [制作Docker镜像](./docker-guide.md) 93 | 94 | - [Kubernetes](./k8s-guide.md) -------------------------------------------------------------------------------- /doc/docker-deploy-guide.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/docker-deploy-guide.md -------------------------------------------------------------------------------- /doc/docker-guide.md: -------------------------------------------------------------------------------- 1 | # 制作镜像 2 | 文件列表 3 | - build.sh 制作镜像脚本 4 | - Dockerfile 5 | - start.sh 启动服务脚本 6 | 7 | 可以按照自己配置去build.sh中修改版本号以及镜像位置 8 | 9 | 然后执行如下命令即可完成镜像制作 10 | 11 | cd docker & sh build.sh 12 | 13 | -------------------------------------------------------------------------------- /doc/img/account-create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/account-create.png -------------------------------------------------------------------------------- /doc/img/account-create_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/account-create_en.png -------------------------------------------------------------------------------- /doc/img/account-entry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/account-entry.png -------------------------------------------------------------------------------- /doc/img/account-entry_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/account-entry_en.png -------------------------------------------------------------------------------- /doc/img/account-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/account-list.png -------------------------------------------------------------------------------- /doc/img/account-list_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/account-list_en.png -------------------------------------------------------------------------------- /doc/img/arch.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/arch.JPG -------------------------------------------------------------------------------- /doc/img/brcc-install-manage-enter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/brcc-install-manage-enter.png -------------------------------------------------------------------------------- /doc/img/brcc-install-manage-enter_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/brcc-install-manage-enter_en.png -------------------------------------------------------------------------------- /doc/img/brcc-instance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/brcc-instance.png -------------------------------------------------------------------------------- /doc/img/brcc-instance_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/brcc-instance_en.png -------------------------------------------------------------------------------- /doc/img/config-batch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/config-batch.png -------------------------------------------------------------------------------- /doc/img/config-batch_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/config-batch_en.png -------------------------------------------------------------------------------- /doc/img/config-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/config-search.png -------------------------------------------------------------------------------- /doc/img/config-search_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/config-search_en.png -------------------------------------------------------------------------------- /doc/img/config-single.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/config-single.png -------------------------------------------------------------------------------- /doc/img/config-single_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/config-single_en.png -------------------------------------------------------------------------------- /doc/img/contact.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/contact.jpg -------------------------------------------------------------------------------- /doc/img/environment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/environment.png -------------------------------------------------------------------------------- /doc/img/environment_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/environment_en.png -------------------------------------------------------------------------------- /doc/img/gray-rule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/gray-rule.png -------------------------------------------------------------------------------- /doc/img/gray-rule_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/gray-rule_en.png -------------------------------------------------------------------------------- /doc/img/gray-version.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/gray-version.png -------------------------------------------------------------------------------- /doc/img/gray-version_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/gray-version_en.png -------------------------------------------------------------------------------- /doc/img/group-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/group-list.png -------------------------------------------------------------------------------- /doc/img/group-list_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/group-list_en.png -------------------------------------------------------------------------------- /doc/img/import-export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/import-export.png -------------------------------------------------------------------------------- /doc/img/import-export_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/import-export_en.png -------------------------------------------------------------------------------- /doc/img/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/login.png -------------------------------------------------------------------------------- /doc/img/login_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/login_en.png -------------------------------------------------------------------------------- /doc/img/product-member.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/product-member.png -------------------------------------------------------------------------------- /doc/img/product-member_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/product-member_en.png -------------------------------------------------------------------------------- /doc/img/product_create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/product_create.png -------------------------------------------------------------------------------- /doc/img/product_create_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/product_create_en.png -------------------------------------------------------------------------------- /doc/img/product_entry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/product_entry.png -------------------------------------------------------------------------------- /doc/img/product_entry_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/product_entry_en.png -------------------------------------------------------------------------------- /doc/img/product_update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/product_update.png -------------------------------------------------------------------------------- /doc/img/product_update_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/product_update_en.png -------------------------------------------------------------------------------- /doc/img/project-manage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/project-manage.png -------------------------------------------------------------------------------- /doc/img/project-manage_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/project-manage_en.png -------------------------------------------------------------------------------- /doc/img/project-member-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/project-member-edit.png -------------------------------------------------------------------------------- /doc/img/project-member-edit_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/project-member-edit_en.png -------------------------------------------------------------------------------- /doc/img/project-member-entry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/project-member-entry.png -------------------------------------------------------------------------------- /doc/img/project-member-entry_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/project-member-entry_en.png -------------------------------------------------------------------------------- /doc/img/quick-navigation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/quick-navigation.png -------------------------------------------------------------------------------- /doc/img/quick-navigation_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/quick-navigation_en.png -------------------------------------------------------------------------------- /doc/img/reset-apipassword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/reset-apipassword.png -------------------------------------------------------------------------------- /doc/img/rest-pwd-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/rest-pwd-1.png -------------------------------------------------------------------------------- /doc/img/rest-pwd-1_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/rest-pwd-1_en.png -------------------------------------------------------------------------------- /doc/img/rest-pwd-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/rest-pwd-2.png -------------------------------------------------------------------------------- /doc/img/rest-pwd-2_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/rest-pwd-2_en.png -------------------------------------------------------------------------------- /doc/img/version-change-log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/version-change-log.png -------------------------------------------------------------------------------- /doc/img/version-change-log_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/version-change-log_en.png -------------------------------------------------------------------------------- /doc/img/version-copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/version-copy.png -------------------------------------------------------------------------------- /doc/img/version-copy_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/version-copy_en.png -------------------------------------------------------------------------------- /doc/img/version-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/version-list.png -------------------------------------------------------------------------------- /doc/img/version-list_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/version-list_en.png -------------------------------------------------------------------------------- /doc/img/version-push.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/version-push.png -------------------------------------------------------------------------------- /doc/img/version-push_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/brcc/8c66fd2ff4fb4bb1ed8060b08f2fbd7144b16d1a/doc/img/version-push_en.png -------------------------------------------------------------------------------- /doc/k8s-guide.md: -------------------------------------------------------------------------------- 1 | # 部署 2 | 文件列表 3 | - brcc-config.yaml 项目配置 4 | - brcc-namespace.yaml 创建ns 5 | - brcc-server.yaml 部署pod 6 | - brcc-server.yaml 配置SVC 7 | 8 | 修改完配置,可以直接执行如下命令,即可完成部署 9 | cd k8s & sh start.sh -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jre-alpine 2 | LABEL maintainer="fkzhao@outlook.com" 3 | 4 | RUN echo "export TZ='Asia/Shanghai'" >> /root/.bashrc && \ 5 | echo "Asia/shanghai" > /etc/timezone && \ 6 | ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ 7 | 8 | USER root 9 | 10 | ARG module 11 | ENV ENV_MODULE=${module} 12 | CMD mkdir -p /home/work 13 | 14 | ADD ${module} /home/work/${module} 15 | 16 | WORKDIR /home/work/${module} 17 | RUN chmod +x /home/work/${module}/bin/start.sh 18 | 19 | ENTRYPOINT sh /home/work/${ENV_MODULE}/bin/start.sh 20 | -------------------------------------------------------------------------------- /docker/start.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | app="brcc-server" 3 | APPLICATION=/home/work/${app}/lib/${app}.jar 4 | MAX_MEMORY=1024M 5 | 6 | if [ "$SERVER_PORT" != "" ]; then 7 | JAVA_OPT="$JAVA_OPT -Dserver.port=$SERVER_PORT" 8 | fi 9 | if [ "$REDIS_HOST" != "" ]; then 10 | JAVA_OPT="$JAVA_OPT -Dredis.host=$REDIS_HOST" 11 | fi 12 | if [ "$REDIS_PASSWORD" != "" ]; then 13 | JAVA_OPT="$JAVA_OPT -Dspring.redis.password=$REDIS_PASSWORD" 14 | fi 15 | if [ "$DB_HOST" != "" ]; then 16 | JAVA_OPT="$JAVA_OPT -Ddb.host=$DB_HOST" 17 | fi 18 | if [ "$DB_PORT" != "" ]; then 19 | JAVA_OPT="$JAVA_OPT -Ddb.port=$DB_PORT" 20 | fi 21 | if [ "$DB_USERNAME" != "" ]; then 22 | JAVA_OPT="$JAVA_OPT -Ddb.username=$DB_USERNAME" 23 | fi 24 | if [ "$DB_PASSWORD" != "" ]; then 25 | JAVA_OPT="$JAVA_OPT -Ddb.password=$DB_PASSWORD" 26 | fi 27 | 28 | # shellcheck disable=SC2086 29 | java -Xmx${MAX_MEMORY} -jar ${JAVA_OPT} ${APPLICATION} -------------------------------------------------------------------------------- /k8s/brcc-config.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: brcc-config 5 | namespace: brcc 6 | data: 7 | server_port: 8080 8 | redis_host: '127.0.0.1' 9 | redis_post: 6379 10 | # redis_password: '' 这个可选根据实际环境选择 11 | mysql_host: '127.0.0.1' 12 | mysql_port: 3306 13 | mysql_username: 'root' 14 | mysql_password: 'password' 15 | 16 | 17 | -------------------------------------------------------------------------------- /k8s/brcc-namespace.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: brcc 5 | labels: 6 | name: brcc 7 | -------------------------------------------------------------------------------- /k8s/brcc-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: brcc-service 5 | labels: 6 | app: brcc 7 | module: brcc-server 8 | spec: 9 | type: NodePort 10 | ports: 11 | - port: 8080 12 | protocol: TCP 13 | nodePort: 8080 14 | name: http 15 | selector: 16 | app: brcc 17 | module: brcc-server -------------------------------------------------------------------------------- /k8s/start.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | kubectl apply -f brcc-namespace.yaml 3 | kubectl apply -f brcc-config.yaml 4 | kubectl apply -f brcc-server.yaml 5 | kubectl apply -f brcc-service.yaml 6 | 7 | -------------------------------------------------------------------------------- /k8s/stop.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | kubectl delete -f brcc-server.yaml 3 | kubectl delete -f brcc-config.yaml 4 | kubectl delete -f brcc-service.yaml 5 | kubectl delete -f brcc-namespace.yaml 6 | 7 | -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | JAVA_FILE=./brcc-server/target/brcc-server.jar 4 | PID=$(jps -ml | grep "$JAVA_FILE" | awk '{print $1}') 5 | if [ "$PID" != "" ] ; then 6 | echo "will kill the pid $PID" 7 | kill -9 $PID; 8 | fi 9 | sleep 5 10 | 11 | # set your web port 12 | # SERVER_PORT=8080 13 | 14 | # SET YOUR REDIS ENVIRONMENT 15 | # REDIS_HOST=x.x.x.x 16 | # REDIS_PORT=6379 17 | # REDIS_PASSWORD=xxx 18 | 19 | # SET YOUR MYSQL ENVIRONMENT 20 | # DB_HOST=x.x.x.x 21 | # DB_PORT=3306 22 | # DB_USERNAME=xxx 23 | # DB_PASSWORD=xxx 24 | 25 | if [ "$SERVER_PORT" != "" ]; then 26 | JAVA_OPT="$JAVA_OPT -Dserver.port=$SERVER_PORT" 27 | fi 28 | if [ "$REDIS_HOST" != "" ]; then 29 | JAVA_OPT="$JAVA_OPT -Dredis.host=$REDIS_HOST" 30 | fi 31 | if [ "$REDIS_PASSWORD" != "" ]; then 32 | JAVA_OPT="$JAVA_OPT -Dspring.redis.password=$REDIS_PASSWORD" 33 | fi 34 | if [ "$REDIS_PORT" != "" ]; then 35 | JAVA_OPT="$JAVA_OPT -Dredis.port=$REDIS_PORT" 36 | fi 37 | if [ "$REDIS_PASSWORD" != "" ]; then 38 | JAVA_OPT="$JAVA_OPT -Dredis.password=$REDIS_PASSWORD" 39 | fi 40 | if [ "$DB_HOST" != "" ]; then 41 | JAVA_OPT="$JAVA_OPT -Ddb.host=$DB_HOST" 42 | fi 43 | if [ "$DB_PORT" != "" ]; then 44 | JAVA_OPT="$JAVA_OPT -Ddb.port=$DB_PORT" 45 | fi 46 | if [ "$DB_USERNAME" != "" ]; then 47 | JAVA_OPT="$JAVA_OPT -Ddb.username=$DB_USERNAME" 48 | fi 49 | if [ "$DB_PASSWORD" != "" ]; then 50 | JAVA_OPT="$JAVA_OPT -Ddb.password=$DB_PASSWORD" 51 | fi 52 | nohup java -jar $JAVA_OPT $JAVA_FILE 1>/dev/null 2>&1 & 53 | --------------------------------------------------------------------------------