package com.bjtdba.userCenter.controller;

import com.bjtdba.userCenter.service.UserInviteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("userCenter_service/userInviteService")
public class UserInviteController {

    @Autowired
    private UserInviteService userInviteService;

    /**
     * 用户累计收益
     * @param uid
     * @return
     */
    @GetMapping("/selectUserInviteProfit")
    public Object userInviteProfit(@RequestHeader Map<String,String> hmap, Integer uid){
        if(uid==null){
            uid=Integer.parseInt(hmap.get("uid"));
        }
        return userInviteService.userInviteProfit(uid);
    }
    /**
     * 邀请商户+伙伴个数 列表
     */
    @GetMapping("/userInviteList")
    public Object userInviteList(Integer pageNum,Integer pageSize,Integer uid,String nickname){
        return userInviteService.userInviteList(pageNum,pageSize,uid,nickname);
    }
    /**
     * 收益列表
     */
    @GetMapping("/userInviteProfitList")
    public Object userInviteProfitList(Integer pageNum,Integer pageSize,Integer uid,Integer commission_type){
        return userInviteService.userInviteProfitList(pageNum,pageSize,uid,commission_type);
    }
}
