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

  private final DynamicPictureClientService dynamicPictureClientService;

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