cqx2005 最近的时间轴更新
cqx2005

cqx2005

V2EX 第 357739 号会员,加入于 2018-10-22 19:58:00 +08:00
cqx2005 最近回复了
@flynnlemon wordpress 不适合,它用来做企业建站,比较快。
带有交易订单之类的,不适合,不好扩展,性能也很差。
mysql5.7 , 对于资料表,都会建立 extra 字段,JSON 类型。

生产环境,单表上亿的表有 4-5 张。
我项目引入了 hutool ,但其代码设计,确实不好,贴代码

/**
* 下载文件
*
* @param path 文件路径
* @param fileName 文件名
* @param outFile 输出文件或目录
*/
public void download(String path, String fileName, File outFile) {
if (outFile.isDirectory()) {
outFile = new File(outFile, fileName);
}
if (false == outFile.exists()) {
FileUtil.touch(outFile);
}
try (OutputStream out = FileUtil.getOutputStream(outFile)) {
download(path, fileName, out);
} catch (IOException e) {
throw new FtpException(e);
}
}



/**
* Ftp 异常
*
* @author xiaoleilu
*/
public class FtpException extends RuntimeException {
private static final long serialVersionUID = -8490149159895201756L;

public FtpException(Throwable e) {
super(ExceptionUtil.getMessage(e), e);
}

public FtpException(String message) {
super(message);
}

public FtpException(String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params));
}

public FtpException(String message, Throwable throwable) {
super(message, throwable);
}

public FtpException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}
}



download 方法把 IO 异常代替为 RuntimeException 。糟糕的设计。
328 天前
回复了 lk960511 创建的主题 程序员 超过了 35 岁的程序员该何去何从?
@wzl0904 同龄,小公司偏管理,最多也只能干 5 年了,房贷没压力,但上有老下有小。还是有些焦虑
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5719 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 02:22 · PVG 10:22 · LAX 19:22 · JFK 22:22
Developed with CodeLauncher
♥ Do have faith in what you're doing.