package com.red.circle.other.app.inner.endpoint.dynamic;

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.app.inner.service.dynamic.TopDynamicClientService;
import com.red.circle.other.inner.endpoint.dynamic.api.TopDynamicClientApi;
import com.red.circle.other.inner.model.cmd.dynamic.TopDynamicCmd;
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 pengliang on 2023/6/5
 */
@Validated
@RestController
@RequestMapping(value = TopDynamicClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class TopDynamicClientEndpoint implements TopDynamicClientApi {

  private final TopDynamicClientService topDynamicClientService;


  @Override
  public ResultResponse<Void> setUpTop(TopDynamicCmd param) {
    topDynamicClientService.setUpTop(param);
    return ResultResponse.success();
  }

  @Override
  public ResultResponse<Void> closeTop(Long dynamicId) {
    topDynamicClientService.closeTop(dynamicId);
    return ResultResponse.success();
  }
}
