刘光辉
14 小时以前 34981c30a78e8bbd7791131059a9210f9928b62c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package jnpf.yozo.client;
 
import jnpf.yozo.constants.EnumResultCode;
import jnpf.yozo.utils.DefaultResult;
import jnpf.yozo.utils.IResult;
 
import java.util.Map;
 
public class UaaAppConfigClient {
    public UaaAppConfigClient() {
        throw new UnsupportedOperationException(
                "未实现,请等待版本发布。"
        );
    }
 
    public static final String APPID = "appId";
 
    public IResult<String> generateSign(String appId, String secret, Map<String, String[]> params) {
        UaaAppAuthenticator authenticator = new UaaAppAuthenticator("sign", (String)null, APPID);
 
        try {
            String[] appIds = params.get(APPID);
            if (appIds == null || appIds.length != 1 || appIds[0] == null || appIds[0].isEmpty()) {
                params.put(APPID, new String[]{appId});
            }
 
            String sign = authenticator.generateSign(secret, params);
            return DefaultResult.successResult(sign);
        } catch (Exception var7) {
            return DefaultResult.failResult(EnumResultCode.E_GENERATE_SIGN_FAIL.getInfo());
        }
    }
}