13693261870
2024-07-16 8cb96c927944f28e7a64a100b046c188d9182ce6
src/main/java/com/se/simu/controller/WaterController.java
@@ -103,7 +103,7 @@
    private boolean validate(String serviceName, HttpServletResponse res) {
        if (StringHelper.isEmpty(serviceName)) {
            return WebHelper.writeStr2Page(res, HttpStatus.BAD_REQUEST, "服务名不能为空");
            return WebHelper.writeJson2Page(res, HttpStatus.BAD_REQUEST, "服务名不能为空");
        }
        return true;
@@ -115,16 +115,16 @@
    private boolean validate(String serviceName, Integer width, Integer height, Long timestamp, HttpServletResponse res) {
        if (StringHelper.isEmpty(serviceName)) {
            return WebHelper.writeStr2Page(res, HttpStatus.BAD_REQUEST, "服务名不能为空");
            return WebHelper.writeJson2Page(res, HttpStatus.BAD_REQUEST, "服务名不能为空");
        }
        if (null == width || width < MIN_SIZE || width > MAX_SIZE) {
            return WebHelper.writeStr2Page(res, HttpStatus.BAD_REQUEST, "图像宽度不能为空且取值范围为" + MIN_SIZE + "~" + MAX_SIZE + "之间");
            return WebHelper.writeJson2Page(res, HttpStatus.BAD_REQUEST, "图像宽度不能为空且取值范围为" + MIN_SIZE + "~" + MAX_SIZE + "之间");
        }
        if (null == height || height < MIN_SIZE || height > MAX_SIZE) {
            return WebHelper.writeStr2Page(res, HttpStatus.BAD_REQUEST, "图像高度不能为空且取值范围为" + MIN_SIZE + "~" + MAX_SIZE + "之间");
            return WebHelper.writeJson2Page(res, HttpStatus.BAD_REQUEST, "图像高度不能为空且取值范围为" + MIN_SIZE + "~" + MAX_SIZE + "之间");
        }
        if (null == timestamp || timestamp < Y2000) {
            return WebHelper.writeStr2Page(res, HttpStatus.BAD_REQUEST, "时间不能为空且大于2000年");
            return WebHelper.writeJson2Page(res, HttpStatus.BAD_REQUEST, "时间不能为空且大于2000年");
        }
        return true;