提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
文章目录
配置文件Properties
import com.alibaba.fastjson.JSON;
import com.tuzhanai.cbsp.business.common.utils.JSRValidatorUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@ConfigurationProperties(prefix = "weixin.ftp.upload")
@Configuration
@Data
@Slf4j
public class weixinProperties implements InitializingBean {
@NotBlank(message = "ip must not null")
private String ip;
@NotNull(message = "port must not null")
private Integer port;
@NotBlank(message = "user must not null")
private String user;
@NotBlank(message = "pwd must not null")
private String pwd;
@NotBlank(message = "uploadDir must not null")
private String uploadDir;
/** * 相关文件名 */
/**上传的基础数据文件名: FK00006D.CAR*/
@NotBlank(message = "uploadFileName must not null")
private String uploadFileName;
/**存储本地上传文件临时文件夹*/
@NotBlank(message = "uploadLocalDir must not null")
private String uploadLocalDir;
private Long fizeSize;
@NotBlank(message = "modelNo must not null")
private String modelNo;
@NotBlank(message = "page must not null")
private String page;
@NotBlank(message = "miniprogramState must not null")
private String miniprogramState;
private Long clearday;
@Override
public void afterPropertiesSet() throws Exception {
String config = JSON.toJSONString(this);
log.info("weixin文件,配置属性:{}",config);
try {
JSRValidatorUtil.validate(this);
} catch (Exception e) {
throw new IllegalArgumentException("weixin配置文件是否存在必填项为空!");
}
}
}
nacos 配置
#weixin直接下发批量文件
weixin:
ftp:
upload:
ip: 192.168.2.51
user: tuzhan
pwd: Tuzhan@2021
port: 21
uploadDir: /home/FTP/notice/MN00001/
uploadLocalDir: /home/FTP/notice/MN00001/
uploadFileName: MN00001.{
0}.025.{
1}.MSG
fizeSize: 10000
modelNo: vMYQzNt1mfEmw0-tUiYnBri_sG5vOo2csfW09pd0Lao
page: pages/poster/index?taskId=
miniprogramState: trial
clearday: 7
文章评论