package com.ytpm.controller;

import com.ytpm.agent.view.AgentUserInfo;
import com.ytpm.general.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

@Api(tags = "用户管理模块")
@RestController
@RequestMapping("/ytUser")
public class UserController{

    @ApiOperation(value = "获取当前登录用户", notes = "无需传参")
    @GetMapping("/curUser")
    public Result<AgentUserInfo> getCurrentUser(@ApiIgnore @AuthenticationPrincipal AgentUserInfo userInfo){
        return Result.resultObjOk(userInfo);
    }
}
