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.RoomThemeUserCustomizeClientService;
import com.red.circle.other.inner.endpoint.material.props.api.RoomThemeUserCustomizeClientApi;
import com.red.circle.other.inner.model.cmd.material.RoomThemeUserCustomizeApprovalCmd;
import com.red.circle.other.inner.model.cmd.material.RoomThemeUserCustomizeOpsPageQryCmd;
import com.red.circle.other.inner.model.dto.material.RoomThemeUserCustomizeDTO;
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 = RoomThemeUserCustomizeClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class RoomThemeUserCustomizeClientEndpoint implements RoomThemeUserCustomizeClientApi {

  private final RoomThemeUserCustomizeClientService roomThemeUserCustomizeClientService;

  @Override
  public ResultResponse<PageResult<RoomThemeUserCustomizeDTO>> pageOps(
      RoomThemeUserCustomizeOpsPageQryCmd pageQryCmd) {
    return ResultResponse.success(
        roomThemeUserCustomizeClientService.pageOps(pageQryCmd)
    );
  }

  @Override
  public ResultResponse<Void> updateApprovalStatus(RoomThemeUserCustomizeApprovalCmd cmd) {
    roomThemeUserCustomizeClientService.updateApprovalStatus(cmd);
    return ResultResponse.success();
  }

}
