package com.red.circle.other.adapter.app.user.user;

import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.app.dto.clientobject.user.relation.cp.CpRightsConfigCO;
import com.red.circle.other.app.dto.cmd.user.relation.cp.CpRightsConfigQueryCmd;
import com.red.circle.other.app.service.user.user.UserCpCabinService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * CP rights.
 */
@RestController
@RequiredArgsConstructor
@RequestMapping(value = "/user/cp/rights", produces = MediaType.APPLICATION_JSON_VALUE)
public class UserCpRightsRestController extends BaseController {

  private final UserCpCabinService userCpCabinService;

  /**
   * CP rights config.
   */
  @GetMapping("/config")
  public CpRightsConfigCO getCpRightsConfig(CpRightsConfigQueryCmd cmd) {
    return userCpCabinService.getCpRightsConfig(cmd);
  }
}
