Class SmsServiceImpl

java.lang.Object
io.github.ricewines.sys.service.impl.SmsServiceImpl
All Implemented Interfaces:
SmsController

@Service @RestController public class SmsServiceImpl extends Object implements SmsController
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    【旧】短信转发接口 POST /sys/sms/forward 老的转发通道,带 sender/receiver/content/receiveTime 完整字段
    void
    【新】短信设备推送回调接口 POST /sys/sms/handle-push 由短信硬件设备主动推送JSON:sender、message、timestamp 成功返回200~299,异常则推送方会自动重试(最多3次,间隔3s)
    短信分页列表查询 GET /sys/sms/list 支持按发送号码筛选、分页
    void
    read(Long id)
    标记短信为已读 POST /sys/sms/read
    org.springframework.web.servlet.mvc.method.annotation.SseEmitter
    subscribe(String clientId)
    SSE 实时短信订阅 GET /sys/sms/subscribe 前端建立长连接,有新短信时主动推送SmsRecordVO
    int
    查询未读短信总数 GET /sys/sms/unread-count

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SmsServiceImpl

      public SmsServiceImpl()
  • Method Details

    • handlePush

      @Transactional(rollbackFor=Exception.class) public void handlePush(SmsPushDTO dto)
      Description copied from interface: SmsController
      【新】短信设备推送回调接口 POST /sys/sms/handle-push 由短信硬件设备主动推送JSON:sender、message、timestamp 成功返回200~299,异常则推送方会自动重试(最多3次,间隔3s)
      Specified by:
      handlePush in interface SmsController
      Parameters:
      dto - 设备推送报文
    • forward

      @Transactional public void forward(SmsForwardDTO dto)
      Description copied from interface: SmsController
      【旧】短信转发接口 POST /sys/sms/forward 老的转发通道,带 sender/receiver/content/receiveTime 完整字段
      Specified by:
      forward in interface SmsController
      Parameters:
      dto - 转发短信DTO
    • subscribe

      public org.springframework.web.servlet.mvc.method.annotation.SseEmitter subscribe(String clientId)
      Description copied from interface: SmsController
      SSE 实时短信订阅 GET /sys/sms/subscribe 前端建立长连接,有新短信时主动推送SmsRecordVO
      Specified by:
      subscribe in interface SmsController
      Parameters:
      clientId - 客户端唯一标识,用于区分不同订阅端
      Returns:
      SseEmitter SSE长连接发射器
    • list

      Description copied from interface: SmsController
      短信分页列表查询 GET /sys/sms/list 支持按发送号码筛选、分页
      Specified by:
      list in interface SmsController
      Parameters:
      dto - 查询条件(sender、pageNum、pageSize)
      Returns:
      分页结果
    • read

      @Transactional public void read(Long id)
      Description copied from interface: SmsController
      标记短信为已读 POST /sys/sms/read
      Specified by:
      read in interface SmsController
      Parameters:
      id - 短信记录主键ID
    • unreadCount

      public int unreadCount()
      Description copied from interface: SmsController
      查询未读短信总数 GET /sys/sms/unread-count
      Specified by:
      unreadCount in interface SmsController
      Returns:
      未读条数