- 新增SmbFileService服务类,支持SMB/CIFS协议的文件操作 - 修改合同文件管理逻辑,支持SMB路径检查与目录创建 - 优化BankTableCell实现工厂模式并更新相关文档 - 调整Redis配置并添加连接测试 - 修复合同发票视图模型的时间处理问题 - 更新项目版本至0.0.134-SNAPSHOT
31 lines
863 B
Java
31 lines
863 B
Java
package com.ecep.contract.config;
|
|
|
|
import lombok.Getter;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
import com.hierynomus.smbj.SMBClient;
|
|
import com.hierynomus.smbj.auth.NtlmAuthenticator;
|
|
|
|
@Configuration()
|
|
public class SmbConfig {
|
|
|
|
@Value("${smb.server.username}")
|
|
@Getter
|
|
private String username;
|
|
|
|
@Value("${smb.server.password}")
|
|
@Getter
|
|
private String password;
|
|
|
|
@Bean
|
|
public SMBClient smbClient() {
|
|
var smbConfig = com.hierynomus.smbj.SmbConfig.builder()
|
|
.withMultiProtocolNegotiate(true).withSigningRequired(true)
|
|
// .withAuthenticators(new NtlmAuthenticator(username, password))
|
|
.build();
|
|
return new SMBClient(smbConfig);
|
|
}
|
|
}
|