package cn.axzo.msg.center.inside.notices.service.impl;


import cn.axzo.msg.center.api.MessagePushApi;
import cn.axzo.msg.center.api.request.MsgBody4Guest;
import cn.axzo.msg.center.inside.notices.service.IYouMengMessageService;
import cn.azxo.framework.common.model.CommonResponse;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;


/**
 * 发送app push消息
 */
@Slf4j
@RestController
public class MessagePushApiImpl implements MessagePushApi {

  @Autowired
  private IYouMengMessageService youMengMessageService;

  @Override
  public CommonResponse<Void> sendPushMessage(MsgBody4Guest msgBody) {
    log.info("sendPushMessage:{}", JSONObject.toJSONString(msgBody));
    youMengMessageService.sendPushMessage(msgBody);
    return CommonResponse.success();
  }
}
