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.DynamicTimelineClientService;
import com.red.circle.other.inner.endpoint.dynamic.api.DynamicTimelineClientApi;
import com.red.circle.other.inner.model.cmd.dynamic.DynamicTimelineCmd;
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 = DynamicTimelineClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class DynamicTimelineClientEndpoint implements DynamicTimelineClientApi {

  private final DynamicTimelineClientService dynamicTimelineClientService;

  @Override
  public ResultResponse<Void> save(DynamicTimelineCmd cmd) {
    dynamicTimelineClientService.save(cmd);
    return ResultResponse.success();
  }
}
