package org.dromara.elevator.controller.message;

import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.elevator.domain.message.AuthBody;
import org.dromara.elevator.domain.message.AuthToken;
import org.dromara.elevator.service.message.AuthTokenService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 认证接口
 *
 * @author ym
 * @version 1.0.0
 * @date 2024-08-27 10:07
 */
@RestController
@RequestMapping("/v5.0/api/auth")
@RequiredArgsConstructor
public class AuthTokenController {

    private final AuthTokenService authTokenService;

    /**
     * 获取三方认证token信息
     */
    @GetMapping("/getToken")
    public R<AuthToken> getToken (AuthBody authBody) {
        return R.ok(authTokenService.getToken(authBody));
    }

}
