From 958556e61b8106a29c089bcd6501b0f3b76cbf21 Mon Sep 17 00:00:00 2001 From: chgxtony Date: Mon, 29 Apr 2019 14:09:09 +0800 Subject: [PATCH 01/11] upgrade spring-boot to 2.1.x and spring to 5.x --- escheduler-alert/pom.xml | 4 - escheduler-api/pom.xml | 11 - .../api/configuration/AppConfiguration.java | 7 +- escheduler-common/pom.xml | 4 - .../cn/escheduler/common/utils/DateUtils.java | 493 ++++++++++-------- .../server/master/MasterServer.java | 1 - pom.xml | 90 ++-- 7 files changed, 309 insertions(+), 301 deletions(-) diff --git a/escheduler-alert/pom.xml b/escheduler-alert/pom.xml index da03314ce8..f066bc4b72 100644 --- a/escheduler-alert/pom.xml +++ b/escheduler-alert/pom.xml @@ -90,10 +90,6 @@ commons-io - - org.apache.commons - commons-collections4 - diff --git a/escheduler-api/pom.xml b/escheduler-api/pom.xml index bfa01dba1e..ec94e30b27 100644 --- a/escheduler-api/pom.xml +++ b/escheduler-api/pom.xml @@ -38,13 +38,6 @@ - - org.springframework.boot - spring-boot-starter-parent - ${spring.boot.version} - pom - import - org.springframework.boot @@ -54,10 +47,6 @@ org.springframework.boot spring-boot-starter-tomcat - - org.springframework.boot - spring-boot-starter - diff --git a/escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java b/escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java index 491da0821e..148efc1894 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java @@ -19,16 +19,13 @@ package cn.escheduler.api.configuration; import cn.escheduler.api.interceptor.LoginHandlerInterceptor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.InterceptorRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.config.annotation.*; /** * application configuration */ @Configuration -public class AppConfiguration extends WebMvcConfigurerAdapter { +public class AppConfiguration implements WebMvcConfigurer { public static final String LOGIN_INTERCEPTOR_PATH_PATTERN = "/**/*"; public static final String LOGIN_PATH_PATTERN = "/login"; diff --git a/escheduler-common/pom.xml b/escheduler-common/pom.xml index f6b8c83028..9703548057 100644 --- a/escheduler-common/pom.xml +++ b/escheduler-common/pom.xml @@ -240,10 +240,6 @@ postgresql - - org.apache.httpcomponents - httpclient - org.apache.hive hive-jdbc diff --git a/escheduler-common/src/main/java/cn/escheduler/common/utils/DateUtils.java b/escheduler-common/src/main/java/cn/escheduler/common/utils/DateUtils.java index 11dc6bfbf6..045db346c6 100644 --- a/escheduler-common/src/main/java/cn/escheduler/common/utils/DateUtils.java +++ b/escheduler-common/src/main/java/cn/escheduler/common/utils/DateUtils.java @@ -20,8 +20,10 @@ import cn.escheduler.common.Constants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.text.ParseException; -import java.text.SimpleDateFormat; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; import java.util.Calendar; import java.util.Date; @@ -30,145 +32,182 @@ import java.util.Date; */ public class DateUtils { - private static final Logger logger = LoggerFactory.getLogger(DateUtils.class); + private static final Logger logger = LoggerFactory.getLogger(DateUtils.class); - /** - * @return get the formatted date string for the current time - */ - public static String getCurrentTime() { - return getCurrentTime(Constants.YYYY_MM_DD_HH_MM_SS); - } + /** + * java.util.Date to java.time.LocalDateTime + * use default zone + * @param date + * @return + */ + private static LocalDateTime date2LocalDateTime(Date date) { + return LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault()); + } - /** - * @param format - * @return get the date string in the specified format of the current time - */ - public static String getCurrentTime(String format) { - return new SimpleDateFormat(format).format(new Date()); - } + /** + * java.time.LocalDateTime to java.util.Date + * use default zone + * @param localDateTime + * @return + */ + private static Date localDateTime2Date(LocalDateTime localDateTime) { + Instant instant = localDateTime.atZone(ZoneId.systemDefault()).toInstant(); + return Date.from(instant); + } - /** - * @param date - * @param format e.g. yyyy-MM-dd HH:mm:ss - * @return get the formatted date string - */ - public static String format(Date date, String format) { - return new SimpleDateFormat(format).format(date); - } + /** + * @return get the formatted date string for the current time + */ + public static String getCurrentTime() { + return getCurrentTime(Constants.YYYY_MM_DD_HH_MM_SS); + } - /** - * @param date - * @return convert time to yyyy-MM-dd HH:mm:ss format - */ - public static String dateToString(Date date){ - return format(date,Constants.YYYY_MM_DD_HH_MM_SS); - } + /** + * @param format + * @return get the date string in the specified format of the current time + */ + public static String getCurrentTime(String format) { +// return new SimpleDateFormat(format).format(new Date()); + return LocalDateTime.now().format(DateTimeFormatter.ofPattern(format)); + } + + /** + * @param date + * @param format e.g. yyyy-MM-dd HH:mm:ss + * @return get the formatted date string + */ + public static String format(Date date, String format) { +// return new SimpleDateFormat(format).format(date); + return format(date2LocalDateTime(date), format); + } + + /** + * @param localDateTime + * @param format e.g. yyyy-MM-dd HH:mm:ss + * @return get the formatted date string + */ + public static String format(LocalDateTime localDateTime, String format) { + return localDateTime.format(DateTimeFormatter.ofPattern(format)); + } + + /** + * @param date + * @return convert time to yyyy-MM-dd HH:mm:ss format + */ + public static String dateToString(Date date) { + return format(date, Constants.YYYY_MM_DD_HH_MM_SS); + } - /** - * @param date - * @return convert string to date and time - */ - public static Date parse(String date,String format){ - try { - return new SimpleDateFormat(format).parse(date); - } catch (Exception e) { - logger.error("error while parse date:" + date, e); - } - return null; - } + /** + * @param date + * @return convert string to date and time + */ + public static Date parse(String date, String format) { + try { + // return new SimpleDateFormat(format).parse(date); + LocalDateTime ldt = LocalDateTime.parse(date, DateTimeFormatter.ofPattern(format)); + return localDateTime2Date(ldt); + } catch (Exception e) { + logger.error("error while parse date:" + date, e); + } + return null; + } - /** - * convert date str to yyyy-MM-dd HH:mm:ss format - * @param str - * @return - */ - public static Date stringToDate(String str){ - return parse(str,Constants.YYYY_MM_DD_HH_MM_SS); - } + /** + * convert date str to yyyy-MM-dd HH:mm:ss format + * + * @param str + * @return + */ + public static Date stringToDate(String str) { + return parse(str, Constants.YYYY_MM_DD_HH_MM_SS); + } - /** - * get seconds between two dates - * - * @param d1 - * @param d2 - * @return - */ - public static long differSec(Date d1, Date d2) { - return (long) Math.ceil(differMs(d1, d2) / 1000.0); - } + /** + * get seconds between two dates + * + * @param d1 + * @param d2 + * @return + */ + public static long differSec(Date d1, Date d2) { + return (long) Math.ceil(differMs(d1, d2) / 1000.0); + } - /** - * get ms between two dates - * - * @param d1 - * @param d2 - * @return - */ - public static long differMs(Date d1, Date d2) { - return Math.abs(d1.getTime() - d2.getTime()); - } + /** + * get ms between two dates + * + * @param d1 + * @param d2 + * @return + */ + public static long differMs(Date d1, Date d2) { + return Math.abs(d1.getTime() - d2.getTime()); + } - /** - * get hours between two dates - * - * @param d1 - * @param d2 - * @return - */ - public static long diffHours(Date d1, Date d2) { - return (long) Math.ceil(diffMin(d1, d2) / 60.0); - } + /** + * get hours between two dates + * + * @param d1 + * @param d2 + * @return + */ + public static long diffHours(Date d1, Date d2) { + return (long) Math.ceil(diffMin(d1, d2) / 60.0); + } - /** - * get minutes between two dates - * - * @param d1 - * @param d2 - * @return - */ - public static long diffMin(Date d1, Date d2) { - return (long) Math.ceil(differSec(d1, d2) / 60.0); - } + /** + * get minutes between two dates + * + * @param d1 + * @param d2 + * @return + */ + public static long diffMin(Date d1, Date d2) { + return (long) Math.ceil(differSec(d1, d2) / 60.0); + } - /** + /** * get the date of the specified date in the days before and after - * @param date - * @param day - * @return - */ - public static Date getSomeDay(Date date, int day) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - calendar.add(Calendar.DATE, day); - return calendar.getTime(); - } + * + * @param date + * @param day + * @return + */ + public static Date getSomeDay(Date date, int day) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.DATE, day); + return calendar.getTime(); + } - /** + /** * compare two dates - * - * @param future - * @param old - * @return - */ - public static boolean compare(Date future, Date old) { - return future.getTime() > old.getTime(); - } + * + * @param future + * @param old + * @return + */ + public static boolean compare(Date future, Date old) { + return future.getTime() > old.getTime(); + } - /** - * convert schedule string to date - * @param schedule - * @return - */ - public static Date getScheduleDate(String schedule){ - return stringToDate(schedule); - } + /** + * convert schedule string to date + * + * @param schedule + * @return + */ + public static Date getScheduleDate(String schedule) { + return stringToDate(schedule); + } /** * format time to readable - * + * * @param ms * @return */ @@ -183,131 +222,135 @@ public class DateUtils { } - /** - * get monday - * - * note: Set the first day of the week to Monday, the default is Sunday - */ - public static Date getMonday(Date date) { - Calendar cal = Calendar.getInstance(); + /** + * get monday + *

+ * note: Set the first day of the week to Monday, the default is Sunday + */ + public static Date getMonday(Date date) { + Calendar cal = Calendar.getInstance(); - cal.setTime(date); + cal.setTime(date); - cal.setFirstDayOfWeek(Calendar.MONDAY); - cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); + cal.setFirstDayOfWeek(Calendar.MONDAY); + cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); - return cal.getTime(); - } + return cal.getTime(); + } - /** - * get sunday - * - * note: Set the first day of the week to Monday, the default is Sunday - */ - public static Date getSunday(Date date) { - Calendar cal = Calendar.getInstance(); - cal.setTime(date); + /** + * get sunday + *

+ * note: Set the first day of the week to Monday, the default is Sunday + */ + public static Date getSunday(Date date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); - cal.setFirstDayOfWeek(Calendar.MONDAY); - cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY); + cal.setFirstDayOfWeek(Calendar.MONDAY); + cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY); - return cal.getTime(); - } + return cal.getTime(); + } - /** - * get first day of month - */ - public static Date getFirstDayOfMonth(Date date) { - Calendar cal = Calendar.getInstance(); + /** + * get first day of month + */ + public static Date getFirstDayOfMonth(Date date) { + Calendar cal = Calendar.getInstance(); - cal.setTime(date); - cal.set(Calendar.DAY_OF_MONTH, 1); + cal.setTime(date); + cal.set(Calendar.DAY_OF_MONTH, 1); - return cal.getTime(); - } + return cal.getTime(); + } - /** - * get first day of month - */ - public static Date getSomeHourOfDay(Date date, int hours) { - Calendar cal = Calendar.getInstance(); + /** + * get first day of month + */ + public static Date getSomeHourOfDay(Date date, int hours) { + Calendar cal = Calendar.getInstance(); - cal.setTime(date); - cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - hours); - cal.set(Calendar.MINUTE, 0); - cal.set(Calendar.SECOND, 0); + cal.setTime(date); + cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - hours); + cal.set(Calendar.MINUTE, 0); + cal.set(Calendar.SECOND, 0); - return cal.getTime(); - } + return cal.getTime(); + } - /** - * get last day of month - */ - public static Date getLastDayOfMonth(Date date) { - Calendar cal = Calendar.getInstance(); + /** + * get last day of month + */ + public static Date getLastDayOfMonth(Date date) { + Calendar cal = Calendar.getInstance(); - cal.setTime(date); + cal.setTime(date); - cal.add(Calendar.MONTH, 1); - cal.set(Calendar.DAY_OF_MONTH, 1); - cal.add(Calendar.DAY_OF_MONTH, -1); + cal.add(Calendar.MONTH, 1); + cal.set(Calendar.DAY_OF_MONTH, 1); + cal.add(Calendar.DAY_OF_MONTH, -1); - return cal.getTime(); - } + return cal.getTime(); + } - /** - * return YYYY-MM-DD 00:00:00 - * @param inputDay - * @return - */ - public static Date getStartOfDay(Date inputDay){ - Calendar cal = Calendar.getInstance(); - cal.setTime(inputDay); - cal.set(Calendar.HOUR_OF_DAY, 0); - cal.set(Calendar.MINUTE, 0); - cal.set(Calendar.SECOND, 0); - return cal.getTime(); - } + /** + * return YYYY-MM-DD 00:00:00 + * + * @param inputDay + * @return + */ + public static Date getStartOfDay(Date inputDay) { + Calendar cal = Calendar.getInstance(); + cal.setTime(inputDay); + cal.set(Calendar.HOUR_OF_DAY, 0); + cal.set(Calendar.MINUTE, 0); + cal.set(Calendar.SECOND, 0); + return cal.getTime(); + } - /** - * return YYYY-MM-DD 23:59:59 - * @param inputDay - * @return - */ - public static Date getEndOfDay(Date inputDay){ - Calendar cal = Calendar.getInstance(); - cal.setTime(inputDay); - cal.set(Calendar.HOUR_OF_DAY, 23); - cal.set(Calendar.MINUTE, 59); - cal.set(Calendar.SECOND, 59); - return cal.getTime(); - } + /** + * return YYYY-MM-DD 23:59:59 + * + * @param inputDay + * @return + */ + public static Date getEndOfDay(Date inputDay) { + Calendar cal = Calendar.getInstance(); + cal.setTime(inputDay); + cal.set(Calendar.HOUR_OF_DAY, 23); + cal.set(Calendar.MINUTE, 59); + cal.set(Calendar.SECOND, 59); + return cal.getTime(); + } - /** - * return YYYY-MM-DD 00:00:00 - * @param inputDay - * @return - */ - public static Date getStartOfHour(Date inputDay){ - Calendar cal = Calendar.getInstance(); - cal.setTime(inputDay); - cal.set(Calendar.MINUTE, 0); - cal.set(Calendar.SECOND, 0); - return cal.getTime(); - } + /** + * return YYYY-MM-DD 00:00:00 + * + * @param inputDay + * @return + */ + public static Date getStartOfHour(Date inputDay) { + Calendar cal = Calendar.getInstance(); + cal.setTime(inputDay); + cal.set(Calendar.MINUTE, 0); + cal.set(Calendar.SECOND, 0); + return cal.getTime(); + } - /** - * return YYYY-MM-DD 23:59:59 - * @param inputDay - * @return - */ - public static Date getEndOfHour(Date inputDay){ - Calendar cal = Calendar.getInstance(); - cal.setTime(inputDay); - cal.set(Calendar.MINUTE, 59); - cal.set(Calendar.SECOND, 59); - return cal.getTime(); - } + /** + * return YYYY-MM-DD 23:59:59 + * + * @param inputDay + * @return + */ + public static Date getEndOfHour(Date inputDay) { + Calendar cal = Calendar.getInstance(); + cal.setTime(inputDay); + cal.set(Calendar.MINUTE, 59); + cal.set(Calendar.SECOND, 59); + return cal.getTime(); + } } diff --git a/escheduler-server/src/main/java/cn/escheduler/server/master/MasterServer.java b/escheduler-server/src/main/java/cn/escheduler/server/master/MasterServer.java index 95705dd017..f877104cc1 100644 --- a/escheduler-server/src/main/java/cn/escheduler/server/master/MasterServer.java +++ b/escheduler-server/src/main/java/cn/escheduler/server/master/MasterServer.java @@ -189,7 +189,6 @@ public class MasterServer implements CommandLineRunner, IStoppable { public static void main(String[] args) { SpringApplication app = new SpringApplication(MasterServer.class); - app.setWebEnvironment(false); app.run(args); } diff --git a/pom.xml b/pom.xml index 3e5ff0d79d..3847b49fd3 100644 --- a/pom.xml +++ b/pom.xml @@ -8,12 +8,13 @@ escheduler http://maven.apache.org + UTF-8 UTF-8 2.12.0 - 4.3.7.RELEASE - 1.4.5.RELEASE + 5.1.5.RELEASE + 2.1.3.RELEASE 1.8 1.2.3 2.7.3 @@ -23,16 +24,27 @@ + + org.mybatis + mybatis + 3.5.1 + + + org.mybatis + mybatis-spring + 2.0.1 + org.mybatis.spring.boot mybatis-spring-boot-autoconfigure - 1.2.0 + 2.0.1 org.mybatis.spring.boot mybatis-spring-boot-starter - 1.2.0 + 2.0.1 + org.quartz-scheduler @@ -49,36 +61,26 @@ cron-utils 5.0.5 - - org.mybatis - mybatis - 3.4.2 - - - org.mybatis - mybatis-spring - 1.3.1 - - - org.springframework - spring-tx - ${spring.version} - - - org.springframework - spring-jdbc - ${spring.version} - + com.alibaba fastjson 1.2.29 - org.springframework.boot - spring-boot-starter-jetty - ${spring.boot.version} + com.alibaba + druid + 1.1.14 + + + org.springframework.boot + spring-boot-starter-parent + ${spring.boot.version} + pom + import + + org.springframework spring-core @@ -96,31 +98,21 @@ org.springframework - spring-test + spring-tx ${spring.version} - org.springframework.boot - spring-boot-starter-parent - ${spring.boot.version} + org.springframework + spring-jdbc + ${spring.version} - org.springframework.boot - spring-boot-starter-web - ${spring.boot.version} - - - org.springframework.boot - spring-boot-starter-test - ${spring.boot.version} - test - - - org.springframework.boot - spring-boot-starter-aop - ${spring.boot.version} + org.springframework + spring-test + ${spring.version} + cn.analysys escheduler-common @@ -146,6 +138,7 @@ escheduler-alert ${project.version} + org.apache.curator curator-framework @@ -249,11 +242,6 @@ - - com.alibaba - druid - 1.1.14 - ch.qos.logback @@ -380,7 +368,7 @@ - + scm:git:https://github.com/analysys/EasyScheduler.git scm:git:https://github.com/analysys/EasyScheduler.git From 541547e5b989d4f6a6e9544e3bc46e18fd89aece Mon Sep 17 00:00:00 2001 From: dailidong Date: Tue, 7 May 2019 17:03:37 +0800 Subject: [PATCH 02/11] /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package cn.escheduler.common.utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.sql.*; public class MysqlUtils { public static final Logger logger = LoggerFactory.getLogger(MysqlUtils.class); private static MysqlUtils instance; MysqlUtils() { } public static MysqlUtils getInstance() { if (null == instance) { syncInit(); } return instance; } private static synchronized void syncInit() { if (instance == null) { instance = new MysqlUtils(); } } public void release(ResultSet rs, Statement stmt, Connection conn) { try { if (rs != null) { rs.close(); rs = null; } } catch (SQLException e) { logger.error(e.getMessage(),e); throw new RuntimeException(e); } finally { try { if (stmt != null) { stmt.close(); stmt = null; } } catch (SQLException e) { logger.error(e.getMessage(),e); throw new RuntimeException(e); } finally { try { if (conn != null) { conn.close(); conn = null; } } catch (SQLException e) { logger.error(e.getMessage(),e); throw new RuntimeException(e); } } } } public static void releaseResource(ResultSet rs, PreparedStatement ps, Connection conn) { MysqlUtils.getInstance().release(rs,ps,conn); if (null != rs) { try { rs.close(); } catch (SQLException e) { logger.error(e.getMessage(),e); } } if (null != ps) { try { ps.close(); } catch (SQLException e) { logger.error(e.getMessage(),e); } } if (null != conn) { try { conn.close(); } catch (SQLException e) { logger.error(e.getMessage(),e); } } } } --- .../escheduler/common/utils/{MysqlUtil.java => MysqlUtils.java} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename escheduler-common/src/main/java/cn/escheduler/common/utils/{MysqlUtil.java => MysqlUtils.java} (100%) diff --git a/escheduler-common/src/main/java/cn/escheduler/common/utils/MysqlUtil.java b/escheduler-common/src/main/java/cn/escheduler/common/utils/MysqlUtils.java similarity index 100% rename from escheduler-common/src/main/java/cn/escheduler/common/utils/MysqlUtil.java rename to escheduler-common/src/main/java/cn/escheduler/common/utils/MysqlUtils.java From 5a8c8ef9436f7dbcc9535575c094dda9db4080f6 Mon Sep 17 00:00:00 2001 From: dailidong Date: Fri, 10 May 2019 11:05:12 +0800 Subject: [PATCH 03/11] =?UTF-8?q?1.0.2=E6=96=87=E6=A1=A3=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.properties | 12 +++++------ .../escheduler/common/utils/MysqlUtils.java | 16 +++++++------- .../cn/escheduler/dao/upgrade/UpgradeDao.java | 18 ++++++++-------- pom.xml | 21 +++++++++---------- 4 files changed, 32 insertions(+), 35 deletions(-) diff --git a/escheduler-api/src/main/resources/application.properties b/escheduler-api/src/main/resources/application.properties index bf003bfdda..2709f419ef 100644 --- a/escheduler-api/src/main/resources/application.properties +++ b/escheduler-api/src/main/resources/application.properties @@ -2,15 +2,13 @@ server.port=12345 # session config -server.session.timeout=7200 +server.servlet.session.timeout=7200 - -server.context-path=/escheduler/ +server.servlet.context-path=/escheduler/ # file size limit for upload -spring.http.multipart.max-file-size=1024MB -spring.http.multipart.max-request-size=1024MB +spring.servlet.multipart.max-file-size=1024MB +spring.servlet.multipart.max-request-size=1024MB #post content -server.max-http-post-size=5000000 - +server.jetty.max-http-post-size=5000000 diff --git a/escheduler-common/src/main/java/cn/escheduler/common/utils/MysqlUtils.java b/escheduler-common/src/main/java/cn/escheduler/common/utils/MysqlUtils.java index d2d1ef203d..3520527c1a 100644 --- a/escheduler-common/src/main/java/cn/escheduler/common/utils/MysqlUtils.java +++ b/escheduler-common/src/main/java/cn/escheduler/common/utils/MysqlUtils.java @@ -21,16 +21,16 @@ import org.slf4j.LoggerFactory; import java.sql.*; -public class MysqlUtil { +public class MysqlUtils { - public static final Logger logger = LoggerFactory.getLogger(MysqlUtil.class); + public static final Logger logger = LoggerFactory.getLogger(MysqlUtils.class); - private static MysqlUtil instance; + private static MysqlUtils instance; - MysqlUtil() { + MysqlUtils() { } - public static MysqlUtil getInstance() { + public static MysqlUtils getInstance() { if (null == instance) { syncInit(); } @@ -39,7 +39,7 @@ public class MysqlUtil { private static synchronized void syncInit() { if (instance == null) { - instance = new MysqlUtil(); + instance = new MysqlUtils(); } } @@ -75,8 +75,8 @@ public class MysqlUtil { } } - public static void realeaseResource(ResultSet rs, PreparedStatement ps, Connection conn) { - MysqlUtil.getInstance().release(rs,ps,conn); + public static void releaseResource(ResultSet rs, PreparedStatement ps, Connection conn) { + MysqlUtils.getInstance().release(rs,ps,conn); if (null != rs) { try { rs.close(); diff --git a/escheduler-dao/src/main/java/cn/escheduler/dao/upgrade/UpgradeDao.java b/escheduler-dao/src/main/java/cn/escheduler/dao/upgrade/UpgradeDao.java index 96199b0725..6fc8a61417 100644 --- a/escheduler-dao/src/main/java/cn/escheduler/dao/upgrade/UpgradeDao.java +++ b/escheduler-dao/src/main/java/cn/escheduler/dao/upgrade/UpgradeDao.java @@ -16,7 +16,7 @@ */ package cn.escheduler.dao.upgrade; -import cn.escheduler.common.utils.MysqlUtil; +import cn.escheduler.common.utils.MysqlUtils; import cn.escheduler.common.utils.ScriptRunner; import cn.escheduler.dao.AbstractBaseDao; import cn.escheduler.dao.datasource.ConnectionFactory; @@ -98,7 +98,7 @@ public class UpgradeDao extends AbstractBaseDao { logger.error(e.getMessage(),e); throw new RuntimeException(e.getMessage(),e); } finally { - MysqlUtil.realeaseResource(null, null, conn); + MysqlUtils.releaseResource(null, null, conn); } @@ -126,7 +126,7 @@ public class UpgradeDao extends AbstractBaseDao { logger.error(e.getMessage(),e); throw new RuntimeException(e.getMessage(),e); } finally { - MysqlUtil.realeaseResource(null, null, conn); + MysqlUtils.releaseResource(null, null, conn); } @@ -152,7 +152,7 @@ public class UpgradeDao extends AbstractBaseDao { logger.error(e.getMessage(),e); throw new RuntimeException(e.getMessage(),e); } finally { - MysqlUtil.realeaseResource(null, null, conn); + MysqlUtils.releaseResource(null, null, conn); } @@ -179,7 +179,7 @@ public class UpgradeDao extends AbstractBaseDao { logger.error(e.getMessage(),e); throw new RuntimeException(e.getMessage(),e); } finally { - MysqlUtil.realeaseResource(null, null, conn); + MysqlUtils.releaseResource(null, null, conn); } @@ -207,7 +207,7 @@ public class UpgradeDao extends AbstractBaseDao { logger.error(e.getMessage(),e); throw new RuntimeException("sql: " + sql, e); } finally { - MysqlUtil.realeaseResource(rs, pstmt, conn); + MysqlUtils.releaseResource(rs, pstmt, conn); } } @@ -277,7 +277,7 @@ public class UpgradeDao extends AbstractBaseDao { logger.error(e.getMessage(),e); throw new RuntimeException(e.getMessage(),e); } finally { - MysqlUtil.realeaseResource(null, pstmt, conn); + MysqlUtils.releaseResource(null, pstmt, conn); } } @@ -316,7 +316,7 @@ public class UpgradeDao extends AbstractBaseDao { logger.error(e.getMessage(),e); throw new RuntimeException(e.getMessage(),e); } finally { - MysqlUtil.realeaseResource(null, pstmt, conn); + MysqlUtils.releaseResource(null, pstmt, conn); } } @@ -338,7 +338,7 @@ public class UpgradeDao extends AbstractBaseDao { logger.error(e.getMessage(),e); throw new RuntimeException("sql: " + upgradeSQL, e); } finally { - MysqlUtil.realeaseResource(null, pstmt, conn); + MysqlUtils.releaseResource(null, pstmt, conn); } } diff --git a/pom.xml b/pom.xml index 3847b49fd3..4e9cc32dca 100644 --- a/pom.xml +++ b/pom.xml @@ -19,6 +19,7 @@ 1.2.3 2.7.3 2.2.3 + 2.9.8 @@ -163,27 +164,27 @@ org.apache.httpcomponents httpclient - 4.3.2 + 4.4.1 org.apache.httpcomponents httpcore - 4.3.2 + 4.4.1 com.fasterxml.jackson.core jackson-annotations - 2.8.6 + ${jackson.version} com.fasterxml.jackson.core jackson-databind - 2.8.6 + ${jackson.version} com.fasterxml.jackson.core jackson-core - 2.8.6 + ${jackson.version} @@ -241,8 +242,6 @@ 1.10 - - ch.qos.logback logback-classic @@ -368,13 +367,13 @@ - + scm:git:https://github.com/analysys/EasyScheduler.git scm:git:https://github.com/analysys/EasyScheduler.git https://github.com/analysys/EasyScheduler.git - HEAD - + HEAD + @@ -435,7 +434,7 @@ - + From 06acbe5fd5487d144e7f66eca64c200bc73642a7 Mon Sep 17 00:00:00 2001 From: lidongdai Date: Mon, 13 May 2019 20:27:42 +0800 Subject: [PATCH 04/11] =?UTF-8?q?1.0.2=E6=96=87=E6=A1=A3=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- escheduler-api/pom.xml | 50 ++++++++++++++--- .../escheduler/api/ApiApplicationServer.java | 1 + .../api/configuration/AppConfiguration.java | 10 +++- .../api/configuration/Swagger2.java | 53 +++++++++++++++++++ .../api/controller/LoginController.java | 8 +++ .../api/service/SchedulerService.java | 4 +- .../escheduler/common/queue/ITaskQueue.java | 2 +- .../mapper/ProcessInstanceMapperProvider.java | 2 +- .../dao/mapper/UserMapperProvider.java | 2 +- .../escheduler/dao/mapper/UserMapperTest.java | 6 +++ escheduler-server/pom.xml | 5 +- .../server/master/MasterServer.java | 4 +- .../server}/quartz/ProcessScheduleJob.java | 6 +-- .../server}/quartz/QuartzExecutors.java | 2 +- .../server/worker/runner/FetchTaskThread.java | 5 +- 15 files changed, 136 insertions(+), 24 deletions(-) create mode 100644 escheduler-api/src/main/java/cn/escheduler/api/configuration/Swagger2.java rename {escheduler-api/src/main/java/cn/escheduler/api => escheduler-server/src/main/java/cn/escheduler/server}/quartz/ProcessScheduleJob.java (96%) rename {escheduler-api/src/main/java/cn/escheduler/api => escheduler-server/src/main/java/cn/escheduler/server}/quartz/QuartzExecutors.java (99%) diff --git a/escheduler-api/pom.xml b/escheduler-api/pom.xml index ec94e30b27..e0e8c54a3b 100644 --- a/escheduler-api/pom.xml +++ b/escheduler-api/pom.xml @@ -1,4 +1,5 @@ - + 4.0.0 cn.analysys @@ -10,13 +11,10 @@ + cn.analysys - escheduler-dao - - - cn.analysys - escheduler-common + escheduler-server io.netty @@ -37,6 +35,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -142,6 +167,17 @@ quartz-jobs + + io.springfox + springfox-swagger2 + 2.8.0 + + + + io.springfox + springfox-swagger-ui + 2.8.0 + cn.analysys escheduler-rpc @@ -187,4 +223,4 @@ - + \ No newline at end of file diff --git a/escheduler-api/src/main/java/cn/escheduler/api/ApiApplicationServer.java b/escheduler-api/src/main/java/cn/escheduler/api/ApiApplicationServer.java index 1c66e2d4ed..5ddc72ffbc 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/ApiApplicationServer.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/ApiApplicationServer.java @@ -20,6 +20,7 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.context.annotation.ComponentScan; +import springfox.documentation.swagger2.annotations.EnableSwagger2; @SpringBootApplication @ServletComponentScan diff --git a/escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java b/escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java index 148efc1894..00272ea5a7 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java @@ -33,8 +33,16 @@ public class AppConfiguration implements WebMvcConfigurer { @Override public void addInterceptors(InterceptorRegistry registry) { - registry.addInterceptor(loginInterceptor()).addPathPatterns(LOGIN_INTERCEPTOR_PATH_PATTERN).excludePathPatterns(LOGIN_PATH_PATTERN); + registry.addInterceptor(loginInterceptor()).addPathPatterns(LOGIN_INTERCEPTOR_PATH_PATTERN).excludePathPatterns(LOGIN_PATH_PATTERN,"/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html"); } +// +// @Override +// public void addResourceHandlers(ResourceHandlerRegistry registry) { +// registry.addResourceHandler("swagger-ui.html") +// .addResourceLocations("classpath:/META-INF/resources/"); +// registry.addResourceHandler("/webjars/**") +// .addResourceLocations("classpath:/META-INF/resources/webjars/"); +// } @Bean public LoginHandlerInterceptor loginInterceptor() { diff --git a/escheduler-api/src/main/java/cn/escheduler/api/configuration/Swagger2.java b/escheduler-api/src/main/java/cn/escheduler/api/configuration/Swagger2.java new file mode 100644 index 0000000000..1e5b9b8fcb --- /dev/null +++ b/escheduler-api/src/main/java/cn/escheduler/api/configuration/Swagger2.java @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.escheduler.api.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +/** + * + * swager2 config class
+ * + */ +@Configuration +@EnableSwagger2 +public class Swagger2 implements WebMvcConfigurer { + + @Bean + public Docket createRestApi() { + return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select() + .apis(RequestHandlerSelectors.basePackage("cn.escheduler.api.controller")).paths(PathSelectors.any()) + .build(); + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder().title("api docs").description("easy scheduler api docs") + .termsOfServiceUrl("https://www.analysys.com").version("1.0.0").build(); + } + + +} diff --git a/escheduler-api/src/main/java/cn/escheduler/api/controller/LoginController.java b/escheduler-api/src/main/java/cn/escheduler/api/controller/LoginController.java index 60530c5376..061a2d404d 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/controller/LoginController.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/controller/LoginController.java @@ -23,6 +23,9 @@ import cn.escheduler.api.service.UsersService; import cn.escheduler.api.utils.Constants; import cn.escheduler.api.utils.Result; import cn.escheduler.dao.model.User; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -60,6 +63,11 @@ public class LoginController extends BaseController { * @param response * @return */ + @ApiOperation(value="更新用户详细信息", notes="根据url的id来指定更新对象,并根据传过来的user信息来更新用户详细信息") + @ApiImplicitParams({ + @ApiImplicitParam(name = "userName", value = "用户名", required = true, dataType = "String"), + @ApiImplicitParam(name = "userPassword", value = "密码", required = true, dataType = "String") + }) @RequestMapping(value = "/login") public Result login(@RequestParam(value = "userName") String userName, @RequestParam(value = "userPassword") String userPassword, diff --git a/escheduler-api/src/main/java/cn/escheduler/api/service/SchedulerService.java b/escheduler-api/src/main/java/cn/escheduler/api/service/SchedulerService.java index 232b9d7b15..ad6cfc7f50 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/service/SchedulerService.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/service/SchedulerService.java @@ -19,8 +19,8 @@ package cn.escheduler.api.service; import cn.escheduler.api.dto.ScheduleParam; import cn.escheduler.api.enums.Status; -import cn.escheduler.api.quartz.ProcessScheduleJob; -import cn.escheduler.api.quartz.QuartzExecutors; +import cn.escheduler.server.quartz.ProcessScheduleJob; +import cn.escheduler.server.quartz.QuartzExecutors; import cn.escheduler.api.utils.Constants; import cn.escheduler.api.utils.PageInfo; import cn.escheduler.common.enums.FailureStrategy; diff --git a/escheduler-common/src/main/java/cn/escheduler/common/queue/ITaskQueue.java b/escheduler-common/src/main/java/cn/escheduler/common/queue/ITaskQueue.java index 42629324a2..106d6ff915 100644 --- a/escheduler-common/src/main/java/cn/escheduler/common/queue/ITaskQueue.java +++ b/escheduler-common/src/main/java/cn/escheduler/common/queue/ITaskQueue.java @@ -54,7 +54,7 @@ public interface ITaskQueue { * an element pops out of the queue * * @param key queue name - * @param remove where remove the element + * @param remove whether remove the element * @return */ String poll(String key, boolean remove); diff --git a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessInstanceMapperProvider.java b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessInstanceMapperProvider.java index cd9daa3781..7e078b995b 100644 --- a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessInstanceMapperProvider.java +++ b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessInstanceMapperProvider.java @@ -220,7 +220,7 @@ public class ProcessInstanceMapperProvider { public String queryDetailById(Map parameter) { return new SQL() { { - SELECT("inst.*,q.queue_name as queue,t.tenant_code as tenantCode,UNIX_TIMESTAMP(inst.end_time)-UNIX_TIMESTAMP(inst.start_time) as duration"); + SELECT("inst.*,q.queue_name as queue,t.tenant_code,UNIX_TIMESTAMP(inst.end_time)-UNIX_TIMESTAMP(inst.start_time) as duration"); FROM(TABLE_NAME + " inst, t_escheduler_user u,t_escheduler_tenant t,t_escheduler_queue q"); diff --git a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapperProvider.java b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapperProvider.java index d060f46dd2..cc404c5c5c 100644 --- a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapperProvider.java +++ b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapperProvider.java @@ -208,7 +208,7 @@ public class UserMapperProvider { public String queryDetailsById(Map parameter) { return new SQL() { { - SELECT("u.*,q.queue_name as queueName,t.tenant_name as tenantName"); + SELECT("u.*,q.queue_name,t.tenant_name"); FROM(TABLE_NAME + " u,t_escheduler_tenant t,t_escheduler_queue q"); diff --git a/escheduler-dao/src/test/java/cn/escheduler/dao/mapper/UserMapperTest.java b/escheduler-dao/src/test/java/cn/escheduler/dao/mapper/UserMapperTest.java index adede0c329..d85a25f175 100644 --- a/escheduler-dao/src/test/java/cn/escheduler/dao/mapper/UserMapperTest.java +++ b/escheduler-dao/src/test/java/cn/escheduler/dao/mapper/UserMapperTest.java @@ -72,4 +72,10 @@ public class UserMapperTest { Assert.assertEquals(user.getUserName(), "qiaozhanwei"); } + @Test + public void test(){ + User user = userMapper.queryDetailsById(19); + System.out.println(user); + } + } diff --git a/escheduler-server/pom.xml b/escheduler-server/pom.xml index 3047296e09..53d6b6f8c5 100644 --- a/escheduler-server/pom.xml +++ b/escheduler-server/pom.xml @@ -46,10 +46,7 @@ - - cn.analysys - escheduler-api - + cn.analysys escheduler-rpc diff --git a/escheduler-server/src/main/java/cn/escheduler/server/master/MasterServer.java b/escheduler-server/src/main/java/cn/escheduler/server/master/MasterServer.java index f877104cc1..e137824814 100644 --- a/escheduler-server/src/main/java/cn/escheduler/server/master/MasterServer.java +++ b/escheduler-server/src/main/java/cn/escheduler/server/master/MasterServer.java @@ -16,8 +16,8 @@ */ package cn.escheduler.server.master; -import cn.escheduler.api.quartz.ProcessScheduleJob; -import cn.escheduler.api.quartz.QuartzExecutors; +import cn.escheduler.server.quartz.ProcessScheduleJob; +import cn.escheduler.server.quartz.QuartzExecutors; import cn.escheduler.common.Constants; import cn.escheduler.common.IStoppable; import cn.escheduler.common.thread.Stopper; diff --git a/escheduler-api/src/main/java/cn/escheduler/api/quartz/ProcessScheduleJob.java b/escheduler-server/src/main/java/cn/escheduler/server/quartz/ProcessScheduleJob.java similarity index 96% rename from escheduler-api/src/main/java/cn/escheduler/api/quartz/ProcessScheduleJob.java rename to escheduler-server/src/main/java/cn/escheduler/server/quartz/ProcessScheduleJob.java index 96e283d7d5..3e546bea7c 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/quartz/ProcessScheduleJob.java +++ b/escheduler-server/src/main/java/cn/escheduler/server/quartz/ProcessScheduleJob.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package cn.escheduler.api.quartz; +package cn.escheduler.server.quartz; import cn.escheduler.common.Constants; @@ -31,8 +31,8 @@ import org.springframework.util.Assert; import java.util.Date; -import static cn.escheduler.api.quartz.QuartzExecutors.buildJobGroupName; -import static cn.escheduler.api.quartz.QuartzExecutors.buildJobName; +import static cn.escheduler.server.quartz.QuartzExecutors.buildJobGroupName; +import static cn.escheduler.server.quartz.QuartzExecutors.buildJobName; /** * process schedule job diff --git a/escheduler-api/src/main/java/cn/escheduler/api/quartz/QuartzExecutors.java b/escheduler-server/src/main/java/cn/escheduler/server/quartz/QuartzExecutors.java similarity index 99% rename from escheduler-api/src/main/java/cn/escheduler/api/quartz/QuartzExecutors.java rename to escheduler-server/src/main/java/cn/escheduler/server/quartz/QuartzExecutors.java index 92e351d5cd..9a72fb95cb 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/quartz/QuartzExecutors.java +++ b/escheduler-server/src/main/java/cn/escheduler/server/quartz/QuartzExecutors.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package cn.escheduler.api.quartz; +package cn.escheduler.server.quartz; import cn.escheduler.common.Constants; import cn.escheduler.common.utils.JSONUtils; diff --git a/escheduler-server/src/main/java/cn/escheduler/server/worker/runner/FetchTaskThread.java b/escheduler-server/src/main/java/cn/escheduler/server/worker/runner/FetchTaskThread.java index f163364b06..6ad3b71f04 100644 --- a/escheduler-server/src/main/java/cn/escheduler/server/worker/runner/FetchTaskThread.java +++ b/escheduler-server/src/main/java/cn/escheduler/server/worker/runner/FetchTaskThread.java @@ -134,7 +134,7 @@ public class FetchTaskThread implements Runnable{ public void run() { while (Stopper.isRunning()){ - + long start = System.currentTimeMillis(); InterProcessMutex mutex = null; try { if(OSUtils.checkResource(this.conf, false)) { @@ -221,7 +221,10 @@ public class FetchTaskThread implements Runnable{ logger.info("task : {} ready to submit to task scheduler thread",taskId); // submit task workerExecService.submit(new TaskScheduleThread(taskInstance, processDao)); + + logger.info("{} 耗时: {} ms",taskQueueStr,System.currentTimeMillis() - start ); } + } } From 6d5368824f8cfc049df5e956cf83d22a07462466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E9=92=A6=E9=BE=99?= Date: Wed, 15 May 2019 11:21:38 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E5=90=AF=E7=94=A8SSL=E7=9A=84=E9=82=AE?= =?UTF-8?q?=E7=AE=B1=E5=8F=91=E9=80=81=E9=82=AE=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/cn/escheduler/alert/utils/Constants.java | 2 ++ .../main/java/cn/escheduler/alert/utils/MailUtils.java | 9 ++++++++- escheduler-alert/src/main/resources/alert.properties | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/escheduler-alert/src/main/java/cn/escheduler/alert/utils/Constants.java b/escheduler-alert/src/main/java/cn/escheduler/alert/utils/Constants.java index 07d1866a5d..1e1a7671e8 100644 --- a/escheduler-alert/src/main/java/cn/escheduler/alert/utils/Constants.java +++ b/escheduler-alert/src/main/java/cn/escheduler/alert/utils/Constants.java @@ -59,6 +59,8 @@ public class Constants { public static final String MAIL_SMTP_STARTTLS_ENABLE = "mail.smtp.starttls.enable"; + public static final String MAIL_SMTP_SSL_ENABLE = "mail.smtp.ssl.enable"; + public static final String TEXT_HTML_CHARSET_UTF_8 = "text/html;charset=utf-8"; public static final String STRING_TRUE = "true"; diff --git a/escheduler-alert/src/main/java/cn/escheduler/alert/utils/MailUtils.java b/escheduler-alert/src/main/java/cn/escheduler/alert/utils/MailUtils.java index 0e514ffee6..4ebdd80522 100644 --- a/escheduler-alert/src/main/java/cn/escheduler/alert/utils/MailUtils.java +++ b/escheduler-alert/src/main/java/cn/escheduler/alert/utils/MailUtils.java @@ -35,6 +35,7 @@ import javax.mail.internet.*; import java.io.*; import java.util.*; +import static cn.escheduler.alert.utils.PropertyUtils.getBoolean; import static cn.escheduler.alert.utils.PropertyUtils.getInt; import static cn.escheduler.alert.utils.PropertyUtils.getString; @@ -56,6 +57,10 @@ public class MailUtils { public static final String mailPasswd = getString(Constants.MAIL_PASSWD); + public static final Boolean mailUseStartTLS = getBoolean(Constants.MAIL_SMTP_STARTTLS_ENABLE); + + public static final Boolean mailUseSSL = getBoolean(Constants.MAIL_SMTP_SSL_ENABLE); + public static final String xlsFilePath = getString(Constants.XLS_FILE_PATH); private static Template MAIL_TEMPLATE; @@ -122,7 +127,9 @@ public class MailUtils { //set charset email.setCharset(Constants.UTF_8); // TLS verification - email.setTLS(true); + email.setTLS(mailUseStartTLS); + // SSL verification + email.setSSL(mailUseSSL); if (CollectionUtils.isNotEmpty(receivers)){ // receivers mail for (String receiver : receivers) { diff --git a/escheduler-alert/src/main/resources/alert.properties b/escheduler-alert/src/main/resources/alert.properties index e2cba1160d..0be0dc2974 100644 --- a/escheduler-alert/src/main/resources/alert.properties +++ b/escheduler-alert/src/main/resources/alert.properties @@ -8,6 +8,9 @@ mail.server.port=25 mail.sender=xxxxxxx mail.passwd=xxxxxxx +mail.smtp.starttls.enable=false +mail.smtp.ssl.enable=true + #xls file path,need create if not exist xls.file.path=/opt/xls From dc55de4e8600087e650b65049ff5e58f77b0ca93 Mon Sep 17 00:00:00 2001 From: lidongdai Date: Wed, 15 May 2019 15:38:46 +0800 Subject: [PATCH 06/11] =?UTF-8?q?1.0.2=E6=96=87=E6=A1=A3=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- escheduler-api/pom.xml | 44 +++++--------- .../escheduler/api/ApiApplicationServer.java | 7 ++- .../api/configuration/AppConfiguration.java | 58 +++++++++++++++---- .../{Swagger2.java => SwaggerConfig.java} | 8 ++- .../api/configuration/SwaggerI18nPlugin.java | 52 +++++++++++++++++ .../api/controller/LoginController.java | 17 +++++- .../src/main/resources/application.properties | 5 ++ .../src/main/resources/messages.properties | 5 ++ .../main/resources/messages_en_US.properties | 5 ++ .../main/resources/messages_zh_CN.properties | 5 ++ .../server/worker/runner/FetchTaskThread.java | 2 - pom.xml | 7 ++- 12 files changed, 163 insertions(+), 52 deletions(-) rename escheduler-api/src/main/java/cn/escheduler/api/configuration/{Swagger2.java => SwaggerConfig.java} (85%) create mode 100644 escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerI18nPlugin.java create mode 100644 escheduler-api/src/main/resources/messages.properties create mode 100644 escheduler-api/src/main/resources/messages_en_US.properties create mode 100644 escheduler-api/src/main/resources/messages_zh_CN.properties diff --git a/escheduler-api/pom.xml b/escheduler-api/pom.xml index e0e8c54a3b..31120c3883 100644 --- a/escheduler-api/pom.xml +++ b/escheduler-api/pom.xml @@ -35,35 +35,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - org.springframework.boot spring-boot-starter-web @@ -170,14 +142,21 @@ io.springfox springfox-swagger2 - 2.8.0 + 2.9.2 io.springfox springfox-swagger-ui - 2.8.0 + 2.9.2 + + + com.github.xiaoymin + swagger-bootstrap-ui + 1.9.3 + + cn.analysys escheduler-rpc @@ -189,6 +168,11 @@ 4.12 test + + io.swagger + swagger-jaxrs + 1.5.12 + diff --git a/escheduler-api/src/main/java/cn/escheduler/api/ApiApplicationServer.java b/escheduler-api/src/main/java/cn/escheduler/api/ApiApplicationServer.java index 5ddc72ffbc..9b84c7f2f7 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/ApiApplicationServer.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/ApiApplicationServer.java @@ -19,14 +19,19 @@ package cn.escheduler.api; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.servlet.ServletComponentScan; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.context.annotation.ComponentScan; import springfox.documentation.swagger2.annotations.EnableSwagger2; @SpringBootApplication @ServletComponentScan @ComponentScan("cn.escheduler") -public class ApiApplicationServer { +@EnableSwagger2 +public class ApiApplicationServer extends SpringBootServletInitializer { + public static void main(String[] args) { SpringApplication.run(ApiApplicationServer.class, args); } + + } diff --git a/escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java b/escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java index 00272ea5a7..74a29a13b5 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java @@ -20,6 +20,12 @@ import cn.escheduler.api.interceptor.LoginHandlerInterceptor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.*; +import org.springframework.web.servlet.LocaleResolver; +import org.springframework.web.servlet.i18n.CookieLocaleResolver; +import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; + +import java.util.Locale; + /** * application configuration @@ -31,24 +37,48 @@ public class AppConfiguration implements WebMvcConfigurer { public static final String LOGIN_PATH_PATTERN = "/login"; public static final String PATH_PATTERN = "/**"; - @Override - public void addInterceptors(InterceptorRegistry registry) { - registry.addInterceptor(loginInterceptor()).addPathPatterns(LOGIN_INTERCEPTOR_PATH_PATTERN).excludePathPatterns(LOGIN_PATH_PATTERN,"/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html"); - } -// -// @Override -// public void addResourceHandlers(ResourceHandlerRegistry registry) { -// registry.addResourceHandler("swagger-ui.html") -// .addResourceLocations("classpath:/META-INF/resources/"); -// registry.addResourceHandler("/webjars/**") -// .addResourceLocations("classpath:/META-INF/resources/webjars/"); -// } @Bean public LoginHandlerInterceptor loginInterceptor() { return new LoginHandlerInterceptor(); } + + //Cookie + @Bean + public LocaleResolver localeResolver() { + CookieLocaleResolver localeResolver = new CookieLocaleResolver(); + localeResolver.setCookieName("localeCookie"); + //设置默认区域 + localeResolver.setDefaultLocale(Locale.ENGLISH); + localeResolver.setCookieMaxAge(3600);//设置cookie有效期. + return localeResolver; + } + + @Bean + public LocaleChangeInterceptor localeChangeInterceptor() { + LocaleChangeInterceptor lci = new LocaleChangeInterceptor(); + // 参数名 + lci.setParamName("lang"); + + return lci; + } + + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(loginInterceptor()).addPathPatterns(LOGIN_INTERCEPTOR_PATH_PATTERN).excludePathPatterns(LOGIN_PATH_PATTERN,"/swagger-resources/**", "/webjars/**", "/v2/**", "/doc.html", "*.html"); + //i18n + registry.addInterceptor(localeChangeInterceptor()); + } + + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/"); + registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); + } + @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping(PATH_PATTERN).allowedOrigins("*").allowedMethods("*"); @@ -64,4 +94,8 @@ public class AppConfiguration implements WebMvcConfigurer { public void configureContentNegotiation(final ContentNegotiationConfigurer configurer) { configurer.favorPathExtension(false); } + + + + } diff --git a/escheduler-api/src/main/java/cn/escheduler/api/configuration/Swagger2.java b/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerConfig.java similarity index 85% rename from escheduler-api/src/main/java/cn/escheduler/api/configuration/Swagger2.java rename to escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerConfig.java index 1e5b9b8fcb..f55d04ab92 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/configuration/Swagger2.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerConfig.java @@ -16,6 +16,7 @@ */ package cn.escheduler.api.configuration; +import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -35,7 +36,8 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; */ @Configuration @EnableSwagger2 -public class Swagger2 implements WebMvcConfigurer { +@EnableSwaggerBootstrapUI +public class SwaggerConfig implements WebMvcConfigurer { @Bean public Docket createRestApi() { @@ -45,8 +47,8 @@ public class Swagger2 implements WebMvcConfigurer { } private ApiInfo apiInfo() { - return new ApiInfoBuilder().title("api docs").description("easy scheduler api docs") - .termsOfServiceUrl("https://www.analysys.com").version("1.0.0").build(); + return new ApiInfoBuilder().title("Easy Scheduler Api Docs").description("Easy Scheduler Api Docs") + .version("1.0.0").build(); } diff --git a/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerI18nPlugin.java b/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerI18nPlugin.java new file mode 100644 index 0000000000..4e4be961e5 --- /dev/null +++ b/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerI18nPlugin.java @@ -0,0 +1,52 @@ +package cn.escheduler.api.configuration; + +import java.util.List; +import java.util.Locale; +import com.fasterxml.classmate.TypeResolver; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; + +import io.swagger.annotations.ApiOperation; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spi.service.OperationBuilderPlugin; +import springfox.documentation.spi.service.contexts.OperationContext; + + +@Component +@Order(Ordered.HIGHEST_PRECEDENCE - 10) +public class SwaggerI18nPlugin implements OperationBuilderPlugin { + + private static final Logger logger = LoggerFactory.getLogger(SwaggerI18nPlugin.class); + + @Autowired + private MessageSource messageSource; + + @Override + public void apply(OperationContext context) { + + Locale locale = LocaleContextHolder.getLocale(); + + List list = context.findAllAnnotations(ApiOperation.class); + if (list.size() > 0) { + for(ApiOperation api : list){ + context.operationBuilder().summary(messageSource.getMessage(api.value(), null, locale)); + context.operationBuilder().notes(messageSource.getMessage(api.notes(), null, locale)); + } + } + + + } + + + @Override + public boolean supports(DocumentationType delimiter) { + return true; + } + +} diff --git a/escheduler-api/src/main/java/cn/escheduler/api/controller/LoginController.java b/escheduler-api/src/main/java/cn/escheduler/api/controller/LoginController.java index 061a2d404d..cd46574d50 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/controller/LoginController.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/controller/LoginController.java @@ -23,6 +23,7 @@ import cn.escheduler.api.service.UsersService; import cn.escheduler.api.utils.Constants; import cn.escheduler.api.utils.Result; import cn.escheduler.dao.model.User; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; @@ -31,12 +32,16 @@ import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.web.bind.annotation.*; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.util.Locale; + import static cn.escheduler.api.enums.Status.*; /** @@ -44,16 +49,22 @@ import static cn.escheduler.api.enums.Status.*; */ @RestController @RequestMapping("") +@Api(value = "", tags = {"中国"}, description = "中国") public class LoginController extends BaseController { private static final Logger logger = LoggerFactory.getLogger(LoginController.class); + private Locale locale = LocaleContextHolder.getLocale(); + @Autowired private SessionService sessionService; @Autowired private UsersService userService; + @Autowired + private MessageSource messageSource; + /** * login * @@ -63,10 +74,10 @@ public class LoginController extends BaseController { * @param response * @return */ - @ApiOperation(value="更新用户详细信息", notes="根据url的id来指定更新对象,并根据传过来的user信息来更新用户详细信息") + @ApiOperation(value = "test", notes="loginNotes") @ApiImplicitParams({ - @ApiImplicitParam(name = "userName", value = "用户名", required = true, dataType = "String"), - @ApiImplicitParam(name = "userPassword", value = "密码", required = true, dataType = "String") + @ApiImplicitParam(name = "userName", value = "userName", required = true, type = "String"), + @ApiImplicitParam(name = "userPassword", value = "userPassword", required = true, type ="String") }) @RequestMapping(value = "/login") public Result login(@RequestParam(value = "userName") String userName, diff --git a/escheduler-api/src/main/resources/application.properties b/escheduler-api/src/main/resources/application.properties index 2709f419ef..118b70e616 100644 --- a/escheduler-api/src/main/resources/application.properties +++ b/escheduler-api/src/main/resources/application.properties @@ -12,3 +12,8 @@ spring.servlet.multipart.max-request-size=1024MB #post content server.jetty.max-http-post-size=5000000 + +spring.messages.encoding=UTF-8 + +#i18n classpath folder , file prefix messages, if have many files, use "," seperator +spring.messages.basename=messages diff --git a/escheduler-api/src/main/resources/messages.properties b/escheduler-api/src/main/resources/messages.properties new file mode 100644 index 0000000000..89ddfd5201 --- /dev/null +++ b/escheduler-api/src/main/resources/messages.properties @@ -0,0 +1,5 @@ +welcome=hello, welcome ! +test=test +userName=user name +userPassword=user password +loginNotes=login notes \ No newline at end of file diff --git a/escheduler-api/src/main/resources/messages_en_US.properties b/escheduler-api/src/main/resources/messages_en_US.properties new file mode 100644 index 0000000000..89ddfd5201 --- /dev/null +++ b/escheduler-api/src/main/resources/messages_en_US.properties @@ -0,0 +1,5 @@ +welcome=hello, welcome ! +test=test +userName=user name +userPassword=user password +loginNotes=login notes \ No newline at end of file diff --git a/escheduler-api/src/main/resources/messages_zh_CN.properties b/escheduler-api/src/main/resources/messages_zh_CN.properties new file mode 100644 index 0000000000..4c21e73399 --- /dev/null +++ b/escheduler-api/src/main/resources/messages_zh_CN.properties @@ -0,0 +1,5 @@ +welcome=您好,欢迎你! +test=测试 +userName=用户名 +userPassword=用户密码 +loginNotes=登录xxx \ No newline at end of file diff --git a/escheduler-server/src/main/java/cn/escheduler/server/worker/runner/FetchTaskThread.java b/escheduler-server/src/main/java/cn/escheduler/server/worker/runner/FetchTaskThread.java index 6ad3b71f04..3ecafde57a 100644 --- a/escheduler-server/src/main/java/cn/escheduler/server/worker/runner/FetchTaskThread.java +++ b/escheduler-server/src/main/java/cn/escheduler/server/worker/runner/FetchTaskThread.java @@ -134,7 +134,6 @@ public class FetchTaskThread implements Runnable{ public void run() { while (Stopper.isRunning()){ - long start = System.currentTimeMillis(); InterProcessMutex mutex = null; try { if(OSUtils.checkResource(this.conf, false)) { @@ -222,7 +221,6 @@ public class FetchTaskThread implements Runnable{ // submit task workerExecService.submit(new TaskScheduleThread(taskInstance, processDao)); - logger.info("{} 耗时: {} ms",taskQueueStr,System.currentTimeMillis() - start ); } } diff --git a/pom.xml b/pom.xml index 4e9cc32dca..ee2b1b3626 100644 --- a/pom.xml +++ b/pom.xml @@ -114,6 +114,11 @@ + + cn.analysys + escheduler-server + ${project.version} + cn.analysys escheduler-common @@ -326,7 +331,7 @@ com.google.guava guava - 19.0 + 20.0 From bb1fa37e31c3212156f05bae71d7b2b452f7dfa4 Mon Sep 17 00:00:00 2001 From: lidongdai Date: Fri, 17 May 2019 18:50:10 +0800 Subject: [PATCH 07/11] use swagger for api docs --- .../api/configuration/AppConfiguration.java | 15 +- .../SwaggerApiImplicitParamPlugin.java | 109 + .../SwaggerApiImplicitParamsPlugin.java | 71 + .../configuration/SwaggerApiModelPlugin.java | 74 + .../SwaggerApiModelPropertyPlugin.java | 219 + .../SwaggerApiOperationPlugin.java | 141 + .../configuration/SwaggerApiParamPlugin.java | 115 + .../api/configuration/SwaggerApiPlugin.java | 74 + .../api/configuration/SwaggerI18nPlugin.java | 52 - .../api/controller/ExecutorController.java | 1 + .../api/controller/LoggerController.java | 18 +- .../api/controller/LoginController.java | 30 +- .../ProcessDefinitionController.java | 133 +- .../controller/ProcessInstanceController.java | 96 +- .../api/controller/SchedulerController.java | 279 +- .../controller/TaskInstanceController.java | 19 +- .../api/controller/UsersController.java | 99 +- .../src/main/resources/messages.properties | 103 +- .../main/resources/messages_en_US.properties | 103 +- .../main/resources/messages_zh_CN.properties | 102 +- .../common/enums/ExecutionStatus.java | 2 +- escheduler-dao/pom.xml | 8 +- .../java/cn/escheduler/dao/model/User.java | 7 + escheduler-ui/dist/combo/1.0.0/3rd.css | 5 - escheduler-ui/dist/combo/1.0.0/3rd.js | 10783 ---------------- escheduler-ui/dist/combo/1.0.0/base.css | 8 - escheduler-ui/dist/combo/1.0.0/es5.js | 14 - escheduler-ui/dist/combo/1.0.0/local.js | 1 - escheduler-ui/dist/css/common.8ba9af7.css | 1 - .../dist/font/fontawesome-webfont.674f50d.eot | Bin 165742 -> 0 bytes .../font/fontawesome-webfont.af7ae50.woff2 | Bin 77160 -> 0 bytes .../dist/font/fontawesome-webfont.b06871f.ttf | Bin 165548 -> 0 bytes .../font/fontawesome-webfont.fee66e7.woff | Bin 98024 -> 0 bytes escheduler-ui/dist/font/iconfont.4f692dd.ttf | Bin 20992 -> 0 bytes escheduler-ui/dist/font/iconfont.6f38b93.eot | Bin 21160 -> 0 bytes escheduler-ui/dist/font/iconfont.be17177.woff | Bin 12684 -> 0 bytes escheduler-ui/dist/images/close.png | Bin 550 -> 0 bytes escheduler-ui/dist/images/dag_bg.png | Bin 5101 -> 0 bytes escheduler-ui/dist/images/down_error.png | Bin 6390 -> 0 bytes escheduler-ui/dist/images/errorTip.png | Bin 4187 -> 0 bytes escheduler-ui/dist/images/favicon.ico | Bin 4286 -> 0 bytes .../dist/images/fontawesome-webfont.svg | 2671 ---- escheduler-ui/dist/images/iconfont.svg | 266 - escheduler-ui/dist/images/login-logo.png | Bin 8007 -> 0 bytes escheduler-ui/dist/images/logo.png | Bin 5888 -> 0 bytes escheduler-ui/dist/images/m_logo.png | Bin 3571 -> 0 bytes escheduler-ui/dist/images/open.png | Bin 586 -> 0 bytes .../dist/images/toolbar_DEPENDENT.png | Bin 2896 -> 0 bytes escheduler-ui/dist/images/toolbar_MR.png | Bin 3675 -> 0 bytes .../dist/images/toolbar_PROCEDURE.png | Bin 3464 -> 0 bytes escheduler-ui/dist/images/toolbar_PYTHON.png | Bin 3554 -> 0 bytes escheduler-ui/dist/images/toolbar_SHELL.png | Bin 3297 -> 0 bytes escheduler-ui/dist/images/toolbar_SPARK.png | Bin 4188 -> 0 bytes escheduler-ui/dist/images/toolbar_SQL.png | Bin 3014 -> 0 bytes .../dist/images/toolbar_SUB_PROCESS.png | Bin 2377 -> 0 bytes escheduler-ui/dist/index.html | 7 - escheduler-ui/dist/js/0.bf0a1e2.js | 2 - escheduler-ui/dist/js/0.bf0a1e2.js.map | 1 - escheduler-ui/dist/js/1.3ff7adc.js | 2 - escheduler-ui/dist/js/1.3ff7adc.js.map | 1 - escheduler-ui/dist/js/10.90da74f.js | 2 - escheduler-ui/dist/js/10.90da74f.js.map | 1 - escheduler-ui/dist/js/11.ca8ac79.js | 2 - escheduler-ui/dist/js/11.ca8ac79.js.map | 1 - escheduler-ui/dist/js/12.b6fb265.js | 2 - escheduler-ui/dist/js/12.b6fb265.js.map | 1 - escheduler-ui/dist/js/13.a8f5ee9.js | 2 - escheduler-ui/dist/js/13.a8f5ee9.js.map | 1 - escheduler-ui/dist/js/14.10001b2.js | 2 - escheduler-ui/dist/js/14.10001b2.js.map | 1 - escheduler-ui/dist/js/15.9119d76.js | 2 - escheduler-ui/dist/js/15.9119d76.js.map | 1 - escheduler-ui/dist/js/16.648c64b.js | 2 - escheduler-ui/dist/js/16.648c64b.js.map | 1 - escheduler-ui/dist/js/17.6761755.js | 9 - escheduler-ui/dist/js/17.6761755.js.map | 1 - escheduler-ui/dist/js/18.3bc2e58.js | 2 - escheduler-ui/dist/js/18.3bc2e58.js.map | 1 - escheduler-ui/dist/js/19.5ce986e.js | 2 - escheduler-ui/dist/js/19.5ce986e.js.map | 1 - escheduler-ui/dist/js/2.3b16c4b.js | 2 - escheduler-ui/dist/js/2.3b16c4b.js.map | 1 - escheduler-ui/dist/js/20.ef7f230.js | 2 - escheduler-ui/dist/js/20.ef7f230.js.map | 1 - escheduler-ui/dist/js/21.b587019.js | 2 - escheduler-ui/dist/js/21.b587019.js.map | 1 - escheduler-ui/dist/js/22.f33bbc0.js | 2 - escheduler-ui/dist/js/22.f33bbc0.js.map | 1 - escheduler-ui/dist/js/23.bb2b238.js | 2 - escheduler-ui/dist/js/23.bb2b238.js.map | 1 - escheduler-ui/dist/js/24.6e296a1.js | 2 - escheduler-ui/dist/js/24.6e296a1.js.map | 1 - escheduler-ui/dist/js/25.079b6f7.js | 2 - escheduler-ui/dist/js/25.079b6f7.js.map | 1 - escheduler-ui/dist/js/26.4fc30f8.js | 2 - escheduler-ui/dist/js/26.4fc30f8.js.map | 1 - escheduler-ui/dist/js/27.77c2a5a.js | 2 - escheduler-ui/dist/js/27.77c2a5a.js.map | 1 - escheduler-ui/dist/js/28.3e34ffe.js | 2 - escheduler-ui/dist/js/28.3e34ffe.js.map | 1 - escheduler-ui/dist/js/29.f8fb5e9.js | 2 - escheduler-ui/dist/js/29.f8fb5e9.js.map | 1 - escheduler-ui/dist/js/3.88f23f8.js | 2 - escheduler-ui/dist/js/3.88f23f8.js.map | 1 - escheduler-ui/dist/js/30.b5bd614.js | 2 - escheduler-ui/dist/js/30.b5bd614.js.map | 1 - escheduler-ui/dist/js/31.6fcd9a5.js | 2 - escheduler-ui/dist/js/31.6fcd9a5.js.map | 1 - escheduler-ui/dist/js/32.78a13b7.js | 2 - escheduler-ui/dist/js/32.78a13b7.js.map | 1 - escheduler-ui/dist/js/33.6f78a15.js | 2 - escheduler-ui/dist/js/33.6f78a15.js.map | 1 - escheduler-ui/dist/js/34.14935c5.js | 2 - escheduler-ui/dist/js/34.14935c5.js.map | 1 - escheduler-ui/dist/js/35.54f8ec4.js | 2 - escheduler-ui/dist/js/35.54f8ec4.js.map | 1 - escheduler-ui/dist/js/36.b17120a.js | 2 - escheduler-ui/dist/js/36.b17120a.js.map | 1 - escheduler-ui/dist/js/37.aa790c9.js | 2 - escheduler-ui/dist/js/37.aa790c9.js.map | 1 - escheduler-ui/dist/js/38.fb0602d.js | 2 - escheduler-ui/dist/js/38.fb0602d.js.map | 1 - escheduler-ui/dist/js/39.85e5891.js | 2 - escheduler-ui/dist/js/39.85e5891.js.map | 1 - escheduler-ui/dist/js/4.d3398c4.js | 2 - escheduler-ui/dist/js/4.d3398c4.js.map | 1 - escheduler-ui/dist/js/40.7eb5806.js | 2 - escheduler-ui/dist/js/40.7eb5806.js.map | 1 - escheduler-ui/dist/js/41.089f7ce.js | 2 - escheduler-ui/dist/js/41.089f7ce.js.map | 1 - escheduler-ui/dist/js/42.b6a308c.js | 2 - escheduler-ui/dist/js/42.b6a308c.js.map | 1 - escheduler-ui/dist/js/43.5e4f13e.js | 2 - escheduler-ui/dist/js/43.5e4f13e.js.map | 1 - escheduler-ui/dist/js/44.0035849.js | 2 - escheduler-ui/dist/js/44.0035849.js.map | 1 - escheduler-ui/dist/js/45.02af8bb.js | 2 - escheduler-ui/dist/js/45.02af8bb.js.map | 1 - escheduler-ui/dist/js/5.2b55fd9.js | 2 - escheduler-ui/dist/js/5.2b55fd9.js.map | 1 - escheduler-ui/dist/js/6.c7ff80d.js | 2 - escheduler-ui/dist/js/6.c7ff80d.js.map | 1 - escheduler-ui/dist/js/7.073bd0f.js | 2 - escheduler-ui/dist/js/7.073bd0f.js.map | 1 - escheduler-ui/dist/js/8.af1dc8f.js | 2 - escheduler-ui/dist/js/8.af1dc8f.js.map | 1 - escheduler-ui/dist/js/9.a5a7679.js | 2 - escheduler-ui/dist/js/9.a5a7679.js.map | 1 - escheduler-ui/dist/js/common.6428411.js | 41 - escheduler-ui/dist/js/common.6428411.js.map | 1 - escheduler-ui/dist/js/home/index.1b09c2f.js | 2 - .../dist/js/home/index.1b09c2f.js.map | 1 - escheduler-ui/dist/js/login/index.97eaebb.js | 2 - .../dist/js/login/index.97eaebb.js.map | 1 - .../dist/lib/@analysys/ana-charts/README.md | 405 - .../lib/@analysys/ana-charts/build/config.js | 60 - .../ana-charts/build/webpack.config.prod.js | 104 - .../lib/@analysys/ana-charts/dist/index.js | 2 - .../@analysys/ana-charts/dist/index.js.map | 1 - .../lib/@analysys/ana-charts/example/app.vue | 87 - .../@analysys/ana-charts/example/index.html | 15 - .../lib/@analysys/ana-charts/example/index.js | 14 - .../@analysys/ana-charts/example/mock/data.js | 58 - .../ana-charts/example/mock/theme.json | 494 - .../ana-charts/example/packages/bar.vue | 72 - .../ana-charts/example/packages/funnel.vue | 23 - .../ana-charts/example/packages/line.vue | 29 - .../ana-charts/example/packages/pie.vue | 29 - .../ana-charts/example/packages/radar.vue | 23 - .../ana-charts/example/packages/scatter.vue | 23 - .../ana-charts/example/router/index.js | 53 - .../ana-charts/example/styles/main.scss | 77 - .../lib/@analysys/ana-charts/package.json | 65 - .../@analysys/ana-charts/postcss.config.js | 7 - .../dist/lib/@analysys/ans-ui/README.md | 55 - .../lib/@analysys/ans-ui/lib/ans-ui.min.css | 1 - .../lib/@analysys/ans-ui/lib/ans-ui.min.js | 40 - .../@analysys/ans-ui/lib/font/iconfont.eot | Bin 7428 -> 0 bytes .../@analysys/ans-ui/lib/font/iconfont.svg | 104 - .../@analysys/ans-ui/lib/font/iconfont.ttf | Bin 7260 -> 0 bytes .../@analysys/ans-ui/lib/font/iconfont.woff | Bin 4256 -> 0 bytes .../lib/@analysys/ans-ui/lib/locale/en.js | 2 - .../lib/@analysys/ans-ui/lib/locale/en.js.map | 1 - .../lib/@analysys/ans-ui/lib/locale/zh-CN.js | 2 - .../@analysys/ans-ui/lib/locale/zh-CN.js.map | 1 - .../dist/lib/@analysys/ans-ui/package.json | 96 - .../ans-ui/packages/vue-box/README.md | 73 - .../ans-ui/packages/vue-box/example/app.vue | 221 - .../packages/vue-box/example/index.html | 16 - .../ans-ui/packages/vue-box/example/index.js | 10 - .../ans-ui/packages/vue-box/src/index.js | 9 - .../packages/vue-box/src/source/base/Box.vue | 135 - .../vue-box/src/source/base/BoxManager.vue | 106 - .../packages/vue-box/src/source/base/index.js | 40 - .../src/source/layer/message/message.js | 99 - .../vue-box/src/source/layer/modal/modal.js | 203 - .../vue-box/src/source/layer/notice/notice.js | 104 - .../ans-ui/packages/vue-button/README.md | 28 - .../packages/vue-button/example/app.vue | 227 - .../packages/vue-button/example/index.html | 16 - .../packages/vue-button/example/index.js | 10 - .../ans-ui/packages/vue-button/src/index.js | 7 - .../packages/vue-button/src/source/Button.vue | 145 - .../vue-button/src/source/ButtonGroup.vue | 152 - .../ans-ui/packages/vue-cascader/README.md | 32 - .../packages/vue-cascader/example/app.vue | 83 - .../packages/vue-cascader/example/data.js | 635 - .../packages/vue-cascader/example/index.html | 16 - .../packages/vue-cascader/example/index.js | 10 - .../ans-ui/packages/vue-cascader/src/index.js | 8 - .../vue-cascader/src/source/Cascader.vue | 440 - .../vue-cascader/src/source/Caspanel.vue | 213 - .../ans-ui/packages/vue-checkbox/README.md | 31 - .../packages/vue-checkbox/example/app.vue | 48 - .../packages/vue-checkbox/example/index.html | 16 - .../packages/vue-checkbox/example/index.js | 10 - .../ans-ui/packages/vue-checkbox/src/index.js | 7 - .../vue-checkbox/src/source/Checkbox.vue | 117 - .../vue-checkbox/src/source/CheckboxGroup.vue | 64 - .../ans-ui/packages/vue-datepicker/README.md | 30 - .../packages/vue-datepicker/example/app.vue | 103 - .../vue-datepicker/example/index.html | 16 - .../packages/vue-datepicker/example/index.js | 10 - .../packages/vue-datepicker/src/index.js | 4 - .../src/source/base/confirm.vue | 69 - .../vue-datepicker/src/source/base/day.vue | 260 - .../vue-datepicker/src/source/base/time.vue | 180 - .../vue-datepicker/src/source/base/years.vue | 120 - .../vue-datepicker/src/source/datepicker.vue | 406 - .../vue-datepicker/src/source/panel/date.vue | 114 - .../src/source/panel/daterange.vue | 436 - .../vue-datepicker/src/source/panel/month.vue | 41 - .../vue-datepicker/src/source/panel/time.vue | 0 .../vue-datepicker/src/source/panel/year.vue | 0 .../vue-datepicker/src/source/util/date.js | 324 - .../vue-datepicker/src/source/util/isType.js | 12 - .../vue-datepicker/src/source/util/isValid.js | 12 - .../vue-datepicker/src/source/util/ishms.js | 15 - .../vue-datepicker/src/source/util/todate.js | 9 - .../ans-ui/packages/vue-drawer/README.md | 15 - .../packages/vue-drawer/example/app.vue | 68 - .../packages/vue-drawer/example/index.html | 16 - .../packages/vue-drawer/example/index.js | 7 - .../packages/vue-drawer/example/test.vue | 18 - .../ans-ui/packages/vue-drawer/src/index.js | 5 - .../packages/vue-drawer/src/source/drawer.js | 33 - .../ans-ui/packages/vue-form/README.md | 41 - .../ans-ui/packages/vue-form/example/app.vue | 141 - .../packages/vue-form/example/index.html | 16 - .../ans-ui/packages/vue-form/example/index.js | 10 - .../ans-ui/packages/vue-form/src/index.js | 7 - .../packages/vue-form/src/source/Form.vue | 93 - .../packages/vue-form/src/source/FormItem.vue | 253 - .../ans-ui/packages/vue-input/README.md | 57 - .../ans-ui/packages/vue-input/example/app.vue | 122 - .../packages/vue-input/example/index.html | 16 - .../packages/vue-input/example/index.js | 10 - .../ans-ui/packages/vue-input/src/index.js | 5 - .../packages/vue-input/src/source/Input.vue | 354 - .../src/source/util/calcTextareaHeight.js | 105 - .../ans-ui/packages/vue-pagination/README.md | 24 - .../packages/vue-pagination/example/app.vue | 64 - .../vue-pagination/example/index.html | 16 - .../packages/vue-pagination/example/index.js | 10 - .../packages/vue-pagination/src/index.js | 3 - .../vue-pagination/src/source/Page.vue | 432 - .../ans-ui/packages/vue-poptip/README.md | 38 - .../packages/vue-poptip/example/app.vue | 91 - .../packages/vue-poptip/example/index.html | 16 - .../packages/vue-poptip/example/index.js | 13 - .../ans-ui/packages/vue-poptip/src/index.js | 13 - .../packages/vue-poptip/src/source/Poptip.vue | 254 - .../vue-poptip/src/source/directive.js | 8 - .../ans-ui/packages/vue-progress/README.md | 25 - .../packages/vue-progress/example/app.vue | 104 - .../packages/vue-progress/example/index.html | 16 - .../packages/vue-progress/example/index.js | 10 - .../ans-ui/packages/vue-progress/src/index.js | 5 - .../vue-progress/src/source/Progress.vue | 172 - .../ans-ui/packages/vue-radio/README.md | 36 - .../ans-ui/packages/vue-radio/example/app.vue | 71 - .../packages/vue-radio/example/index.html | 16 - .../packages/vue-radio/example/index.js | 10 - .../ans-ui/packages/vue-radio/src/index.js | 7 - .../packages/vue-radio/src/source/Radio.vue | 154 - .../vue-radio/src/source/RadioGroup.vue | 74 - .../ans-ui/packages/vue-scroller/README.md | 42 - .../packages/vue-scroller/example/app.vue | 28 - .../packages/vue-scroller/example/index.html | 14 - .../packages/vue-scroller/example/index.js | 10 - .../ans-ui/packages/vue-scroller/src/index.js | 5 - .../src/source/HorizontalScrollbar.vue | 144 - .../vue-scroller/src/source/Scroller.vue | 459 - .../src/source/VerticalScrollbar.vue | 144 - .../ans-ui/packages/vue-select/README.md | 80 - .../packages/vue-select/example/app.vue | 354 - .../packages/vue-select/example/async.vue | 137 - .../packages/vue-select/example/dynamic.vue | 128 - .../packages/vue-select/example/index.html | 16 - .../packages/vue-select/example/index.js | 10 - .../vue-select/example/navigation.vue | 111 - .../ans-ui/packages/vue-select/src/index.js | 9 - .../packages/vue-select/src/source/Option.vue | 114 - .../vue-select/src/source/OptionGroup.vue | 40 - .../packages/vue-select/src/source/Select.vue | 682 - .../vue-select/src/source/SelectDropdown.vue | 99 - .../ans-ui/packages/vue-spin/README.md | 33 - .../ans-ui/packages/vue-spin/example/app.vue | 126 - .../packages/vue-spin/example/index.html | 16 - .../ans-ui/packages/vue-spin/example/index.js | 13 - .../ans-ui/packages/vue-spin/src/index.js | 17 - .../packages/vue-spin/src/source/Spin.vue | 57 - .../packages/vue-spin/src/source/directive.js | 101 - .../packages/vue-spin/src/source/service.js | 96 - .../ans-ui/packages/vue-switch/README.md | 23 - .../packages/vue-switch/example/app.vue | 53 - .../packages/vue-switch/example/index.html | 16 - .../packages/vue-switch/example/index.js | 10 - .../ans-ui/packages/vue-switch/src/index.js | 3 - .../packages/vue-switch/src/source/Switch.vue | 107 - .../ans-ui/packages/vue-table/README.md | 86 - .../ans-ui/packages/vue-table/example/app.vue | 318 - .../packages/vue-table/example/array.vue | 31 - .../packages/vue-table/example/dynamic.vue | 99 - .../packages/vue-table/example/index.html | 15 - .../packages/vue-table/example/index.js | 10 - .../packages/vue-table/example/indexs.json | 1 - .../packages/vue-table/example/paging.vue | 54 - .../packages/vue-table/example/restrict.vue | 67 - .../packages/vue-table/example/sort.vue | 65 - .../packages/vue-table/example/tree.vue | 62 - .../ans-ui/packages/vue-table/src/index.js | 7 - .../packages/vue-table/src/source/Table.vue | 750 -- .../vue-table/src/source/TableBody.vue | 163 - .../vue-table/src/source/TableColumn.vue | 240 - .../vue-table/src/source/TableHeader.vue | 172 - .../packages/vue-table/src/source/TableTd.vue | 152 - .../packages/vue-table/src/source/TableTh.vue | 222 - .../vue-table/src/source/cellRenderer.js | 43 - .../packages/vue-table/src/source/layout.js | 276 - .../vue-table/src/source/layoutObserver.js | 41 - .../packages/vue-table/src/source/store.js | 660 - .../ans-ui/packages/vue-timepicker/README.md | 30 - .../packages/vue-timepicker/example/app.vue | 41 - .../vue-timepicker/example/index.html | 16 - .../packages/vue-timepicker/example/index.js | 10 - .../packages/vue-timepicker/src/index.js | 3 - .../vue-timepicker/src/source/Timepicker.vue | 263 - .../ans-ui/packages/vue-tooltip/README.md | 27 - .../packages/vue-tooltip/example/app.vue | 100 - .../packages/vue-tooltip/example/index.html | 16 - .../packages/vue-tooltip/example/index.js | 13 - .../ans-ui/packages/vue-tooltip/src/index.js | 11 - .../vue-tooltip/src/source/Tooltip.vue | 59 - .../vue-tooltip/src/source/directive.js | 82 - .../vue-tooltip/src/source/factory.js | 39 - .../dist/lib/@analysys/ans-ui/src/index.js | 108 - .../lib/@analysys/ans-ui/src/locale/format.js | 43 - .../lib/@analysys/ans-ui/src/locale/index.js | 48 - .../@analysys/ans-ui/src/locale/lang/en.js | 70 - .../@analysys/ans-ui/src/locale/lang/zh-CN.js | 70 - .../src/style/animation/attentionSeekers.scss | 599 - .../style/animation/bouncingEntrances.scss | 354 - .../src/style/animation/bouncingExits.scss | 173 - .../src/style/animation/fadingEntrances.scss | 246 - .../src/style/animation/fadingExits.scss | 212 - .../ans-ui/src/style/animation/flippers.scss | 290 - .../ans-ui/src/style/animation/index.scss | 90 - .../src/style/animation/lightspeed.scss | 72 - .../style/animation/rotatingEntrances.scss | 181 - .../src/style/animation/rotatingExits.scss | 160 - .../src/style/animation/slidingEntrances.scss | 115 - .../src/style/animation/slidingExits.scss | 93 - .../ans-ui/src/style/animation/specials.scss | 173 - .../src/style/animation/zoomEntrances.scss | 169 - .../ans-ui/src/style/animation/zoomExits.scss | 174 - .../@analysys/ans-ui/src/style/common.scss | 293 - .../ans-ui/src/style/components/box/box.scss | 3 - .../src/style/components/box/message.scss | 82 - .../src/style/components/box/modal.scss | 100 - .../src/style/components/box/notice.scss | 116 - .../src/style/components/button/button.scss | 122 - .../src/style/components/button/mixin.scss | 346 - .../style/components/cascader/cascader.scss | 122 - .../style/components/checkbox/checkbox.scss | 103 - .../components/datepicker/datepicker.scss | 419 - .../src/style/components/drawer/drawer.scss | 164 - .../src/style/components/form/form.scss | 36 - .../ans-ui/src/style/components/index.scss | 18 - .../src/style/components/input/input.scss | 162 - .../components/pagination/pagination.scss | 150 - .../src/style/components/poptip/poptip.scss | 52 - .../style/components/progress/progress.scss | 89 - .../src/style/components/radio/radio.scss | 195 - .../style/components/scroller/scroller.scss | 59 - .../src/style/components/select/select.scss | 266 - .../src/style/components/spin/spin.scss | 41 - .../src/style/components/switch/switch.scss | 136 - .../src/style/components/table/table.scss | 255 - .../src/style/components/tooltip/tooltip.scss | 33 - .../lib/@analysys/ans-ui/src/style/font.scss | 67 - .../ans-ui/src/style/font/iconfont.eot | Bin 7428 -> 0 bytes .../ans-ui/src/style/font/iconfont.svg | 104 - .../ans-ui/src/style/font/iconfont.ttf | Bin 7260 -> 0 bytes .../ans-ui/src/style/font/iconfont.woff | Bin 4256 -> 0 bytes .../lib/@analysys/ans-ui/src/style/index.scss | 5 - .../lib/@analysys/ans-ui/src/style/vars.scss | 48 - .../lib/@analysys/ans-ui/src/util/assist.js | 59 - .../@analysys/ans-ui/src/util/constants.js | 2 - .../ans-ui/src/util/customRenderer.js | 15 - .../src/util/directives/clickOutside.js | 63 - .../ans-ui/src/util/directives/index.js | 7 - .../ans-ui/src/util/directives/mousewheel.js | 16 - .../ans-ui/src/util/dom/animatedScroll.js | 90 - .../@analysys/ans-ui/src/util/dom/class.js | 79 - .../@analysys/ans-ui/src/util/dom/index.js | 14 - .../ans-ui/src/util/dom/limitedLoop.js | 36 - .../ans-ui/src/util/dom/scrollIntoView.js | 17 - .../ans-ui/src/util/dom/scrollbarWidth.js | 25 - .../@analysys/ans-ui/src/util/dom/style.js | 15 - .../lib/@analysys/ans-ui/src/util/event.js | 18 - .../lib/@analysys/ans-ui/src/util/index.js | 13 - .../lib/@analysys/ans-ui/src/util/lang.js | 50 - .../ans-ui/src/util/mixins/emitter.js | 34 - .../@analysys/ans-ui/src/util/mixins/index.js | 9 - .../ans-ui/src/util/mixins/locale.js | 9 - .../ans-ui/src/util/mixins/popper.js | 166 - escheduler-ui/dist/lib/@fedor/io/README.md | 127 - .../dist/lib/@fedor/io/dist/io.esm.js | 1426 -- escheduler-ui/dist/lib/@fedor/io/dist/io.js | 1430 -- .../dist/lib/@fedor/io/dist/io.min.js | 4 - escheduler-ui/dist/lib/@fedor/io/package.json | 74 - .../progress-webpack-plugin/lib/index.js | 81 - .../progress-webpack-plugin/package.json | 17 - .../.circleci/config.yml | 31 - .../component-compiler-utils/.prettierrc.js | 4 - .../component-compiler-utils/CHANGELOG.md | 125 - .../@vue/component-compiler-utils/README.md | 146 - .../dist/compileStyle.d.ts | 25 - .../dist/compileStyle.js | 78 - .../dist/compileTemplate.d.ts | 22 - .../dist/compileTemplate.js | 106 - .../component-compiler-utils/dist/index.d.ts | 5 - .../component-compiler-utils/dist/index.js | 9 - .../component-compiler-utils/dist/parse.d.ts | 32 - .../component-compiler-utils/dist/parse.js | 53 - .../dist/stylePlugins/scoped.d.ts | 3 - .../dist/stylePlugins/scoped.js | 95 - .../dist/stylePlugins/trim.d.ts | 3 - .../dist/stylePlugins/trim.js | 10 - .../dist/styleProcessors/index.d.ts | 11 - .../dist/styleProcessors/index.js | 87 - .../templateCompilerModules/assetUrl.d.ts | 8 - .../dist/templateCompilerModules/assetUrl.js | 44 - .../dist/templateCompilerModules/srcset.d.ts | 5 - .../dist/templateCompilerModules/srcset.js | 51 - .../dist/templateCompilerModules/utils.d.ts | 9 - .../dist/templateCompilerModules/utils.js | 17 - .../component-compiler-utils/dist/types.d.ts | 30 - .../component-compiler-utils/dist/types.js | 2 - .../lib/compileStyle.ts | 143 - .../lib/compileTemplate.ts | 176 - .../component-compiler-utils/lib/index.ts | 28 - .../component-compiler-utils/lib/parse.ts | 112 - .../lib/stylePlugins/scoped.ts | 99 - .../lib/stylePlugins/trim.ts | 10 - .../lib/styleProcessors/index.ts | 133 - .../lib/templateCompilerModules/assetUrl.ts | 51 - .../lib/templateCompilerModules/srcset.ts | 66 - .../lib/templateCompilerModules/utils.ts | 23 - .../component-compiler-utils/lib/types.ts | 47 - .../component-compiler-utils/package.json | 64 - escheduler-ui/dist/lib/@vue/crontab/README.md | 30 - .../dist/lib/@vue/crontab/build/config.js | 65 - .../@vue/crontab/build/webpack.config.prod.js | 106 - .../dist/lib/@vue/crontab/dist/index.css | 1 - .../dist/lib/@vue/crontab/dist/index.js | 2 - .../dist/lib/@vue/crontab/dist/index.js.map | 1 - .../dist/lib/@vue/crontab/example/app.vue | 48 - .../dist/lib/@vue/crontab/example/index.html | 14 - .../dist/lib/@vue/crontab/example/index.js | 14 - .../dist/lib/@vue/crontab/package.json | 63 - .../dist/lib/@vue/crontab/postcss.config.js | 7 - escheduler-ui/dist/view/login/index.html | 3 - 484 files changed, 1580 insertions(+), 45528 deletions(-) create mode 100644 escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiImplicitParamPlugin.java create mode 100644 escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiImplicitParamsPlugin.java create mode 100644 escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiModelPlugin.java create mode 100644 escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiModelPropertyPlugin.java create mode 100644 escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiOperationPlugin.java create mode 100644 escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiParamPlugin.java create mode 100644 escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiPlugin.java delete mode 100644 escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerI18nPlugin.java delete mode 100644 escheduler-ui/dist/combo/1.0.0/3rd.css delete mode 100644 escheduler-ui/dist/combo/1.0.0/3rd.js delete mode 100644 escheduler-ui/dist/combo/1.0.0/base.css delete mode 100644 escheduler-ui/dist/combo/1.0.0/es5.js delete mode 100644 escheduler-ui/dist/combo/1.0.0/local.js delete mode 100644 escheduler-ui/dist/css/common.8ba9af7.css delete mode 100644 escheduler-ui/dist/font/fontawesome-webfont.674f50d.eot delete mode 100644 escheduler-ui/dist/font/fontawesome-webfont.af7ae50.woff2 delete mode 100644 escheduler-ui/dist/font/fontawesome-webfont.b06871f.ttf delete mode 100644 escheduler-ui/dist/font/fontawesome-webfont.fee66e7.woff delete mode 100644 escheduler-ui/dist/font/iconfont.4f692dd.ttf delete mode 100644 escheduler-ui/dist/font/iconfont.6f38b93.eot delete mode 100644 escheduler-ui/dist/font/iconfont.be17177.woff delete mode 100644 escheduler-ui/dist/images/close.png delete mode 100644 escheduler-ui/dist/images/dag_bg.png delete mode 100644 escheduler-ui/dist/images/down_error.png delete mode 100644 escheduler-ui/dist/images/errorTip.png delete mode 100644 escheduler-ui/dist/images/favicon.ico delete mode 100644 escheduler-ui/dist/images/fontawesome-webfont.svg delete mode 100644 escheduler-ui/dist/images/iconfont.svg delete mode 100644 escheduler-ui/dist/images/login-logo.png delete mode 100644 escheduler-ui/dist/images/logo.png delete mode 100644 escheduler-ui/dist/images/m_logo.png delete mode 100644 escheduler-ui/dist/images/open.png delete mode 100644 escheduler-ui/dist/images/toolbar_DEPENDENT.png delete mode 100644 escheduler-ui/dist/images/toolbar_MR.png delete mode 100644 escheduler-ui/dist/images/toolbar_PROCEDURE.png delete mode 100644 escheduler-ui/dist/images/toolbar_PYTHON.png delete mode 100644 escheduler-ui/dist/images/toolbar_SHELL.png delete mode 100644 escheduler-ui/dist/images/toolbar_SPARK.png delete mode 100644 escheduler-ui/dist/images/toolbar_SQL.png delete mode 100644 escheduler-ui/dist/images/toolbar_SUB_PROCESS.png delete mode 100644 escheduler-ui/dist/index.html delete mode 100644 escheduler-ui/dist/js/0.bf0a1e2.js delete mode 100644 escheduler-ui/dist/js/0.bf0a1e2.js.map delete mode 100644 escheduler-ui/dist/js/1.3ff7adc.js delete mode 100644 escheduler-ui/dist/js/1.3ff7adc.js.map delete mode 100644 escheduler-ui/dist/js/10.90da74f.js delete mode 100644 escheduler-ui/dist/js/10.90da74f.js.map delete mode 100644 escheduler-ui/dist/js/11.ca8ac79.js delete mode 100644 escheduler-ui/dist/js/11.ca8ac79.js.map delete mode 100644 escheduler-ui/dist/js/12.b6fb265.js delete mode 100644 escheduler-ui/dist/js/12.b6fb265.js.map delete mode 100644 escheduler-ui/dist/js/13.a8f5ee9.js delete mode 100644 escheduler-ui/dist/js/13.a8f5ee9.js.map delete mode 100644 escheduler-ui/dist/js/14.10001b2.js delete mode 100644 escheduler-ui/dist/js/14.10001b2.js.map delete mode 100644 escheduler-ui/dist/js/15.9119d76.js delete mode 100644 escheduler-ui/dist/js/15.9119d76.js.map delete mode 100644 escheduler-ui/dist/js/16.648c64b.js delete mode 100644 escheduler-ui/dist/js/16.648c64b.js.map delete mode 100644 escheduler-ui/dist/js/17.6761755.js delete mode 100644 escheduler-ui/dist/js/17.6761755.js.map delete mode 100644 escheduler-ui/dist/js/18.3bc2e58.js delete mode 100644 escheduler-ui/dist/js/18.3bc2e58.js.map delete mode 100644 escheduler-ui/dist/js/19.5ce986e.js delete mode 100644 escheduler-ui/dist/js/19.5ce986e.js.map delete mode 100644 escheduler-ui/dist/js/2.3b16c4b.js delete mode 100644 escheduler-ui/dist/js/2.3b16c4b.js.map delete mode 100644 escheduler-ui/dist/js/20.ef7f230.js delete mode 100644 escheduler-ui/dist/js/20.ef7f230.js.map delete mode 100644 escheduler-ui/dist/js/21.b587019.js delete mode 100644 escheduler-ui/dist/js/21.b587019.js.map delete mode 100644 escheduler-ui/dist/js/22.f33bbc0.js delete mode 100644 escheduler-ui/dist/js/22.f33bbc0.js.map delete mode 100644 escheduler-ui/dist/js/23.bb2b238.js delete mode 100644 escheduler-ui/dist/js/23.bb2b238.js.map delete mode 100644 escheduler-ui/dist/js/24.6e296a1.js delete mode 100644 escheduler-ui/dist/js/24.6e296a1.js.map delete mode 100644 escheduler-ui/dist/js/25.079b6f7.js delete mode 100644 escheduler-ui/dist/js/25.079b6f7.js.map delete mode 100644 escheduler-ui/dist/js/26.4fc30f8.js delete mode 100644 escheduler-ui/dist/js/26.4fc30f8.js.map delete mode 100644 escheduler-ui/dist/js/27.77c2a5a.js delete mode 100644 escheduler-ui/dist/js/27.77c2a5a.js.map delete mode 100644 escheduler-ui/dist/js/28.3e34ffe.js delete mode 100644 escheduler-ui/dist/js/28.3e34ffe.js.map delete mode 100644 escheduler-ui/dist/js/29.f8fb5e9.js delete mode 100644 escheduler-ui/dist/js/29.f8fb5e9.js.map delete mode 100644 escheduler-ui/dist/js/3.88f23f8.js delete mode 100644 escheduler-ui/dist/js/3.88f23f8.js.map delete mode 100644 escheduler-ui/dist/js/30.b5bd614.js delete mode 100644 escheduler-ui/dist/js/30.b5bd614.js.map delete mode 100644 escheduler-ui/dist/js/31.6fcd9a5.js delete mode 100644 escheduler-ui/dist/js/31.6fcd9a5.js.map delete mode 100644 escheduler-ui/dist/js/32.78a13b7.js delete mode 100644 escheduler-ui/dist/js/32.78a13b7.js.map delete mode 100644 escheduler-ui/dist/js/33.6f78a15.js delete mode 100644 escheduler-ui/dist/js/33.6f78a15.js.map delete mode 100644 escheduler-ui/dist/js/34.14935c5.js delete mode 100644 escheduler-ui/dist/js/34.14935c5.js.map delete mode 100644 escheduler-ui/dist/js/35.54f8ec4.js delete mode 100644 escheduler-ui/dist/js/35.54f8ec4.js.map delete mode 100644 escheduler-ui/dist/js/36.b17120a.js delete mode 100644 escheduler-ui/dist/js/36.b17120a.js.map delete mode 100644 escheduler-ui/dist/js/37.aa790c9.js delete mode 100644 escheduler-ui/dist/js/37.aa790c9.js.map delete mode 100644 escheduler-ui/dist/js/38.fb0602d.js delete mode 100644 escheduler-ui/dist/js/38.fb0602d.js.map delete mode 100644 escheduler-ui/dist/js/39.85e5891.js delete mode 100644 escheduler-ui/dist/js/39.85e5891.js.map delete mode 100644 escheduler-ui/dist/js/4.d3398c4.js delete mode 100644 escheduler-ui/dist/js/4.d3398c4.js.map delete mode 100644 escheduler-ui/dist/js/40.7eb5806.js delete mode 100644 escheduler-ui/dist/js/40.7eb5806.js.map delete mode 100644 escheduler-ui/dist/js/41.089f7ce.js delete mode 100644 escheduler-ui/dist/js/41.089f7ce.js.map delete mode 100644 escheduler-ui/dist/js/42.b6a308c.js delete mode 100644 escheduler-ui/dist/js/42.b6a308c.js.map delete mode 100644 escheduler-ui/dist/js/43.5e4f13e.js delete mode 100644 escheduler-ui/dist/js/43.5e4f13e.js.map delete mode 100644 escheduler-ui/dist/js/44.0035849.js delete mode 100644 escheduler-ui/dist/js/44.0035849.js.map delete mode 100644 escheduler-ui/dist/js/45.02af8bb.js delete mode 100644 escheduler-ui/dist/js/45.02af8bb.js.map delete mode 100644 escheduler-ui/dist/js/5.2b55fd9.js delete mode 100644 escheduler-ui/dist/js/5.2b55fd9.js.map delete mode 100644 escheduler-ui/dist/js/6.c7ff80d.js delete mode 100644 escheduler-ui/dist/js/6.c7ff80d.js.map delete mode 100644 escheduler-ui/dist/js/7.073bd0f.js delete mode 100644 escheduler-ui/dist/js/7.073bd0f.js.map delete mode 100644 escheduler-ui/dist/js/8.af1dc8f.js delete mode 100644 escheduler-ui/dist/js/8.af1dc8f.js.map delete mode 100644 escheduler-ui/dist/js/9.a5a7679.js delete mode 100644 escheduler-ui/dist/js/9.a5a7679.js.map delete mode 100644 escheduler-ui/dist/js/common.6428411.js delete mode 100644 escheduler-ui/dist/js/common.6428411.js.map delete mode 100644 escheduler-ui/dist/js/home/index.1b09c2f.js delete mode 100644 escheduler-ui/dist/js/home/index.1b09c2f.js.map delete mode 100644 escheduler-ui/dist/js/login/index.97eaebb.js delete mode 100644 escheduler-ui/dist/js/login/index.97eaebb.js.map delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/build/config.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/build/webpack.config.prod.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/dist/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/dist/index.js.map delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/example/mock/data.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/example/mock/theme.json delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/example/packages/bar.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/example/packages/funnel.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/example/packages/line.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/example/packages/pie.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/example/packages/radar.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/example/packages/scatter.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/example/router/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/example/styles/main.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/package.json delete mode 100644 escheduler-ui/dist/lib/@analysys/ana-charts/postcss.config.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/lib/ans-ui.min.css delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/lib/ans-ui.min.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/lib/font/iconfont.eot delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/lib/font/iconfont.svg delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/lib/font/iconfont.ttf delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/lib/font/iconfont.woff delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/lib/locale/en.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/lib/locale/en.js.map delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/lib/locale/zh-CN.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/lib/locale/zh-CN.js.map delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/package.json delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-box/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-box/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-box/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-box/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-box/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-box/src/source/base/Box.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-box/src/source/base/BoxManager.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-box/src/source/base/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-box/src/source/layer/message/message.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-box/src/source/layer/modal/modal.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-box/src/source/layer/notice/notice.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-button/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-button/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-button/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-button/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-button/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-button/src/source/Button.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-button/src/source/ButtonGroup.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-cascader/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-cascader/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-cascader/example/data.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-cascader/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-cascader/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-cascader/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-cascader/src/source/Cascader.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-cascader/src/source/Caspanel.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-checkbox/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-checkbox/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-checkbox/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-checkbox/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-checkbox/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-checkbox/src/source/Checkbox.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-checkbox/src/source/CheckboxGroup.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/src/source/base/confirm.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/src/source/base/day.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/src/source/base/time.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/src/source/base/years.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/src/source/datepicker.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/src/source/panel/date.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/src/source/panel/daterange.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/src/source/panel/month.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/src/source/panel/time.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/src/source/panel/year.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/src/source/util/date.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/src/source/util/isType.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/src/source/util/isValid.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/src/source/util/ishms.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-datepicker/src/source/util/todate.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-drawer/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-drawer/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-drawer/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-drawer/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-drawer/example/test.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-drawer/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-drawer/src/source/drawer.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-form/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-form/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-form/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-form/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-form/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-form/src/source/Form.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-form/src/source/FormItem.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-input/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-input/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-input/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-input/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-input/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-input/src/source/Input.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-input/src/source/util/calcTextareaHeight.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-pagination/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-pagination/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-pagination/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-pagination/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-pagination/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-pagination/src/source/Page.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-poptip/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-poptip/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-poptip/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-poptip/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-poptip/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-poptip/src/source/Poptip.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-poptip/src/source/directive.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-progress/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-progress/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-progress/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-progress/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-progress/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-progress/src/source/Progress.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-radio/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-radio/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-radio/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-radio/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-radio/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-radio/src/source/Radio.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-radio/src/source/RadioGroup.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-scroller/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-scroller/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-scroller/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-scroller/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-scroller/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-scroller/src/source/HorizontalScrollbar.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-scroller/src/source/Scroller.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-scroller/src/source/VerticalScrollbar.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-select/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-select/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-select/example/async.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-select/example/dynamic.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-select/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-select/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-select/example/navigation.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-select/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-select/src/source/Option.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-select/src/source/OptionGroup.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-select/src/source/Select.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-select/src/source/SelectDropdown.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-spin/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-spin/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-spin/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-spin/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-spin/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-spin/src/source/Spin.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-spin/src/source/directive.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-spin/src/source/service.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-switch/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-switch/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-switch/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-switch/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-switch/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-switch/src/source/Switch.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/example/array.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/example/dynamic.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/example/indexs.json delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/example/paging.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/example/restrict.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/example/sort.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/example/tree.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/src/source/Table.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/src/source/TableBody.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/src/source/TableColumn.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/src/source/TableHeader.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/src/source/TableTd.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/src/source/TableTh.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/src/source/cellRenderer.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/src/source/layout.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/src/source/layoutObserver.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-table/src/source/store.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-timepicker/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-timepicker/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-timepicker/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-timepicker/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-timepicker/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-timepicker/src/source/Timepicker.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-tooltip/README.md delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-tooltip/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-tooltip/example/index.html delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-tooltip/example/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-tooltip/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-tooltip/src/source/Tooltip.vue delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-tooltip/src/source/directive.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/packages/vue-tooltip/src/source/factory.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/locale/format.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/locale/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/locale/lang/en.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/locale/lang/zh-CN.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/animation/attentionSeekers.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/animation/bouncingEntrances.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/animation/bouncingExits.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/animation/fadingEntrances.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/animation/fadingExits.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/animation/flippers.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/animation/index.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/animation/lightspeed.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/animation/rotatingEntrances.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/animation/rotatingExits.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/animation/slidingEntrances.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/animation/slidingExits.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/animation/specials.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/animation/zoomEntrances.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/animation/zoomExits.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/common.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/box/box.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/box/message.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/box/modal.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/box/notice.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/button/button.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/button/mixin.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/cascader/cascader.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/checkbox/checkbox.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/datepicker/datepicker.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/drawer/drawer.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/form/form.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/index.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/input/input.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/pagination/pagination.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/poptip/poptip.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/progress/progress.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/radio/radio.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/scroller/scroller.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/select/select.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/spin/spin.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/switch/switch.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/table/table.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/components/tooltip/tooltip.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/font.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/font/iconfont.eot delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/font/iconfont.svg delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/font/iconfont.ttf delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/font/iconfont.woff delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/index.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/style/vars.scss delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/assist.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/constants.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/customRenderer.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/directives/clickOutside.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/directives/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/directives/mousewheel.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/dom/animatedScroll.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/dom/class.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/dom/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/dom/limitedLoop.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/dom/scrollIntoView.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/dom/scrollbarWidth.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/dom/style.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/event.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/lang.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/mixins/emitter.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/mixins/index.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/mixins/locale.js delete mode 100644 escheduler-ui/dist/lib/@analysys/ans-ui/src/util/mixins/popper.js delete mode 100644 escheduler-ui/dist/lib/@fedor/io/README.md delete mode 100644 escheduler-ui/dist/lib/@fedor/io/dist/io.esm.js delete mode 100644 escheduler-ui/dist/lib/@fedor/io/dist/io.js delete mode 100644 escheduler-ui/dist/lib/@fedor/io/dist/io.min.js delete mode 100644 escheduler-ui/dist/lib/@fedor/io/package.json delete mode 100644 escheduler-ui/dist/lib/@fedor/progress-webpack-plugin/lib/index.js delete mode 100644 escheduler-ui/dist/lib/@fedor/progress-webpack-plugin/package.json delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/.circleci/config.yml delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/.prettierrc.js delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/CHANGELOG.md delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/README.md delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/compileStyle.d.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/compileStyle.js delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/compileTemplate.d.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/compileTemplate.js delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/index.d.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/index.js delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/parse.d.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/parse.js delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/stylePlugins/scoped.d.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/stylePlugins/scoped.js delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/stylePlugins/trim.d.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/stylePlugins/trim.js delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/styleProcessors/index.d.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/styleProcessors/index.js delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/templateCompilerModules/assetUrl.d.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/templateCompilerModules/assetUrl.js delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/templateCompilerModules/srcset.d.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/templateCompilerModules/srcset.js delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/templateCompilerModules/utils.d.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/templateCompilerModules/utils.js delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/types.d.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/dist/types.js delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/lib/compileStyle.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/lib/compileTemplate.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/lib/index.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/lib/parse.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/lib/stylePlugins/scoped.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/lib/stylePlugins/trim.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/lib/styleProcessors/index.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/lib/templateCompilerModules/assetUrl.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/lib/templateCompilerModules/srcset.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/lib/templateCompilerModules/utils.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/lib/types.ts delete mode 100644 escheduler-ui/dist/lib/@vue/component-compiler-utils/package.json delete mode 100644 escheduler-ui/dist/lib/@vue/crontab/README.md delete mode 100644 escheduler-ui/dist/lib/@vue/crontab/build/config.js delete mode 100644 escheduler-ui/dist/lib/@vue/crontab/build/webpack.config.prod.js delete mode 100644 escheduler-ui/dist/lib/@vue/crontab/dist/index.css delete mode 100644 escheduler-ui/dist/lib/@vue/crontab/dist/index.js delete mode 100644 escheduler-ui/dist/lib/@vue/crontab/dist/index.js.map delete mode 100644 escheduler-ui/dist/lib/@vue/crontab/example/app.vue delete mode 100644 escheduler-ui/dist/lib/@vue/crontab/example/index.html delete mode 100644 escheduler-ui/dist/lib/@vue/crontab/example/index.js delete mode 100644 escheduler-ui/dist/lib/@vue/crontab/package.json delete mode 100644 escheduler-ui/dist/lib/@vue/crontab/postcss.config.js delete mode 100644 escheduler-ui/dist/view/login/index.html diff --git a/escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java b/escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java index 74a29a13b5..77066386e8 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java @@ -36,6 +36,8 @@ public class AppConfiguration implements WebMvcConfigurer { public static final String LOGIN_INTERCEPTOR_PATH_PATTERN = "/**/*"; public static final String LOGIN_PATH_PATTERN = "/login"; public static final String PATH_PATTERN = "/**"; + public static final String LOCALE_LANGUAGE_COOKIE = "language"; + public static final int COOKIE_MAX_AGE = 3600; @Bean @@ -44,21 +46,24 @@ public class AppConfiguration implements WebMvcConfigurer { } - //Cookie + /** + * Cookie + */ @Bean public LocaleResolver localeResolver() { CookieLocaleResolver localeResolver = new CookieLocaleResolver(); - localeResolver.setCookieName("localeCookie"); - //设置默认区域 + localeResolver.setCookieName(LOCALE_LANGUAGE_COOKIE); + /** set default locale **/ localeResolver.setDefaultLocale(Locale.ENGLISH); - localeResolver.setCookieMaxAge(3600);//设置cookie有效期. + /** set cookie max age **/ + localeResolver.setCookieMaxAge(COOKIE_MAX_AGE); return localeResolver; } @Bean public LocaleChangeInterceptor localeChangeInterceptor() { LocaleChangeInterceptor lci = new LocaleChangeInterceptor(); - // 参数名 + /** **/ lci.setParamName("lang"); return lci; diff --git a/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiImplicitParamPlugin.java b/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiImplicitParamPlugin.java new file mode 100644 index 0000000000..0bb3733dd5 --- /dev/null +++ b/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiImplicitParamPlugin.java @@ -0,0 +1,109 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.escheduler.api.configuration; + +import com.google.common.base.MoreObjects; +import com.google.common.base.Optional; +import com.google.common.collect.Lists; +import io.swagger.annotations.ApiImplicitParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import springfox.documentation.builders.ParameterBuilder; +import springfox.documentation.schema.ModelRef; +import springfox.documentation.service.AllowableValues; +import springfox.documentation.service.Parameter; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spi.service.OperationBuilderPlugin; +import springfox.documentation.spi.service.contexts.OperationContext; +import springfox.documentation.spring.web.DescriptionResolver; +import springfox.documentation.swagger.common.SwaggerPluginSupport; + +import java.util.List; +import java.util.Locale; + +import static com.google.common.base.Strings.emptyToNull; +import static springfox.documentation.schema.Types.isBaseType; +import static springfox.documentation.swagger.common.SwaggerPluginSupport.SWAGGER_PLUGIN_ORDER; +import static springfox.documentation.swagger.readers.parameter.Examples.examples; +import static springfox.documentation.swagger.schema.ApiModelProperties.allowableValueFromString; + +@Component +@Order(Ordered.HIGHEST_PRECEDENCE - 10) +public class SwaggerApiImplicitParamPlugin implements OperationBuilderPlugin { + + @Autowired + private DescriptionResolver descriptions; + + @Autowired + private MessageSource messageSource; + + static Parameter implicitParameter(MessageSource messageSource, DescriptionResolver descriptions, ApiImplicitParam param) { + Locale locale = LocaleContextHolder.getLocale(); + + ModelRef modelRef = maybeGetModelRef(param); + return new ParameterBuilder() + .name(param.name()) + .description(descriptions.resolve(messageSource.getMessage(param.value(), null, locale))) + .defaultValue(param.defaultValue()) + .required(param.required()) + .allowMultiple(param.allowMultiple()) + .modelRef(modelRef) + .allowableValues(allowableValueFromString(param.allowableValues())) + .parameterType(emptyToNull(param.paramType())) + .parameterAccess(param.access()) + .order(SWAGGER_PLUGIN_ORDER) + .scalarExample(param.example()) + .complexExamples(examples(param.examples())) + .build(); + } + + private static ModelRef maybeGetModelRef(ApiImplicitParam param) { + String dataType = MoreObjects.firstNonNull(emptyToNull(param.dataType()), "string"); + AllowableValues allowableValues = null; + if (isBaseType(dataType)) { + allowableValues = allowableValueFromString(param.allowableValues()); + } + if (param.allowMultiple()) { + return new ModelRef("", new ModelRef(dataType, allowableValues)); + } + return new ModelRef(dataType, allowableValues); + } + + @Override + public void apply(OperationContext context) { + context.operationBuilder().parameters(readParameters(context)); + } + + @Override + public boolean supports(DocumentationType delimiter) { + return SwaggerPluginSupport.pluginDoesApply(delimiter); + } + + private List readParameters(OperationContext context) { + Optional annotation = context.findAnnotation(ApiImplicitParam.class); + List parameters = Lists.newArrayList(); + if (annotation.isPresent()) { + parameters.add(implicitParameter(messageSource, descriptions, annotation.get())); + } + return parameters; + } + +} \ No newline at end of file diff --git a/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiImplicitParamsPlugin.java b/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiImplicitParamsPlugin.java new file mode 100644 index 0000000000..a1a0b41dda --- /dev/null +++ b/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiImplicitParamsPlugin.java @@ -0,0 +1,71 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.escheduler.api.configuration; + +import com.google.common.base.Optional; +import com.google.common.collect.Lists; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.MessageSource; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import springfox.documentation.service.Parameter; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spi.service.OperationBuilderPlugin; +import springfox.documentation.spi.service.contexts.OperationContext; +import springfox.documentation.spring.web.DescriptionResolver; + +import java.util.List; + +import static springfox.documentation.swagger.common.SwaggerPluginSupport.pluginDoesApply; + +@Component +@Order(Ordered.HIGHEST_PRECEDENCE - 10) +public class SwaggerApiImplicitParamsPlugin implements OperationBuilderPlugin { + + @Autowired + private DescriptionResolver descriptions; + @Autowired + private MessageSource messageSource; + + @Override + public void apply(OperationContext context) { + context.operationBuilder().parameters(readParameters(context)); + } + + @Override + public boolean supports(DocumentationType delimiter) { + return pluginDoesApply(delimiter); + } + + private List readParameters(OperationContext context) { + Optional annotation = context.findAnnotation(ApiImplicitParams.class); + + List parameters = Lists.newArrayList(); + if (annotation.isPresent()) { + for (ApiImplicitParam param : annotation.get().value()) { + parameters.add(SwaggerApiImplicitParamPlugin.implicitParameter(messageSource, descriptions, param)); + } + } + + return parameters; + } + + +} \ No newline at end of file diff --git a/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiModelPlugin.java b/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiModelPlugin.java new file mode 100644 index 0000000000..157d5d9581 --- /dev/null +++ b/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiModelPlugin.java @@ -0,0 +1,74 @@ +package cn.escheduler.api.configuration; + + + +import com.fasterxml.classmate.TypeResolver; +import io.swagger.annotations.ApiModel; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.AnnotationUtils; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import springfox.documentation.schema.ModelReference; +import springfox.documentation.schema.TypeNameExtractor; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spi.schema.ModelBuilderPlugin; +import springfox.documentation.spi.schema.contexts.ModelContext; + +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; + +import static springfox.documentation.schema.ResolvedTypes.*; +import static springfox.documentation.swagger.common.SwaggerPluginSupport.*; + +/** + * NOTE : not useful + */ +@Component +@Order(Ordered.HIGHEST_PRECEDENCE - 10) +public class SwaggerApiModelPlugin implements ModelBuilderPlugin { + + @Autowired + private TypeResolver typeResolver; + @Autowired + private TypeNameExtractor typeNameExtractor; + @Autowired + private MessageSource messageSource; + + @Override + public void apply(ModelContext context) { + ApiModel annotation = AnnotationUtils.findAnnotation(forClass(context), ApiModel.class); + if (annotation != null) { + List modelRefs = new ArrayList(); + for (Class each : annotation.subTypes()) { + modelRefs.add(modelRefFactory(context, typeNameExtractor) + .apply(typeResolver.resolve(each))); + } + Locale locale = LocaleContextHolder.getLocale(); + + context.getBuilder() + .description(messageSource.getMessage(annotation.description(), null, locale)) + .discriminator(annotation.discriminator()) + .subTypes(modelRefs); + } + } + + private Class forClass(ModelContext context) { + return typeResolver.resolve(context.getType()).getErasedType(); + } + + +// @Override +// public boolean supports(DocumentationType delimiter) { +// return pluginDoesApply(delimiter); +// } + + @Override + public boolean supports(DocumentationType delimiter) { + return true; + } +} + diff --git a/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiModelPropertyPlugin.java b/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiModelPropertyPlugin.java new file mode 100644 index 0000000000..9b40eed6fd --- /dev/null +++ b/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiModelPropertyPlugin.java @@ -0,0 +1,219 @@ +package cn.escheduler.api.configuration; + + +import com.fasterxml.classmate.ResolvedType; +import com.fasterxml.classmate.TypeResolver; +import com.google.common.base.Function; +import com.google.common.base.Optional; +import com.google.common.base.Splitter; +import com.google.common.base.Strings; +import com.google.common.collect.Lists; +import io.swagger.annotations.ApiModelProperty; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.AnnotationUtils; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import springfox.documentation.service.AllowableListValues; +import springfox.documentation.service.AllowableRangeValues; +import springfox.documentation.service.AllowableValues; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spi.schema.ModelPropertyBuilderPlugin; +import springfox.documentation.spi.schema.contexts.ModelPropertyContext; +import springfox.documentation.spring.web.DescriptionResolver; +import springfox.documentation.swagger.common.SwaggerPluginSupport; +import springfox.documentation.swagger.schema.ApiModelProperties; + +import java.lang.reflect.AnnotatedElement; +import java.lang.reflect.Method; +import java.util.Collections; +import java.util.List; +import java.util.Locale; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static com.google.common.collect.Lists.newArrayList; +import static org.springframework.util.StringUtils.hasText; +import static springfox.documentation.schema.Annotations.*; +import static springfox.documentation.swagger.schema.ApiModelProperties.*; + +@Component +@Order(Ordered.HIGHEST_PRECEDENCE - 10) +public class SwaggerApiModelPropertyPlugin implements ModelPropertyBuilderPlugin { + private static final Logger LOGGER = LoggerFactory.getLogger(ApiModelProperties.class); + private static final Pattern RANGE_PATTERN = Pattern.compile("range([\\[(])(.*),(.*)([])])$"); + + @Autowired + private DescriptionResolver descriptions; + @Autowired + private MessageSource messageSource; + + + @Override + public void apply(ModelPropertyContext context) { + Optional annotation = Optional.absent(); + + if (context.getAnnotatedElement().isPresent()) { + annotation = annotation.or(findApiModePropertyAnnotation(context.getAnnotatedElement().get())); + } + if (context.getBeanPropertyDefinition().isPresent()) { + annotation = annotation.or(findPropertyAnnotation( + context.getBeanPropertyDefinition().get(), + ApiModelProperty.class)); + } + if (annotation.isPresent()) { + context.getBuilder() + .allowableValues(annotation.transform(toAllowableValues()).orNull()) + .required(annotation.transform(toIsRequired()).or(false)) + .readOnly(annotation.transform(toIsReadOnly()).or(false)) + .description(annotation.transform(toDescription(descriptions)).orNull()) + .isHidden(annotation.transform(toHidden()).or(false)) + .type(annotation.transform(toType(context.getResolver())).orNull()) + .position(annotation.transform(toPosition()).or(0)) + .example(annotation.transform(toExample()).orNull()); + } + } + + + static Function toAllowableValues() { + return new Function() { + @Override + public AllowableValues apply(ApiModelProperty annotation) { + return allowableValueFromString(annotation.allowableValues()); + } + }; + } + + public static AllowableValues allowableValueFromString(String allowableValueString) { + AllowableValues allowableValues = new AllowableListValues(Lists.newArrayList(), "LIST"); + String trimmed = allowableValueString.trim(); + Matcher matcher = RANGE_PATTERN.matcher(trimmed.replaceAll(" ", "")); + if (matcher.matches()) { + if (matcher.groupCount() != 4) { + LOGGER.warn("Unable to parse range specified {} correctly", trimmed); + } else { + allowableValues = new AllowableRangeValues( + matcher.group(2).contains("infinity") ? null : matcher.group(2), + matcher.group(1).equals("("), + matcher.group(3).contains("infinity") ? null : matcher.group(3), + matcher.group(4).equals(")")); + } + } else if (trimmed.contains(",")) { + Iterable split = Splitter.on(',').trimResults().omitEmptyStrings().split(trimmed); + allowableValues = new AllowableListValues(newArrayList(split), "LIST"); + } else if (hasText(trimmed)) { + List singleVal = Collections.singletonList(trimmed); + allowableValues = new AllowableListValues(singleVal, "LIST"); + } + return allowableValues; + } + + static Function toIsRequired() { + return new Function() { + @Override + public Boolean apply(ApiModelProperty annotation) { + return annotation.required(); + } + }; + } + + static Function toPosition() { + return new Function() { + @Override + public Integer apply(ApiModelProperty annotation) { + return annotation.position(); + } + }; + } + + static Function toIsReadOnly() { + return new Function() { + @Override + public Boolean apply(ApiModelProperty annotation) { + return annotation.readOnly(); + } + }; + } + + static Function toAllowEmptyValue() { + return new Function() { + @Override + public Boolean apply(ApiModelProperty annotation) { + return annotation.allowEmptyValue(); + } + }; + } + + Function toDescription( + final DescriptionResolver descriptions) { + Locale locale = LocaleContextHolder.getLocale(); + + return new Function() { + @Override + public String apply(ApiModelProperty annotation) { + String description = ""; + if (!Strings.isNullOrEmpty(annotation.value())) { + description = messageSource.getMessage(annotation.value(), null, "" ,locale); + } else if (!Strings.isNullOrEmpty(annotation.notes())) { + description = messageSource.getMessage(annotation.notes(), null, "" ,locale); + } + return descriptions.resolve(description); + } + }; + } + + static Function toType(final TypeResolver resolver) { + return new Function() { + @Override + public ResolvedType apply(ApiModelProperty annotation) { + try { + return resolver.resolve(Class.forName(annotation.dataType())); + } catch (ClassNotFoundException e) { + return resolver.resolve(Object.class); + } + } + }; + } + + public static Optional findApiModePropertyAnnotation(AnnotatedElement annotated) { + Optional annotation = Optional.absent(); + + if (annotated instanceof Method) { + // If the annotated element is a method we can use this information to check superclasses as well + annotation = Optional.fromNullable(AnnotationUtils.findAnnotation(((Method) annotated), ApiModelProperty.class)); + } + + return annotation.or(Optional.fromNullable(AnnotationUtils.getAnnotation(annotated, ApiModelProperty.class))); + } + + static Function toHidden() { + return new Function() { + @Override + public Boolean apply(ApiModelProperty annotation) { + return annotation.hidden(); + } + }; + } + + static Function toExample() { + return new Function() { + @Override + public String apply(ApiModelProperty annotation) { + String example = ""; + if (!Strings.isNullOrEmpty(annotation.example())) { + example = annotation.example(); + } + return example; + } + }; + } + + @Override + public boolean supports(DocumentationType delimiter) { + return SwaggerPluginSupport.pluginDoesApply(delimiter); + } +} diff --git a/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiOperationPlugin.java b/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiOperationPlugin.java new file mode 100644 index 0000000000..0ff4de15c3 --- /dev/null +++ b/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiOperationPlugin.java @@ -0,0 +1,141 @@ +package cn.escheduler.api.configuration; + +import java.util.List; +import java.util.Locale; +import java.util.Set; + +import com.google.common.base.Function; +import com.google.common.base.Optional; +import com.google.common.base.Splitter; +import com.google.common.collect.Sets; +import io.swagger.annotations.Api; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; + +import io.swagger.annotations.ApiOperation; +import org.springframework.util.StringUtils; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spi.service.OperationBuilderPlugin; +import springfox.documentation.spi.service.contexts.OperationContext; +import springfox.documentation.spring.web.DescriptionResolver; +import springfox.documentation.spring.web.readers.operation.DefaultTagsProvider; +import springfox.documentation.swagger.common.SwaggerPluginSupport; + +import static com.google.common.base.Strings.nullToEmpty; +import static com.google.common.collect.FluentIterable.from; +import static com.google.common.collect.Lists.newArrayList; +import static com.google.common.collect.Sets.*; +import static springfox.documentation.service.Tags.emptyTags; + + +@Component +@Order(Ordered.HIGHEST_PRECEDENCE - 10) +public class SwaggerApiOperationPlugin implements OperationBuilderPlugin { + + private static final Logger logger = LoggerFactory.getLogger(SwaggerApiOperationPlugin.class); + + @Autowired + private DescriptionResolver descriptions; + @Autowired + private DefaultTagsProvider tagsProvider; + + @Autowired + private MessageSource messageSource; + + @Override + public void apply(OperationContext context) { + + Locale locale = LocaleContextHolder.getLocale(); + + Set defaultTags = tagsProvider.tags(context); + Sets.SetView tags = union(operationTags(context), controllerTags(context)); + if (tags.isEmpty()) { + context.operationBuilder().tags(defaultTags); + } else { + context.operationBuilder().tags(tags); + } + + + Optional apiOperationAnnotation = context.findAnnotation(ApiOperation.class); + if (apiOperationAnnotation.isPresent()) { + ApiOperation operation = apiOperationAnnotation.get(); + + if (StringUtils.hasText(operation.nickname())) { + // Populate the value of nickname annotation into uniqueId + context.operationBuilder().uniqueId(operation.nickname()); + context.operationBuilder().codegenMethodNameStem(operation.nickname()); + } + + if (StringUtils.hasText(apiOperationAnnotation.get().notes())) { + context.operationBuilder().notes(descriptions.resolve(messageSource.getMessage(apiOperationAnnotation.get().notes(), null, "", locale))); + } + + if (apiOperationAnnotation.get().position() > 0) { + context.operationBuilder().position(apiOperationAnnotation.get().position()); + } + + if (StringUtils.hasText(apiOperationAnnotation.get().value())) { + context.operationBuilder().summary(descriptions.resolve(apiOperationAnnotation.get().value())); + } + + context.operationBuilder().consumes(asSet(nullToEmpty(apiOperationAnnotation.get().consumes()))); + context.operationBuilder().produces(asSet(nullToEmpty(apiOperationAnnotation.get().produces()))); + } + + + + + } + + + private Set controllerTags(OperationContext context) { + Optional controllerAnnotation = context.findControllerAnnotation(Api.class); + return controllerAnnotation.transform(tagsFromController()).or(Sets.newHashSet()); + } + + private Set operationTags(OperationContext context) { + Optional annotation = context.findAnnotation(ApiOperation.class); + return annotation.transform(tagsFromOperation()).or(Sets.newHashSet()); + } + + private Function> tagsFromOperation() { + return new Function>() { + @Override + public Set apply(ApiOperation input) { + Set tags = newTreeSet(); + tags.addAll(from(newArrayList(input.tags())).filter(emptyTags()).toSet()); + return tags; + } + }; + } + + private Function> tagsFromController() { + return new Function>() { + @Override + public Set apply(Api input) { + Set tags = newTreeSet(); + tags.addAll(from(newArrayList(input.tags())).filter(emptyTags()).toSet()); + return tags; + } + }; + } + private Set asSet(String mediaTypes) { + return newHashSet(Splitter.on(',') + .trimResults() + .omitEmptyStrings() + .splitToList(mediaTypes)); + } + + @Override + public boolean supports(DocumentationType delimiter) { + return SwaggerPluginSupport.pluginDoesApply(delimiter); +// return true; + } + +} diff --git a/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiParamPlugin.java b/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiParamPlugin.java new file mode 100644 index 0000000000..9fbdc1ce66 --- /dev/null +++ b/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiParamPlugin.java @@ -0,0 +1,115 @@ +/* + * + * Copyright 2015-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ +package cn.escheduler.api.configuration; + +import com.fasterxml.classmate.ResolvedType; +import com.google.common.base.Function; +import com.google.common.base.Optional; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import springfox.documentation.schema.Collections; +import springfox.documentation.schema.Enums; +import springfox.documentation.schema.Example; +import springfox.documentation.service.AllowableValues; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spi.schema.EnumTypeDeterminer; +import springfox.documentation.spi.service.ParameterBuilderPlugin; +import springfox.documentation.spi.service.contexts.ParameterContext; +import springfox.documentation.spring.web.DescriptionResolver; +import springfox.documentation.swagger.schema.ApiModelProperties; + +import java.util.Locale; + +import static com.google.common.base.Strings.emptyToNull; +import static com.google.common.base.Strings.isNullOrEmpty; +import static springfox.documentation.swagger.common.SwaggerPluginSupport.SWAGGER_PLUGIN_ORDER; +import static springfox.documentation.swagger.common.SwaggerPluginSupport.pluginDoesApply; +import static springfox.documentation.swagger.readers.parameter.Examples.examples; + +@Component +@Order(Ordered.HIGHEST_PRECEDENCE - 10) +public class SwaggerApiParamPlugin implements ParameterBuilderPlugin { + @Autowired + private DescriptionResolver descriptions; + @Autowired + private EnumTypeDeterminer enumTypeDeterminer; + @Autowired + private MessageSource messageSource; + + @Override + public void apply(ParameterContext context) { + Optional apiParam = context.resolvedMethodParameter().findAnnotation(ApiParam.class); + context.parameterBuilder() + .allowableValues(allowableValues( + context.alternateFor(context.resolvedMethodParameter().getParameterType()), + apiParam.transform(toAllowableValue()).or(""))); + if (apiParam.isPresent()) { + Locale locale = LocaleContextHolder.getLocale(); + + ApiParam annotation = apiParam.get(); + context.parameterBuilder().name(emptyToNull(annotation.name())) + .description(emptyToNull(descriptions.resolve(messageSource.getMessage(annotation.value(), null, "",locale)))) + .parameterAccess(emptyToNull(annotation.access())) + .defaultValue(emptyToNull(annotation.defaultValue())) + .allowMultiple(annotation.allowMultiple()) + .allowEmptyValue(annotation.allowEmptyValue()) + .required(annotation.required()) + .scalarExample(new Example(annotation.example())) + .complexExamples(examples(annotation.examples())) + .hidden(annotation.hidden()) + .collectionFormat(annotation.collectionFormat()) + .order(SWAGGER_PLUGIN_ORDER); + } + } + + private Function toAllowableValue() { + return new Function() { + @Override + public String apply(ApiParam input) { + return input.allowableValues(); + } + }; + } + + private AllowableValues allowableValues(ResolvedType parameterType, String allowableValueString) { + AllowableValues allowableValues = null; + if (!isNullOrEmpty(allowableValueString)) { + allowableValues = ApiModelProperties.allowableValueFromString(allowableValueString); + } else { + if (enumTypeDeterminer.isEnum(parameterType.getErasedType())) { + allowableValues = Enums.allowableValues(parameterType.getErasedType()); + } + if (Collections.isContainerType(parameterType)) { + allowableValues = Enums.allowableValues(Collections.collectionElementType(parameterType).getErasedType()); + } + } + return allowableValues; + } + + @Override + public boolean supports(DocumentationType delimiter) { + return pluginDoesApply(delimiter); + } +} + diff --git a/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiPlugin.java b/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiPlugin.java new file mode 100644 index 0000000000..abc466cb54 --- /dev/null +++ b/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerApiPlugin.java @@ -0,0 +1,74 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.escheduler.api.configuration; + +import io.swagger.annotations.Api; +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spi.service.OperationBuilderPlugin; +import springfox.documentation.spi.service.contexts.OperationContext; + +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Set; + +@Component +@Order(Ordered.HIGHEST_PRECEDENCE - 10) +public class SwaggerApiPlugin implements OperationBuilderPlugin { + + private static final Logger logger = LoggerFactory.getLogger(SwaggerApiPlugin.class); + + @Autowired + private MessageSource messageSource; + + @Override + public void apply(OperationContext context) { + Locale locale = LocaleContextHolder.getLocale(); + + List list = context.findAllAnnotations(Api.class); + if (list.size() > 0) { + Api api = list.get(0); + + Set tagsSet = new HashSet<>(1); + + if(api.tags() != null && api.tags().length > 0){ + tagsSet.add(StringUtils.isNotBlank(api.tags()[0]) ? messageSource.getMessage(api.tags()[0], null, locale) : " "); + } + + context.operationBuilder().hidden(api.hidden()) + .tags(tagsSet).build(); + + } + + } + + + @Override + public boolean supports(DocumentationType delimiter) { + return true; + } + +} diff --git a/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerI18nPlugin.java b/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerI18nPlugin.java deleted file mode 100644 index 4e4be961e5..0000000000 --- a/escheduler-api/src/main/java/cn/escheduler/api/configuration/SwaggerI18nPlugin.java +++ /dev/null @@ -1,52 +0,0 @@ -package cn.escheduler.api.configuration; - -import java.util.List; -import java.util.Locale; -import com.fasterxml.classmate.TypeResolver; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.MessageSource; -import org.springframework.context.i18n.LocaleContextHolder; -import org.springframework.core.Ordered; -import org.springframework.core.annotation.Order; -import org.springframework.stereotype.Component; - -import io.swagger.annotations.ApiOperation; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spi.service.OperationBuilderPlugin; -import springfox.documentation.spi.service.contexts.OperationContext; - - -@Component -@Order(Ordered.HIGHEST_PRECEDENCE - 10) -public class SwaggerI18nPlugin implements OperationBuilderPlugin { - - private static final Logger logger = LoggerFactory.getLogger(SwaggerI18nPlugin.class); - - @Autowired - private MessageSource messageSource; - - @Override - public void apply(OperationContext context) { - - Locale locale = LocaleContextHolder.getLocale(); - - List list = context.findAllAnnotations(ApiOperation.class); - if (list.size() > 0) { - for(ApiOperation api : list){ - context.operationBuilder().summary(messageSource.getMessage(api.value(), null, locale)); - context.operationBuilder().notes(messageSource.getMessage(api.notes(), null, locale)); - } - } - - - } - - - @Override - public boolean supports(DocumentationType delimiter) { - return true; - } - -} diff --git a/escheduler-api/src/main/java/cn/escheduler/api/controller/ExecutorController.java b/escheduler-api/src/main/java/cn/escheduler/api/controller/ExecutorController.java index a3c1e40cfd..6830e3c72d 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/controller/ExecutorController.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/controller/ExecutorController.java @@ -24,6 +24,7 @@ import cn.escheduler.api.utils.Constants; import cn.escheduler.api.utils.Result; import cn.escheduler.common.enums.*; import cn.escheduler.dao.model.User; +import io.swagger.annotations.Api; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/escheduler-api/src/main/java/cn/escheduler/api/controller/LoggerController.java b/escheduler-api/src/main/java/cn/escheduler/api/controller/LoggerController.java index 603dced013..00bc99df52 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/controller/LoggerController.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/controller/LoggerController.java @@ -21,6 +21,10 @@ import cn.escheduler.api.service.LoggerService; import cn.escheduler.api.utils.Constants; import cn.escheduler.api.utils.Result; import cn.escheduler.dao.model.User; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -28,6 +32,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; import static cn.escheduler.api.enums.Status.DOWNLOAD_TASK_INSTANCE_LOG_FILE_ERROR; import static cn.escheduler.api.enums.Status.QUERY_TASK_INSTANCE_LOG_ERROR; @@ -36,6 +41,7 @@ import static cn.escheduler.api.enums.Status.QUERY_TASK_INSTANCE_LOG_ERROR; /** * log controller */ +@Api(tags = "LOGGER_TAG", position = 13) @RestController @RequestMapping("/log") public class LoggerController extends BaseController { @@ -49,9 +55,15 @@ public class LoggerController extends BaseController { /** * query task log */ + @ApiOperation(value = "queryLog", notes= "QUERY_TASK_INSTANCE_LOG_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "taskInstId", value = "TASK_ID",type = "Int"), + @ApiImplicitParam(name = "skipLineNum", value = "SKIP_LINE_NUM", type ="Int"), + @ApiImplicitParam(name = "limit", value = "LIMIT", type ="Int") + }) @GetMapping(value = "/detail") @ResponseStatus(HttpStatus.OK) - public Result queryLog(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryLog(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "taskInstId") int taskInstanceId, @RequestParam(value = "skipLineNum") int skipNum, @RequestParam(value = "limit") int limit) { @@ -73,6 +85,10 @@ public class LoggerController extends BaseController { * @param loginUser * @param taskInstanceId */ + @ApiOperation(value = "downloadTaskLog", notes= "DOWNLOAD_TASK_INSTANCE_LOG_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "taskInstId", value = "TASK_ID",type = "Int") + }) @GetMapping(value = "/download-log") @ResponseBody public ResponseEntity downloadTaskLog(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, diff --git a/escheduler-api/src/main/java/cn/escheduler/api/controller/LoginController.java b/escheduler-api/src/main/java/cn/escheduler/api/controller/LoginController.java index cd46574d50..1855800ea5 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/controller/LoginController.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/controller/LoginController.java @@ -23,38 +23,33 @@ import cn.escheduler.api.service.UsersService; import cn.escheduler.api.utils.Constants; import cn.escheduler.api.utils.Result; import cn.escheduler.dao.model.User; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.*; import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.MessageSource; -import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.util.Locale; - import static cn.escheduler.api.enums.Status.*; /** * user login controller + * + * swagger bootstrap ui docs refer : https://doc.xiaominfo.com/guide/enh-func.html */ @RestController @RequestMapping("") -@Api(value = "", tags = {"中国"}, description = "中国") +@Api(tags = "LOGIN_TAG", position = 1) public class LoginController extends BaseController { private static final Logger logger = LoggerFactory.getLogger(LoginController.class); - private Locale locale = LocaleContextHolder.getLocale(); @Autowired private SessionService sessionService; @@ -62,8 +57,6 @@ public class LoginController extends BaseController { @Autowired private UsersService userService; - @Autowired - private MessageSource messageSource; /** * login @@ -74,18 +67,17 @@ public class LoginController extends BaseController { * @param response * @return */ - @ApiOperation(value = "test", notes="loginNotes") + @ApiOperation(value = "login", notes= "LOGIN_NOTES") @ApiImplicitParams({ - @ApiImplicitParam(name = "userName", value = "userName", required = true, type = "String"), - @ApiImplicitParam(name = "userPassword", value = "userPassword", required = true, type ="String") + @ApiImplicitParam(name = "userName", value = "USER_NAME", required = true, type = "String"), + @ApiImplicitParam(name = "userPassword", value = "USER_PASSWORD", required = true, type ="String") }) - @RequestMapping(value = "/login") + @PostMapping(value = "/login") public Result login(@RequestParam(value = "userName") String userName, @RequestParam(value = "userPassword") String userPassword, HttpServletRequest request, HttpServletResponse response) { - try { logger.info("login user name: {} ", userName); @@ -95,7 +87,6 @@ public class LoginController extends BaseController { Status.USER_NAME_NULL.getMsg()); } - // user ip check String ip = getClientIpAddress(request); if (StringUtils.isEmpty(ip)) { @@ -136,8 +127,9 @@ public class LoginController extends BaseController { * @param loginUser * @return */ + @ApiOperation(value = "signOut", notes = "SIGNOUT_NOTES") @PostMapping(value = "/signOut") - public Result signOut(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result signOut(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, HttpServletRequest request) { try { diff --git a/escheduler-api/src/main/java/cn/escheduler/api/controller/ProcessDefinitionController.java b/escheduler-api/src/main/java/cn/escheduler/api/controller/ProcessDefinitionController.java index ec1f38b0ce..f928b257c1 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/controller/ProcessDefinitionController.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/controller/ProcessDefinitionController.java @@ -21,11 +21,13 @@ import cn.escheduler.api.service.ProcessDefinitionService; import cn.escheduler.api.utils.Constants; import cn.escheduler.api.utils.Result; import cn.escheduler.dao.model.User; +import io.swagger.annotations.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; import java.util.Map; @@ -35,6 +37,7 @@ import static cn.escheduler.api.enums.Status.*; /** * process definition controller */ +@Api(tags = "PROCESS_DEFINITION_TAG", position = 2) @RestController @RequestMapping("projects/{projectName}/process") public class ProcessDefinitionController extends BaseController{ @@ -54,28 +57,36 @@ public class ProcessDefinitionController extends BaseController{ * @param desc * @return */ - @PostMapping(value = "/save") - @ResponseStatus(HttpStatus.CREATED) - public Result createProcessDefinition(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable String projectName, - @RequestParam(value = "name", required = true) String name, - @RequestParam(value = "processDefinitionJson", required = true) String json, - @RequestParam(value = "locations", required = false) String locations, - @RequestParam(value = "connects", required = false) String connects, - @RequestParam(value = "desc", required = false) String desc) { + @ApiOperation(value = "save", notes= "CREATE_PROCESS_DEFINITION_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "name", value = "PROCESS_DEFINITION_NAME", required = true, type = "String"), + @ApiImplicitParam(name = "processDefinitionJson", value = "PROCESS_DEFINITION_JSON", required = true, type ="String"), + @ApiImplicitParam(name = "locations", value = "PROCESS_DEFINITION_LOCATIONS", required = true, type ="String"), + @ApiImplicitParam(name = "connects", value = "PROCESS_DEFINITION_CONNECTS", required = true, type ="String"), + @ApiImplicitParam(name = "desc", value = "PROCESS_DEFINITION_DESC", required = false, type ="String"), + }) + @PostMapping(value = "/save") + @ResponseStatus(HttpStatus.CREATED) + public Result createProcessDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, + @RequestParam(value = "name", required = true) String name, + @RequestParam(value = "processDefinitionJson", required = true) String json, + @RequestParam(value = "locations", required = true) String locations, + @RequestParam(value = "connects", required = true) String connects, + @RequestParam(value = "desc", required = false) String desc) { - try { - logger.info("login user {}, create process definition, project name: {}, process definition name: {}, " + - "process_definition_json: {}, desc: {} locations:{}, connects:{}", - loginUser.getUserName(), projectName, name, json,desc, locations, connects); - Map result = processDefinitionService.createProcessDefinition(loginUser, projectName, name, json, - desc, locations, connects ); - return returnDataList(result); - }catch (Exception e){ - logger.error(CREATE_PROCESS_DEFINITION.getMsg(),e); - return error(CREATE_PROCESS_DEFINITION.getCode(), CREATE_PROCESS_DEFINITION.getMsg()); + try { + logger.info("login user {}, create process definition, project name: {}, process definition name: {}, " + + "process_definition_json: {}, desc: {} locations:{}, connects:{}", + loginUser.getUserName(), projectName, name, json, desc, locations, connects); + Map result = processDefinitionService.createProcessDefinition(loginUser, projectName, name, json, + desc, locations, connects); + return returnDataList(result); + } catch (Exception e) { + logger.error(CREATE_PROCESS_DEFINITION.getMsg(), e); + return error(CREATE_PROCESS_DEFINITION.getCode(), CREATE_PROCESS_DEFINITION.getMsg()); + } } - } /** * verify process definition name unique @@ -85,10 +96,14 @@ public class ProcessDefinitionController extends BaseController{ * @param name * @return */ + @ApiOperation(value = "verify-name", notes = "VERIFY_PROCCESS_DEFINITION_NAME_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "name", value = "PROCESS_DEFINITION_NAME", required = true, type = "String") + }) @GetMapping(value = "/verify-name") @ResponseStatus(HttpStatus.OK) - public Result verifyProccessDefinitionName(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable String projectName, + public Result verifyProccessDefinitionName(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME",required = true) @PathVariable String projectName, @RequestParam(value = "name", required = true) String name){ try { logger.info("verify process definition name unique, user:{}, project name:{}, process definition name:{}", @@ -102,7 +117,7 @@ public class ProcessDefinitionController extends BaseController{ } /** - * update process definition + * update process definition * * @param loginUser * @param projectName @@ -112,10 +127,19 @@ public class ProcessDefinitionController extends BaseController{ * @param desc * @return */ + @ApiOperation(value = "updateProccessDefinition", notes= "UPDATE_PROCCESS_DEFINITION_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "name", value = "PROCESS_DEFINITION_NAME", required = true, type = "String"), + @ApiImplicitParam(name = "id", value = "PROCESS_DEFINITION_ID", required = true, type = "Int"), + @ApiImplicitParam(name = "processDefinitionJson", value = "PROCESS_DEFINITION_JSON", required = true, type ="String"), + @ApiImplicitParam(name = "locations", value = "PROCESS_DEFINITION_LOCATIONS", required = true, type ="String"), + @ApiImplicitParam(name = "connects", value = "PROCESS_DEFINITION_CONNECTS", required = true, type ="String"), + @ApiImplicitParam(name = "desc", value = "PROCESS_DEFINITION_DESC", required = false, type ="String"), + }) @PostMapping(value = "/update") @ResponseStatus(HttpStatus.OK) - public Result updateProccessDefinition(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable String projectName, + public Result updateProccessDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME",required = true) @PathVariable String projectName, @RequestParam(value = "name", required = true) String name, @RequestParam(value = "id", required = true) int id, @RequestParam(value = "processDefinitionJson", required = true) String processDefinitionJson, @@ -145,10 +169,16 @@ public class ProcessDefinitionController extends BaseController{ * @param releaseState * @return */ + @ApiOperation(value = "releaseProccessDefinition", notes= "RELEASE_PROCCESS_DEFINITION_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "name", value = "PROCESS_DEFINITION_NAME", required = true, type = "String"), + @ApiImplicitParam(name = "processId", value = "PROCESS_DEFINITION_ID", required = true, type = "Int"), + @ApiImplicitParam(name = "releaseState", value = "PROCESS_DEFINITION_CONNECTS", required = true, type ="Int"), + }) @PostMapping(value = "/release") @ResponseStatus(HttpStatus.OK) - public Result releaseProccessDefinition(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable String projectName, + public Result releaseProccessDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME",required = true) @PathVariable String projectName, @RequestParam(value = "processId", required = true) int processId, @RequestParam(value = "releaseState", required = true) int releaseState) { @@ -172,10 +202,14 @@ public class ProcessDefinitionController extends BaseController{ * @param processId * @return */ + @ApiOperation(value = "queryProccessDefinitionById", notes= "QUERY_PROCCESS_DEFINITION_BY_ID_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "processId", value = "PROCESS_DEFINITION_ID", required = true, type = "Int") + }) @GetMapping(value="/select-by-id") @ResponseStatus(HttpStatus.OK) - public Result queryProccessDefinitionById(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable String projectName, + public Result queryProccessDefinitionById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME",required = true) @PathVariable String projectName, @RequestParam("processId") Integer processId ){ try{ @@ -197,10 +231,11 @@ public class ProcessDefinitionController extends BaseController{ * @param projectName * @return */ + @ApiOperation(value = "queryProccessDefinitionList", notes= "QUERY_PROCCESS_DEFINITION_LIST_NOTES") @GetMapping(value="/list") @ResponseStatus(HttpStatus.OK) - public Result queryProccessDefinitionList(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable String projectName + public Result queryProccessDefinitionList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME",required = true) @PathVariable String projectName ){ try{ logger.info("query proccess definition list, login user:{}, project name:{}", @@ -221,10 +256,17 @@ public class ProcessDefinitionController extends BaseController{ * @param pageSize * @return */ + @ApiOperation(value = "queryProcessDefinitionListPaging", notes= "QUERY_PROCCESS_DEFINITION_LIST_PAGING_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, type = "Int"), + @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", required = false, type = "String"), + @ApiImplicitParam(name = "userId", value = "USER_ID", required = false, type = "Int"), + @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, type = "Int") + }) @GetMapping(value="/list-paging") @ResponseStatus(HttpStatus.OK) - public Result queryProcessDefinitionListPaging(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable String projectName, + public Result queryProcessDefinitionListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME",required = true) @PathVariable String projectName, @RequestParam("pageNo") Integer pageNo, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam(value = "userId", required = false, defaultValue = "0") Integer userId, @@ -252,10 +294,15 @@ public class ProcessDefinitionController extends BaseController{ * @param id * @return */ + @ApiOperation(value = "viewTree", notes= "VIEW_TREE_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "processId", value = "PROCESS_DEFINITION_ID", required = true, type = "Int"), + @ApiImplicitParam(name = "limit", value = "LIMIT", required = true, type = "Int") + }) @GetMapping(value="/view-tree") @ResponseStatus(HttpStatus.OK) - public Result viewTree(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable String projectName, + public Result viewTree(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME",required = true) @PathVariable String projectName, @RequestParam("processId") Integer id, @RequestParam("limit") Integer limit){ try{ @@ -278,11 +325,15 @@ public class ProcessDefinitionController extends BaseController{ * @param processDefinitionId * @return */ + @ApiOperation(value = "getNodeListByDefinitionId", notes= "GET_NODE_LIST_BY_DEFINITION_ID_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "processDefinitionId", value = "PROCESS_DEFINITION_ID", required = true, type = "Int") + }) @GetMapping(value="gen-task-list") @ResponseStatus(HttpStatus.OK) public Result getNodeListByDefinitionId( - @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable String projectName, + @ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME",required = true) @PathVariable String projectName, @RequestParam("processDefinitionId") Integer processDefinitionId){ try { logger.info("query task node name list by definitionId, login user:{}, project name:{}, id : {}", @@ -305,11 +356,15 @@ public class ProcessDefinitionController extends BaseController{ * @param processDefinitionIdList * @return */ + @ApiOperation(value = "getNodeListByDefinitionIdList", notes= "GET_NODE_LIST_BY_DEFINITION_ID_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "processDefinitionIdList", value = "PROCESS_DEFINITION_ID_LIST", required = true, type = "String") + }) @GetMapping(value="get-task-list") @ResponseStatus(HttpStatus.OK) public Result getNodeListByDefinitionIdList( - @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable String projectName, + @ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME",required = true) @PathVariable String projectName, @RequestParam("processDefinitionIdList") String processDefinitionIdList){ try { diff --git a/escheduler-api/src/main/java/cn/escheduler/api/controller/ProcessInstanceController.java b/escheduler-api/src/main/java/cn/escheduler/api/controller/ProcessInstanceController.java index 323e240d79..1c36e7ca3e 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/controller/ProcessInstanceController.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/controller/ProcessInstanceController.java @@ -23,11 +23,13 @@ import cn.escheduler.api.utils.Result; import cn.escheduler.common.enums.ExecutionStatus; import cn.escheduler.common.enums.Flag; import cn.escheduler.dao.model.User; +import io.swagger.annotations.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; import java.util.Map; @@ -36,6 +38,7 @@ import static cn.escheduler.api.enums.Status.*; /** * process instance controller */ +@Api(tags = "PROCESS_INSTANCE_TAG", position = 10) @RestController @RequestMapping("projects/{projectName}/instance") public class ProcessInstanceController extends BaseController{ @@ -55,10 +58,21 @@ public class ProcessInstanceController extends BaseController{ * @param pageSize * @return */ + @ApiOperation(value = "queryProcessInstanceList", notes= "QUERY_PROCESS_INSTANCE_LIST_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "processDefinitionId", value = "PROCESS_DEFINITION_ID", type = "Int"), + @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", type ="String"), + @ApiImplicitParam(name = "stateType", value = "EXECUTION_STATUS", type ="ExecutionStatus"), + @ApiImplicitParam(name = "host", value = "HOST", type ="String"), + @ApiImplicitParam(name = "startDate", value = "START_DATE", type ="String"), + @ApiImplicitParam(name = "endDate", value = "END_DATE", type ="String"), + @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", type ="Int"), + @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", type ="Int") + }) @GetMapping(value="list-paging") @ResponseStatus(HttpStatus.OK) - public Result queryProcessInstanceList(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable String projectName, + public Result queryProcessInstanceList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam(value = "processDefinitionId", required = false, defaultValue = "0") Integer processDefinitionId, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam(value = "stateType", required = false) ExecutionStatus stateType, @@ -86,19 +100,23 @@ public class ProcessInstanceController extends BaseController{ * * @param loginUser * @param projectName - * @param workflowId + * @param processInstanceId * @return */ + @ApiOperation(value = "queryTaskListByProcessId", notes= "QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "processInstanceId", value = "PROCESS_INSTANCE_ID", type = "Int") + }) @GetMapping(value="/task-list-by-process-id") @ResponseStatus(HttpStatus.OK) - public Result queryTaskListByProcessId(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable String projectName, - @RequestParam("processInstanceId") Integer workflowId + public Result queryTaskListByProcessId(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, + @RequestParam("processInstanceId") Integer processInstanceId ) { try{ - logger.info("query task instance list by process instance id, login user:{}, project name:{}, work instance id:{}", - loginUser.getUserName(), projectName, workflowId); - Map result = processInstanceService.queryTaskListByProcessId(loginUser, projectName, workflowId); + logger.info("query task instance list by process instance id, login user:{}, project name:{}, process instance id:{}", + loginUser.getUserName(), projectName, processInstanceId); + Map result = processInstanceService.queryTaskListByProcessId(loginUser, projectName, processInstanceId); return returnDataList(result); }catch (Exception e){ logger.error(QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_ERROR.getMsg(),e); @@ -118,10 +136,20 @@ public class ProcessInstanceController extends BaseController{ * @param flag * @return */ + @ApiOperation(value = "updateProcessInstance", notes= "UPDATE_PROCESS_INSTANCE_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "processInstanceJson", value = "PROCESS_INSTANCE_JSON", type = "String"), + @ApiImplicitParam(name = "processInstanceId", value = "PROCESS_INSTANCE_ID", type = "Int"), + @ApiImplicitParam(name = "scheduleTime", value = "SCHEDULE_TIME", type = "String"), + @ApiImplicitParam(name = "syncDefine", value = "SYNC_DEFINE", type = "Boolean"), + @ApiImplicitParam(name = "locations", value = "PROCESS_INSTANCE_LOCATIONS", type = "String"), + @ApiImplicitParam(name = "connects", value = "PROCESS_INSTANCE_CONNECTS", type = "String"), + @ApiImplicitParam(name = "flag", value = "RECOVERY_PROCESS_INSTANCE_FLAG", type = "Flag"), + }) @PostMapping(value="/update") @ResponseStatus(HttpStatus.OK) - public Result updateProcessInstance(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable String projectName, + public Result updateProcessInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam( value = "processInstanceJson", required = false) String processInstanceJson, @RequestParam( value = "processInstanceId") Integer processInstanceId, @RequestParam( value = "scheduleTime", required = false) String scheduleTime, @@ -152,10 +180,14 @@ public class ProcessInstanceController extends BaseController{ * @param processInstanceId * @return */ + @ApiOperation(value = "queryProcessInstanceById", notes= "QUERY_PROCESS_INSTANCE_BY_ID_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "processInstanceId", value = "PROCESS_INSTANCE_ID", type = "Int") + }) @GetMapping(value="/select-by-id") @ResponseStatus(HttpStatus.OK) - public Result queryProcessInstanceById(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable String projectName, + public Result queryProcessInstanceById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam("processInstanceId") Integer processInstanceId ){ try{ @@ -178,10 +210,14 @@ public class ProcessInstanceController extends BaseController{ * @param processInstanceId * @return */ + @ApiOperation(value = "deleteProcessInstanceById", notes= "DELETE_PROCESS_INSTANCE_BY_ID_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "processInstanceId", value = "PROCESS_INSTANCE_ID", type = "Int") + }) @GetMapping(value="/delete") @ResponseStatus(HttpStatus.OK) - public Result deleteProcessInstanceById(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable String projectName, + public Result deleteProcessInstanceById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam("processInstanceId") Integer processInstanceId ){ try{ @@ -203,10 +239,14 @@ public class ProcessInstanceController extends BaseController{ * @param taskId * @return */ + @ApiOperation(value = "querySubProcessInstanceByTaskId", notes= "QUERY_SUBPROCESS_INSTANCE_BY_TASK_ID_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "taskId", value = "TASK_ID", type = "Int") + }) @GetMapping(value="/select-sub-process") @ResponseStatus(HttpStatus.OK) - public Result querySubProcessInstanceByTaskId(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable String projectName, + public Result querySubProcessInstanceByTaskId(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam("taskId") Integer taskId){ try{ Map result = processInstanceService.querySubProcessInstanceByTaskId(loginUser, projectName, taskId); @@ -225,10 +265,14 @@ public class ProcessInstanceController extends BaseController{ * @param subId * @return */ + @ApiOperation(value = "queryParentInstanceBySubId", notes= "QUERY_PARENT_PROCESS_INSTANCE_BY_SUB_PROCESS_INSTANCE_ID_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "subId", value = "SUB_PROCESS_INSTANCE_ID", type = "Int") + }) @GetMapping(value="/select-parent-process") @ResponseStatus(HttpStatus.OK) - public Result queryParentInstanceBySubId(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable String projectName, + public Result queryParentInstanceBySubId(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam("subId") Integer subId){ try{ Map result = processInstanceService.queryParentInstanceBySubId(loginUser, projectName, subId); @@ -246,9 +290,13 @@ public class ProcessInstanceController extends BaseController{ * @param processInstanceId * @return */ + @ApiOperation(value = "viewVariables", notes= "QUERY_PROCESS_INSTANCE_GLOBAL_VARIABLES_AND_LOCAL_VARIABLES_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "processInstanceId", value = "PROCESS_INSTANCE_ID", type = "Int") + }) @GetMapping(value="/view-variables") @ResponseStatus(HttpStatus.OK) - public Result viewVariables(@RequestAttribute(value = Constants.SESSION_USER) User loginUser + public Result viewVariables(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser , @RequestParam("processInstanceId") Integer processInstanceId){ try{ Map result = processInstanceService.viewVariables(processInstanceId); @@ -267,10 +315,14 @@ public class ProcessInstanceController extends BaseController{ * @param processInstanceId * @return */ + @ApiOperation(value = "vieGanttTree", notes= "VIEW_GANTT_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "processInstanceId", value = "PROCESS_INSTANCE_ID", type = "Int") + }) @GetMapping(value="/view-gantt") @ResponseStatus(HttpStatus.OK) - public Result viewTree(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable String projectName, + public Result viewTree(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam("processInstanceId") Integer processInstanceId){ try{ Map result = processInstanceService.viewGantt(processInstanceId); diff --git a/escheduler-api/src/main/java/cn/escheduler/api/controller/SchedulerController.java b/escheduler-api/src/main/java/cn/escheduler/api/controller/SchedulerController.java index 8449bd1d38..d860979d62 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/controller/SchedulerController.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/controller/SchedulerController.java @@ -25,11 +25,13 @@ import cn.escheduler.common.enums.Priority; import cn.escheduler.common.enums.ReleaseState; import cn.escheduler.common.enums.WarningType; import cn.escheduler.dao.model.User; +import io.swagger.annotations.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; import java.util.Map; @@ -39,9 +41,10 @@ import static cn.escheduler.api.utils.Constants.SESSION_USER; /** * schedule controller */ +@Api(tags = "SCHEDULER_TAG", position = 13) @RestController @RequestMapping("/projects/{projectName}/schedule") -public class SchedulerController extends BaseController{ +public class SchedulerController extends BaseController { private static final Logger logger = LoggerFactory.getLogger(SchedulerController.class); public static final String DEFAULT_WARNING_TYPE = "NONE"; @@ -65,33 +68,45 @@ public class SchedulerController extends BaseController{ * @param failureStrategy * @return */ - @PostMapping("/create") - @ResponseStatus(HttpStatus.CREATED) - public Result createSchedule(@RequestAttribute(value = SESSION_USER) User loginUser, - @PathVariable String projectName, - @RequestParam(value = "processDefinitionId") Integer processDefinitionId, - @RequestParam(value = "schedule") String schedule, - @RequestParam(value = "warningType", required = false,defaultValue = DEFAULT_WARNING_TYPE) WarningType warningType, - @RequestParam(value = "warningGroupId", required = false,defaultValue = DEFAULT_NOTIFY_GROUP_ID) int warningGroupId, - @RequestParam(value = "failureStrategy", required = false, defaultValue = DEFAULT_FAILURE_POLICY) FailureStrategy failureStrategy, - @RequestParam(value = "receivers", required = false) String receivers, - @RequestParam(value = "receiversCc", required = false) String receiversCc, - @RequestParam(value = "workerGroupId", required = false, defaultValue = "-1") int workerGroupId, - @RequestParam(value = "processInstancePriority", required = false) Priority processInstancePriority) { - logger.info("login user {}, project name: {}, process name: {}, create schedule: {}, warning type: {}, warning group id: {}," + - "failure policy: {},receivers : {},receiversCc : {},processInstancePriority : {}, workGroupId:{}", - loginUser.getUserName(), projectName, processDefinitionId, schedule, warningType, warningGroupId, - failureStrategy,receivers,receiversCc,processInstancePriority,workerGroupId); - try { - Map result = schedulerService.insertSchedule(loginUser, projectName, processDefinitionId, schedule, - warningType, warningGroupId, failureStrategy, receivers,receiversCc,processInstancePriority,workerGroupId); + @ApiOperation(value = "createSchedule", notes= "CREATE_SCHEDULE_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "processDefinitionId", value = "PROCESS_DEFINITION_ID", required = true, type = "Int"), + @ApiImplicitParam(name = "schedule", value = "SCHEDULE", type = "Int"), + @ApiImplicitParam(name = "warningType", value = "WARNING_TYPE", type ="WarningType"), + @ApiImplicitParam(name = "warningGroupId", value = "WARNING_GROUP_ID", type ="Int"), + @ApiImplicitParam(name = "failureStrategy", value = "FAILURE_STRATEGY", type ="FailureStrategy"), + @ApiImplicitParam(name = "receivers", value = "RECEIVERS", type ="String"), + @ApiImplicitParam(name = "receiversCc", value = "RECEIVERS_CC", type ="String"), + @ApiImplicitParam(name = "workerGroupId", value = "WORKER_GROUP_ID", type ="Int"), + @ApiImplicitParam(name = "processInstancePriority", value = "PROCESS_INSTANCE_PRIORITY", type ="Priority"), + }) + @PostMapping("/create") + @ResponseStatus(HttpStatus.CREATED) + public Result createSchedule(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, + @RequestParam(value = "processDefinitionId") Integer processDefinitionId, + @RequestParam(value = "schedule") String schedule, + @RequestParam(value = "warningType", required = false, defaultValue = DEFAULT_WARNING_TYPE) WarningType warningType, + @RequestParam(value = "warningGroupId", required = false, defaultValue = DEFAULT_NOTIFY_GROUP_ID) int warningGroupId, + @RequestParam(value = "failureStrategy", required = false, defaultValue = DEFAULT_FAILURE_POLICY) FailureStrategy failureStrategy, + @RequestParam(value = "receivers", required = false) String receivers, + @RequestParam(value = "receiversCc", required = false) String receiversCc, + @RequestParam(value = "workerGroupId", required = false, defaultValue = "-1") int workerGroupId, + @RequestParam(value = "processInstancePriority", required = false) Priority processInstancePriority) { + logger.info("login user {}, project name: {}, process name: {}, create schedule: {}, warning type: {}, warning group id: {}," + + "failure policy: {},receivers : {},receiversCc : {},processInstancePriority : {}, workGroupId:{}", + loginUser.getUserName(), projectName, processDefinitionId, schedule, warningType, warningGroupId, + failureStrategy, receivers, receiversCc, processInstancePriority, workerGroupId); + try { + Map result = schedulerService.insertSchedule(loginUser, projectName, processDefinitionId, schedule, + warningType, warningGroupId, failureStrategy, receivers, receiversCc, processInstancePriority, workerGroupId); - return returnDataList(result); - }catch (Exception e){ - logger.error(CREATE_SCHEDULE_ERROR.getMsg(),e); - return error(CREATE_SCHEDULE_ERROR.getCode(), CREATE_SCHEDULE_ERROR.getMsg()); - } - } + return returnDataList(result); + } catch (Exception e) { + logger.error(CREATE_SCHEDULE_ERROR.getMsg(), e); + return error(CREATE_SCHEDULE_ERROR.getCode(), CREATE_SCHEDULE_ERROR.getMsg()); + } + } /** * updateProcessInstance schedule @@ -105,33 +120,45 @@ public class SchedulerController extends BaseController{ * @param failureStrategy * @return */ - @PostMapping("/update") - public Result updateSchedule(@RequestAttribute(value = SESSION_USER) User loginUser, - @PathVariable String projectName, - @RequestParam(value = "id") Integer id, - @RequestParam(value = "schedule") String schedule, - @RequestParam(value = "warningType", required = false, defaultValue = DEFAULT_WARNING_TYPE) WarningType warningType, - @RequestParam(value = "warningGroupId", required = false) int warningGroupId, - @RequestParam(value = "failureStrategy", required = false, defaultValue = "END") FailureStrategy failureStrategy, - @RequestParam(value = "receivers", required = false) String receivers, - @RequestParam(value = "receiversCc", required = false) String receiversCc, - @RequestParam(value = "workerGroupId", required = false, defaultValue = "-1") int workerGroupId, - @RequestParam(value = "processInstancePriority", required = false) Priority processInstancePriority) { - logger.info("login user {}, project name: {},id: {}, updateProcessInstance schedule: {}, notify type: {}, notify mails: {}, " + - "failure policy: {},receivers : {},receiversCc : {},processInstancePriority : {},workerGroupId:{}", - loginUser.getUserName(), projectName, id, schedule, warningType, warningGroupId, failureStrategy, - receivers,receiversCc,processInstancePriority,workerGroupId); + @ApiOperation(value = "updateSchedule", notes= "UPDATE_SCHEDULE_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "SCHEDULE_ID", required = true, type = "Int"), + @ApiImplicitParam(name = "schedule", value = "SCHEDULE", type = "Int"), + @ApiImplicitParam(name = "warningType", value = "WARNING_TYPE", type ="WarningType"), + @ApiImplicitParam(name = "warningGroupId", value = "WARNING_GROUP_ID", type ="Int"), + @ApiImplicitParam(name = "failureStrategy", value = "FAILURE_STRATEGY", type ="FailureStrategy"), + @ApiImplicitParam(name = "receivers", value = "RECEIVERS", type ="String"), + @ApiImplicitParam(name = "receiversCc", value = "RECEIVERS_CC", type ="String"), + @ApiImplicitParam(name = "workerGroupId", value = "WORKER_GROUP_ID", type ="Int"), + @ApiImplicitParam(name = "processInstancePriority", value = "PROCESS_INSTANCE_PRIORITY", type ="Priority"), + }) + @PostMapping("/update") + public Result updateSchedule(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, + @RequestParam(value = "id") Integer id, + @RequestParam(value = "schedule") String schedule, + @RequestParam(value = "warningType", required = false, defaultValue = DEFAULT_WARNING_TYPE) WarningType warningType, + @RequestParam(value = "warningGroupId", required = false) int warningGroupId, + @RequestParam(value = "failureStrategy", required = false, defaultValue = "END") FailureStrategy failureStrategy, + @RequestParam(value = "receivers", required = false) String receivers, + @RequestParam(value = "receiversCc", required = false) String receiversCc, + @RequestParam(value = "workerGroupId", required = false, defaultValue = "-1") int workerGroupId, + @RequestParam(value = "processInstancePriority", required = false) Priority processInstancePriority) { + logger.info("login user {}, project name: {},id: {}, updateProcessInstance schedule: {}, notify type: {}, notify mails: {}, " + + "failure policy: {},receivers : {},receiversCc : {},processInstancePriority : {},workerGroupId:{}", + loginUser.getUserName(), projectName, id, schedule, warningType, warningGroupId, failureStrategy, + receivers, receiversCc, processInstancePriority, workerGroupId); - try { - Map result = schedulerService.updateSchedule(loginUser, projectName, id, schedule, - warningType, warningGroupId, failureStrategy, receivers,receiversCc,null,processInstancePriority, workerGroupId); - return returnDataList(result); + try { + Map result = schedulerService.updateSchedule(loginUser, projectName, id, schedule, + warningType, warningGroupId, failureStrategy, receivers, receiversCc, null, processInstancePriority, workerGroupId); + return returnDataList(result); - }catch (Exception e){ - logger.error(UPDATE_SCHEDULE_ERROR.getMsg(),e); - return error(Status.UPDATE_SCHEDULE_ERROR.getCode(), Status.UPDATE_SCHEDULE_ERROR.getMsg()); - } - } + } catch (Exception e) { + logger.error(UPDATE_SCHEDULE_ERROR.getMsg(), e); + return error(Status.UPDATE_SCHEDULE_ERROR.getCode(), Status.UPDATE_SCHEDULE_ERROR.getMsg()); + } + } /** * publish schedule setScheduleState @@ -142,21 +169,25 @@ public class SchedulerController extends BaseController{ * @return * @throws Exception */ - @PostMapping("/online") - public Result online(@RequestAttribute(value = SESSION_USER) User loginUser, - @PathVariable("projectName") String projectName, - @RequestParam("id") Integer id) { - logger.info("login user {}, schedule setScheduleState, project name: {}, id: {}", - loginUser.getUserName(), projectName, id); - try { - Map result = schedulerService.setScheduleState(loginUser, projectName, id, ReleaseState.ONLINE); - return returnDataList(result); + @ApiOperation(value = "online", notes= "ONLINE_SCHEDULE_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "SCHEDULE_ID", required = true, type = "Int") + }) + @PostMapping("/online") + public Result online(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable("projectName") String projectName, + @RequestParam("id") Integer id) { + logger.info("login user {}, schedule setScheduleState, project name: {}, id: {}", + loginUser.getUserName(), projectName, id); + try { + Map result = schedulerService.setScheduleState(loginUser, projectName, id, ReleaseState.ONLINE); + return returnDataList(result); - }catch (Exception e){ - logger.error(PUBLISH_SCHEDULE_ONLINE_ERROR.getMsg(),e); - return error(Status.PUBLISH_SCHEDULE_ONLINE_ERROR.getCode(), Status.PUBLISH_SCHEDULE_ONLINE_ERROR.getMsg()); - } - } + } catch (Exception e) { + logger.error(PUBLISH_SCHEDULE_ONLINE_ERROR.getMsg(), e); + return error(Status.PUBLISH_SCHEDULE_ONLINE_ERROR.getCode(), Status.PUBLISH_SCHEDULE_ONLINE_ERROR.getMsg()); + } + } /** * offline schedule @@ -166,22 +197,26 @@ public class SchedulerController extends BaseController{ * @param id * @return */ - @PostMapping("/offline") - public Result offline(@RequestAttribute(value = SESSION_USER) User loginUser, - @PathVariable("projectName") String projectName, - @RequestParam("id") Integer id) { - logger.info("login user {}, schedule offline, project name: {}, process definition id: {}", - loginUser.getUserName(), projectName, id); + @ApiOperation(value = "offline", notes= "OFFLINE_SCHEDULE_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "SCHEDULE_ID", required = true, type = "Int") + }) + @PostMapping("/offline") + public Result offline(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable("projectName") String projectName, + @RequestParam("id") Integer id) { + logger.info("login user {}, schedule offline, project name: {}, process definition id: {}", + loginUser.getUserName(), projectName, id); - try { - Map result = schedulerService.setScheduleState(loginUser, projectName, id, ReleaseState.OFFLINE); - return returnDataList(result); + try { + Map result = schedulerService.setScheduleState(loginUser, projectName, id, ReleaseState.OFFLINE); + return returnDataList(result); - }catch (Exception e){ - logger.error(OFFLINE_SCHEDULE_ERROR.getMsg(),e); - return error(Status.OFFLINE_SCHEDULE_ERROR.getCode(), Status.OFFLINE_SCHEDULE_ERROR.getMsg()); - } - } + } catch (Exception e) { + logger.error(OFFLINE_SCHEDULE_ERROR.getMsg(), e); + return error(Status.OFFLINE_SCHEDULE_ERROR.getCode(), Status.OFFLINE_SCHEDULE_ERROR.getMsg()); + } + } /** * query schedule list paging @@ -191,43 +226,53 @@ public class SchedulerController extends BaseController{ * @param processDefinitionId * @return */ - @GetMapping("/list-paging") - public Result querySchedule(@RequestAttribute(value = SESSION_USER) User loginUser, - @PathVariable String projectName, - @RequestParam Integer processDefinitionId, - @RequestParam(value = "searchVal", required = false) String searchVal, - @RequestParam("pageNo") Integer pageNo, - @RequestParam("pageSize") Integer pageSize) { - logger.info("login user {}, query schedule, project name: {}, process definition id: {}", - loginUser.getUserName(), projectName, processDefinitionId); - try { - Map result = schedulerService.querySchedule(loginUser, projectName, processDefinitionId, searchVal, pageNo, pageSize); - return returnDataListPaging(result); - }catch (Exception e){ - logger.error(QUERY_SCHEDULE_LIST_PAGING_ERROR.getMsg(),e); - return error(Status.QUERY_SCHEDULE_LIST_PAGING_ERROR.getCode(), Status.QUERY_SCHEDULE_LIST_PAGING_ERROR.getMsg()); - } + @ApiOperation(value = "queryScheduleListPaging", notes= "QUERY_SCHEDULE_LIST_PAGING_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "SCHEDULE_ID", required = true, type = "Int"), + @ApiImplicitParam(name = "processDefinitionId", value = "PROCESS_DEFINITION_ID", required = true,type = "Int"), + @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", type = "String"), + @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", type = "Int"), + @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", type = "Int") - } + }) + @GetMapping("/list-paging") + public Result queryScheduleListPaging(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, + @RequestParam Integer processDefinitionId, + @RequestParam(value = "searchVal", required = false) String searchVal, + @RequestParam("pageNo") Integer pageNo, + @RequestParam("pageSize") Integer pageSize) { + logger.info("login user {}, query schedule, project name: {}, process definition id: {}", + loginUser.getUserName(), projectName, processDefinitionId); + try { + Map result = schedulerService.querySchedule(loginUser, projectName, processDefinitionId, searchVal, pageNo, pageSize); + return returnDataListPaging(result); + } catch (Exception e) { + logger.error(QUERY_SCHEDULE_LIST_PAGING_ERROR.getMsg(), e); + return error(Status.QUERY_SCHEDULE_LIST_PAGING_ERROR.getCode(), Status.QUERY_SCHEDULE_LIST_PAGING_ERROR.getMsg()); + } - /** - * query schedule list - * - * @param loginUser - * @param projectName - * @return - */ - @PostMapping("/list") - public Result queryScheduleList(@RequestAttribute(value = SESSION_USER) User loginUser, - @PathVariable String projectName) { - try{ - logger.info("login user {}, query schedule list, project name: {}", - loginUser.getUserName(), projectName); - Map result = schedulerService.queryScheduleList(loginUser, projectName); - return returnDataList(result); - }catch (Exception e){ - logger.error(QUERY_SCHEDULE_LIST_ERROR.getMsg(),e); - return error(Status.QUERY_SCHEDULE_LIST_ERROR.getCode(), Status.QUERY_SCHEDULE_LIST_ERROR.getMsg()); - } - } + } + + /** + * query schedule list + * + * @param loginUser + * @param projectName + * @return + */ + @ApiOperation(value = "queryScheduleList", notes= "QUERY_SCHEDULE_LIST_NOTES") + @PostMapping("/list") + public Result queryScheduleList(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName) { + try { + logger.info("login user {}, query schedule list, project name: {}", + loginUser.getUserName(), projectName); + Map result = schedulerService.queryScheduleList(loginUser, projectName); + return returnDataList(result); + } catch (Exception e) { + logger.error(QUERY_SCHEDULE_LIST_ERROR.getMsg(), e); + return error(Status.QUERY_SCHEDULE_LIST_ERROR.getCode(), Status.QUERY_SCHEDULE_LIST_ERROR.getMsg()); + } + } } diff --git a/escheduler-api/src/main/java/cn/escheduler/api/controller/TaskInstanceController.java b/escheduler-api/src/main/java/cn/escheduler/api/controller/TaskInstanceController.java index d9d18923e0..b249bf8e04 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/controller/TaskInstanceController.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/controller/TaskInstanceController.java @@ -22,11 +22,13 @@ import cn.escheduler.api.utils.Constants; import cn.escheduler.api.utils.Result; import cn.escheduler.common.enums.ExecutionStatus; import cn.escheduler.dao.model.User; +import io.swagger.annotations.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; import java.util.Map; @@ -35,6 +37,7 @@ import static cn.escheduler.api.enums.Status.QUERY_TASK_LIST_PAGING_ERROR; /** * task instance controller */ +@Api(tags = "TASK_INSTANCE_TAG", position = 11) @RestController @RequestMapping("/projects/{projectName}/task-instance") public class TaskInstanceController extends BaseController{ @@ -51,10 +54,22 @@ public class TaskInstanceController extends BaseController{ * @param loginUser * @return */ + @ApiOperation(value = "queryTaskListPaging", notes= "QUERY_TASK_INSTANCE_LIST_PAGING_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "processInstanceId", value = "PROCESS_INSTANCE_ID",required = false, type = "Int"), + @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", type ="String"), + @ApiImplicitParam(name = "taskName", value = "TASK_NAME", type ="String"), + @ApiImplicitParam(name = "stateType", value = "EXECUTION_STATUS", type ="ExecutionStatus"), + @ApiImplicitParam(name = "host", value = "HOST", type ="String"), + @ApiImplicitParam(name = "startDate", value = "START_DATE", type ="String"), + @ApiImplicitParam(name = "endDate", value = "END_DATE", type ="String"), + @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", type ="Int"), + @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", type ="Int") + }) @GetMapping("/list-paging") @ResponseStatus(HttpStatus.OK) - public Result queryTaskListPaging(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable String projectName, + public Result queryTaskListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam(value = "processInstanceId", required = false, defaultValue = "0") Integer processInstanceId, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam(value = "taskName", required = false) String taskName, diff --git a/escheduler-api/src/main/java/cn/escheduler/api/controller/UsersController.java b/escheduler-api/src/main/java/cn/escheduler/api/controller/UsersController.java index 72f2eb31c2..ee2d564e88 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/controller/UsersController.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/controller/UsersController.java @@ -22,11 +22,16 @@ import cn.escheduler.api.service.UsersService; import cn.escheduler.api.utils.Constants; import cn.escheduler.api.utils.Result; import cn.escheduler.dao.model.User; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; import java.util.Map; @@ -36,14 +41,13 @@ import static cn.escheduler.api.enums.Status.*; /** * user controller */ +@Api(tags = "USERS_TAG" , position = 14) @RestController @RequestMapping("/users") public class UsersController extends BaseController{ - private static final Logger logger = LoggerFactory.getLogger(UsersController.class); - @Autowired private UsersService usersService; @@ -58,9 +62,18 @@ public class UsersController extends BaseController{ * @param phone * @return */ + @ApiOperation(value = "createUser", notes= "CREATE_USER_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "userName", value = "USER_NAME",type = "String"), + @ApiImplicitParam(name = "userPassword", value = "USER_PASSWORD", type ="String"), + @ApiImplicitParam(name = "tenantId", value = "TENANT_ID", type ="Int"), + @ApiImplicitParam(name = "queue", value = "QUEUE", type ="Int"), + @ApiImplicitParam(name = "email", value = "EMAIL", type ="Int"), + @ApiImplicitParam(name = "phone", value = "PHONE", type ="Int") + }) @PostMapping(value = "/create") @ResponseStatus(HttpStatus.CREATED) - public Result createUser(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result createUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userName") String userName, @RequestParam(value = "userPassword") String userPassword, @RequestParam(value = "tenantId") int tenantId, @@ -88,9 +101,15 @@ public class UsersController extends BaseController{ * @param pageSize * @return */ + @ApiOperation(value = "queryUserList", notes= "QUERY_USER_LIST_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNo", value = "PAGE_NO",type = "Int"), + @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", type ="String"), + @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", type ="String") + }) @GetMapping(value="/list-paging") @ResponseStatus(HttpStatus.OK) - public Result queryUserList(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryUserList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("pageNo") Integer pageNo, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageSize") Integer pageSize){ @@ -111,7 +130,7 @@ public class UsersController extends BaseController{ /** - * updateProcessInstance user + * update user * * @param loginUser * @param id @@ -122,9 +141,19 @@ public class UsersController extends BaseController{ * @param phone * @return */ + @ApiOperation(value = "updateUser", notes= "UPDATE_USER_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "USER_ID",type = "Int"), + @ApiImplicitParam(name = "userName", value = "USER_NAME",type = "String"), + @ApiImplicitParam(name = "userPassword", value = "USER_PASSWORD", type ="String"), + @ApiImplicitParam(name = "tenantId", value = "TENANT_ID", type ="Int"), + @ApiImplicitParam(name = "queue", value = "QUEUE", type ="Int"), + @ApiImplicitParam(name = "email", value = "EMAIL", type ="Int"), + @ApiImplicitParam(name = "phone", value = "PHONE", type ="Int") + }) @PostMapping(value = "/update") @ResponseStatus(HttpStatus.OK) - public Result updateUser(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result updateUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id") int id, @RequestParam(value = "userName") String userName, @RequestParam(value = "userPassword") String userPassword, @@ -149,9 +178,13 @@ public class UsersController extends BaseController{ * @param id * @return */ + @ApiOperation(value = "delUserById", notes= "DELETE_USER_BY_ID_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "USER_ID",type = "Int") + }) @PostMapping(value = "/delete") @ResponseStatus(HttpStatus.OK) - public Result delUserById(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result delUserById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id") int id) { logger.info("login user {}, delete user, userId: {},", loginUser.getUserName(), id); try { @@ -170,9 +203,14 @@ public class UsersController extends BaseController{ * @param userId * @return */ + @ApiOperation(value = "grantProject", notes= "GRANT_PROJECT_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "userId", value = "USER_ID",type = "Int"), + @ApiImplicitParam(name = "projectIds", value = "PROJECT_IDS",type = "String") + }) @PostMapping(value = "/grant-project") @ResponseStatus(HttpStatus.OK) - public Result grantProject(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result grantProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "projectIds") String projectIds) { logger.info("login user {}, grant project, userId: {},projectIds : {}", loginUser.getUserName(), userId,projectIds); @@ -192,9 +230,14 @@ public class UsersController extends BaseController{ * @param userId * @return */ + @ApiOperation(value = "grantResource", notes= "GRANT_RESOURCE_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "userId", value = "USER_ID",type = "Int"), + @ApiImplicitParam(name = "resourceIds", value = "RESOURCE_IDS",type = "String") + }) @PostMapping(value = "/grant-file") @ResponseStatus(HttpStatus.OK) - public Result grantResource(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result grantResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "resourceIds") String resourceIds) { logger.info("login user {}, grant project, userId: {},resourceIds : {}", loginUser.getUserName(), userId,resourceIds); @@ -215,9 +258,14 @@ public class UsersController extends BaseController{ * @param userId * @return */ + @ApiOperation(value = "grantUDFFunc", notes= "GRANT_UDF_FUNC_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "userId", value = "USER_ID",type = "Int"), + @ApiImplicitParam(name = "udfIds", value = "UDF_IDS",type = "String") + }) @PostMapping(value = "/grant-udf-func") @ResponseStatus(HttpStatus.OK) - public Result grantUDFFunc(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result grantUDFFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "udfIds") String udfIds) { logger.info("login user {}, grant project, userId: {},resourceIds : {}", loginUser.getUserName(), userId,udfIds); @@ -239,9 +287,14 @@ public class UsersController extends BaseController{ * @param userId * @return */ + @ApiOperation(value = "grantDataSource", notes= "GRANT_DATASOURCE_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "userId", value = "USER_ID",type = "Int"), + @ApiImplicitParam(name = "datasourceIds", value = "DATASOURCE_IDS",type = "String") + }) @PostMapping(value = "/grant-datasource") @ResponseStatus(HttpStatus.OK) - public Result grantDataSource(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result grantDataSource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "datasourceIds") String datasourceIds) { logger.info("login user {}, grant project, userId: {},projectIds : {}", loginUser.getUserName(),userId,datasourceIds); @@ -261,9 +314,10 @@ public class UsersController extends BaseController{ * @param loginUser * @return */ + @ApiOperation(value = "getUserInfo", notes= "GET_USER_INFO_NOTES") @GetMapping(value="/get-user-info") @ResponseStatus(HttpStatus.OK) - public Result getUserInfo(@RequestAttribute(value = Constants.SESSION_USER) User loginUser){ + public Result getUserInfo(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser){ logger.info("login user {},get user info : {}", loginUser.getUserName()); try{ Map result = usersService.getUserInfo(loginUser); @@ -280,9 +334,10 @@ public class UsersController extends BaseController{ * @param loginUser * @return */ + @ApiOperation(value = "listUser", notes= "LIST_USER_NOTES") @GetMapping(value="/list") @ResponseStatus(HttpStatus.OK) - public Result listUser(@RequestAttribute(value = Constants.SESSION_USER) User loginUser){ + public Result listUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser){ logger.info("login user {}, user list"); try{ Map result = usersService.queryUserList(loginUser); @@ -300,9 +355,13 @@ public class UsersController extends BaseController{ * @param userName * @return */ + @ApiOperation(value = "verifyUserName", notes= "VERIFY_USER_NAME_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "userName", value = "USER_NAME",type = "String") + }) @GetMapping(value = "/verify-user-name") @ResponseStatus(HttpStatus.OK) - public Result verifyUserName(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result verifyUserName(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value ="userName") String userName ) { try{ @@ -324,9 +383,13 @@ public class UsersController extends BaseController{ * @param alertgroupId * @return */ + @ApiOperation(value = "unauthorizedUser", notes= "UNAUTHORIZED_USER_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "alertgroupId", value = "ALERT_GROUP_ID",type = "String") + }) @GetMapping(value = "/unauth-user") @ResponseStatus(HttpStatus.OK) - public Result unauthorizedUser(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result unauthorizedUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("alertgroupId") Integer alertgroupId) { try{ logger.info("unauthorized user, login user:{}, alert group id:{}", @@ -347,9 +410,13 @@ public class UsersController extends BaseController{ * @param alertgroupId * @return */ + @ApiOperation(value = "authorizedUser", notes= "AUTHORIZED_USER_NOTES") + @ApiImplicitParams({ + @ApiImplicitParam(name = "alertgroupId", value = "ALERT_GROUP_ID",type = "String") + }) @GetMapping(value = "/authed-user") @ResponseStatus(HttpStatus.OK) - public Result authorizedUser(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result authorizedUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("alertgroupId") Integer alertgroupId) { try{ logger.info("authorized user , login user:{}, alert group id:{}", diff --git a/escheduler-api/src/main/resources/messages.properties b/escheduler-api/src/main/resources/messages.properties index 89ddfd5201..e3a80c0e32 100644 --- a/escheduler-api/src/main/resources/messages.properties +++ b/escheduler-api/src/main/resources/messages.properties @@ -1,5 +1,98 @@ -welcome=hello, welcome ! -test=test -userName=user name -userPassword=user password -loginNotes=login notes \ No newline at end of file +QUERY_SCHEDULE_LIST_NOTES=query schedule list +SCHEDULE=schedule +WARNING_TYPE=warning type(sending strategy) +WARNING_GROUP_ID=warning group id +FAILURE_STRATEGY=failure strategy +RECEIVERS=receivers +RECEIVERS_CC=receivers cc +WORKER_GROUP_ID=worker server group id +PROCESS_INSTANCE_PRIORITY=process instance priority +UPDATE_SCHEDULE_NOTES=update schedule +SCHEDULE_ID=schedule id +ONLINE_SCHEDULE_NOTES=online schedule +OFFLINE_SCHEDULE_NOTES=offline schedule +QUERY_SCHEDULE_NOTES=query schedule +QUERY_SCHEDULE_LIST_PAGING_NOTES=query schedule list paging +LOGIN_TAG=User login related operations +USER_NAME=user name +PROJECT_NAME=project name +CREATE_PROCESS_DEFINITION_NOTES=create process definition +PROCESS_DEFINITION_NAME=process definition name +PROCESS_DEFINITION_JSON=process definition detail info (json format) +PROCESS_DEFINITION_LOCATIONS=process definition node locations info (json format) +PROCESS_INSTANCE_LOCATIONS=process instance node locations info (json format) +PROCESS_DEFINITION_CONNECTS=process definition node connects info (json format) +PROCESS_INSTANCE_CONNECTS=process instance node connects info (json format) +PROCESS_DEFINITION_DESC=process definition desc +PROCESS_DEFINITION_TAG=process definition related opertation +SIGNOUT_NOTES=logout +USER_PASSWORD=user password +UPDATE_PROCESS_INSTANCE_NOTES=update process instance +QUERY_PROCESS_INSTANCE_LIST_NOTES=query process instance list +VERIFY_PROCCESS_DEFINITION_NAME_NOTES=verify proccess definition name +LOGIN_NOTES=user login +UPDATE_PROCCESS_DEFINITION_NOTES=update proccess definition +PROCESS_DEFINITION_ID=process definition id +RELEASE_PROCCESS_DEFINITION_NOTES=release proccess definition +QUERY_PROCCESS_DEFINITION_BY_ID_NOTES=query proccess definition by id +QUERY_PROCCESS_DEFINITION_LIST_NOTES=query proccess definition list +QUERY_PROCCESS_DEFINITION_LIST_PAGING_NOTES=query proccess definition list paging +PAGE_NO=page no +PROCESS_INSTANCE_ID=process instance id +PROCESS_INSTANCE_JSON=process instance info(json format) +SCHEDULE_TIME=schedule time +SYNC_DEFINE=update the information of the process instance to the process definition\ + +RECOVERY_PROCESS_INSTANCE_FLAG=whether to recovery process instance +SEARCH_VAL=search val +USER_ID=user id +PAGE_SIZE=page size +LIMIT=limit +VIEW_TREE_NOTES=view tree +GET_NODE_LIST_BY_DEFINITION_ID_NOTES=get task node list by process definition id +PROCESS_DEFINITION_ID_LIST=PROCESS DEFINITION ID LIST +QUERY_PROCESS_INSTANCE_BY_ID_NOTES=query process instance by process instance id +DELETE_PROCESS_INSTANCE_BY_ID_NOTES=delete process instance by process instance id +TASK_ID=TASK INSTANCE ID +SKIP_LINE_NUM=skip line num +QUERY_TASK_INSTANCE_LOG_NOTES=QUERY TASK INSTANCE LOG +DOWNLOAD_TASK_INSTANCE_LOG_NOTES=download task instance log +USERS_TAG=users related operation +SCHEDULER_TAG=scheduler related operation +CREATE_SCHEDULE_NOTES=CREATE SCHEDULE +CREATE_USER_NOTES=create user +TENANT_ID=tenant id +QUEUE=queue +EMAIL=email +PHONE=phone +QUERY_USER_LIST_NOTES=query user list +UPDATE_USER_NOTES=update user +DELETE_USER_BY_ID_NOTES=delete user by id +GRANT_PROJECT_NOTES=GRANT PROJECT +PROJECT_IDS=project ids(string format, multiple projects separated by ",") +GRANT_RESOURCE_NOTES=grant resource file +RESOURCE_IDS=resource ids(string format, multiple resources separated by ",") +GET_USER_INFO_NOTES=get user info +LIST_USER_NOTES=list user +VERIFY_USER_NAME_NOTES=verify user name +UNAUTHORIZED_USER_NOTES=cancel authorization +ALERT_GROUP_ID=alert group id +AUTHORIZED_USER_NOTES=authorized user +GRANT_UDF_FUNC_NOTES=grant udf function +UDF_IDS=udf ids(string format, multiple udf functions separated by ",") +GRANT_DATASOURCE_NOTES=GRANT DATASOURCE +DATASOURCE_IDS=datasource ids(string format, multiple datasources separated by ",") +QUERY_SUBPROCESS_INSTANCE_BY_TASK_ID_NOTES=query subprocess instance by task instance id +QUERY_PARENT_PROCESS_INSTANCE_BY_SUB_PROCESS_INSTANCE_ID_NOTES=query parent process instance info by sub process instance id +QUERY_PROCESS_INSTANCE_GLOBAL_VARIABLES_AND_LOCAL_VARIABLES_NOTES=query process instance global variables and local variables +VIEW_GANTT_NOTES=view gantt +SUB_PROCESS_INSTANCE_ID=sub process instance id +TASK_NAME=task instance name +TASK_INSTANCE_TAG=task instance related operation +LOGGER_TAG=log related operation +PROCESS_INSTANCE_TAG=process instance related operation +EXECUTION_STATUS=runing status for workflow and task nodes +HOST=ip address of running task +START_DATE=start date +END_DATE=end date +QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_NOTES=query task list by process instance id \ No newline at end of file diff --git a/escheduler-api/src/main/resources/messages_en_US.properties b/escheduler-api/src/main/resources/messages_en_US.properties index 89ddfd5201..a378223636 100644 --- a/escheduler-api/src/main/resources/messages_en_US.properties +++ b/escheduler-api/src/main/resources/messages_en_US.properties @@ -1,5 +1,98 @@ -welcome=hello, welcome ! -test=test -userName=user name -userPassword=user password -loginNotes=login notes \ No newline at end of file +QUERY_SCHEDULE_LIST_NOTES=query schedule list +SCHEDULE=schedule +WARNING_TYPE=warning type(sending strategy) +WARNING_GROUP_ID=warning group id +FAILURE_STRATEGY=failure strategy +RECEIVERS=receivers +RECEIVERS_CC=receivers cc +WORKER_GROUP_ID=worker server group id +PROCESS_INSTANCE_PRIORITY=process instance priority +UPDATE_SCHEDULE_NOTES=update schedule +SCHEDULE_ID=schedule id +ONLINE_SCHEDULE_NOTES=online schedule +OFFLINE_SCHEDULE_NOTES=offline schedule +QUERY_SCHEDULE_NOTES=query schedule +QUERY_SCHEDULE_LIST_PAGING_NOTES=query schedule list paging +LOGIN_TAG=User login related operations +USER_NAME=user name +PROJECT_NAME=project name +CREATE_PROCESS_DEFINITION_NOTES=create process definition +PROCESS_DEFINITION_NAME=process definition name +PROCESS_DEFINITION_JSON=process definition detail info (json format) +PROCESS_DEFINITION_LOCATIONS=process definition node locations info (json format) +PROCESS_INSTANCE_LOCATIONS=process instance node locations info (json format) +PROCESS_DEFINITION_CONNECTS=process definition node connects info (json format) +PROCESS_INSTANCE_CONNECTS=process instance node connects info (json format) +PROCESS_DEFINITION_DESC=process definition desc +PROCESS_DEFINITION_TAG=process definition related opertation +SIGNOUT_NOTES=logout +USER_PASSWORD=user password +UPDATE_PROCESS_INSTANCE_NOTES=update process instance +QUERY_PROCESS_INSTANCE_LIST_NOTES=query process instance list +VERIFY_PROCCESS_DEFINITION_NAME_NOTES=verify proccess definition name +LOGIN_NOTES=user login +UPDATE_PROCCESS_DEFINITION_NOTES=update proccess definition +PROCESS_DEFINITION_ID=process definition id +RELEASE_PROCCESS_DEFINITION_NOTES=release proccess definition +QUERY_PROCCESS_DEFINITION_BY_ID_NOTES=query proccess definition by id +QUERY_PROCCESS_DEFINITION_LIST_NOTES=query proccess definition list +QUERY_PROCCESS_DEFINITION_LIST_PAGING_NOTES=query proccess definition list paging +PAGE_NO=page no +PROCESS_INSTANCE_ID=process instance id +PROCESS_INSTANCE_JSON=process instance info(json format) +SCHEDULE_TIME=schedule time +SYNC_DEFINE=update the information of the process instance to the process definition\ + +RECOVERY_PROCESS_INSTANCE_FLAG=whether to recovery process instance +SEARCH_VAL=search val +USER_ID=user id +PAGE_SIZE=page size +LIMIT=limit +VIEW_TREE_NOTES=view tree +GET_NODE_LIST_BY_DEFINITION_ID_NOTES=get task node list by process definition id +PROCESS_DEFINITION_ID_LIST=PROCESS DEFINITION ID LIST +QUERY_PROCESS_INSTANCE_BY_ID_NOTES=query process instance by process instance id +DELETE_PROCESS_INSTANCE_BY_ID_NOTES=delete process instance by process instance id +TASK_ID=TASK INSTANCE ID +SKIP_LINE_NUM=skip line num +QUERY_TASK_INSTANCE_LOG_NOTES=QUERY TASK INSTANCE LOG +DOWNLOAD_TASK_INSTANCE_LOG_NOTES=download task instance log +USERS_TAG=users related operation +SCHEDULER_TAG=scheduler related operation +CREATE_SCHEDULE_NOTES=CREATE SCHEDULE +CREATE_USER_NOTES=create user +TENANT_ID=tenant id +QUEUE=queue +EMAIL=email +PHONE=phone +QUERY_USER_LIST_NOTES=query user list +UPDATE_USER_NOTES=update user +DELETE_USER_BY_ID_NOTES=delete user by id +GRANT_PROJECT_NOTES=GRANT PROJECT +PROJECT_IDS=project ids(string format, multiple projects separated by ",") +GRANT_RESOURCE_NOTES=grant resource file +RESOURCE_IDS=resource ids(string format, multiple resources separated by ",") +GET_USER_INFO_NOTES=get user info +LIST_USER_NOTES=list user +VERIFY_USER_NAME_NOTES=verify user name +UNAUTHORIZED_USER_NOTES=cancel authorization +ALERT_GROUP_ID=alert group id +AUTHORIZED_USER_NOTES=authorized user +GRANT_UDF_FUNC_NOTES=grant udf function +UDF_IDS=udf ids(string format, multiple udf functions separated by ",") +GRANT_DATASOURCE_NOTES=GRANT DATASOURCE +DATASOURCE_IDS=datasource ids(string format, multiple datasources separated by ",") +QUERY_SUBPROCESS_INSTANCE_BY_TASK_ID_NOTES=query subprocess instance by task instance id +QUERY_PARENT_PROCESS_INSTANCE_BY_SUB_PROCESS_INSTANCE_ID_NOTES=query parent process instance info by sub process instance id +QUERY_PROCESS_INSTANCE_GLOBAL_VARIABLES_AND_LOCAL_VARIABLES_NOTES=query process instance global variables and local variables +VIEW_GANTT_NOTES=view gantt +SUB_PROCESS_INSTANCE_ID=sub process instance id +TASK_NAME=task instance name +TASK_INSTANCE_TAG=task instance related operation +LOGGER_TAG=log related operation +PROCESS_INSTANCE_TAG=process instance related operation +EXECUTION_STATUS=runing status for workflow and task nodes +HOST=ip address of running task +START_DATE=start date +END_DATE=end date +QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_NOTES=query task list by process instance id diff --git a/escheduler-api/src/main/resources/messages_zh_CN.properties b/escheduler-api/src/main/resources/messages_zh_CN.properties index 4c21e73399..f55574a7f4 100644 --- a/escheduler-api/src/main/resources/messages_zh_CN.properties +++ b/escheduler-api/src/main/resources/messages_zh_CN.properties @@ -1,5 +1,97 @@ -welcome=您好,欢迎你! -test=测试 -userName=用户名 -userPassword=用户密码 -loginNotes=登录xxx \ No newline at end of file +QUERY_SCHEDULE_LIST_NOTES=查询定时列表 +SCHEDULE=定时 +WARNING_TYPE=发送策略 +WARNING_GROUP_ID=发送组ID +FAILURE_STRATEGY=失败策略 +RECEIVERS=收件人 +RECEIVERS_CC=收件人(抄送) +WORKER_GROUP_ID=Worker Server分组ID +PROCESS_INSTANCE_PRIORITY=流程实例优先级 +UPDATE_SCHEDULE_NOTES=更新定时 +SCHEDULE_ID=定时ID +ONLINE_SCHEDULE_NOTES=定时上线 +OFFLINE_SCHEDULE_NOTES=定时下线 +QUERY_SCHEDULE_NOTES=查询定时 +QUERY_SCHEDULE_LIST_PAGING_NOTES=分页查询定时 +LOGIN_TAG=用户登录相关操作 +USER_NAME=用户名 +PROJECT_NAME=项目名称 +CREATE_PROCESS_DEFINITION_NOTES=创建流程定义 +PROCESS_DEFINITION_NAME=流程定义名称 +PROCESS_DEFINITION_JSON=流程定义详细信息(json格式) +PROCESS_DEFINITION_LOCATIONS=流程定义节点坐标位置信息(json格式) +PROCESS_INSTANCE_LOCATIONS=流程实例节点坐标位置信息(json格式) +PROCESS_DEFINITION_CONNECTS=流程定义节点图标连接信息(json格式) +PROCESS_INSTANCE_CONNECTS=流程实例节点图标连接信息(json格式) +PROCESS_DEFINITION_DESC=流程定义描述信息 +PROCESS_DEFINITION_TAG=流程定义相关操作 +SIGNOUT_NOTES=退出登录 +USER_PASSWORD=用户密码 +UPDATE_PROCESS_INSTANCE_NOTES=更新流程实例 +QUERY_PROCESS_INSTANCE_LIST_NOTES=查询流程实例列表 +VERIFY_PROCCESS_DEFINITION_NAME_NOTES=验证流程定义名字 +LOGIN_NOTES=用户登录 +UPDATE_PROCCESS_DEFINITION_NOTES=更新流程定义 +PROCESS_DEFINITION_ID=流程定义ID +RELEASE_PROCCESS_DEFINITION_NOTES=发布流程定义 +QUERY_PROCCESS_DEFINITION_BY_ID_NOTES=查询流程定义通过流程定义ID +QUERY_PROCCESS_DEFINITION_LIST_NOTES=查询流程定义列表 +QUERY_PROCCESS_DEFINITION_LIST_PAGING_NOTES=分页查询流程定义列表 +PAGE_NO=页码号 +PROCESS_INSTANCE_ID=流程实例ID +PROCESS_INSTANCE_JSON=流程实例信息(json格式) +SCHEDULE_TIME=定时时间 +SYNC_DEFINE=更新流程实例的信息是否同步到流程定义 +RECOVERY_PROCESS_INSTANCE_FLAG=是否恢复流程实例 +SEARCH_VAL=搜索值 +USER_ID=用户ID +PAGE_SIZE=页大小 +LIMIT=显示多少条 +VIEW_TREE_NOTES=树状图 +GET_NODE_LIST_BY_DEFINITION_ID_NOTES=获得任务节点列表通过流程定义ID +PROCESS_DEFINITION_ID_LIST=流程定义id列表 +QUERY_PROCESS_INSTANCE_BY_ID_NOTES=查询流程实例通过流程实例ID +DELETE_PROCESS_INSTANCE_BY_ID_NOTES=删除流程实例通过流程实例ID +TASK_ID=任务实例ID +SKIP_LINE_NUM=忽略行数 +QUERY_TASK_INSTANCE_LOG_NOTES=查询任务实例日志 +DOWNLOAD_TASK_INSTANCE_LOG_NOTES=下载任务实例日志 +USERS_TAG=用户相关操作 +SCHEDULER_TAG=定时相关操作 +CREATE_SCHEDULE_NOTES=创建定时 +CREATE_USER_NOTES=创建用户 +TENANT_ID=租户ID +QUEUE=使用的队列 +EMAIL=邮箱 +PHONE=手机号 +QUERY_USER_LIST_NOTES=查询用户列表 +UPDATE_USER_NOTES=更新用户 +DELETE_USER_BY_ID_NOTES=删除用户通过ID +GRANT_PROJECT_NOTES=授权项目 +PROJECT_IDS=项目IDS(字符串格式,多个项目以","分割) +GRANT_RESOURCE_NOTES=授权资源文件 +RESOURCE_IDS=资源ID列表(字符串格式,多个资源ID以","分割) +GET_USER_INFO_NOTES=获取用户信息 +LIST_USER_NOTES=用户列表 +VERIFY_USER_NAME_NOTES=验证用户名 +UNAUTHORIZED_USER_NOTES=取消授权 +ALERT_GROUP_ID=报警组ID +AUTHORIZED_USER_NOTES=授权用户 +GRANT_UDF_FUNC_NOTES=授权udf函数 +UDF_IDS=udf函数id列表(字符串格式,多个udf函数ID以","分割) +GRANT_DATASOURCE_NOTES=授权数据源 +DATASOURCE_IDS=数据源ID列表(字符串格式,多个数据源ID以","分割) +QUERY_SUBPROCESS_INSTANCE_BY_TASK_ID_NOTES=查询子流程实例通过任务实例ID +QUERY_PARENT_PROCESS_INSTANCE_BY_SUB_PROCESS_INSTANCE_ID_NOTES=查询父流程实例信息通过子流程实例ID +QUERY_PROCESS_INSTANCE_GLOBAL_VARIABLES_AND_LOCAL_VARIABLES_NOTES=查询流程实例全局变量和局部变量 +VIEW_GANTT_NOTES=浏览Gantt图 +SUB_PROCESS_INSTANCE_ID=子流程是咧ID +TASK_NAME=任务实例名 +TASK_INSTANCE_TAG=任务实例相关操作 +LOGGER_TAG=日志相关操作 +PROCESS_INSTANCE_TAG=流程实例相关操作 +EXECUTION_STATUS=工作流和任务节点的运行状态 +HOST=运行任务的主机IP地址 +START_DATE=开始时间 +END_DATE=结束时间 +QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_NOTES=通过流程实例ID查询任务列表 diff --git a/escheduler-common/src/main/java/cn/escheduler/common/enums/ExecutionStatus.java b/escheduler-common/src/main/java/cn/escheduler/common/enums/ExecutionStatus.java index e2a727636d..4efcc09d6c 100644 --- a/escheduler-common/src/main/java/cn/escheduler/common/enums/ExecutionStatus.java +++ b/escheduler-common/src/main/java/cn/escheduler/common/enums/ExecutionStatus.java @@ -18,7 +18,7 @@ package cn.escheduler.common.enums; /** - * runing status for work flow and task nodes + * runing status for workflow and task nodes * */ public enum ExecutionStatus { diff --git a/escheduler-dao/pom.xml b/escheduler-dao/pom.xml index ca489b2107..a06c7582f7 100644 --- a/escheduler-dao/pom.xml +++ b/escheduler-dao/pom.xml @@ -131,8 +131,14 @@ spring-test test + + io.swagger + swagger-annotations + 1.5.20 + compile + - + diff --git a/escheduler-dao/src/main/java/cn/escheduler/dao/model/User.java b/escheduler-dao/src/main/java/cn/escheduler/dao/model/User.java index 6f831fbd96..bad6b6313e 100644 --- a/escheduler-dao/src/main/java/cn/escheduler/dao/model/User.java +++ b/escheduler-dao/src/main/java/cn/escheduler/dao/model/User.java @@ -17,12 +17,15 @@ package cn.escheduler.dao.model; import cn.escheduler.common.enums.UserType; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.Date; /** * user */ +@ApiModel(description = "UserModelDesc") public class User { /** @@ -33,21 +36,25 @@ public class User { /** * user name */ + @ApiModelProperty(name = "userName", notes = "USER_NAME",dataType = "String",required = true) private String userName; /** * user password */ + @ApiModelProperty(name = "userPassword", notes = "USER_PASSWORD",dataType = "String",required = true) private String userPassword; /** * mail */ + @ApiModelProperty(name = "email", notes = "email",dataType = "String",required = true) private String email; /** * phone */ + @ApiModelProperty(name = "phone", notes = "phone",dataType = "String",required = true) private String phone; /** diff --git a/escheduler-ui/dist/combo/1.0.0/3rd.css b/escheduler-ui/dist/combo/1.0.0/3rd.css deleted file mode 100644 index 658a682e97..0000000000 --- a/escheduler-ui/dist/combo/1.0.0/3rd.css +++ /dev/null @@ -1,5 +0,0 @@ -.hljs{display:block;overflow-x:auto;padding:0.5em;background:white;color:black}.hljs-comment,.hljs-quote,.hljs-variable{color:#008000}.hljs-keyword,.hljs-selector-tag,.hljs-built_in,.hljs-name,.hljs-tag{color:#00f}.hljs-string,.hljs-title,.hljs-section,.hljs-attribute,.hljs-literal,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-addition{color:#a31515}.hljs-deletion,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-meta{color:#2b91af}.hljs-doctag{color:#808080}.hljs-attr{color:#f00}.hljs-symbol,.hljs-bullet,.hljs-link{color:#00b0e8}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:bold} -.jtk-node{position:absolute}.jtk-group{position:absolute;overflow:visible}[jtk-group-content]{position:relative}.katavorio-clone-drag{pointer-events:none}.jtk-surface{overflow:hidden!important;position:relative;cursor:move;cursor:-moz-grab;cursor:-webkit-grab;touch-action:none}.jtk-surface-panning{cursor:-moz-grabbing;cursor:-webkit-grabbing;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.jtk-surface-canvas{overflow:visible!important}.jtk-surface-droppable-node{touch-action:none}.jtk-surface-nopan{overflow:scroll!important;cursor:default}.jtk-surface-tile{border:none;outline:0;margin:0;-webkit-transition:opacity .3s ease .15s;-moz-transition:opacity .3s ease .15s;-o-transition:opacity .3s ease .15s;-ms-transition:opacity .3s ease .15s;transition:opacity .3s ease .15s}.jtk-lasso{border:2px solid #3177b8;background-color:#f5f5f5;opacity:.5;display:none;z-index:20000;position:absolute}.jtk-lasso-select-defeat *{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.jtk-lasso-mask{position:fixed;z-index:20000;display:none;opacity:.5;background-color:#07234e;top:0;bottom:0;left:0;right:0}.jtk-surface-selected-element{border:2px dashed #f76258!important}.jtk-surface-pan{background-color:Azure;opacity:.4;text-align:center;cursor:pointer;z-index:2;-webkit-transition:background-color .15s ease-in;-moz-transition:background-color .15s ease-in;-o-transition:background-color .15s ease-in;transition:background-color .15s ease-in}.jtk-surface-pan-bottom,.jtk-surface-pan-top{width:100%;height:20px}.jtk-surface-pan-bottom:hover,.jtk-surface-pan-left:hover,.jtk-surface-pan-right:hover,.jtk-surface-pan-top:hover{opacity:.6;background-color:#3177b8;color:#fff;font-weight:700}.jtk-surface-pan-left,.jtk-surface-pan-right{width:20px;height:100%;line-height:40}.jtk-surface-pan-active,.jtk-surface-pan-active:hover{background-color:#f76258}.jtk-miniview{overflow:hidden!important;width:125px;height:125px;position:relative;background-color:#b2c9cd;border:1px solid #e2e6cd;border-radius:4px;opacity:.8}.jtk-miniview-panner{border:5px dotted #f5f5f5;opacity:.4;background-color:#4f6f7e;cursor:move;cursor:-moz-grab;cursor:-webkit-grab}.jtk-miniview-panning{cursor:-moz-grabbing;cursor:-webkit-grabbing}.jtk-miniview-element{background-color:#607a86;position:absolute}.jtk-miniview-group-element{background:0 0;border:2px solid #607a86}.jtk-miniview-collapse{color:#f5f5f5;position:absolute;font-size:18px;top:-1px;right:3px;cursor:pointer;font-weight:700}.jtk-miniview-collapse:before{content:"\2012"}.jtk-miniview-collapsed{background-color:#449ea6;border-radius:4px;height:22px;margin-right:0;padding:4px;width:21px}.jtk-miniview-collapsed .jtk-miniview-element,.jtk-miniview-collapsed .jtk-miniview-panner{visibility:hidden}.jtk-miniview-collapsed .jtk-miniview-collapse:before{content:"+"}.jtk-miniview-collapse:hover{color:#e4f013}.jtk-dialog-underlay{left:0;right:0;top:0;bottom:0;position:fixed;z-index:100000;opacity:.8;background-color:#ccc;display:none}.jtk-dialog-overlay{position:fixed;z-index:100001;display:none;background-color:#fff;font-family:"Open Sans",sans-serif;padding:7px;box-shadow:0 0 5px gray;overflow:hidden}.jtk-dialog-overlay-x{max-height:0;transition:max-height .5s ease-in;-moz-transition:max-height .5s ease-in;-ms-transition:max-height .5s ease-in;-o-transition:max-height .5s ease-in;-webkit-transition:max-height .5s ease-in}.jtk-dialog-overlay-y{max-width:0;transition:max-width .5s ease-in;-moz-transition:max-width .5s ease-in;-ms-transition:max-width .5s ease-in;-o-transition:max-width .5s ease-in;-webkit-transition:max-width .5s ease-in}.jtk-dialog-overlay-top{top:20px}.jtk-dialog-overlay-bottom{bottom:20px}.jtk-dialog-overlay-left{left:20px}.jtk-dialog-overlay-right{right:20px}.jtk-dialog-overlay-x.jtk-dialog-overlay-visible{max-height:1000px}.jtk-dialog-overlay-y.jtk-dialog-overlay-visible{max-width:1000px}.jtk-dialog-buttons{text-align:right;margin-top:5px}.jtk-dialog-button{border:none;cursor:pointer;margin-right:5px;min-width:56px;background-color:#fff;outline:1px solid #ccc}.jtk-dialog-button:hover{color:#fff;background-color:#234b5e}.jtk-dialog-title{text-align:left;font-size:14px;margin-bottom:9px}.jtk-dialog-content{font-size:12px;text-align:left;min-width:250px;margin:0 14px}.jtk-dialog-content ul{width:100%;padding-left:0}.jtk-dialog-content label{cursor:pointer;font-weight:inherit}.jtk-dialog-overlay input,.jtk-dialog-overlay textarea{background-color:#fff;border:1px solid #ccc;color:#333;font-size:14px;font-style:normal;outline:0;padding:6px 4px;margin-right:6px}.jtk-dialog-overlay input:focus,.jtk-dialog-overlay textarea:focus{background-color:#cbeae1;border:1px solid #83b8a8;color:#333;font-size:14px;font-style:normal;outline:0}.jtk-draw-skeleton{position:absolute;left:0;right:0;top:0;bottom:0;outline:2px solid #84acb3;opacity:.8}.jtk-draw-handle{position:absolute;width:7px;height:7px;background-color:#84acb3}.jtk-draw-handle-tl{left:0;top:0;cursor:nw-resize}.jtk-draw-handle-tr{right:0;top:0;cursor:ne-resize}.jtk-draw-handle-bl{left:0;bottom:0;cursor:sw-resize}.jtk-draw-handle-br{bottom:0;right:0;cursor:se-resize}.jtk-draw-drag{display:none;position:absolute;left:50%;top:50%;margin-left:-10px;margin-top:-10px;width:20px;height:20px;background-color:#84acb3;cursor:move}.jtk-drag-select-defeat *{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} -.CodeMirror{font-family:monospace;height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20,255,20,.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:-20px;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-type,.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0} -.cm-s-mdn-like.CodeMirror{color:#999;background-color:#fff}.cm-s-mdn-like .CodeMirror-line::selection,.cm-s-mdn-like .CodeMirror-line>span::selection,.cm-s-mdn-like .CodeMirror-line>span>span::selection,.cm-s-mdn-like div.CodeMirror-selected{background:#cfc}.cm-s-mdn-like .CodeMirror-line::-moz-selection,.cm-s-mdn-like .CodeMirror-line>span::-moz-selection,.cm-s-mdn-like .CodeMirror-line>span>span::-moz-selection{background:#cfc}.cm-s-mdn-like .CodeMirror-gutters{background:#f8f8f8;border-left:6px solid rgba(0,83,159,.65);color:#333}.cm-s-mdn-like .CodeMirror-linenumber{color:#aaa;padding-left:8px}.cm-s-mdn-like .CodeMirror-cursor{border-left:2px solid #222}.cm-s-mdn-like .cm-keyword{color:#6262FF}.cm-s-mdn-like .cm-atom{color:#F90}.cm-s-mdn-like .cm-number{color:#ca7841}.cm-s-mdn-like .cm-def{color:#8DA6CE}.cm-s-mdn-like span.cm-tag,.cm-s-mdn-like span.cm-variable-2{color:#690}.cm-s-mdn-like .cm-variable,.cm-s-mdn-like span.cm-def,.cm-s-mdn-like span.cm-variable-3{color:#07a}.cm-s-mdn-like .cm-property{color:#905}.cm-s-mdn-like .cm-qualifier{color:#690}.cm-s-mdn-like .cm-operator{color:#cda869}.cm-s-mdn-like .cm-comment{color:#777;font-weight:400}.cm-s-mdn-like .cm-string{color:#07a;font-style:italic}.cm-s-mdn-like .cm-string-2{color:#bd6b18}.cm-s-mdn-like .cm-meta{color:#000}.cm-s-mdn-like .cm-builtin{color:#9B7536}.cm-s-mdn-like .cm-tag{color:#997643}.cm-s-mdn-like .cm-attribute{color:#d6bb6d}.cm-s-mdn-like .cm-header{color:#FF6400}.cm-s-mdn-like .cm-hr{color:#AEAEAE}.cm-s-mdn-like .cm-link{color:#ad9361;font-style:italic;text-decoration:none}.cm-s-mdn-like .cm-error{border-bottom:1px solid red}div.cm-s-mdn-like .CodeMirror-activeline-background{background:#efefff}div.cm-s-mdn-like span.CodeMirror-matchingbracket{outline:grey solid 1px;color:inherit}.cm-s-mdn-like.CodeMirror{background-image:url(/~/codemirror/5.20.0/theme/mdn-like.min.css)} -.CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px rgba(0,0,0,.2);border-radius:3px;border:1px solid silver;background:#fff;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;white-space:pre;color:#000;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:#fff} diff --git a/escheduler-ui/dist/combo/1.0.0/3rd.js b/escheduler-ui/dist/combo/1.0.0/3rd.js deleted file mode 100644 index ad25b0c4cc..0000000000 --- a/escheduler-ui/dist/combo/1.0.0/3rd.js +++ /dev/null @@ -1,10783 +0,0 @@ -/*! - * Vue.js v2.5.2 - * (c) 2014-2017 Evan You - * Released under the MIT License. - */ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.Vue = factory()); -}(this, (function () { 'use strict'; - -/* */ - -// these helpers produces better vm code in JS engines due to their -// explicitness and function inlining -function isUndef (v) { - return v === undefined || v === null -} - -function isDef (v) { - return v !== undefined && v !== null -} - -function isTrue (v) { - return v === true -} - -function isFalse (v) { - return v === false -} - -/** - * Check if value is primitive - */ -function isPrimitive (value) { - return ( - typeof value === 'string' || - typeof value === 'number' || - typeof value === 'boolean' - ) -} - -/** - * Quick object check - this is primarily used to tell - * Objects from primitive values when we know the value - * is a JSON-compliant type. - */ -function isObject (obj) { - return obj !== null && typeof obj === 'object' -} - -/** - * Get the raw type string of a value e.g. [object Object] - */ -var _toString = Object.prototype.toString; - -function toRawType (value) { - return _toString.call(value).slice(8, -1) -} - -/** - * Strict object type check. Only returns true - * for plain JavaScript objects. - */ -function isPlainObject (obj) { - return _toString.call(obj) === '[object Object]' -} - -function isRegExp (v) { - return _toString.call(v) === '[object RegExp]' -} - -/** - * Check if val is a valid array index. - */ -function isValidArrayIndex (val) { - var n = parseFloat(String(val)); - return n >= 0 && Math.floor(n) === n && isFinite(val) -} - -/** - * Convert a value to a string that is actually rendered. - */ -function toString (val) { - return val == null - ? '' - : typeof val === 'object' - ? JSON.stringify(val, null, 2) - : String(val) -} - -/** - * Convert a input value to a number for persistence. - * If the conversion fails, return original string. - */ -function toNumber (val) { - var n = parseFloat(val); - return isNaN(n) ? val : n -} - -/** - * Make a map and return a function for checking if a key - * is in that map. - */ -function makeMap ( - str, - expectsLowerCase -) { - var map = Object.create(null); - var list = str.split(','); - for (var i = 0; i < list.length; i++) { - map[list[i]] = true; - } - return expectsLowerCase - ? function (val) { return map[val.toLowerCase()]; } - : function (val) { return map[val]; } -} - -/** - * Check if a tag is a built-in tag. - */ -var isBuiltInTag = makeMap('slot,component', true); - -/** - * Check if a attribute is a reserved attribute. - */ -var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is'); - -/** - * Remove an item from an array - */ -function remove (arr, item) { - if (arr.length) { - var index = arr.indexOf(item); - if (index > -1) { - return arr.splice(index, 1) - } - } -} - -/** - * Check whether the object has the property. - */ -var hasOwnProperty = Object.prototype.hasOwnProperty; -function hasOwn (obj, key) { - return hasOwnProperty.call(obj, key) -} - -/** - * Create a cached version of a pure function. - */ -function cached (fn) { - var cache = Object.create(null); - return (function cachedFn (str) { - var hit = cache[str]; - return hit || (cache[str] = fn(str)) - }) -} - -/** - * Camelize a hyphen-delimited string. - */ -var camelizeRE = /-(\w)/g; -var camelize = cached(function (str) { - return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; }) -}); - -/** - * Capitalize a string. - */ -var capitalize = cached(function (str) { - return str.charAt(0).toUpperCase() + str.slice(1) -}); - -/** - * Hyphenate a camelCase string. - */ -var hyphenateRE = /\B([A-Z])/g; -var hyphenate = cached(function (str) { - return str.replace(hyphenateRE, '-$1').toLowerCase() -}); - -/** - * Simple bind, faster than native - */ -function bind (fn, ctx) { - function boundFn (a) { - var l = arguments.length; - return l - ? l > 1 - ? fn.apply(ctx, arguments) - : fn.call(ctx, a) - : fn.call(ctx) - } - // record original fn length - boundFn._length = fn.length; - return boundFn -} - -/** - * Convert an Array-like object to a real Array. - */ -function toArray (list, start) { - start = start || 0; - var i = list.length - start; - var ret = new Array(i); - while (i--) { - ret[i] = list[i + start]; - } - return ret -} - -/** - * Mix properties into target object. - */ -function extend (to, _from) { - for (var key in _from) { - to[key] = _from[key]; - } - return to -} - -/** - * Merge an Array of Objects into a single Object. - */ -function toObject (arr) { - var res = {}; - for (var i = 0; i < arr.length; i++) { - if (arr[i]) { - extend(res, arr[i]); - } - } - return res -} - -/** - * Perform no operation. - * Stubbing args to make Flow happy without leaving useless transpiled code - * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/) - */ -function noop (a, b, c) {} - -/** - * Always return false. - */ -var no = function (a, b, c) { return false; }; - -/** - * Return same value - */ -var identity = function (_) { return _; }; - -/** - * Generate a static keys string from compiler modules. - */ -function genStaticKeys (modules) { - return modules.reduce(function (keys, m) { - return keys.concat(m.staticKeys || []) - }, []).join(',') -} - -/** - * Check if two values are loosely equal - that is, - * if they are plain objects, do they have the same shape? - */ -function looseEqual (a, b) { - if (a === b) { return true } - var isObjectA = isObject(a); - var isObjectB = isObject(b); - if (isObjectA && isObjectB) { - try { - var isArrayA = Array.isArray(a); - var isArrayB = Array.isArray(b); - if (isArrayA && isArrayB) { - return a.length === b.length && a.every(function (e, i) { - return looseEqual(e, b[i]) - }) - } else if (!isArrayA && !isArrayB) { - var keysA = Object.keys(a); - var keysB = Object.keys(b); - return keysA.length === keysB.length && keysA.every(function (key) { - return looseEqual(a[key], b[key]) - }) - } else { - /* istanbul ignore next */ - return false - } - } catch (e) { - /* istanbul ignore next */ - return false - } - } else if (!isObjectA && !isObjectB) { - return String(a) === String(b) - } else { - return false - } -} - -function looseIndexOf (arr, val) { - for (var i = 0; i < arr.length; i++) { - if (looseEqual(arr[i], val)) { return i } - } - return -1 -} - -/** - * Ensure a function is called only once. - */ -function once (fn) { - var called = false; - return function () { - if (!called) { - called = true; - fn.apply(this, arguments); - } - } -} - -var SSR_ATTR = 'data-server-rendered'; - -var ASSET_TYPES = [ - 'component', - 'directive', - 'filter' -]; - -var LIFECYCLE_HOOKS = [ - 'beforeCreate', - 'created', - 'beforeMount', - 'mounted', - 'beforeUpdate', - 'updated', - 'beforeDestroy', - 'destroyed', - 'activated', - 'deactivated', - 'errorCaptured' -]; - -/* */ - -var config = ({ - /** - * Option merge strategies (used in core/util/options) - */ - optionMergeStrategies: Object.create(null), - - /** - * Whether to suppress warnings. - */ - silent: false, - - /** - * Show production mode tip message on boot? - */ - productionTip: "development" !== 'production', - - /** - * Whether to enable devtools - */ - devtools: "development" !== 'production', - - /** - * Whether to record perf - */ - performance: false, - - /** - * Error handler for watcher errors - */ - errorHandler: null, - - /** - * Warn handler for watcher warns - */ - warnHandler: null, - - /** - * Ignore certain custom elements - */ - ignoredElements: [], - - /** - * Custom user key aliases for v-on - */ - keyCodes: Object.create(null), - - /** - * Check if a tag is reserved so that it cannot be registered as a - * component. This is platform-dependent and may be overwritten. - */ - isReservedTag: no, - - /** - * Check if an attribute is reserved so that it cannot be used as a component - * prop. This is platform-dependent and may be overwritten. - */ - isReservedAttr: no, - - /** - * Check if a tag is an unknown element. - * Platform-dependent. - */ - isUnknownElement: no, - - /** - * Get the namespace of an element - */ - getTagNamespace: noop, - - /** - * Parse the real tag name for the specific platform. - */ - parsePlatformTagName: identity, - - /** - * Check if an attribute must be bound using property, e.g. value - * Platform-dependent. - */ - mustUseProp: no, - - /** - * Exposed for legacy reasons - */ - _lifecycleHooks: LIFECYCLE_HOOKS -}); - -/* */ - -var emptyObject = Object.freeze({}); - -/** - * Check if a string starts with $ or _ - */ -function isReserved (str) { - var c = (str + '').charCodeAt(0); - return c === 0x24 || c === 0x5F -} - -/** - * Define a property. - */ -function def (obj, key, val, enumerable) { - Object.defineProperty(obj, key, { - value: val, - enumerable: !!enumerable, - writable: true, - configurable: true - }); -} - -/** - * Parse simple path. - */ -var bailRE = /[^\w.$]/; -function parsePath (path) { - if (bailRE.test(path)) { - return - } - var segments = path.split('.'); - return function (obj) { - for (var i = 0; i < segments.length; i++) { - if (!obj) { return } - obj = obj[segments[i]]; - } - return obj - } -} - -/* */ - -// can we use __proto__? -var hasProto = '__proto__' in {}; - -// Browser environment sniffing -var inBrowser = typeof window !== 'undefined'; -var UA = inBrowser && window.navigator.userAgent.toLowerCase(); -var isIE = UA && /msie|trident/.test(UA); -var isIE9 = UA && UA.indexOf('msie 9.0') > 0; -var isEdge = UA && UA.indexOf('edge/') > 0; -var isAndroid = UA && UA.indexOf('android') > 0; -var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA); -var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge; - -// Firefox has a "watch" function on Object.prototype... -var nativeWatch = ({}).watch; - -var supportsPassive = false; -if (inBrowser) { - try { - var opts = {}; - Object.defineProperty(opts, 'passive', ({ - get: function get () { - /* istanbul ignore next */ - supportsPassive = true; - } - })); // https://github.com/facebook/flow/issues/285 - window.addEventListener('test-passive', null, opts); - } catch (e) {} -} - -// this needs to be lazy-evaled because vue may be required before -// vue-server-renderer can set VUE_ENV -var _isServer; -var isServerRendering = function () { - if (_isServer === undefined) { - /* istanbul ignore if */ - if (!inBrowser && typeof global !== 'undefined') { - // detect presence of vue-server-renderer and avoid - // Webpack shimming the process - _isServer = global['process'].env.VUE_ENV === 'server'; - } else { - _isServer = false; - } - } - return _isServer -}; - -// detect devtools -var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__; - -/* istanbul ignore next */ -function isNative (Ctor) { - return typeof Ctor === 'function' && /native code/.test(Ctor.toString()) -} - -var hasSymbol = - typeof Symbol !== 'undefined' && isNative(Symbol) && - typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys); - -var _Set; -/* istanbul ignore if */ // $flow-disable-line -if (typeof Set !== 'undefined' && isNative(Set)) { - // use native Set when available. - _Set = Set; -} else { - // a non-standard Set polyfill that only works with primitive keys. - _Set = (function () { - function Set () { - this.set = Object.create(null); - } - Set.prototype.has = function has (key) { - return this.set[key] === true - }; - Set.prototype.add = function add (key) { - this.set[key] = true; - }; - Set.prototype.clear = function clear () { - this.set = Object.create(null); - }; - - return Set; - }()); -} - -/* */ - -var warn = noop; -var tip = noop; -var generateComponentTrace = (noop); // work around flow check -var formatComponentName = (noop); - -{ - var hasConsole = typeof console !== 'undefined'; - var classifyRE = /(?:^|[-_])(\w)/g; - var classify = function (str) { return str - .replace(classifyRE, function (c) { return c.toUpperCase(); }) - .replace(/[-_]/g, ''); }; - - warn = function (msg, vm) { - var trace = vm ? generateComponentTrace(vm) : ''; - - if (config.warnHandler) { - config.warnHandler.call(null, msg, vm, trace); - } else if (hasConsole && (!config.silent)) { - console.error(("[Vue warn]: " + msg + trace)); - } - }; - - tip = function (msg, vm) { - if (hasConsole && (!config.silent)) { - console.warn("[Vue tip]: " + msg + ( - vm ? generateComponentTrace(vm) : '' - )); - } - }; - - formatComponentName = function (vm, includeFile) { - if (vm.$root === vm) { - return '' - } - var options = typeof vm === 'function' && vm.cid != null - ? vm.options - : vm._isVue - ? vm.$options || vm.constructor.options - : vm || {}; - var name = options.name || options._componentTag; - var file = options.__file; - if (!name && file) { - var match = file.match(/([^/\\]+)\.vue$/); - name = match && match[1]; - } - - return ( - (name ? ("<" + (classify(name)) + ">") : "") + - (file && includeFile !== false ? (" at " + file) : '') - ) - }; - - var repeat = function (str, n) { - var res = ''; - while (n) { - if (n % 2 === 1) { res += str; } - if (n > 1) { str += str; } - n >>= 1; - } - return res - }; - - generateComponentTrace = function (vm) { - if (vm._isVue && vm.$parent) { - var tree = []; - var currentRecursiveSequence = 0; - while (vm) { - if (tree.length > 0) { - var last = tree[tree.length - 1]; - if (last.constructor === vm.constructor) { - currentRecursiveSequence++; - vm = vm.$parent; - continue - } else if (currentRecursiveSequence > 0) { - tree[tree.length - 1] = [last, currentRecursiveSequence]; - currentRecursiveSequence = 0; - } - } - tree.push(vm); - vm = vm.$parent; - } - return '\n\nfound in\n\n' + tree - .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm) - ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)") - : formatComponentName(vm))); }) - .join('\n') - } else { - return ("\n\n(found in " + (formatComponentName(vm)) + ")") - } - }; -} - -/* */ - - -var uid = 0; - -/** - * A dep is an observable that can have multiple - * directives subscribing to it. - */ -var Dep = function Dep () { - this.id = uid++; - this.subs = []; -}; - -Dep.prototype.addSub = function addSub (sub) { - this.subs.push(sub); -}; - -Dep.prototype.removeSub = function removeSub (sub) { - remove(this.subs, sub); -}; - -Dep.prototype.depend = function depend () { - if (Dep.target) { - Dep.target.addDep(this); - } -}; - -Dep.prototype.notify = function notify () { - // stabilize the subscriber list first - var subs = this.subs.slice(); - for (var i = 0, l = subs.length; i < l; i++) { - subs[i].update(); - } -}; - -// the current target watcher being evaluated. -// this is globally unique because there could be only one -// watcher being evaluated at any time. -Dep.target = null; -var targetStack = []; - -function pushTarget (_target) { - if (Dep.target) { targetStack.push(Dep.target); } - Dep.target = _target; -} - -function popTarget () { - Dep.target = targetStack.pop(); -} - -/* */ - -var VNode = function VNode ( - tag, - data, - children, - text, - elm, - context, - componentOptions, - asyncFactory -) { - this.tag = tag; - this.data = data; - this.children = children; - this.text = text; - this.elm = elm; - this.ns = undefined; - this.context = context; - this.functionalContext = undefined; - this.functionalOptions = undefined; - this.functionalScopeId = undefined; - this.key = data && data.key; - this.componentOptions = componentOptions; - this.componentInstance = undefined; - this.parent = undefined; - this.raw = false; - this.isStatic = false; - this.isRootInsert = true; - this.isComment = false; - this.isCloned = false; - this.isOnce = false; - this.asyncFactory = asyncFactory; - this.asyncMeta = undefined; - this.isAsyncPlaceholder = false; -}; - -var prototypeAccessors = { child: { configurable: true } }; - -// DEPRECATED: alias for componentInstance for backwards compat. -/* istanbul ignore next */ -prototypeAccessors.child.get = function () { - return this.componentInstance -}; - -Object.defineProperties( VNode.prototype, prototypeAccessors ); - -var createEmptyVNode = function (text) { - if ( text === void 0 ) text = ''; - - var node = new VNode(); - node.text = text; - node.isComment = true; - return node -}; - -function createTextVNode (val) { - return new VNode(undefined, undefined, undefined, String(val)) -} - -// optimized shallow clone -// used for static nodes and slot nodes because they may be reused across -// multiple renders, cloning them avoids errors when DOM manipulations rely -// on their elm reference. -function cloneVNode (vnode, deep) { - var cloned = new VNode( - vnode.tag, - vnode.data, - vnode.children, - vnode.text, - vnode.elm, - vnode.context, - vnode.componentOptions, - vnode.asyncFactory - ); - cloned.ns = vnode.ns; - cloned.isStatic = vnode.isStatic; - cloned.key = vnode.key; - cloned.isComment = vnode.isComment; - cloned.isCloned = true; - if (deep && vnode.children) { - cloned.children = cloneVNodes(vnode.children); - } - return cloned -} - -function cloneVNodes (vnodes, deep) { - var len = vnodes.length; - var res = new Array(len); - for (var i = 0; i < len; i++) { - res[i] = cloneVNode(vnodes[i], deep); - } - return res -} - -/* - * not type checking this file because flow doesn't play well with - * dynamically accessing methods on Array prototype - */ - -var arrayProto = Array.prototype; -var arrayMethods = Object.create(arrayProto);[ - 'push', - 'pop', - 'shift', - 'unshift', - 'splice', - 'sort', - 'reverse' -] -.forEach(function (method) { - // cache original method - var original = arrayProto[method]; - def(arrayMethods, method, function mutator () { - var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; - - var result = original.apply(this, args); - var ob = this.__ob__; - var inserted; - switch (method) { - case 'push': - case 'unshift': - inserted = args; - break - case 'splice': - inserted = args.slice(2); - break - } - if (inserted) { ob.observeArray(inserted); } - // notify change - ob.dep.notify(); - return result - }); -}); - -/* */ - -var arrayKeys = Object.getOwnPropertyNames(arrayMethods); - -/** - * By default, when a reactive property is set, the new value is - * also converted to become reactive. However when passing down props, - * we don't want to force conversion because the value may be a nested value - * under a frozen data structure. Converting it would defeat the optimization. - */ -var observerState = { - shouldConvert: true -}; - -/** - * Observer class that are attached to each observed - * object. Once attached, the observer converts target - * object's property keys into getter/setters that - * collect dependencies and dispatches updates. - */ -var Observer = function Observer (value) { - this.value = value; - this.dep = new Dep(); - this.vmCount = 0; - def(value, '__ob__', this); - if (Array.isArray(value)) { - var augment = hasProto - ? protoAugment - : copyAugment; - augment(value, arrayMethods, arrayKeys); - this.observeArray(value); - } else { - this.walk(value); - } -}; - -/** - * Walk through each property and convert them into - * getter/setters. This method should only be called when - * value type is Object. - */ -Observer.prototype.walk = function walk (obj) { - var keys = Object.keys(obj); - for (var i = 0; i < keys.length; i++) { - defineReactive(obj, keys[i], obj[keys[i]]); - } -}; - -/** - * Observe a list of Array items. - */ -Observer.prototype.observeArray = function observeArray (items) { - for (var i = 0, l = items.length; i < l; i++) { - observe(items[i]); - } -}; - -// helpers - -/** - * Augment an target Object or Array by intercepting - * the prototype chain using __proto__ - */ -function protoAugment (target, src, keys) { - /* eslint-disable no-proto */ - target.__proto__ = src; - /* eslint-enable no-proto */ -} - -/** - * Augment an target Object or Array by defining - * hidden properties. - */ -/* istanbul ignore next */ -function copyAugment (target, src, keys) { - for (var i = 0, l = keys.length; i < l; i++) { - var key = keys[i]; - def(target, key, src[key]); - } -} - -/** - * Attempt to create an observer instance for a value, - * returns the new observer if successfully observed, - * or the existing observer if the value already has one. - */ -function observe (value, asRootData) { - if (!isObject(value) || value instanceof VNode) { - return - } - var ob; - if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) { - ob = value.__ob__; - } else if ( - observerState.shouldConvert && - !isServerRendering() && - (Array.isArray(value) || isPlainObject(value)) && - Object.isExtensible(value) && - !value._isVue - ) { - ob = new Observer(value); - } - if (asRootData && ob) { - ob.vmCount++; - } - return ob -} - -/** - * Define a reactive property on an Object. - */ -function defineReactive ( - obj, - key, - val, - customSetter, - shallow -) { - var dep = new Dep(); - - var property = Object.getOwnPropertyDescriptor(obj, key); - if (property && property.configurable === false) { - return - } - - // cater for pre-defined getter/setters - var getter = property && property.get; - var setter = property && property.set; - - var childOb = !shallow && observe(val); - Object.defineProperty(obj, key, { - enumerable: true, - configurable: true, - get: function reactiveGetter () { - var value = getter ? getter.call(obj) : val; - if (Dep.target) { - dep.depend(); - if (childOb) { - childOb.dep.depend(); - if (Array.isArray(value)) { - dependArray(value); - } - } - } - return value - }, - set: function reactiveSetter (newVal) { - var value = getter ? getter.call(obj) : val; - /* eslint-disable no-self-compare */ - if (newVal === value || (newVal !== newVal && value !== value)) { - return - } - /* eslint-enable no-self-compare */ - if ("development" !== 'production' && customSetter) { - customSetter(); - } - if (setter) { - setter.call(obj, newVal); - } else { - val = newVal; - } - childOb = !shallow && observe(newVal); - dep.notify(); - } - }); -} - -/** - * Set a property on an object. Adds the new property and - * triggers change notification if the property doesn't - * already exist. - */ -function set (target, key, val) { - if (Array.isArray(target) && isValidArrayIndex(key)) { - target.length = Math.max(target.length, key); - target.splice(key, 1, val); - return val - } - if (hasOwn(target, key)) { - target[key] = val; - return val - } - var ob = (target).__ob__; - if (target._isVue || (ob && ob.vmCount)) { - "development" !== 'production' && warn( - 'Avoid adding reactive properties to a Vue instance or its root $data ' + - 'at runtime - declare it upfront in the data option.' - ); - return val - } - if (!ob) { - target[key] = val; - return val - } - defineReactive(ob.value, key, val); - ob.dep.notify(); - return val -} - -/** - * Delete a property and trigger change if necessary. - */ -function del (target, key) { - if (Array.isArray(target) && isValidArrayIndex(key)) { - target.splice(key, 1); - return - } - var ob = (target).__ob__; - if (target._isVue || (ob && ob.vmCount)) { - "development" !== 'production' && warn( - 'Avoid deleting properties on a Vue instance or its root $data ' + - '- just set it to null.' - ); - return - } - if (!hasOwn(target, key)) { - return - } - delete target[key]; - if (!ob) { - return - } - ob.dep.notify(); -} - -/** - * Collect dependencies on array elements when the array is touched, since - * we cannot intercept array element access like property getters. - */ -function dependArray (value) { - for (var e = (void 0), i = 0, l = value.length; i < l; i++) { - e = value[i]; - e && e.__ob__ && e.__ob__.dep.depend(); - if (Array.isArray(e)) { - dependArray(e); - } - } -} - -/* */ - -/** - * Option overwriting strategies are functions that handle - * how to merge a parent option value and a child option - * value into the final value. - */ -var strats = config.optionMergeStrategies; - -/** - * Options with restrictions - */ -{ - strats.el = strats.propsData = function (parent, child, vm, key) { - if (!vm) { - warn( - "option \"" + key + "\" can only be used during instance " + - 'creation with the `new` keyword.' - ); - } - return defaultStrat(parent, child) - }; -} - -/** - * Helper that recursively merges two data objects together. - */ -function mergeData (to, from) { - if (!from) { return to } - var key, toVal, fromVal; - var keys = Object.keys(from); - for (var i = 0; i < keys.length; i++) { - key = keys[i]; - toVal = to[key]; - fromVal = from[key]; - if (!hasOwn(to, key)) { - set(to, key, fromVal); - } else if (isPlainObject(toVal) && isPlainObject(fromVal)) { - mergeData(toVal, fromVal); - } - } - return to -} - -/** - * Data - */ -function mergeDataOrFn ( - parentVal, - childVal, - vm -) { - if (!vm) { - // in a Vue.extend merge, both should be functions - if (!childVal) { - return parentVal - } - if (!parentVal) { - return childVal - } - // when parentVal & childVal are both present, - // we need to return a function that returns the - // merged result of both functions... no need to - // check if parentVal is a function here because - // it has to be a function to pass previous merges. - return function mergedDataFn () { - return mergeData( - typeof childVal === 'function' ? childVal.call(this) : childVal, - typeof parentVal === 'function' ? parentVal.call(this) : parentVal - ) - } - } else if (parentVal || childVal) { - return function mergedInstanceDataFn () { - // instance merge - var instanceData = typeof childVal === 'function' - ? childVal.call(vm) - : childVal; - var defaultData = typeof parentVal === 'function' - ? parentVal.call(vm) - : parentVal; - if (instanceData) { - return mergeData(instanceData, defaultData) - } else { - return defaultData - } - } - } -} - -strats.data = function ( - parentVal, - childVal, - vm -) { - if (!vm) { - if (childVal && typeof childVal !== 'function') { - "development" !== 'production' && warn( - 'The "data" option should be a function ' + - 'that returns a per-instance value in component ' + - 'definitions.', - vm - ); - - return parentVal - } - return mergeDataOrFn.call(this, parentVal, childVal) - } - - return mergeDataOrFn(parentVal, childVal, vm) -}; - -/** - * Hooks and props are merged as arrays. - */ -function mergeHook ( - parentVal, - childVal -) { - return childVal - ? parentVal - ? parentVal.concat(childVal) - : Array.isArray(childVal) - ? childVal - : [childVal] - : parentVal -} - -LIFECYCLE_HOOKS.forEach(function (hook) { - strats[hook] = mergeHook; -}); - -/** - * Assets - * - * When a vm is present (instance creation), we need to do - * a three-way merge between constructor options, instance - * options and parent options. - */ -function mergeAssets ( - parentVal, - childVal, - vm, - key -) { - var res = Object.create(parentVal || null); - if (childVal) { - "development" !== 'production' && assertObjectType(key, childVal, vm); - return extend(res, childVal) - } else { - return res - } -} - -ASSET_TYPES.forEach(function (type) { - strats[type + 's'] = mergeAssets; -}); - -/** - * Watchers. - * - * Watchers hashes should not overwrite one - * another, so we merge them as arrays. - */ -strats.watch = function ( - parentVal, - childVal, - vm, - key -) { - // work around Firefox's Object.prototype.watch... - if (parentVal === nativeWatch) { parentVal = undefined; } - if (childVal === nativeWatch) { childVal = undefined; } - /* istanbul ignore if */ - if (!childVal) { return Object.create(parentVal || null) } - { - assertObjectType(key, childVal, vm); - } - if (!parentVal) { return childVal } - var ret = {}; - extend(ret, parentVal); - for (var key$1 in childVal) { - var parent = ret[key$1]; - var child = childVal[key$1]; - if (parent && !Array.isArray(parent)) { - parent = [parent]; - } - ret[key$1] = parent - ? parent.concat(child) - : Array.isArray(child) ? child : [child]; - } - return ret -}; - -/** - * Other object hashes. - */ -strats.props = -strats.methods = -strats.inject = -strats.computed = function ( - parentVal, - childVal, - vm, - key -) { - if (childVal && "development" !== 'production') { - assertObjectType(key, childVal, vm); - } - if (!parentVal) { return childVal } - var ret = Object.create(null); - extend(ret, parentVal); - if (childVal) { extend(ret, childVal); } - return ret -}; -strats.provide = mergeDataOrFn; - -/** - * Default strategy. - */ -var defaultStrat = function (parentVal, childVal) { - return childVal === undefined - ? parentVal - : childVal -}; - -/** - * Validate component names - */ -function checkComponents (options) { - for (var key in options.components) { - var lower = key.toLowerCase(); - if (isBuiltInTag(lower) || config.isReservedTag(lower)) { - warn( - 'Do not use built-in or reserved HTML elements as component ' + - 'id: ' + key - ); - } - } -} - -/** - * Ensure all props option syntax are normalized into the - * Object-based format. - */ -function normalizeProps (options, vm) { - var props = options.props; - if (!props) { return } - var res = {}; - var i, val, name; - if (Array.isArray(props)) { - i = props.length; - while (i--) { - val = props[i]; - if (typeof val === 'string') { - name = camelize(val); - res[name] = { type: null }; - } else { - warn('props must be strings when using array syntax.'); - } - } - } else if (isPlainObject(props)) { - for (var key in props) { - val = props[key]; - name = camelize(key); - res[name] = isPlainObject(val) - ? val - : { type: val }; - } - } else { - warn( - "Invalid value for option \"props\": expected an Array or an Object, " + - "but got " + (toRawType(props)) + ".", - vm - ); - } - options.props = res; -} - -/** - * Normalize all injections into Object-based format - */ -function normalizeInject (options, vm) { - var inject = options.inject; - var normalized = options.inject = {}; - if (Array.isArray(inject)) { - for (var i = 0; i < inject.length; i++) { - normalized[inject[i]] = { from: inject[i] }; - } - } else if (isPlainObject(inject)) { - for (var key in inject) { - var val = inject[key]; - normalized[key] = isPlainObject(val) - ? extend({ from: key }, val) - : { from: val }; - } - } else if ("development" !== 'production' && inject) { - warn( - "Invalid value for option \"inject\": expected an Array or an Object, " + - "but got " + (toRawType(inject)) + ".", - vm - ); - } -} - -/** - * Normalize raw function directives into object format. - */ -function normalizeDirectives (options) { - var dirs = options.directives; - if (dirs) { - for (var key in dirs) { - var def = dirs[key]; - if (typeof def === 'function') { - dirs[key] = { bind: def, update: def }; - } - } - } -} - -function assertObjectType (name, value, vm) { - if (!isPlainObject(value)) { - warn( - "Invalid value for option \"" + name + "\": expected an Object, " + - "but got " + (toRawType(value)) + ".", - vm - ); - } -} - -/** - * Merge two option objects into a new one. - * Core utility used in both instantiation and inheritance. - */ -function mergeOptions ( - parent, - child, - vm -) { - { - checkComponents(child); - } - - if (typeof child === 'function') { - child = child.options; - } - - normalizeProps(child, vm); - normalizeInject(child, vm); - normalizeDirectives(child); - var extendsFrom = child.extends; - if (extendsFrom) { - parent = mergeOptions(parent, extendsFrom, vm); - } - if (child.mixins) { - for (var i = 0, l = child.mixins.length; i < l; i++) { - parent = mergeOptions(parent, child.mixins[i], vm); - } - } - var options = {}; - var key; - for (key in parent) { - mergeField(key); - } - for (key in child) { - if (!hasOwn(parent, key)) { - mergeField(key); - } - } - function mergeField (key) { - var strat = strats[key] || defaultStrat; - options[key] = strat(parent[key], child[key], vm, key); - } - return options -} - -/** - * Resolve an asset. - * This function is used because child instances need access - * to assets defined in its ancestor chain. - */ -function resolveAsset ( - options, - type, - id, - warnMissing -) { - /* istanbul ignore if */ - if (typeof id !== 'string') { - return - } - var assets = options[type]; - // check local registration variations first - if (hasOwn(assets, id)) { return assets[id] } - var camelizedId = camelize(id); - if (hasOwn(assets, camelizedId)) { return assets[camelizedId] } - var PascalCaseId = capitalize(camelizedId); - if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] } - // fallback to prototype chain - var res = assets[id] || assets[camelizedId] || assets[PascalCaseId]; - if ("development" !== 'production' && warnMissing && !res) { - warn( - 'Failed to resolve ' + type.slice(0, -1) + ': ' + id, - options - ); - } - return res -} - -/* */ - -function validateProp ( - key, - propOptions, - propsData, - vm -) { - var prop = propOptions[key]; - var absent = !hasOwn(propsData, key); - var value = propsData[key]; - // handle boolean props - if (isType(Boolean, prop.type)) { - if (absent && !hasOwn(prop, 'default')) { - value = false; - } else if (!isType(String, prop.type) && (value === '' || value === hyphenate(key))) { - value = true; - } - } - // check default value - if (value === undefined) { - value = getPropDefaultValue(vm, prop, key); - // since the default value is a fresh copy, - // make sure to observe it. - var prevShouldConvert = observerState.shouldConvert; - observerState.shouldConvert = true; - observe(value); - observerState.shouldConvert = prevShouldConvert; - } - { - assertProp(prop, key, value, vm, absent); - } - return value -} - -/** - * Get the default value of a prop. - */ -function getPropDefaultValue (vm, prop, key) { - // no default, return undefined - if (!hasOwn(prop, 'default')) { - return undefined - } - var def = prop.default; - // warn against non-factory defaults for Object & Array - if ("development" !== 'production' && isObject(def)) { - warn( - 'Invalid default value for prop "' + key + '": ' + - 'Props with type Object/Array must use a factory function ' + - 'to return the default value.', - vm - ); - } - // the raw prop value was also undefined from previous render, - // return previous default value to avoid unnecessary watcher trigger - if (vm && vm.$options.propsData && - vm.$options.propsData[key] === undefined && - vm._props[key] !== undefined - ) { - return vm._props[key] - } - // call factory function for non-Function types - // a value is Function if its prototype is function even across different execution context - return typeof def === 'function' && getType(prop.type) !== 'Function' - ? def.call(vm) - : def -} - -/** - * Assert whether a prop is valid. - */ -function assertProp ( - prop, - name, - value, - vm, - absent -) { - if (prop.required && absent) { - warn( - 'Missing required prop: "' + name + '"', - vm - ); - return - } - if (value == null && !prop.required) { - return - } - var type = prop.type; - var valid = !type || type === true; - var expectedTypes = []; - if (type) { - if (!Array.isArray(type)) { - type = [type]; - } - for (var i = 0; i < type.length && !valid; i++) { - var assertedType = assertType(value, type[i]); - expectedTypes.push(assertedType.expectedType || ''); - valid = assertedType.valid; - } - } - if (!valid) { - warn( - "Invalid prop: type check failed for prop \"" + name + "\"." + - " Expected " + (expectedTypes.map(capitalize).join(', ')) + - ", got " + (toRawType(value)) + ".", - vm - ); - return - } - var validator = prop.validator; - if (validator) { - if (!validator(value)) { - warn( - 'Invalid prop: custom validator check failed for prop "' + name + '".', - vm - ); - } - } -} - -var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/; - -function assertType (value, type) { - var valid; - var expectedType = getType(type); - if (simpleCheckRE.test(expectedType)) { - var t = typeof value; - valid = t === expectedType.toLowerCase(); - // for primitive wrapper objects - if (!valid && t === 'object') { - valid = value instanceof type; - } - } else if (expectedType === 'Object') { - valid = isPlainObject(value); - } else if (expectedType === 'Array') { - valid = Array.isArray(value); - } else { - valid = value instanceof type; - } - return { - valid: valid, - expectedType: expectedType - } -} - -/** - * Use function string name to check built-in types, - * because a simple equality check will fail when running - * across different vms / iframes. - */ -function getType (fn) { - var match = fn && fn.toString().match(/^\s*function (\w+)/); - return match ? match[1] : '' -} - -function isType (type, fn) { - if (!Array.isArray(fn)) { - return getType(fn) === getType(type) - } - for (var i = 0, len = fn.length; i < len; i++) { - if (getType(fn[i]) === getType(type)) { - return true - } - } - /* istanbul ignore next */ - return false -} - -/* */ - -function handleError (err, vm, info) { - if (vm) { - var cur = vm; - while ((cur = cur.$parent)) { - var hooks = cur.$options.errorCaptured; - if (hooks) { - for (var i = 0; i < hooks.length; i++) { - try { - var capture = hooks[i].call(cur, err, vm, info) === false; - if (capture) { return } - } catch (e) { - globalHandleError(e, cur, 'errorCaptured hook'); - } - } - } - } - } - globalHandleError(err, vm, info); -} - -function globalHandleError (err, vm, info) { - if (config.errorHandler) { - try { - return config.errorHandler.call(null, err, vm, info) - } catch (e) { - logError(e, null, 'config.errorHandler'); - } - } - logError(err, vm, info); -} - -function logError (err, vm, info) { - { - warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm); - } - /* istanbul ignore else */ - if (inBrowser && typeof console !== 'undefined') { - console.error(err); - } else { - throw err - } -} - -/* */ -/* globals MessageChannel */ - -var callbacks = []; -var pending = false; - -function flushCallbacks () { - pending = false; - var copies = callbacks.slice(0); - callbacks.length = 0; - for (var i = 0; i < copies.length; i++) { - copies[i](); - } -} - -// Here we have async deferring wrappers using both micro and macro tasks. -// In < 2.4 we used micro tasks everywhere, but there are some scenarios where -// micro tasks have too high a priority and fires in between supposedly -// sequential events (e.g. #4521, #6690) or even between bubbling of the same -// event (#6566). However, using macro tasks everywhere also has subtle problems -// when state is changed right before repaint (e.g. #6813, out-in transitions). -// Here we use micro task by default, but expose a way to force macro task when -// needed (e.g. in event handlers attached by v-on). -var microTimerFunc; -var macroTimerFunc; -var useMacroTask = false; - -// Determine (macro) Task defer implementation. -// Technically setImmediate should be the ideal choice, but it's only available -// in IE. The only polyfill that consistently queues the callback after all DOM -// events triggered in the same loop is by using MessageChannel. -/* istanbul ignore if */ -if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { - macroTimerFunc = function () { - setImmediate(flushCallbacks); - }; -} else if (typeof MessageChannel !== 'undefined' && ( - isNative(MessageChannel) || - // PhantomJS - MessageChannel.toString() === '[object MessageChannelConstructor]' -)) { - var channel = new MessageChannel(); - var port = channel.port2; - channel.port1.onmessage = flushCallbacks; - macroTimerFunc = function () { - port.postMessage(1); - }; -} else { - /* istanbul ignore next */ - macroTimerFunc = function () { - setTimeout(flushCallbacks, 0); - }; -} - -// Determine MicroTask defer implementation. -/* istanbul ignore next, $flow-disable-line */ -if (typeof Promise !== 'undefined' && isNative(Promise)) { - var p = Promise.resolve(); - microTimerFunc = function () { - p.then(flushCallbacks); - // in problematic UIWebViews, Promise.then doesn't completely break, but - // it can get stuck in a weird state where callbacks are pushed into the - // microtask queue but the queue isn't being flushed, until the browser - // needs to do some other work, e.g. handle a timer. Therefore we can - // "force" the microtask queue to be flushed by adding an empty timer. - if (isIOS) { setTimeout(noop); } - }; -} else { - // fallback to macro - microTimerFunc = macroTimerFunc; -} - -/** - * Wrap a function so that if any code inside triggers state change, - * the changes are queued using a Task instead of a MicroTask. - */ -function withMacroTask (fn) { - return fn._withTask || (fn._withTask = function () { - useMacroTask = true; - var res = fn.apply(null, arguments); - useMacroTask = false; - return res - }) -} - -function nextTick (cb, ctx) { - var _resolve; - callbacks.push(function () { - if (cb) { - try { - cb.call(ctx); - } catch (e) { - handleError(e, ctx, 'nextTick'); - } - } else if (_resolve) { - _resolve(ctx); - } - }); - if (!pending) { - pending = true; - if (useMacroTask) { - macroTimerFunc(); - } else { - microTimerFunc(); - } - } - // $flow-disable-line - if (!cb && typeof Promise !== 'undefined') { - return new Promise(function (resolve) { - _resolve = resolve; - }) - } -} - -/* */ - -var mark; -var measure; - -{ - var perf = inBrowser && window.performance; - /* istanbul ignore if */ - if ( - perf && - perf.mark && - perf.measure && - perf.clearMarks && - perf.clearMeasures - ) { - mark = function (tag) { return perf.mark(tag); }; - measure = function (name, startTag, endTag) { - perf.measure(name, startTag, endTag); - perf.clearMarks(startTag); - perf.clearMarks(endTag); - perf.clearMeasures(name); - }; - } -} - -/* not type checking this file because flow doesn't play well with Proxy */ - -var initProxy; - -{ - var allowedGlobals = makeMap( - 'Infinity,undefined,NaN,isFinite,isNaN,' + - 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' + - 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' + - 'require' // for Webpack/Browserify - ); - - var warnNonPresent = function (target, key) { - warn( - "Property or method \"" + key + "\" is not defined on the instance but " + - 'referenced during render. Make sure that this property is reactive, ' + - 'either in the data option, or for class-based components, by ' + - 'initializing the property. ' + - 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', - target - ); - }; - - var hasProxy = - typeof Proxy !== 'undefined' && - Proxy.toString().match(/native code/); - - if (hasProxy) { - var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact'); - config.keyCodes = new Proxy(config.keyCodes, { - set: function set (target, key, value) { - if (isBuiltInModifier(key)) { - warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key)); - return false - } else { - target[key] = value; - return true - } - } - }); - } - - var hasHandler = { - has: function has (target, key) { - var has = key in target; - var isAllowed = allowedGlobals(key) || key.charAt(0) === '_'; - if (!has && !isAllowed) { - warnNonPresent(target, key); - } - return has || !isAllowed - } - }; - - var getHandler = { - get: function get (target, key) { - if (typeof key === 'string' && !(key in target)) { - warnNonPresent(target, key); - } - return target[key] - } - }; - - initProxy = function initProxy (vm) { - if (hasProxy) { - // determine which proxy handler to use - var options = vm.$options; - var handlers = options.render && options.render._withStripped - ? getHandler - : hasHandler; - vm._renderProxy = new Proxy(vm, handlers); - } else { - vm._renderProxy = vm; - } - }; -} - -/* */ - -var normalizeEvent = cached(function (name) { - var passive = name.charAt(0) === '&'; - name = passive ? name.slice(1) : name; - var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first - name = once$$1 ? name.slice(1) : name; - var capture = name.charAt(0) === '!'; - name = capture ? name.slice(1) : name; - return { - name: name, - once: once$$1, - capture: capture, - passive: passive - } -}); - -function createFnInvoker (fns) { - function invoker () { - var arguments$1 = arguments; - - var fns = invoker.fns; - if (Array.isArray(fns)) { - var cloned = fns.slice(); - for (var i = 0; i < cloned.length; i++) { - cloned[i].apply(null, arguments$1); - } - } else { - // return handler return value for single handlers - return fns.apply(null, arguments) - } - } - invoker.fns = fns; - return invoker -} - -function updateListeners ( - on, - oldOn, - add, - remove$$1, - vm -) { - var name, cur, old, event; - for (name in on) { - cur = on[name]; - old = oldOn[name]; - event = normalizeEvent(name); - if (isUndef(cur)) { - "development" !== 'production' && warn( - "Invalid handler for event \"" + (event.name) + "\": got " + String(cur), - vm - ); - } else if (isUndef(old)) { - if (isUndef(cur.fns)) { - cur = on[name] = createFnInvoker(cur); - } - add(event.name, cur, event.once, event.capture, event.passive); - } else if (cur !== old) { - old.fns = cur; - on[name] = old; - } - } - for (name in oldOn) { - if (isUndef(on[name])) { - event = normalizeEvent(name); - remove$$1(event.name, oldOn[name], event.capture); - } - } -} - -/* */ - -function mergeVNodeHook (def, hookKey, hook) { - var invoker; - var oldHook = def[hookKey]; - - function wrappedHook () { - hook.apply(this, arguments); - // important: remove merged hook to ensure it's called only once - // and prevent memory leak - remove(invoker.fns, wrappedHook); - } - - if (isUndef(oldHook)) { - // no existing hook - invoker = createFnInvoker([wrappedHook]); - } else { - /* istanbul ignore if */ - if (isDef(oldHook.fns) && isTrue(oldHook.merged)) { - // already a merged invoker - invoker = oldHook; - invoker.fns.push(wrappedHook); - } else { - // existing plain hook - invoker = createFnInvoker([oldHook, wrappedHook]); - } - } - - invoker.merged = true; - def[hookKey] = invoker; -} - -/* */ - -function extractPropsFromVNodeData ( - data, - Ctor, - tag -) { - // we are only extracting raw values here. - // validation and default values are handled in the child - // component itself. - var propOptions = Ctor.options.props; - if (isUndef(propOptions)) { - return - } - var res = {}; - var attrs = data.attrs; - var props = data.props; - if (isDef(attrs) || isDef(props)) { - for (var key in propOptions) { - var altKey = hyphenate(key); - { - var keyInLowerCase = key.toLowerCase(); - if ( - key !== keyInLowerCase && - attrs && hasOwn(attrs, keyInLowerCase) - ) { - tip( - "Prop \"" + keyInLowerCase + "\" is passed to component " + - (formatComponentName(tag || Ctor)) + ", but the declared prop name is" + - " \"" + key + "\". " + - "Note that HTML attributes are case-insensitive and camelCased " + - "props need to use their kebab-case equivalents when using in-DOM " + - "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"." - ); - } - } - checkProp(res, props, key, altKey, true) || - checkProp(res, attrs, key, altKey, false); - } - } - return res -} - -function checkProp ( - res, - hash, - key, - altKey, - preserve -) { - if (isDef(hash)) { - if (hasOwn(hash, key)) { - res[key] = hash[key]; - if (!preserve) { - delete hash[key]; - } - return true - } else if (hasOwn(hash, altKey)) { - res[key] = hash[altKey]; - if (!preserve) { - delete hash[altKey]; - } - return true - } - } - return false -} - -/* */ - -// The template compiler attempts to minimize the need for normalization by -// statically analyzing the template at compile time. -// -// For plain HTML markup, normalization can be completely skipped because the -// generated render function is guaranteed to return Array. There are -// two cases where extra normalization is needed: - -// 1. When the children contains components - because a functional component -// may return an Array instead of a single root. In this case, just a simple -// normalization is needed - if any child is an Array, we flatten the whole -// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep -// because functional components already normalize their own children. -function simpleNormalizeChildren (children) { - for (var i = 0; i < children.length; i++) { - if (Array.isArray(children[i])) { - return Array.prototype.concat.apply([], children) - } - } - return children -} - -// 2. When the children contains constructs that always generated nested Arrays, -// e.g.