package cn.newfeifan.mall.module.distri.controller.app.duser;

import cn.newfeifan.mall.framework.security.core.annotations.PreAuthenticated;
import cn.newfeifan.mall.module.distri.controller.admin.duser.vo.DuserInfoVO;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;

import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;

import cn.newfeifan.mall.framework.common.pojo.CommonResult;
import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;

import static cn.newfeifan.mall.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;

import cn.newfeifan.mall.module.distri.service.duser.DuserService;

@Tag(name = "用户 APP - 推荐用户")
@RestController
@RequestMapping("/distri/duser")
@Validated
public class AppDuserController {

    @Resource
    private DuserService duserService;

    @GetMapping("/getDuserInfo")
    @Operation(summary = "获取分销人员信息")
    @PreAuthenticated
    public CommonResult<DuserInfoVO> getDuserInfo() {

        DuserInfoVO duserInfo = duserService.getDuserInfo(getLoginUserId());
        return success(duserInfo);
    }


}