package org.jeecg.modules.api.carrentController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.apiService.RecommendService;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags="我的推荐相关接口")
@RestController
@RequestMapping("/api/recommend")
@Slf4j
public class RecommendController {

    //推荐信息
    @Resource
    private RecommendService recommendService;
    /****************************************************************************************************/

    @ApiOperation(value="我的推荐-获取个人邀请码", notes="我的推荐-获取个人邀请码")
    @RequestMapping(value = "/getInviteCode", method = {RequestMethod.GET})
    public Result<?> getInviteCode(@RequestHeader("X-Access-Token") String token){
        return recommendService.getInviteCode(token);
    }

    @ApiOperation(value="我的推荐-获取推荐用户信息", notes="我的推荐-获取推荐用户信息")
    @RequestMapping(value = "/getInviteUser", method = {RequestMethod.GET})
    public Result<?> getInviteUser(@RequestHeader("X-Access-Token") String token){
        return recommendService.getInviteUser(token);
    }


}
