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

import com.red.circle.common.business.dto.cmd.AppExtCommand;
import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.app.service.user.user.UserActionCheckService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户操作检查.
 *
 * @author pengliang on 2020/11/2
 * @eo.api-type http
 * @eo.groupName 用户服务.用户操作检查
 * @eo.path /user/user-action/check
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/user/user-action/check")
public class UserActionCheckRestController extends BaseController {

  private final UserActionCheckService userActionCheckService;

  /**
   * 验证是否购买过内购.
   *
   * @eo.name 验证是否购买过内购.
   * @eo.url /in-app-purchasing
   * @eo.method get
   * @eo.request-type formdata
   */
  @GetMapping("/in-app-purchasing")
  public Boolean inAppPurchasing(AppExtCommand cmd) {
    return userActionCheckService.isInAppPurchasing(cmd);
  }

}
