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

import com.red.circle.common.business.dto.cmd.app.AppFlowCmd;
import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.app.dto.clientobject.user.user.InviteUserRewardRecordCO;
import com.red.circle.other.app.service.user.user.UserInviteService;
import com.red.circle.other.inner.model.dto.user.UserProfileDTO;
import java.util.List;
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;

/**
 * 用户邀请服务.
 *
 * @author pengliang on 2023/6/11
 * @eo.api-type http
 * @eo.groupName 用户服务.用户邀请
 * @eo.path /user/user-invite
 */
@RestController
@RequestMapping(value = "/user/user-invite", produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class UserInviteRestController extends BaseController {

  private final UserInviteService userInviteService;

  /**
   * 邀请用户列表.
   *
   * @eo.name 邀请用户列表.
   * @eo.url /list
   * @eo.method get
   * @eo.request-type formdata
   */
  @GetMapping("/list")
  public List<UserProfileDTO> searchInviteUserList(AppFlowCmd cmd) {
    return userInviteService.listSearchInviteUser(cmd);
  }

  /**
   * 我的邀请收入流水.
   *
   * @eo.name 我的邀请收入流水.
   * @eo.url /reward/record
   * @eo.method get
   * @eo.request-type formdata
   */
  @GetMapping("/reward/record")
  public List<InviteUserRewardRecordCO> flowInviteUser(AppFlowCmd cmd) {
    return userInviteService.flowInviteUserReward(cmd);
  }

}
