feat: 实现SMB文件服务并优化合同文件管理
- 新增SmbFileService服务类,支持SMB/CIFS协议的文件操作 - 修改合同文件管理逻辑,支持SMB路径检查与目录创建 - 优化BankTableCell实现工厂模式并更新相关文档 - 调整Redis配置并添加连接测试 - 修复合同发票视图模型的时间处理问题 - 更新项目版本至0.0.134-SNAPSHOT
This commit is contained in:
30
server/src/main/java/com/ecep/contract/config/SmbConfig.java
Normal file
30
server/src/main/java/com/ecep/contract/config/SmbConfig.java
Normal file
@@ -0,0 +1,30 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user