package com.dgtly.wxportal.utils.ESign;

import com.dgtly.wxportal.config.ESignConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.EnumSet;
import java.util.Formatter;


public enum ESignUrl {
    //获取token方法
    AccessToken("/v1/oauth2/access_token?appId=%s&secret=%s&grantType=client_credentials")
    //个人注册
    ,CreatePersonalAccount("/v1/accounts/createByThirdPartyUserId")
    ,GetPersonalAddress("/v2/identity/auth/web/%s/indivIdentityUrl")
    //企业注册
    ,CreateThirdParty("/v1/organizations/createByThirdPartyUserId")
    ,uploadCreateFile("/v1/files/getUploadUrl")
    //个人认证
    ,IndivIdentityUrl("/v2/identity/auth/web/%s/indivIdentityUrl")
    //企业认证
    ,OrgIdentityUrl("/v2/identity/auth/web/%s/orgIdentityUrl")

    //一步发起签署-包含以下几个流程
    ,CreateFlowOneStepUrl("/api/v2/signflows/createFlowOneStep")
    //2、创建签署流程
//    ,CreateFlowOneStepUrl("/v1/signflows")
//    //3、添加流程文件
//    ,CreateFlowOneStepUrl("/v1/signflows/{flowId}/documents")
//    //4、添加签署区，（自动和手动）
//    ,CreateFlowOneStepUrl("/v1/signflows/{flowId}/signfields/platformSign")
//    ,CreateFlowOneStepUrl("/v1/signflows/{flowId}/signfields/handSign")
//    //6、开启签署流程
    ,ProcessStartUrl("/v1/signflows/%s/start")
    //6、流程签署人列表
    ,ProcessExecuteSignersUrl("/v1/signflows/%s/signers")
    //获取签署地址
    ,ProcessExecuteUrl("/v1/signflows/%s/executeUrl?accountId=%s&organizeId=%s")
//    //7、流程归档
    ,ProcessArchivUrl("/v1/signflows/%s/archive")
//    //8、签署的文件下载
    ,ProcessDocumentDownloadUrl("/v1/signflows/%s/documents")
    //个人信息修改
    ,updatePersonalAccount("/v1/accounts/%s")
    //E签宝个人信息查询
    ,getAccountIdByThirdId("/v1/accounts/getByThirdId?thirdPartyUserId=%s")
    //E签宝企业信息查询
    ,getOrgIdByThirdId("/v1/organizations/getByThirdId?thirdPartyUserId=%s")
    //E签宝发起企业授权书签署任务 URI
    ,createEsignAuthUrl("/v1/signAuthApi/online")
    //E签宝获取授权流程签署URL
    ,getSignUrl("/v1/signAuthApi/signUrl")
    //E签宝查询授权结果
    ,queryAuthResult("/v1/signAuthApi/queryAuthResult?authId=%s")
    //公司信息修改
    ,updateThirdParty("/v1/organizations/%s")
    //设置静默签署
    ,signAuthUrl("/v1/signAuth/%s")
    ,delOrgUrl("/v1/organizations/%s")
    ;
    public String url;

    ESignUrl(String url){

        this.url = url;
    }

}
