package com.red.circle.external.inner.endpoint.google;

import com.red.circle.external.inner.endpoint.push.api.GoogleFirebasePushClientApi;
import com.red.circle.external.inner.model.cmd.message.google.GooglePushCmd;
import com.red.circle.external.inner.service.google.GoogleFirebasePushClientService;
import com.red.circle.framework.dto.ResultResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lisizhe 2023/11/13  16:27
 */
@Validated
@RestController
@RequestMapping(value = GoogleFirebasePushClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class GoogleFirebaseGoogleFirebasePushClientEndpoint implements GoogleFirebasePushClientApi {

  private final GoogleFirebasePushClientService googleFirebasePushClientService;


  @Override
  public ResultResponse<Void> broadcast(GooglePushCmd cmd) {
    googleFirebasePushClientService.broadcast(cmd);
    return ResultResponse.success();
  }

}
