NC65获取Token以及相关信息

private static void setToken() {
    IPriviledgedGenerator tokenGenerator = (IPriviledgedGenerator)     
    BusinessAppServer.getInstance().getContext().lookup("priviledgedTokenGenerator");
    byte[] bytes = tokenGenerator.genPriviledgedToken();
    NetStreamContext.setToken(bytes);
}


private void loginAsDefault() {
    setToken();
    if (StringUtils.isBlank(InvocationInfoProxy.getInstance().getGroupId())) {
    InvocationInfoProxy.getInstance().setGroupId(IOrgConst.GLOBEORG);
    InvocationInfoProxy.getInstance().setGroupNumber("1001");
    InvocationInfoProxy.getInstance().setRunAs(UserExit.DEFAULT_USERID_VALUE);
    InvocationInfoProxy.getInstance().setUserCode(UserExit.DEFAULT_USERID_VALUE);
    InvocationInfoProxy.getInstance().setUserDataSource("design");
    }
}

/**   
* 获取泛型的Collection Type  
* @param collectionClass 泛型的Collection   
* @return JavaType Java类型   
* @since 1.0   
*/
public static JavaType getCollectionType(Class<?> collectionClass, Class<?>... elementClasses) {
    return objectmapper.getTypeFactory().constructParametricType(collectionClass, elementClasses);
}
posted @ 2023-12-26 10:13  Kwoky  阅读(95)  评论(0编辑  收藏  举报