package com.tuoheng.controller;

import com.tuoheng.model.dto.LoginUser;
import com.tuoheng.service.CurrentUser;
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;

/**
 * @author chenjiandong
 * @description: TODO
 * @date 2022/10/21 14:51
 */
@RestController
@Slf4j
@RequestMapping("/test")
public class DemoController {

    @GetMapping("/getHealth")
    public String getHealth(@CurrentUser LoginUser loginUser) {
        log.info("tuoheng-oidc-admin is ok~");
        return null == loginUser.getRoleId() ? null : loginUser.getRoleId().toString();
    }
}
