Back to projects

Backend Case Study

Case Study

Enterprise System Practice

一个企业级业务系统开发经历的去敏案例,重点展示后端接口、业务流程、数据处理、设备交互流程和稳定性意识。

Java
Spring Boot
MyBatis
SQL
Business Flow
Debugging

Architecture Overview

Layer 01

User Operation 触发业务动作或设备相关流程。

Layer 02

API Layer 校验参数、识别用户操作意图并返回稳定响应。

Layer 03

Business Service 处理状态流转、数据转换和异常分支。

Layer 04

Data Layer 执行查询与更新,并保留必要的排查信息。

API Example

POST
/api/business/process

示例接口只表达通用业务流程,不包含真实系统名称、接口路径或字段。

POST /api/business/process requestjson
{
  "recordId": "example-record-id",
  "action": "SUBMIT",
  "operatorNote": "checked"
}
response.jsonjson
{
  "success": true,
  "status": "PROCESSING",
  "message": "Business flow accepted"
}

Data Model

BusinessRecord

  • id
  • status
  • ownerId
  • createdAt
  • updatedAt

Relations

belongs to a business flow

ProcessLog

  • id
  • recordId
  • action
  • result
  • createdAt

Relations

records state changes and debugging context

ExternalTask

  • id
  • recordId
  • type
  • status
  • errorMessage

Relations

tracks external or device-related work

Deployment Notes

  • Keep environment-specific config outside source code.
  • Use structured logs around key state changes and external calls.
  • Avoid exposing internal identifiers or sensitive fields in public examples.
  • Document known failure states so support and engineering teams can debug faster.

Engineering Decisions

Describe capability without exposing internals

The portfolio version keeps the engineering lessons while removing company names, business details, real endpoints, and schema fields.

Make state changes traceable

Business flow bugs are easier to locate when each important transition has clear logs and a stable status model.

Optimize for maintainable interfaces

The backend response should help frontend users understand what happened without leaking implementation details.

项目背景

企业系统的难点通常不在单个接口,而在业务流程、历史数据、异常状态、外部设备或服务协作,以及上线后的可维护性。这个案例只保留工程能力表达,不包含公司、客户、内部系统或敏感业务信息。

解决的问题

  • 业务流程长,接口之间存在状态流转和异常分支。
  • 数据处理需要兼顾准确性、可追踪性和用户操作体验。
  • 设备或外部流程存在失败、超时和重复提交等稳定性问题。

核心功能

  • 按业务流程拆分后端接口和服务职责。
  • 使用 MyBatis 和 SQL 完成查询、更新和数据处理。
  • 围绕异常状态补充日志、错误提示和排查线索。
  • 配合前端和业务反馈优化接口响应与交互流程。

技术架构

  • Spring Boot 提供后端接口和业务服务层。
  • MyBatis 管理 SQL 映射和数据访问逻辑。
  • 业务流程通过明确状态字段和服务方法推进。
  • 日志记录关键输入、处理结果和异常上下文。

技术难点

  • 真实业务流程中异常分支多,单纯按正常路径开发容易遗漏问题。
  • 数据处理既要满足业务结果,也要方便后续定位问题。
  • 外部或设备相关流程需要考虑失败、超时和重复操作。

我的解决方案

  • 把业务流程拆成明确状态,并为关键状态变化记录日志。
  • 用统一错误信息和异常处理减少前后端联调成本。
  • 对外部流程补充超时、重试边界和可追踪的失败原因。

Evidence to Add

Sanitized business flow diagram
API contract examples
State transition notes
Debugging checklist
Public technical retrospective

下一步计划

  • 继续总结可公开的业务流程建模经验。
  • 沉淀企业系统接口设计 checklist。
  • 把真实问题转化成不含敏感信息的技术复盘。