# sms-processor **Repository Path**: nobodycc/sms-processor ## Basic Information - **Project Name**: sms-processor - **Description**: sms处理组件(scdf) - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-12-23 - **Last Updated**: 2024-12-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # SMS Processor Application A Spring Cloud Stream processor application that processes SMS messages and enriches them with additional metadata and analysis. ## Overview This application is designed to work as a processor within Spring Cloud Data Flow (SCDF), consuming SMS messages from a message queue, processing them, and publishing enriched results back to another message queue. ## Input Format The input message is expected to be in the following format: ```json { "task_id": "35e93d1b-ae5e-4188-a117-c456e9b8b4eb", "workflow_run_id": "c28742fa-4eab-48bc-9f3f-82125e537993", "data": { "id": "c28742fa-4eab-48bc-9f3f-82125e537993", "workflow_id": "e5666709-c551-4ce0-ab0b-4f55fd88b3bf", "status": "succeeded", "outputs": { "batch_result": [ { "output": { "SmsIndex": "[SMS 0001]", "Center": "+9999999", "Phone": "99999", "DateTime": "2023-07-24 22:22:09", "GMT": "GMT +6.50", "Content": "You have a missed call from Henry1", "ProcessTime": "2024-12-17 03:46:38", "ContentTranslate": "看来你收到了一个来自名为Henry的人的漏接来电,他可能使用了一个昵称或以“1”结尾的电话号码。如果你正在期待他的来电,或者你对为何收到这个漏接来电感到好奇,你可以回拨他的电话或发送信息以了解更多信息。", "category": "", "category_confidence": 0, "category_reason": "", "priority": "普通", "priority_confidence": 0.8, "priority_reason": "文本内容表明需要常规处理,因为一个错过的来电并不一定需要立即处理。", "emotion": "中性", "emotion_confidence": 0.8, "emotion_reason": "文本没有明显的情绪表达,只是陈述了一个事实。", "language_code": "en", "language_name": "英语" } }, { "output": { "SmsIndex": "[SMS 0002]", "Center": "+9999999", "Phone": "99999", "DateTime": "2023-07-24 22:22:09", "GMT": "GMT +6.50", "Content": "You have a missed call from Henry2", "ProcessTime": "2024-12-17 03:46:38", "ContentTranslate": "此消息显示你收到了一个来自名为\"Henry2\"的联系人的未接来电,但未提供任何关于错过此电话的原因或关于该联系人的其他详情。若你需要与Henry2联系,你可以考虑回拨或发送消息询问其来电的目的。", "category": "", "category_confidence": 0, "category_reason": "", "priority": "普通", "priority_confidence": 0.8, "priority_reason": "文本内容表明需要常规处理,因为一个错过的来电通常需要回复,但不一定需要立即处理。", "emotion": "中性", "emotion_confidence": 0.8, "emotion_reason": "文本没有明显的情绪表达,只是陈述了一个事实。", "language_code": "en", "language_name": "英语" } }, { "output": { "SmsIndex": "[SMS 0003]", "Center": "+9999999", "Phone": "99999", "DateTime": "2023-07-24 22:22:09", "GMT": "GMT +6.50", "Content": "You have a missed call from Henry3", "ProcessTime": "2024-12-17 03:46:38", "ContentTranslate": "看来你收到了一个来自名为“Henry3”的人的未接来电。这可能是他的昵称,也可能是亨利用来标识他的电话的一种方式,或许是为了将其与其他可能使用的电话区分开来。如果你正在期待他的来电,或者这种情况比较异常,你可能想要回拨或者发送短信以查明Henry3为何会打电话。", "category": "", "category_confidence": 0, "category_reason": "", "priority": "普通", "priority_confidence": 0.8, "priority_reason": "文本内容表明需要常规处理,因为一个错过的来电并不一定需要立即处理。", "emotion": "中性", "emotion_confidence": 0.8, "emotion_reason": "文本没有明显的情绪表达,只是陈述了一个事实。", "language_code": "en", "language_name": "英语" } }, { "output": { "SmsIndex": "[SMS 0004]", "Center": "+9999999", "Phone": "99999", "DateTime": "2023-07-24 22:22:09", "GMT": "GMT +6.50", "Content": "You have a missed call from Henry4", "ProcessTime": "2024-12-17 03:46:38", "ContentTranslate": "你有一个未接来电,来电的人名叫Henry,他的电话号码以“4”结尾,这可能是他在联系信息中添加的一个标识符。如果你想回拨或了解未接来电的原因,可以检查你最近与Henry的互动或消息,以获取更多信息。", "category": "", "category_confidence": 0, "category_reason": "", "priority": "普通", "priority_confidence": 0.8, "priority_reason": "文本内容表明需要常规处理,因为一个错过的来电并不一定需要立即处理。", "emotion": "中性", "emotion_confidence": 0.8, "emotion_reason": "文本没有明显的情绪表达,只是陈述了一个事实。", "language_code": "en", "language_name": "英文" } } ] }, "error": null, "elapsed_time": 13.550104345020372, "total_tokens": 0, "total_steps": 36, "created_at": 1734407198, "finished_at": 1734407211 } } ``` ## Output Format The processor enriches the SMS data and outputs a JSON object with the following structure: ```json { "SmsIndex": "[SMS 0001]", "Center": "+9999999", "Phone": "99999", "DateTime": "2023-07-24 22:22:09", "GMT": "GMT +6.50", "Content": "You have a missed call from Henry1", "ProcessTime": "2024-12-17 03:46:38", "ContentTranslate": "Chinese translation of the content", "category": "", "category_confidence": 0, "category_reason": "", "priority": "普通|紧急|特急", "priority_confidence": 0.8, "priority_reason": "Reason for priority classification", "emotion": "积极|消极|中性", "emotion_confidence": 0.8, "emotion_reason": "Reason for emotion classification", "language_code": "en", "language_name": "英语" } ``` ## Features 1. Parses raw SMS text into structured data ## Technical Requirements - Spring Boot 3.x - Spring Cloud Stream - Java 17+ - Message broker (Kafka) for integration with SCDF ## Configuration The application will support configuration through application.properties/yaml for: - Input/output binding destinations - Message broker connection details - Processing parameters ## Integration This processor is designed to be deployed as part of a Spring Cloud Data Flow stream, but can also run as a standalone Spring Boot application. ## Development Guidelines - Follow Spring Cloud Stream best practices - Implement proper error handling and logging - Include unit and integration tests - Use constructor injection - Follow SOLID principles