[Studio] feat: add core common foundation module with unified response, base entity, enums and global exception handling#455
Open
zhaohai666 wants to merge 3 commits into
Conversation
zhaohai666
force-pushed
the
feature/studio-common-foundation
branch
from
July 18, 2026 03:57
44d4886 to
d7e7e26
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Title
[studio] feat: add core common foundation module with unified response, base entity, enums and global exception handlingOverview
This module serves as the foundational common component of the project, delivering standardized response wrappers (
Result/PageResult), base entityBaseEntity, 16 business enumerations, global exception handling logic (BusinessException+GlobalExceptionHandler), CORS cross-origin setup and web interceptor configuration. All page-related PRs depend on this module.Source Code Files (10 files total)
StudioApplication.java— Spring Boot application entry pointcommon/config/CorsConfig.java— CORS cross-origin configuration allowing all originscommon/config/WebConfig.java— Web interceptor configurationcommon/domain/BaseEntity.java— Base entity withid,createdAtandupdatedAtfieldscommon/domain/PageResult.java— Pagination response wrapper with static factory methodsof()andempty()common/domain/Result.java— Unified HTTP response wrapper with static factory methodsok()anderror()common/domain/enums/*.java— 16 business enums:ClusterStatus, BrokerRole, ClientType, ConsumerStatus, MessageType, AlertLevel, AlertStatus, AlertMetric, AuditOperation, AuditResult, DataSourceType, InstanceStatus, NameServerStatus, ProxyStatus, TopicStatus, QueueType
common/exception/BusinessException.java— Custom business runtime exception carrying error code and messagecommon/exception/GlobalExceptionHandler.java— Global exception handler annotated with@RestControllerAdviceTest Coverage
8 test files with total 632 lines of test code:
ok()with data/empty/null payload;error()with various error codes; complex object serializationof(), empty page viaempty(), pagination parameter validation, edge casesid/createdAt/updatedAt, default values,equals()&hashCode()values()andvalueOf()for one business enumRuntimeExceptioninheritance,getCode()&getMessage()@Configurationannotation, existence of CorsFilter bean, wildcard origin access policy@Configurationannotation and implementation ofWebMvcConfigurerRepository Naming Convention Requirement
All PR and Issue titles associated with this project must start with the
[studio]prefix.This prefix enables community members to quickly identify, filter and track all studio-related work items.
Standard Title Template