package com.ruoyi.ibs.qxhy.controller;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.ibs.qxhy.service.QxhyLoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author 吴凯程
 * @Date 2025/1/13
 **/
@Api(tags = "启信慧眼登录")
@RestController
@RequestMapping("/qxhy")
public class QxhyController {

    @Resource
    private QxhyLoginService qxhyLoginService;

    @ApiOperation("获取登录TOKEN")
    @PostMapping("/token")
    public R<String> getUrlToken() {
        String deptCode = SecurityUtils.getHeadId() + "000";
        return R.ok(qxhyLoginService.getUrlToken(deptCode));
    }

    @ApiOperation("获取登录TOKEN")
    @PostMapping("/rpa/token")
    public R<String> getRPAUrl() {
        return R.ok(qxhyLoginService.getRPAUrl());
    }

}
