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

import com.red.circle.console.app.dto.clienobject.gm.GmGoldOperationCO;
import com.red.circle.console.app.dto.cmd.gm.GmGoldOperationCmd;
import com.red.circle.console.app.dto.cmd.gm.GmGoldOperationPageQryCmd;
import com.red.circle.console.app.dto.cmd.gm.GmGoldOperationReviewCmd;
import com.red.circle.console.app.service.gm.GmGoldOperationService;
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金币操作.
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/gm/gold-operation")
public class GmGoldOperationRestController extends BaseController {

  private final GmGoldOperationService gmGoldOperationService;

  @OpsOperationReqLog("GM金币操作申请")
  @PostMapping
  public GmGoldOperationCO submit(@RequestBody @Validated GmGoldOperationCmd cmd) {
    return gmGoldOperationService.submit(cmd);
  }

  @GetMapping("/page")
  public PageResult<GmGoldOperationCO> page(GmGoldOperationPageQryCmd cmd) {
    return gmGoldOperationService.page(cmd);
  }

  @OpsOperationReqLog("GM金币操作审核")
  @PostMapping("/review")
  public GmGoldOperationCO review(@RequestBody @Validated GmGoldOperationReviewCmd cmd) {
    return gmGoldOperationService.review(cmd);
  }
}
