package com.red.circle.other.app.inner.endpoint.material.props;

import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.app.inner.service.material.props.RoomThemeStoreClientService;
import com.red.circle.other.inner.endpoint.material.props.api.RoomThemeStoreClientApi;
import com.red.circle.other.inner.model.cmd.material.RoomThemePageQryCmd;
import com.red.circle.other.inner.model.dto.material.RoomThemeStoreDTO;
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/12/4
 */
@Validated
@RestController
@RequestMapping(value = RoomThemeStoreClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class RoomThemeStoreClientEndpoint implements RoomThemeStoreClientApi {

  private final RoomThemeStoreClientService roomThemeStoreClientService;

  @Override
  public ResultResponse<PageResult<RoomThemeStoreDTO>> pageOps(RoomThemePageQryCmd pageQryCmd) {
    return ResultResponse.success(roomThemeStoreClientService.pageOps(pageQryCmd));
  }

  @Override
  public ResultResponse<Boolean> updateRoomTheme(RoomThemeStoreDTO dto) {
    return ResultResponse.success(roomThemeStoreClientService.updateRoomTheme(dto));
  }

  @Override
  public ResultResponse<Boolean> addRoomTheme(RoomThemeStoreDTO dto) {
    return ResultResponse.success(roomThemeStoreClientService.addRoomTheme(dto));
  }

}
