package com.njzscloud.supervisory.sys.auth.controller;

import com.njzscloud.common.core.utils.R;
import com.njzscloud.common.security.support.UserDetail;
import com.njzscloud.supervisory.sys.auth.service.AuthService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 登录
 */
@Slf4j
@RestController
@RequestMapping("/auth")
@RequiredArgsConstructor
public class AuthController {
    private final AuthService authService;

    /**
     * 获取当前登录人信息
     */
    @GetMapping("/my")
    public R<UserDetail> my() {
        return R.success(authService.my());
    }
}
