package com.microservices.pms.common.controller;

import com.microservices.common.core.utils.html.EscapeUtil;
import com.microservices.common.core.web.controller.BaseController;
import com.microservices.common.core.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author otto
 */
@RestController
@Api(tags = "项目管理-公开接口")
@RequestMapping("/open")
@RefreshScope
public class OpenController extends BaseController {

    @Value("${http.gitLinkUrl}")
    public String gitLinkUrl;

    /**
     * 查询项目管理企业列表
     */
    @GetMapping("/loginUrl")
    @ApiOperation(value = "获取登录地址")
    public AjaxResult loginUrl() {
        return success(
                (Object) EscapeUtil.removeExtraSlashOfUrl(gitLinkUrl + "/login")
        );
    }
}
