package com.red.circle.console.adapter.gm;

import com.red.circle.console.app.dto.clienobject.gm.GmVipGiftCO;
import com.red.circle.console.app.dto.cmd.gm.GmVipGiftCmd;
import com.red.circle.console.app.dto.cmd.gm.GmVipGiftPageQryCmd;
import com.red.circle.console.app.service.gm.GmVipGiftService;
import com.red.circle.console.infra.annotations.OpsOperationReqLog;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.web.controller.BaseController;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * GM VIP赠送.
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/gm/vip-gift")
public class GmVipGiftRestController extends BaseController {

  private final GmVipGiftService gmVipGiftService;

  @OpsOperationReqLog("GM VIP赠送")
  @PostMapping
  public GmVipGiftCO gift(@RequestBody @Validated GmVipGiftCmd cmd) {
    return gmVipGiftService.gift(cmd);
  }

  @GetMapping("/page")
  public PageResult<GmVipGiftCO> page(GmVipGiftPageQryCmd cmd) {
    return gmVipGiftService.page(cmd);
  }
}
