运营平台系统设计
2023-03-14 09:03:20 0 举报
运营平台系统基于DDD模式架构
作者其他创作
大纲/内容
获取文件发布目标配置信息
MailConfig
+sender: String+receivers: List<String>+ccList: List<String>+bccList: List<String>+privateKey: String
Data
TaskFacade
- taskApi:SendingTaskApi
SendingType
ImmediatelyCron
HTTP
OperationServiceImpl
SourceRepositoryImpl
Dubbo
Nginx
Platform
OMP(20)
文件是否需要重新调整:即拆分和合并。业务实现细节在领域对象的adjustment方法中。
AmazonTarget
- amazonClient: AmazonClient
AmazonConfig
+url: String+account: String+password: String+path
目标服务器
ResourceService
Key<T extend String>
BizSourceService
+ type(): BizType+ customers():List<Customer>
SendingTaskFeign
+ newTask(request): response+ asyncSend(request): response
Mosquitto
Task
HTVIPServiceImpl
- source: HTVIPSource-repository: SoureRepository
PlatformRespCode
+ platform():Platform+ module():Module+ level():Level+ category():Category
TaskAPI
Status
ReadUnreadSentFailure
MsgId
+id: String
StockOptionSource
- srcFTPs: List<FTP>
+ adjustment(List<DataFile>):List<DataFile>
DBMsgHandler
TaskService
ConfigRepository
Serializable
考虑到文件发送等任务都是比较耗时,并且比较消耗IO的服务,所以有必要将Task服务作为独立的模块实施。也方便系统上线后,依据具体运行状态,动态调配资源
AbstractTarget
-resourceFacade: ResourceFacade-configFacade: ConfigFacade
+doSend(String content): void+doSend(List<File>):void
ID<T extend Long>
Container3-2
MongoDB
RPC
Passport
DataFileService
任务服务
OperationAPI
+task(List<NewSendTaskDto>): List<SendingTaskDto>+task(NewSendTaskDto):SendingTaskDto+asyncSend(NewSendTaskDto): SendingTaskDto
SendingTaskServiceImpl
-resourceFacade: ResoureFacade-repository: SendingTaskRepository
OverseasServiceImpl
-source: OverseasSource-repository: SoureRepository
OperationRepository
SendingConfig
-groupId: String-groupName: String-enableRSA: boolean-hasProior: boolean-mailConfig: ChannelConfig-ftpConfig: ChannelConfig-sztongConfig: ChannelConfig-amazonConfig: ChannelConfig
MsgRepository
+ findUnreadMsg(identity):List<Message>
OnlineInfo
+ time:Long+ state:OnlineState
依赖
Operation
Facade
MinIOFileStorage
MongoTemplate
ResourceRepository
MinIO 对象存储
网关
WebResult<T>
+ errorCode: Integer+ errorMessage: String+ timestamp: Long+ data: T
SettlementServiceImpl
-source: SettlementSource-repository: SoureRepository
ResponseCode
+ code():int+ msg():String
ResourceServiceImpl
ConfigServiceImpl
+ repository:ConfigRepository
Container1-1
ResourceType
DirectoryFile
TargetType
FTPEmailSZTongAmazon
PendingMsg
+publishTime: Long
+isCronTime(): boolean
Unique<T>
+getValue(): T+type(): Unique.Type
Cleanable
+ LocalDateTime expiredTime();+ LocalDateTime createdTime();+ isValid():boolean+ timeout():boolean
MsgRepositoryImpl
- mapper:MsgMapper
OverseaCustomer
Container3-1
- minio:MinIOClient- repository:ResourceRepository
Restfull
WebPageResult<T>
+ totalSize: long
FTPConfig
+protocol: String+host: String+port: Integer+username: String+password: String+privateFileKey: String+privatePwd: String+path: String
HTVIPSource
- filesSrc: OA
UserMsg
+subscriber: Identity+msgId: MsgId+status: Status
SendingTaskRepository
+findTasks(sendTaskCriteria): List<Task>+findTask(id): Task
BizType
StockOptionSettlementFundHTVIPOverseas
MsgHandler
结算文件发送
ChannelType
EMAILFTPSZTongAmazon
FTPTarget
- ftpClient:FTPClient
获取发送文件
MQTT
GarbageService
+ clear(@Nullable List<Resource>):void+ recovery(List<Resource>):void
abstract Resource
+ id: Unique<Long>+ user: BizUser+ name:String+ parent:Resource+ gmtCreated:DateTime+ gmtModified:DateTime
+ type():ResourceType
SZTongTarget
- sztClient:SZTongaClient
Config
span style=\"font-size: inherit;\
BizUser
+uid: String+bizName: String
StockOptCustomer
+bondAccount
Biz
MsgClientType
User(APP/WEB)ServerDevice
Unique.Type
IDKey
Websocket
FundSource
ContextService
+user(): BizUser
OperationService
Mode
BroadcastMulticastUnicast
//topic: {service}/{mode}/{parentTopic}/{topic}{ \"status\": \"Unread\
ChannelConfig
+type(): ChannelType+isZip(): boolean+enable(): boolean+srcPathPattern(): String
TaskRepository
各业务线具体服务实现类
API
PageFunction
+ function(WebPageResult<T>):void
+ save(resource):void+ modify(resource):void+ delete(resource):void+ findResouces(directroyId):List<Resource>+ findFile(fileId):Resource+ findGarbageResources():List<Resource>
Euraka
Level
Ignored(\"0\")Normal(\"1\")Important(\"2\")
OnlineState
OFFLINE(0)ONLINE(1)UNKNOWN(2)
SendingTaskFeignImpl
-service: SendingTaskService-repository: SendingTaskRepository
FileType
TXTZIPCSVImageVideoExcelWordPPTPDF
HTVIPCustomer
Customer
+id(): String+name(): String+bizType(): BizType
Dubbo服务治理
源文件服务器
ConfigType
FTPEmailSZTongAmazonTask
DataFile
-resourceId: String-filename: String-bizType: BizType-tradeDate: Date
FundServiceImpl
-source: FundSource-repository: SoureRepository
消息网关
container2-1
OperationRepositoryImpl
Service
Identity
+ id(): String+ type():MsgClientType+ identity():String+ parse(identity): Identity
OverseasSource
- srcFTP: List<FTP>
Category
Biz(\"10\
向目标服务器发送结算单文件
Domain
container2-2
WS/MQTT
Topic
+service(): String+mode(): Mode+parentTocpic(): String+subTopic(): String+topic(): String+parse(): Topic
File
- fileKey: Unique<String>- md5:String- size:Long- fileType: FileType
MQTTMsgHandler
SZTongConfig
+ip: String+path: String+attachmentPath: String+attachments: List<String>
WSMsgHandler
SendingTask
+targetType: TargetType+configId: String+fileKeys: List<String>
MailTarget
- mailClient:MailClient
NewSendingTaskDto
+configId: String+fileKeys: List<String>+targetType: String+cron: String
FundCustomer
1,当前各业务线只有文件发送相关运营。后期若有差错相关业务运营,则只需在原来的架构上,增加差错相关的接口,同时不影响旧的业务功能。2,依据SOA标准,各个业务线的服务是可以独立划分的。但是当前业务量规模有限,考虑各种成本和后续维护问题,没有将各个业务线进行服务拆分的必要。此外,在这样设计架构领域分割清晰,将来拆分也不会涉及业务逻辑修改问题。
Resource
SendingTaskRepositoryImpl
SendingTaskService
MinioClient
Operation(\"10\")Signet(\"20\")Info(\"30\")Message(\"40\")Task(\"50\")Config(\"60\")PassportProxy(\"70\")Resource(\"80\")
Container1-2
中间件(Redis...)
运营中心
AbstractBizSourceService
-minio: MinioClient-taskFacade: TaskFacade
- doSync(): List<DataFile> abstract- prepareSend(customer):List<DataFile> abstract
Function
+ function(WebResult<T>):void
SettlementSource
ConfigCriteria
+ function:String+ type:String
请求/定时同步结算文件(sync)
Message
- id:MsgId- topic:Topic- publisher:Identity- bornTimestamp:Long- qos:Integer- data:String
文件拆分合并
ResourceRepositoryImpl
- mapper:ResourceMapper
AbstractMsgHandler
-repository: MsgRepository
CodeException
+ code:ResponseCode+ returnObject:Object
请求创建结算文件发送任务
ConfigService
根据客户/分组保存发送文件
ResourceRepostioryImpl
UserContextHolder
-bizUser: ThreadLocal<BizUser>
+init(): void+check(): void+get(): User+exit(): void
Docker
Passport Proxy Service
enum ErrorCode
+ code:String+ msg:String+ level:Level+ category:Category
-id: String-tradeDate: Date-bizType: BizType-fileKeys: List<String>-target: Customer-channelType: ChannelType-type: SendingType-cron: String
MsgServiceImpl
- handler:MsgHandler- repository:MsgRepository
SettlementCustomer
StockOptionServiceImpl
-source: StockOptionSource-repository: SoureRepository
GarbageServiceImpl
Source
+customers(): List<Customer>+sendingConfig: SendingConfig+srcPath(tradeDate): String
TaskServiceImpl
SendingTaskCriteria
+groupId: Long+targetType: String
配置中心
GroupTask
+id: Long+size: Integer+tasks: List<Task>
MsgService
+id(): String+cron(): String+type: TaskType+state(): State+gmtCreated(): Date
SourceRepository
+save(Source): void+find(BizType): Source
Directory
- resources:List<Resource>
ResourceAPI
Target
+ configId(): String+ target(): String+ fileKeys():List<String>+ type(): TargetType+ send(): void
TaskRepositoryImpl
ConfigRepositoryImpl
+ mongo:MongoTemplate
ELK
MySQL
资源中心
保存当日结算文件
0 条评论
下一页