food-job-executor
parent
462ec58b07
commit
73fe457ac4
@ -0,0 +1,54 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.0.0.xsd">
|
||||||
|
<id>package</id>
|
||||||
|
<formats>
|
||||||
|
<format>dir</format>
|
||||||
|
<format>zip</format>
|
||||||
|
</formats>
|
||||||
|
<includeBaseDirectory>true</includeBaseDirectory>
|
||||||
|
<fileSets>
|
||||||
|
<fileSet>
|
||||||
|
<directory>src/main/bin</directory>
|
||||||
|
<outputDirectory>bin</outputDirectory>
|
||||||
|
</fileSet>
|
||||||
|
<fileSet>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<outputDirectory>conf</outputDirectory>
|
||||||
|
<includes>
|
||||||
|
<include>application.properties</include>
|
||||||
|
<include>xxl-job-executor.properties</include>
|
||||||
|
<include>log4j.properties</include>
|
||||||
|
<include>quartz.properties</include>
|
||||||
|
<include>logback.xml</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
<fileSet>
|
||||||
|
<directory>src/main/conf</directory>
|
||||||
|
<outputDirectory>conf</outputDirectory>
|
||||||
|
</fileSet>
|
||||||
|
<fileSet>
|
||||||
|
<directory>src/main/logs</directory>
|
||||||
|
<outputDirectory>logs</outputDirectory>
|
||||||
|
</fileSet>
|
||||||
|
<fileSet>
|
||||||
|
<directory>src/main/lib</directory>
|
||||||
|
<outputDirectory>lib</outputDirectory>
|
||||||
|
</fileSet>
|
||||||
|
<fileSet>
|
||||||
|
<directory>src/main/temp</directory>
|
||||||
|
<outputDirectory>temp</outputDirectory>
|
||||||
|
</fileSet>
|
||||||
|
<fileSet>
|
||||||
|
<directory>src/main/webapps</directory>
|
||||||
|
<outputDirectory>webapps</outputDirectory>
|
||||||
|
</fileSet>
|
||||||
|
</fileSets>
|
||||||
|
<files>
|
||||||
|
<file>
|
||||||
|
<source>${project.build.directory}/${artifactId}-${version}.jar</source>
|
||||||
|
<outputDirectory>lib</outputDirectory>
|
||||||
|
<destName>${artifactId}-${version}.jar</destName>
|
||||||
|
</file>
|
||||||
|
</files>
|
||||||
|
</assembly>
|
@ -0,0 +1,86 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||||
|
<component name="FacetManager">
|
||||||
|
<facet type="Spring" name="Spring">
|
||||||
|
<configuration />
|
||||||
|
</facet>
|
||||||
|
<facet type="web" name="Web">
|
||||||
|
<configuration>
|
||||||
|
<webroots />
|
||||||
|
<sourceRoots>
|
||||||
|
<root url="file://$MODULE_DIR$/src/main/java" />
|
||||||
|
<root url="file://$MODULE_DIR$/src/main/resources" />
|
||||||
|
</sourceRoots>
|
||||||
|
</configuration>
|
||||||
|
</facet>
|
||||||
|
</component>
|
||||||
|
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||||
|
<output url="file://$MODULE_DIR$/target/classes" />
|
||||||
|
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:1.4.3.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:1.4.3.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:1.4.3.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:1.4.3.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.1.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.1.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.22" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.22" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.slf4j:log4j-over-slf4j:1.7.22" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-core:4.3.5.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.17" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:1.4.3.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:1.4.3.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:8.5.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:8.5.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.hibernate:hibernate-validator:5.2.4.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: javax.validation:validation-api:1.1.0.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.0.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.3.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.8.5" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.5" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.8.5" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-web:4.3.5.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-aop:4.3.5.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-beans:4.3.5.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.3.5.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-expression:4.3.5.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:1.4.3.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:1.4.3.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:1.4.3.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.2.0" level="project" />
|
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.2.1" level="project" />
|
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.1" level="project" />
|
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.3" level="project" />
|
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:2.5.0" level="project" />
|
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:1.10.19" level="project" />
|
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.1" level="project" />
|
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
|
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
|
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.3.0" level="project" />
|
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.json:json:20140107" level="project" />
|
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:4.3.5.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.jwsaas:common-utils:1.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-context:4.3.5.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.22" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.mchange:c3p0:0.9.5.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.mchange:mchange-commons-java:0.2.11" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.4.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.squareup.okio:okio:1.9.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.jwsaas:jw-job-core:1.0.0" level="project" />
|
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
|
||||||
|
</component>
|
||||||
|
</module>
|
@ -0,0 +1,140 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
|
||||||
|
rem http://www.tanukisoftware.com
|
||||||
|
rem All rights reserved.
|
||||||
|
rem
|
||||||
|
rem This software is the proprietary information of Tanuki Software.
|
||||||
|
rem You shall use it only in accordance with the terms of the
|
||||||
|
rem license agreement you entered into with Tanuki Software.
|
||||||
|
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
|
||||||
|
rem
|
||||||
|
rem Java Service Wrapper general passthrough startup script.
|
||||||
|
rem
|
||||||
|
|
||||||
|
rem -----------------------------------------------------------------------------
|
||||||
|
rem These settings can be modified to fit the needs of your application
|
||||||
|
rem Optimized for use with version 3.5.28 of the Wrapper.
|
||||||
|
|
||||||
|
rem The base name for the Wrapper binary.
|
||||||
|
set _WRAPPER_BASE=wrapper
|
||||||
|
|
||||||
|
rem The directory where the Wrapper binary (.exe) file is located. It can be
|
||||||
|
rem either an absolute or a relative path. If the path contains any special
|
||||||
|
rem characters, please make sure to quote the variable.
|
||||||
|
set _WRAPPER_DIR=
|
||||||
|
|
||||||
|
rem The name and location of the Wrapper configuration file. This will be used
|
||||||
|
rem if the user does not specify a configuration file as the first parameter to
|
||||||
|
rem this script.
|
||||||
|
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
|
||||||
|
|
||||||
|
rem Makes it possible to override the Wrapper configuration file by specifying it
|
||||||
|
rem as the first parameter.
|
||||||
|
rem set _WRAPPER_CONF_OVERRIDE=true
|
||||||
|
|
||||||
|
rem _PASS_THROUGH tells the script to pass all parameters through to the JVM
|
||||||
|
rem as is.
|
||||||
|
rem If _WRAPPER_CONF_OVERRIDE is specified then all parameters will be passed.
|
||||||
|
rem If not set then all parameters starting with the second will be passed.
|
||||||
|
set _PASS_THROUGH=true
|
||||||
|
|
||||||
|
rem Do not modify anything beyond this point
|
||||||
|
rem -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Resolve the real path of the wrapper.exe
|
||||||
|
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
|
||||||
|
rem can be hard-coded below and the following test removed.
|
||||||
|
rem
|
||||||
|
if "%OS%"=="Windows_NT" goto nt
|
||||||
|
echo This script only works with NT-based versions of Windows.
|
||||||
|
goto :eof
|
||||||
|
|
||||||
|
:nt
|
||||||
|
rem Find the application home.
|
||||||
|
rem if no path path specified do the default action
|
||||||
|
IF not DEFINED _WRAPPER_DIR goto dir_undefined
|
||||||
|
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
|
||||||
|
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
|
||||||
|
rem check if absolute path
|
||||||
|
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
|
||||||
|
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
|
||||||
|
rem everythig else means relative path
|
||||||
|
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
|
||||||
|
goto pathfound
|
||||||
|
|
||||||
|
:dir_undefined
|
||||||
|
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
|
||||||
|
set _REALPATH="%~dp0"
|
||||||
|
goto pathfound
|
||||||
|
:absolute_path
|
||||||
|
rem Use an absolute path to the wrapper
|
||||||
|
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
|
||||||
|
|
||||||
|
:pathfound
|
||||||
|
rem
|
||||||
|
rem Decide on the specific Wrapper binary to use (See delta-pack)
|
||||||
|
rem
|
||||||
|
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
|
||||||
|
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
|
||||||
|
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
|
||||||
|
goto search
|
||||||
|
:amd64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
|
||||||
|
goto search
|
||||||
|
:ia64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
|
||||||
|
goto search
|
||||||
|
:search
|
||||||
|
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
|
||||||
|
if exist %_WRAPPER_EXE% goto conf
|
||||||
|
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
|
||||||
|
if exist %_WRAPPER_EXE% goto conf
|
||||||
|
echo Unable to locate a Wrapper executable using any of the following names:
|
||||||
|
echo %_WRAPPER_L_EXE%
|
||||||
|
echo %_WRAPPER_EXE%
|
||||||
|
pause
|
||||||
|
goto :eof
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Find the wrapper.conf
|
||||||
|
rem
|
||||||
|
:conf
|
||||||
|
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
|
||||||
|
set _WRAPPER_CONF="%~f1"
|
||||||
|
if not [%_WRAPPER_CONF%]==[""] (
|
||||||
|
shift
|
||||||
|
goto :startup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Start the Wrapper
|
||||||
|
rem
|
||||||
|
:startup
|
||||||
|
if not [%_PASS_THROUGH%]==[true] (
|
||||||
|
if not [%1]==[] (
|
||||||
|
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
rem Collect the application parameters
|
||||||
|
:parameters
|
||||||
|
set _PARAMETERS=%_PARAMETERS% %1
|
||||||
|
shift
|
||||||
|
if not [%1]==[] goto :parameters
|
||||||
|
|
||||||
|
if not [%_PASS_THROUGH%]==[true] (
|
||||||
|
%_WRAPPER_EXE% -i %_WRAPPER_CONF%
|
||||||
|
) else (
|
||||||
|
%_WRAPPER_EXE% -i %_WRAPPER_CONF% -- %_PARAMETERS%
|
||||||
|
)
|
||||||
|
if not errorlevel 1 goto :eof
|
||||||
|
pause
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,135 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
|
||||||
|
rem http://www.tanukisoftware.com
|
||||||
|
rem All rights reserved.
|
||||||
|
rem
|
||||||
|
rem This software is the proprietary information of Tanuki Software.
|
||||||
|
rem You shall use it only in accordance with the terms of the
|
||||||
|
rem license agreement you entered into with Tanuki Software.
|
||||||
|
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
|
||||||
|
rem
|
||||||
|
rem Java Service Wrapper general startup script.
|
||||||
|
rem
|
||||||
|
|
||||||
|
rem -----------------------------------------------------------------------------
|
||||||
|
rem These settings can be modified to fit the needs of your application
|
||||||
|
rem Optimized for use with version 3.5.28 of the Wrapper.
|
||||||
|
|
||||||
|
rem The base name for the Wrapper binary.
|
||||||
|
set _WRAPPER_BASE=wrapper
|
||||||
|
|
||||||
|
rem The directory where the Wrapper binary (.exe) file is located. It can be
|
||||||
|
rem either an absolute or a relative path. If the path contains any special
|
||||||
|
rem characters, please make sure to quote the variable.
|
||||||
|
set _WRAPPER_DIR=
|
||||||
|
|
||||||
|
rem The name and location of the Wrapper configuration file. This will be used
|
||||||
|
rem if the user does not specify a configuration file as the first parameter to
|
||||||
|
rem this script.
|
||||||
|
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
|
||||||
|
|
||||||
|
rem Makes it possible to override the Wrapper configuration file by specifying it
|
||||||
|
rem as the first parameter.
|
||||||
|
rem set _WRAPPER_CONF_OVERRIDE=true
|
||||||
|
|
||||||
|
rem Note that it is only possible to pass parameters through to the JVM when
|
||||||
|
rem installing the service, or when running in a console.
|
||||||
|
|
||||||
|
rem Do not modify anything beyond this point
|
||||||
|
rem -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Resolve the real path of the wrapper.exe
|
||||||
|
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
|
||||||
|
rem can be hard-coded below and the following test removed.
|
||||||
|
rem
|
||||||
|
if "%OS%"=="Windows_NT" goto nt
|
||||||
|
echo This script only works with NT-based versions of Windows.
|
||||||
|
goto :eof
|
||||||
|
|
||||||
|
:nt
|
||||||
|
rem Find the application home.
|
||||||
|
rem if no path path specified do the default action
|
||||||
|
IF not DEFINED _WRAPPER_DIR goto dir_undefined
|
||||||
|
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
|
||||||
|
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
|
||||||
|
rem check if absolute path
|
||||||
|
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
|
||||||
|
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
|
||||||
|
rem everythig else means relative path
|
||||||
|
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
|
||||||
|
goto pathfound
|
||||||
|
|
||||||
|
:dir_undefined
|
||||||
|
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
|
||||||
|
set _REALPATH="%~dp0"
|
||||||
|
goto pathfound
|
||||||
|
:absolute_path
|
||||||
|
rem Use an absolute path to the wrapper
|
||||||
|
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
|
||||||
|
|
||||||
|
:pathfound
|
||||||
|
rem
|
||||||
|
rem Decide on the specific Wrapper binary to use (See delta-pack)
|
||||||
|
rem
|
||||||
|
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
|
||||||
|
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
|
||||||
|
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
|
||||||
|
goto search
|
||||||
|
:amd64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
|
||||||
|
goto search
|
||||||
|
:ia64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
|
||||||
|
goto search
|
||||||
|
:search
|
||||||
|
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
|
||||||
|
if exist %_WRAPPER_EXE% goto conf
|
||||||
|
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
|
||||||
|
if exist %_WRAPPER_EXE% goto conf
|
||||||
|
echo Unable to locate a Wrapper executable using any of the following names:
|
||||||
|
echo %_WRAPPER_L_EXE%
|
||||||
|
echo %_WRAPPER_EXE%
|
||||||
|
pause
|
||||||
|
goto :eof
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Find the wrapper.conf
|
||||||
|
rem
|
||||||
|
:conf
|
||||||
|
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
|
||||||
|
set _WRAPPER_CONF="%~f1"
|
||||||
|
if not [%_WRAPPER_CONF%]==[""] (
|
||||||
|
shift
|
||||||
|
goto :startup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Start the Wrapper
|
||||||
|
rem
|
||||||
|
:startup
|
||||||
|
if not [%_PASS_THROUGH%]==[true] (
|
||||||
|
if not [%1]==[] (
|
||||||
|
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
rem Collect the application parameters
|
||||||
|
:parameters
|
||||||
|
set _PARAMETERS=%_PARAMETERS% %1
|
||||||
|
shift
|
||||||
|
if not [%1]==[] goto :parameters
|
||||||
|
|
||||||
|
if not [%_PASS_THROUGH%]==[true] (
|
||||||
|
%_WRAPPER_EXE% -a %_WRAPPER_CONF%
|
||||||
|
) else (
|
||||||
|
%_WRAPPER_EXE% -a %_WRAPPER_CONF% -- %_PARAMETERS%
|
||||||
|
)
|
||||||
|
if not errorlevel 1 goto :eof
|
||||||
|
pause
|
@ -0,0 +1,135 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
|
||||||
|
rem http://www.tanukisoftware.com
|
||||||
|
rem All rights reserved.
|
||||||
|
rem
|
||||||
|
rem This software is the proprietary information of Tanuki Software.
|
||||||
|
rem You shall use it only in accordance with the terms of the
|
||||||
|
rem license agreement you entered into with Tanuki Software.
|
||||||
|
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
|
||||||
|
rem
|
||||||
|
rem Java Service Wrapper general startup script.
|
||||||
|
rem
|
||||||
|
|
||||||
|
rem -----------------------------------------------------------------------------
|
||||||
|
rem These settings can be modified to fit the needs of your application
|
||||||
|
rem Optimized for use with version 3.5.28 of the Wrapper.
|
||||||
|
|
||||||
|
rem The base name for the Wrapper binary.
|
||||||
|
set _WRAPPER_BASE=wrapper
|
||||||
|
|
||||||
|
rem The directory where the Wrapper binary (.exe) file is located. It can be
|
||||||
|
rem either an absolute or a relative path. If the path contains any special
|
||||||
|
rem characters, please make sure to quote the variable.
|
||||||
|
set _WRAPPER_DIR=
|
||||||
|
|
||||||
|
rem The name and location of the Wrapper configuration file. This will be used
|
||||||
|
rem if the user does not specify a configuration file as the first parameter to
|
||||||
|
rem this script.
|
||||||
|
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
|
||||||
|
|
||||||
|
rem Makes it possible to override the Wrapper configuration file by specifying it
|
||||||
|
rem as the first parameter.
|
||||||
|
rem set _WRAPPER_CONF_OVERRIDE=true
|
||||||
|
|
||||||
|
rem Note that it is only possible to pass parameters through to the JVM when
|
||||||
|
rem installing the service, or when running in a console.
|
||||||
|
|
||||||
|
rem Do not modify anything beyond this point
|
||||||
|
rem -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Resolve the real path of the wrapper.exe
|
||||||
|
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
|
||||||
|
rem can be hard-coded below and the following test removed.
|
||||||
|
rem
|
||||||
|
if "%OS%"=="Windows_NT" goto nt
|
||||||
|
echo This script only works with NT-based versions of Windows.
|
||||||
|
goto :eof
|
||||||
|
|
||||||
|
:nt
|
||||||
|
rem Find the application home.
|
||||||
|
rem if no path path specified do the default action
|
||||||
|
IF not DEFINED _WRAPPER_DIR goto dir_undefined
|
||||||
|
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
|
||||||
|
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
|
||||||
|
rem check if absolute path
|
||||||
|
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
|
||||||
|
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
|
||||||
|
rem everythig else means relative path
|
||||||
|
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
|
||||||
|
goto pathfound
|
||||||
|
|
||||||
|
:dir_undefined
|
||||||
|
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
|
||||||
|
set _REALPATH="%~dp0"
|
||||||
|
goto pathfound
|
||||||
|
:absolute_path
|
||||||
|
rem Use an absolute path to the wrapper
|
||||||
|
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
|
||||||
|
|
||||||
|
:pathfound
|
||||||
|
rem
|
||||||
|
rem Decide on the specific Wrapper binary to use (See delta-pack)
|
||||||
|
rem
|
||||||
|
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
|
||||||
|
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
|
||||||
|
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
|
||||||
|
goto search
|
||||||
|
:amd64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
|
||||||
|
goto search
|
||||||
|
:ia64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
|
||||||
|
goto search
|
||||||
|
:search
|
||||||
|
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
|
||||||
|
if exist %_WRAPPER_EXE% goto conf
|
||||||
|
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
|
||||||
|
if exist %_WRAPPER_EXE% goto conf
|
||||||
|
echo Unable to locate a Wrapper executable using any of the following names:
|
||||||
|
echo %_WRAPPER_L_EXE%
|
||||||
|
echo %_WRAPPER_EXE%
|
||||||
|
pause
|
||||||
|
goto :eof
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Find the wrapper.conf
|
||||||
|
rem
|
||||||
|
:conf
|
||||||
|
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
|
||||||
|
set _WRAPPER_CONF="%~f1"
|
||||||
|
if not [%_WRAPPER_CONF%]==[""] (
|
||||||
|
shift
|
||||||
|
goto :startup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Start the Wrapper
|
||||||
|
rem
|
||||||
|
:startup
|
||||||
|
if not [%_PASS_THROUGH%]==[true] (
|
||||||
|
if not [%1]==[] (
|
||||||
|
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
rem Collect the application parameters
|
||||||
|
:parameters
|
||||||
|
set _PARAMETERS=%_PARAMETERS% %1
|
||||||
|
shift
|
||||||
|
if not [%1]==[] goto :parameters
|
||||||
|
|
||||||
|
if not [%_PASS_THROUGH%]==[true] (
|
||||||
|
%_WRAPPER_EXE% -q %_WRAPPER_CONF%
|
||||||
|
) else (
|
||||||
|
%_WRAPPER_EXE% -q %_WRAPPER_CONF% -- %_PARAMETERS%
|
||||||
|
)
|
||||||
|
if not errorlevel 1 goto :eof
|
||||||
|
pause
|
@ -0,0 +1,135 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
|
||||||
|
rem http://www.tanukisoftware.com
|
||||||
|
rem All rights reserved.
|
||||||
|
rem
|
||||||
|
rem This software is the proprietary information of Tanuki Software.
|
||||||
|
rem You shall use it only in accordance with the terms of the
|
||||||
|
rem license agreement you entered into with Tanuki Software.
|
||||||
|
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
|
||||||
|
rem
|
||||||
|
rem Java Service Wrapper general startup script.
|
||||||
|
rem
|
||||||
|
|
||||||
|
rem -----------------------------------------------------------------------------
|
||||||
|
rem These settings can be modified to fit the needs of your application
|
||||||
|
rem Optimized for use with version 3.5.28 of the Wrapper.
|
||||||
|
|
||||||
|
rem The base name for the Wrapper binary.
|
||||||
|
set _WRAPPER_BASE=wrapper
|
||||||
|
|
||||||
|
rem The directory where the Wrapper binary (.exe) file is located. It can be
|
||||||
|
rem either an absolute or a relative path. If the path contains any special
|
||||||
|
rem characters, please make sure to quote the variable.
|
||||||
|
set _WRAPPER_DIR=
|
||||||
|
|
||||||
|
rem The name and location of the Wrapper configuration file. This will be used
|
||||||
|
rem if the user does not specify a configuration file as the first parameter to
|
||||||
|
rem this script.
|
||||||
|
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
|
||||||
|
|
||||||
|
rem Makes it possible to override the Wrapper configuration file by specifying it
|
||||||
|
rem as the first parameter.
|
||||||
|
rem set _WRAPPER_CONF_OVERRIDE=true
|
||||||
|
|
||||||
|
rem Note that it is only possible to pass parameters through to the JVM when
|
||||||
|
rem installing the service, or when running in a console.
|
||||||
|
|
||||||
|
rem Do not modify anything beyond this point
|
||||||
|
rem -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Resolve the real path of the wrapper.exe
|
||||||
|
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
|
||||||
|
rem can be hard-coded below and the following test removed.
|
||||||
|
rem
|
||||||
|
if "%OS%"=="Windows_NT" goto nt
|
||||||
|
echo This script only works with NT-based versions of Windows.
|
||||||
|
goto :eof
|
||||||
|
|
||||||
|
:nt
|
||||||
|
rem Find the application home.
|
||||||
|
rem if no path path specified do the default action
|
||||||
|
IF not DEFINED _WRAPPER_DIR goto dir_undefined
|
||||||
|
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
|
||||||
|
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
|
||||||
|
rem check if absolute path
|
||||||
|
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
|
||||||
|
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
|
||||||
|
rem everythig else means relative path
|
||||||
|
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
|
||||||
|
goto pathfound
|
||||||
|
|
||||||
|
:dir_undefined
|
||||||
|
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
|
||||||
|
set _REALPATH="%~dp0"
|
||||||
|
goto pathfound
|
||||||
|
:absolute_path
|
||||||
|
rem Use an absolute path to the wrapper
|
||||||
|
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
|
||||||
|
|
||||||
|
:pathfound
|
||||||
|
rem
|
||||||
|
rem Decide on the specific Wrapper binary to use (See delta-pack)
|
||||||
|
rem
|
||||||
|
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
|
||||||
|
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
|
||||||
|
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
|
||||||
|
goto search
|
||||||
|
:amd64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
|
||||||
|
goto search
|
||||||
|
:ia64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
|
||||||
|
goto search
|
||||||
|
:search
|
||||||
|
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
|
||||||
|
if exist %_WRAPPER_EXE% goto conf
|
||||||
|
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
|
||||||
|
if exist %_WRAPPER_EXE% goto conf
|
||||||
|
echo Unable to locate a Wrapper executable using any of the following names:
|
||||||
|
echo %_WRAPPER_L_EXE%
|
||||||
|
echo %_WRAPPER_EXE%
|
||||||
|
pause
|
||||||
|
goto :eof
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Find the wrapper.conf
|
||||||
|
rem
|
||||||
|
:conf
|
||||||
|
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
|
||||||
|
set _WRAPPER_CONF="%~f1"
|
||||||
|
if not [%_WRAPPER_CONF%]==[""] (
|
||||||
|
shift
|
||||||
|
goto :startup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Start the Wrapper
|
||||||
|
rem
|
||||||
|
:startup
|
||||||
|
if not [%_PASS_THROUGH%]==[true] (
|
||||||
|
if not [%1]==[] (
|
||||||
|
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
rem Collect the application parameters
|
||||||
|
:parameters
|
||||||
|
set _PARAMETERS=%_PARAMETERS% %1
|
||||||
|
shift
|
||||||
|
if not [%1]==[] goto :parameters
|
||||||
|
|
||||||
|
if not [%_PASS_THROUGH%]==[true] (
|
||||||
|
%_WRAPPER_EXE% -e %_WRAPPER_CONF%
|
||||||
|
) else (
|
||||||
|
%_WRAPPER_EXE% -e %_WRAPPER_CONF% -- %_PARAMETERS%
|
||||||
|
)
|
||||||
|
if not errorlevel 1 goto :eof
|
||||||
|
pause
|
@ -0,0 +1,156 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
|
||||||
|
rem http://www.tanukisoftware.com
|
||||||
|
rem All rights reserved.
|
||||||
|
rem
|
||||||
|
rem This software is the proprietary information of Tanuki Software.
|
||||||
|
rem You shall use it only in accordance with the terms of the
|
||||||
|
rem license agreement you entered into with Tanuki Software.
|
||||||
|
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
|
||||||
|
rem
|
||||||
|
rem Java Service Wrapper general passthrough startup script.
|
||||||
|
rem
|
||||||
|
|
||||||
|
rem -----------------------------------------------------------------------------
|
||||||
|
rem These settings can be modified to fit the needs of your application
|
||||||
|
rem Optimized for use with version 3.5.28 of the Wrapper.
|
||||||
|
rem
|
||||||
|
rem ********************************************************************
|
||||||
|
rem NOTE - This script has been modified to run the TestWrapper sample
|
||||||
|
rem application and should NOT be used as a base for your own
|
||||||
|
rem applications. All of the documentation assumes that you are
|
||||||
|
rem working from the default source script:
|
||||||
|
rem WRAPPER_HOME/src/bin/App.bat.in
|
||||||
|
rem ********************************************************************
|
||||||
|
rem
|
||||||
|
rem ********************************************************************
|
||||||
|
rem NOTE - This script has been modified to run the TestWrapper sample
|
||||||
|
rem application and should NOT be used as a base for your own
|
||||||
|
rem applications. All of the documentation assumes that you are
|
||||||
|
rem working from the default source script:
|
||||||
|
rem WRAPPER_HOME/src/bin/App.bat.in
|
||||||
|
rem ********************************************************************
|
||||||
|
|
||||||
|
rem The base name for the Wrapper binary.
|
||||||
|
set _WRAPPER_BASE=wrapper
|
||||||
|
|
||||||
|
rem The directory where the Wrapper binary (.exe) file is located. It can be
|
||||||
|
rem either an absolute or a relative path. If the path contains any special
|
||||||
|
rem characters, please make sure to quote the variable.
|
||||||
|
set _WRAPPER_DIR=
|
||||||
|
|
||||||
|
rem The name and location of the Wrapper configuration file. This will be used
|
||||||
|
rem if the user does not specify a configuration file as the first parameter to
|
||||||
|
rem this script.
|
||||||
|
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
|
||||||
|
|
||||||
|
rem Makes it possible to override the Wrapper configuration file by specifying it
|
||||||
|
rem as the first parameter.
|
||||||
|
rem set _WRAPPER_CONF_OVERRIDE=true
|
||||||
|
|
||||||
|
rem _PASS_THROUGH tells the script to pass all parameters through to the JVM
|
||||||
|
rem as is.
|
||||||
|
rem If _WRAPPER_CONF_OVERRIDE is specified then all parameters will be passed.
|
||||||
|
rem If not set then all parameters starting with the second will be passed.
|
||||||
|
set _PASS_THROUGH=true
|
||||||
|
|
||||||
|
rem Do not modify anything beyond this point
|
||||||
|
rem -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Resolve the real path of the wrapper.exe
|
||||||
|
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
|
||||||
|
rem can be hard-coded below and the following test removed.
|
||||||
|
rem
|
||||||
|
if "%OS%"=="Windows_NT" goto nt
|
||||||
|
echo This script only works with NT-based versions of Windows.
|
||||||
|
goto :eof
|
||||||
|
|
||||||
|
:nt
|
||||||
|
rem Find the application home.
|
||||||
|
rem if no path path specified do the default action
|
||||||
|
IF not DEFINED _WRAPPER_DIR goto dir_undefined
|
||||||
|
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
|
||||||
|
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
|
||||||
|
rem check if absolute path
|
||||||
|
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
|
||||||
|
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
|
||||||
|
rem everythig else means relative path
|
||||||
|
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
|
||||||
|
goto pathfound
|
||||||
|
|
||||||
|
:dir_undefined
|
||||||
|
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
|
||||||
|
set _REALPATH="%~dp0"
|
||||||
|
goto pathfound
|
||||||
|
:absolute_path
|
||||||
|
rem Use an absolute path to the wrapper
|
||||||
|
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
|
||||||
|
|
||||||
|
:pathfound
|
||||||
|
rem
|
||||||
|
rem Decide on the specific Wrapper binary to use (See delta-pack)
|
||||||
|
rem
|
||||||
|
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
|
||||||
|
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
|
||||||
|
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
|
||||||
|
goto search
|
||||||
|
:amd64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
|
||||||
|
goto search
|
||||||
|
:ia64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
|
||||||
|
goto search
|
||||||
|
:search
|
||||||
|
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
|
||||||
|
if exist %_WRAPPER_EXE% goto conf
|
||||||
|
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
|
||||||
|
if exist %_WRAPPER_EXE% goto conf
|
||||||
|
echo Unable to locate a Wrapper executable using any of the following names:
|
||||||
|
echo %_WRAPPER_L_EXE%
|
||||||
|
echo %_WRAPPER_EXE%
|
||||||
|
pause
|
||||||
|
goto :eof
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Find the wrapper.conf
|
||||||
|
rem
|
||||||
|
:conf
|
||||||
|
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
|
||||||
|
set _WRAPPER_CONF="%~f1"
|
||||||
|
if not [%_WRAPPER_CONF%]==[""] (
|
||||||
|
shift
|
||||||
|
goto :startup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Start the Wrapper
|
||||||
|
rem
|
||||||
|
:startup
|
||||||
|
if not [%_PASS_THROUGH%]==[true] (
|
||||||
|
if not [%1]==[] (
|
||||||
|
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
rem Collect the application parameters
|
||||||
|
:parameters
|
||||||
|
set _PARAMETERS=%_PARAMETERS% %1
|
||||||
|
shift
|
||||||
|
if not [%1]==[] goto :parameters
|
||||||
|
|
||||||
|
if not [%_PASS_THROUGH%]==[true] (
|
||||||
|
%_WRAPPER_EXE% -c %_WRAPPER_CONF%
|
||||||
|
) else (
|
||||||
|
%_WRAPPER_EXE% -c %_WRAPPER_CONF% -- %_PARAMETERS%
|
||||||
|
)
|
||||||
|
if not errorlevel 1 goto :eof
|
||||||
|
pause
|
||||||
|
|
||||||
|
|
@ -0,0 +1,135 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
|
||||||
|
rem http://www.tanukisoftware.com
|
||||||
|
rem All rights reserved.
|
||||||
|
rem
|
||||||
|
rem This software is the proprietary information of Tanuki Software.
|
||||||
|
rem You shall use it only in accordance with the terms of the
|
||||||
|
rem license agreement you entered into with Tanuki Software.
|
||||||
|
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
|
||||||
|
rem
|
||||||
|
rem Java Service Wrapper general startup script.
|
||||||
|
rem
|
||||||
|
|
||||||
|
rem -----------------------------------------------------------------------------
|
||||||
|
rem These settings can be modified to fit the needs of your application
|
||||||
|
rem Optimized for use with version 3.5.28 of the Wrapper.
|
||||||
|
|
||||||
|
rem The base name for the Wrapper binary.
|
||||||
|
set _WRAPPER_BASE=wrapper
|
||||||
|
|
||||||
|
rem The directory where the Wrapper binary (.exe) file is located. It can be
|
||||||
|
rem either an absolute or a relative path. If the path contains any special
|
||||||
|
rem characters, please make sure to quote the variable.
|
||||||
|
set _WRAPPER_DIR=
|
||||||
|
|
||||||
|
rem The name and location of the Wrapper configuration file. This will be used
|
||||||
|
rem if the user does not specify a configuration file as the first parameter to
|
||||||
|
rem this script.
|
||||||
|
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
|
||||||
|
|
||||||
|
rem Makes it possible to override the Wrapper configuration file by specifying it
|
||||||
|
rem as the first parameter.
|
||||||
|
rem set _WRAPPER_CONF_OVERRIDE=true
|
||||||
|
|
||||||
|
rem Note that it is only possible to pass parameters through to the JVM when
|
||||||
|
rem installing the service, or when running in a console.
|
||||||
|
|
||||||
|
rem Do not modify anything beyond this point
|
||||||
|
rem -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Resolve the real path of the wrapper.exe
|
||||||
|
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
|
||||||
|
rem can be hard-coded below and the following test removed.
|
||||||
|
rem
|
||||||
|
if "%OS%"=="Windows_NT" goto nt
|
||||||
|
echo This script only works with NT-based versions of Windows.
|
||||||
|
goto :eof
|
||||||
|
|
||||||
|
:nt
|
||||||
|
rem Find the application home.
|
||||||
|
rem if no path path specified do the default action
|
||||||
|
IF not DEFINED _WRAPPER_DIR goto dir_undefined
|
||||||
|
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
|
||||||
|
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
|
||||||
|
rem check if absolute path
|
||||||
|
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
|
||||||
|
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
|
||||||
|
rem everythig else means relative path
|
||||||
|
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
|
||||||
|
goto pathfound
|
||||||
|
|
||||||
|
:dir_undefined
|
||||||
|
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
|
||||||
|
set _REALPATH="%~dp0"
|
||||||
|
goto pathfound
|
||||||
|
:absolute_path
|
||||||
|
rem Use an absolute path to the wrapper
|
||||||
|
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
|
||||||
|
|
||||||
|
:pathfound
|
||||||
|
rem
|
||||||
|
rem Decide on the specific Wrapper binary to use (See delta-pack)
|
||||||
|
rem
|
||||||
|
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
|
||||||
|
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
|
||||||
|
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
|
||||||
|
goto search
|
||||||
|
:amd64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
|
||||||
|
goto search
|
||||||
|
:ia64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
|
||||||
|
goto search
|
||||||
|
:search
|
||||||
|
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
|
||||||
|
if exist %_WRAPPER_EXE% goto conf
|
||||||
|
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
|
||||||
|
if exist %_WRAPPER_EXE% goto conf
|
||||||
|
echo Unable to locate a Wrapper executable using any of the following names:
|
||||||
|
echo %_WRAPPER_L_EXE%
|
||||||
|
echo %_WRAPPER_EXE%
|
||||||
|
pause
|
||||||
|
goto :eof
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Find the wrapper.conf
|
||||||
|
rem
|
||||||
|
:conf
|
||||||
|
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
|
||||||
|
set _WRAPPER_CONF="%~f1"
|
||||||
|
if not [%_WRAPPER_CONF%]==[""] (
|
||||||
|
shift
|
||||||
|
goto :startup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Start the Wrapper
|
||||||
|
rem
|
||||||
|
:startup
|
||||||
|
if not [%_PASS_THROUGH%]==[true] (
|
||||||
|
if not [%1]==[] (
|
||||||
|
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
rem Collect the application parameters
|
||||||
|
:parameters
|
||||||
|
set _PARAMETERS=%_PARAMETERS% %1
|
||||||
|
shift
|
||||||
|
if not [%1]==[] goto :parameters
|
||||||
|
|
||||||
|
if not [%_PASS_THROUGH%]==[true] (
|
||||||
|
%_WRAPPER_EXE% -t %_WRAPPER_CONF%
|
||||||
|
) else (
|
||||||
|
%_WRAPPER_EXE% -t %_WRAPPER_CONF% -- %_PARAMETERS%
|
||||||
|
)
|
||||||
|
if not errorlevel 1 goto :eof
|
||||||
|
pause
|
@ -0,0 +1,135 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
|
||||||
|
rem http://www.tanukisoftware.com
|
||||||
|
rem All rights reserved.
|
||||||
|
rem
|
||||||
|
rem This software is the proprietary information of Tanuki Software.
|
||||||
|
rem You shall use it only in accordance with the terms of the
|
||||||
|
rem license agreement you entered into with Tanuki Software.
|
||||||
|
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
|
||||||
|
rem
|
||||||
|
rem Java Service Wrapper general startup script.
|
||||||
|
rem
|
||||||
|
|
||||||
|
rem -----------------------------------------------------------------------------
|
||||||
|
rem These settings can be modified to fit the needs of your application
|
||||||
|
rem Optimized for use with version 3.5.28 of the Wrapper.
|
||||||
|
|
||||||
|
rem The base name for the Wrapper binary.
|
||||||
|
set _WRAPPER_BASE=wrapper
|
||||||
|
|
||||||
|
rem The directory where the Wrapper binary (.exe) file is located. It can be
|
||||||
|
rem either an absolute or a relative path. If the path contains any special
|
||||||
|
rem characters, please make sure to quote the variable.
|
||||||
|
set _WRAPPER_DIR=
|
||||||
|
|
||||||
|
rem The name and location of the Wrapper configuration file. This will be used
|
||||||
|
rem if the user does not specify a configuration file as the first parameter to
|
||||||
|
rem this script.
|
||||||
|
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
|
||||||
|
|
||||||
|
rem Makes it possible to override the Wrapper configuration file by specifying it
|
||||||
|
rem as the first parameter.
|
||||||
|
rem set _WRAPPER_CONF_OVERRIDE=true
|
||||||
|
|
||||||
|
rem Note that it is only possible to pass parameters through to the JVM when
|
||||||
|
rem installing the service, or when running in a console.
|
||||||
|
|
||||||
|
rem Do not modify anything beyond this point
|
||||||
|
rem -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Resolve the real path of the wrapper.exe
|
||||||
|
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
|
||||||
|
rem can be hard-coded below and the following test removed.
|
||||||
|
rem
|
||||||
|
if "%OS%"=="Windows_NT" goto nt
|
||||||
|
echo This script only works with NT-based versions of Windows.
|
||||||
|
goto :eof
|
||||||
|
|
||||||
|
:nt
|
||||||
|
rem Find the application home.
|
||||||
|
rem if no path path specified do the default action
|
||||||
|
IF not DEFINED _WRAPPER_DIR goto dir_undefined
|
||||||
|
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
|
||||||
|
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
|
||||||
|
rem check if absolute path
|
||||||
|
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
|
||||||
|
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
|
||||||
|
rem everythig else means relative path
|
||||||
|
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
|
||||||
|
goto pathfound
|
||||||
|
|
||||||
|
:dir_undefined
|
||||||
|
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
|
||||||
|
set _REALPATH="%~dp0"
|
||||||
|
goto pathfound
|
||||||
|
:absolute_path
|
||||||
|
rem Use an absolute path to the wrapper
|
||||||
|
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
|
||||||
|
|
||||||
|
:pathfound
|
||||||
|
rem
|
||||||
|
rem Decide on the specific Wrapper binary to use (See delta-pack)
|
||||||
|
rem
|
||||||
|
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
|
||||||
|
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
|
||||||
|
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
|
||||||
|
goto search
|
||||||
|
:amd64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
|
||||||
|
goto search
|
||||||
|
:ia64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
|
||||||
|
goto search
|
||||||
|
:search
|
||||||
|
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
|
||||||
|
if exist %_WRAPPER_EXE% goto conf
|
||||||
|
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
|
||||||
|
if exist %_WRAPPER_EXE% goto conf
|
||||||
|
echo Unable to locate a Wrapper executable using any of the following names:
|
||||||
|
echo %_WRAPPER_L_EXE%
|
||||||
|
echo %_WRAPPER_EXE%
|
||||||
|
pause
|
||||||
|
goto :eof
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Find the wrapper.conf
|
||||||
|
rem
|
||||||
|
:conf
|
||||||
|
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
|
||||||
|
set _WRAPPER_CONF="%~f1"
|
||||||
|
if not [%_WRAPPER_CONF%]==[""] (
|
||||||
|
shift
|
||||||
|
goto :startup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Start the Wrapper
|
||||||
|
rem
|
||||||
|
:startup
|
||||||
|
if not [%_PASS_THROUGH%]==[true] (
|
||||||
|
if not [%1]==[] (
|
||||||
|
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
rem Collect the application parameters
|
||||||
|
:parameters
|
||||||
|
set _PARAMETERS=%_PARAMETERS% %1
|
||||||
|
shift
|
||||||
|
if not [%1]==[] goto :parameters
|
||||||
|
|
||||||
|
if not [%_PASS_THROUGH%]==[true] (
|
||||||
|
%_WRAPPER_EXE% -p %_WRAPPER_CONF%
|
||||||
|
) else (
|
||||||
|
%_WRAPPER_EXE% -p %_WRAPPER_CONF% -- %_PARAMETERS%
|
||||||
|
)
|
||||||
|
if not errorlevel 1 goto :eof
|
||||||
|
pause
|
@ -0,0 +1,135 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
|
||||||
|
rem http://www.tanukisoftware.com
|
||||||
|
rem All rights reserved.
|
||||||
|
rem
|
||||||
|
rem This software is the proprietary information of Tanuki Software.
|
||||||
|
rem You shall use it only in accordance with the terms of the
|
||||||
|
rem license agreement you entered into with Tanuki Software.
|
||||||
|
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
|
||||||
|
rem
|
||||||
|
rem Java Service Wrapper general startup script.
|
||||||
|
rem
|
||||||
|
|
||||||
|
rem -----------------------------------------------------------------------------
|
||||||
|
rem These settings can be modified to fit the needs of your application
|
||||||
|
rem Optimized for use with version 3.5.28 of the Wrapper.
|
||||||
|
|
||||||
|
rem The base name for the Wrapper binary.
|
||||||
|
set _WRAPPER_BASE=wrapper
|
||||||
|
|
||||||
|
rem The directory where the Wrapper binary (.exe) file is located. It can be
|
||||||
|
rem either an absolute or a relative path. If the path contains any special
|
||||||
|
rem characters, please make sure to quote the variable.
|
||||||
|
set _WRAPPER_DIR=
|
||||||
|
|
||||||
|
rem The name and location of the Wrapper configuration file. This will be used
|
||||||
|
rem if the user does not specify a configuration file as the first parameter to
|
||||||
|
rem this script.
|
||||||
|
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
|
||||||
|
|
||||||
|
rem Makes it possible to override the Wrapper configuration file by specifying it
|
||||||
|
rem as the first parameter.
|
||||||
|
rem set _WRAPPER_CONF_OVERRIDE=true
|
||||||
|
|
||||||
|
rem Note that it is only possible to pass parameters through to the JVM when
|
||||||
|
rem installing the service, or when running in a console.
|
||||||
|
|
||||||
|
rem Do not modify anything beyond this point
|
||||||
|
rem -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Resolve the real path of the wrapper.exe
|
||||||
|
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
|
||||||
|
rem can be hard-coded below and the following test removed.
|
||||||
|
rem
|
||||||
|
if "%OS%"=="Windows_NT" goto nt
|
||||||
|
echo This script only works with NT-based versions of Windows.
|
||||||
|
goto :eof
|
||||||
|
|
||||||
|
:nt
|
||||||
|
rem Find the application home.
|
||||||
|
rem if no path path specified do the default action
|
||||||
|
IF not DEFINED _WRAPPER_DIR goto dir_undefined
|
||||||
|
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
|
||||||
|
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
|
||||||
|
rem check if absolute path
|
||||||
|
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
|
||||||
|
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
|
||||||
|
rem everythig else means relative path
|
||||||
|
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
|
||||||
|
goto pathfound
|
||||||
|
|
||||||
|
:dir_undefined
|
||||||
|
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
|
||||||
|
set _REALPATH="%~dp0"
|
||||||
|
goto pathfound
|
||||||
|
:absolute_path
|
||||||
|
rem Use an absolute path to the wrapper
|
||||||
|
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
|
||||||
|
|
||||||
|
:pathfound
|
||||||
|
rem
|
||||||
|
rem Decide on the specific Wrapper binary to use (See delta-pack)
|
||||||
|
rem
|
||||||
|
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
|
||||||
|
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
|
||||||
|
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
|
||||||
|
goto search
|
||||||
|
:amd64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
|
||||||
|
goto search
|
||||||
|
:ia64
|
||||||
|
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
|
||||||
|
goto search
|
||||||
|
:search
|
||||||
|
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
|
||||||
|
if exist %_WRAPPER_EXE% goto conf
|
||||||
|
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
|
||||||
|
if exist %_WRAPPER_EXE% goto conf
|
||||||
|
echo Unable to locate a Wrapper executable using any of the following names:
|
||||||
|
echo %_WRAPPER_L_EXE%
|
||||||
|
echo %_WRAPPER_EXE%
|
||||||
|
pause
|
||||||
|
goto :eof
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Find the wrapper.conf
|
||||||
|
rem
|
||||||
|
:conf
|
||||||
|
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
|
||||||
|
set _WRAPPER_CONF="%~f1"
|
||||||
|
if not [%_WRAPPER_CONF%]==[""] (
|
||||||
|
shift
|
||||||
|
goto :startup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Start the Wrapper
|
||||||
|
rem
|
||||||
|
:startup
|
||||||
|
if not [%_PASS_THROUGH%]==[true] (
|
||||||
|
if not [%1]==[] (
|
||||||
|
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
rem Collect the application parameters
|
||||||
|
:parameters
|
||||||
|
set _PARAMETERS=%_PARAMETERS% %1
|
||||||
|
shift
|
||||||
|
if not [%1]==[] goto :parameters
|
||||||
|
|
||||||
|
if not [%_PASS_THROUGH%]==[true] (
|
||||||
|
%_WRAPPER_EXE% -r %_WRAPPER_CONF%
|
||||||
|
) else (
|
||||||
|
%_WRAPPER_EXE% -r %_WRAPPER_CONF% -- %_PARAMETERS%
|
||||||
|
)
|
||||||
|
if not errorlevel 1 goto :eof
|
||||||
|
pause
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,60 @@
|
|||||||
|
encoding=UTF-8
|
||||||
|
wrapper.lang=zh_CN
|
||||||
|
#using the system default JDK environment variable
|
||||||
|
wrapper.java.command=java
|
||||||
|
#set.JAVA_HOME=/home/jdk1.8.0_65
|
||||||
|
#wrapper.java.command=%JAVA_HOME%/bin/java
|
||||||
|
wrapper.java.command.loglevel=INFO
|
||||||
|
|
||||||
|
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
|
||||||
|
wrapper.java.classpath.1=./
|
||||||
|
wrapper.java.classpath.2=../conf/
|
||||||
|
wrapper.java.classpath.3=../lib/*.jar
|
||||||
|
|
||||||
|
wrapper.java.library.path.1=../lib
|
||||||
|
|
||||||
|
wrapper.java.additional.auto_bits=TRUE
|
||||||
|
#set the default parameters
|
||||||
|
wrapper.java.additional.1=-Xms512m
|
||||||
|
wrapper.java.additional.2=-Xmx1024m
|
||||||
|
wrapper.java.additional.3=-XX:PermSize=256m
|
||||||
|
wrapper.java.additional.4=-XX:MaxPermSize=512m
|
||||||
|
wrapper.java.additional.5=-Djava.net.preferIPv4Stack=true
|
||||||
|
wrapper.java.additional.6=-Dsun.lang.ClassLoader.allowArraySyntax=true
|
||||||
|
|
||||||
|
# Initial Java Heap Size (in MB)
|
||||||
|
wrapper.java.initmemory=128
|
||||||
|
# Maximum Java Heap Size (in MB)
|
||||||
|
wrapper.java.maxmemory=512
|
||||||
|
|
||||||
|
# Application parameters. Add parameters as needed starting from 1
|
||||||
|
wrapper.app.parameter.1=org.springframework.boot.loader.JarLauncher
|
||||||
|
wrapper.app.parameter.2=--spring.config.location=../conf/application.properties
|
||||||
|
wrapper.app.parameter.3=--logging.config=../conf/logback.xml
|
||||||
|
wrapper.app.parameter.4=--logging.path=../logs
|
||||||
|
|
||||||
|
wrapper.filter.trigger.1=java.lang.OutOfMemoryError
|
||||||
|
wrapper.filter.action.1=RESTART
|
||||||
|
|
||||||
|
wrapper.console.format=PM
|
||||||
|
wrapper.console.loglevel=INFO
|
||||||
|
|
||||||
|
wrapper.logfile=../logs/server_YYYYMMDD.log
|
||||||
|
wrapper.logfile.rollmode=DATE
|
||||||
|
wrapper.logfile.format=LPTM
|
||||||
|
wrapper.logfile.loglevel=INFO
|
||||||
|
wrapper.logfile.maxsize=0
|
||||||
|
wrapper.logfile.maxfiles=0
|
||||||
|
wrapper.syslog.loglevel=NONE
|
||||||
|
|
||||||
|
wrapper.ignore_sequence_gaps=TRUE
|
||||||
|
wrapper.pidfile.strict=TRUE
|
||||||
|
|
||||||
|
wrapper.console.title=Food Job Executor Application
|
||||||
|
|
||||||
|
wrapper.name=Food Job Executor
|
||||||
|
wrapper.displayname=Food Job Executor Application
|
||||||
|
wrapper.description=Food Job Executor Application
|
||||||
|
wrapper.ntservice.dependency.1=
|
||||||
|
wrapper.ntservice.starttype=AUTO_START
|
||||||
|
wrapper.ntservice.interactive=false
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.jwsaas;
|
||||||
|
|
||||||
|
public class Constants {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用类型标识,运维系统中全局唯一
|
||||||
|
*/
|
||||||
|
public static final String APP_TYPE_SIGN = "cy2";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开放平台RSA公钥
|
||||||
|
*/
|
||||||
|
public static final String OPEN_API_RSA_PUBLICK_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDEVtinnqO5NvpSul4XRpwc7yQoOobvob8dKCX5K79bns3TTmeGoTwwoXJuJX0KUBF817Tr+DKA4Dd/a5VLTZux3Xww2Lox773lByp7g9kCiUAQK4JDJKu0IdAhGX7pE8ABNRnG0vPQLvwF/mQEt5ItFaxk3gtfWJB2ay5yyQiboQIDAQAB";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开放平台RSA私钥
|
||||||
|
*/
|
||||||
|
public static final String OPEN_API_RSA_PRIVATE_KEY = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMRW2Keeo7k2+lK6XhdGnBzvJCg6hu+hvx0oJfkrv1uezdNOZ4ahPDChcm4lfQpQEXzXtOv4MoDgN39rlUtNm7HdfDDYujHvveUHKnuD2QKJQBArgkMkq7Qh0CEZfukTwAE1GcbS89Au/AX+ZAS3ki0VrGTeC19YkHZrLnLJCJuhAgMBAAECgYEAtQGnvWh4YjF4N7qPMgArvlUNzXSfn95LNdMkpwGY6huOf6dBtBGDTwYYW8l97HsClEi9B+qKjNuo7nS9b23+AS+kfx1dkFzw/slDrD36EUWxbWp4K6NLnEShv5JmX7wPCHGERSRnbgPRp9zchkFtwHP2gaJnkW+6N10cwgPveY0CQQDn+wT3E+QMHola/RMTd1Eef/0RyHcSLaVJKmgZuV5rfHnUa4H+56xZzeboYdfBpgOujnRSNLC/tKmrRfCHfkJ3AkEA2KsaQXshLFIc8zOZtY8fNqGa9nvHUgwqzS6HT23O4YDiQaQgcibMQn+HneGn0sjNxvbMmWi7A8UfYTaY/T7ApwJARLdJmDrPIXvmKgqvHOQKJmO5PgxIoRzeShcCsSQEwQglOnQCFNTha9SfIpThCV641nsiH7u144OLgs1721beLwJARJLyvmK//w0GCJr+PQ5NLLc9GmHWlcswCLx/Ks5wOcLW2Tue4UISR8GhJID04quXJS+bVbpl5i2PXu8uwIgJ5QJAM6UkIzSvovpahuhsdUuGolAtmCmrZ5A/c3A8CWNSWDd9KmBXU+S/Hl5L9snD9IQXlg2saSgJ+zrM510Ohl5RUg==";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.jwsaas;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
import org.springframework.context.annotation.ImportResource;
|
||||||
|
|
||||||
|
@ComponentScan(basePackages = "com.jwsaas")
|
||||||
|
@SpringBootApplication
|
||||||
|
@ImportResource(locations = { "classpath:applicationcontext-xxl-job.xml", "classpath*:META-INF/spring/spring-*.xml" })
|
||||||
|
public class ExecutorApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(ExecutorApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,85 @@
|
|||||||
|
package com.jwsaas.job.executor.service.jobhandler;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.jwsaas.Constants;
|
||||||
|
import com.jwsaas.properties.FoodApiProperties;
|
||||||
|
import com.jwsaas.utils.JSONUtil;
|
||||||
|
import com.jwsaas.utils.SignUtil;
|
||||||
|
import com.xxl.job.core.biz.model.ReturnT;
|
||||||
|
import com.xxl.job.core.handler.IJobHandler;
|
||||||
|
import com.xxl.job.core.handler.annotation.JobHander;
|
||||||
|
import com.xxl.job.core.log.XxlJobLogger;
|
||||||
|
|
||||||
|
import okhttp3.FormBody;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
import org.apache.commons.collections4.MapUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by wanghui on 2017/12/22.
|
||||||
|
*/
|
||||||
|
@JobHander(value = "couponFinishJobHandler")
|
||||||
|
@Service
|
||||||
|
public class CouponFinishJobHandler extends IJobHandler {
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(CouponFinishJobHandler.class);
|
||||||
|
private static String charset = "UTF-8";
|
||||||
|
@Autowired
|
||||||
|
private FoodApiProperties foodApiProperties;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ReturnT<String> execute(String... params) throws Exception {
|
||||||
|
XxlJobLogger.log(Constants.APP_TYPE_SIGN + ": JOB, Coupon Finish .");
|
||||||
|
logger.info(Constants.APP_TYPE_SIGN + ": JOB, Coupon Finish .");
|
||||||
|
|
||||||
|
Map<String, String> paramMap = new HashMap<>();
|
||||||
|
paramMap.put("action", "CouponFinish");
|
||||||
|
String[] temp = null;
|
||||||
|
for (String param : params) {
|
||||||
|
logger.info("param:{}", param);
|
||||||
|
temp = StringUtils.split(param, "#");
|
||||||
|
paramMap.put(temp[0], temp[1]);
|
||||||
|
}
|
||||||
|
String sign = SignUtil.rsaSign(SignUtil.getSignCheckContent(paramMap), Constants.OPEN_API_RSA_PRIVATE_KEY, charset);
|
||||||
|
paramMap.put("sign", sign);
|
||||||
|
|
||||||
|
FormBody.Builder formBody = new FormBody.Builder();
|
||||||
|
paramMap.keySet().stream().forEach(key -> formBody.add(key, MapUtils.getString(paramMap, key, "")));
|
||||||
|
|
||||||
|
String url = foodApiProperties.getServerUrl() + "/open/task";
|
||||||
|
final Request request = new Request.Builder().url(url).post(formBody.build()).build();
|
||||||
|
final Response response = new OkHttpClient().newCall(request).execute();
|
||||||
|
logger.info("response.body:{}----------", response.body());
|
||||||
|
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
result.put("status", 0);
|
||||||
|
result.put("message", "操作失败");
|
||||||
|
|
||||||
|
if (response.isSuccessful()) {
|
||||||
|
String content = response.body().string();
|
||||||
|
logger.info("content:{}----------", content);
|
||||||
|
result = JSONUtil.parseObject(content, new TypeReference<Map<String, Object>>() {
|
||||||
|
});
|
||||||
|
|
||||||
|
if (result.get("status") != null && StringUtils.equals("1", result.get("status").toString())) {
|
||||||
|
// return ReturnT.SUCCESS;
|
||||||
|
return new ReturnT<String>(JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// return ReturnT.FAIL;
|
||||||
|
return new ReturnT<String>(ReturnT.FAIL_CODE, JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,85 @@
|
|||||||
|
package com.jwsaas.job.executor.service.jobhandler;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.jwsaas.Constants;
|
||||||
|
import com.jwsaas.properties.FoodApiProperties;
|
||||||
|
import com.jwsaas.utils.JSONUtil;
|
||||||
|
import com.jwsaas.utils.SignUtil;
|
||||||
|
import com.xxl.job.core.biz.model.ReturnT;
|
||||||
|
import com.xxl.job.core.handler.IJobHandler;
|
||||||
|
import com.xxl.job.core.handler.annotation.JobHander;
|
||||||
|
import com.xxl.job.core.log.XxlJobLogger;
|
||||||
|
import okhttp3.FormBody;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
import org.apache.commons.collections4.MapUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除门店出库流水BAK表记录
|
||||||
|
*/
|
||||||
|
@JobHander(value = "DelProductStoreStockLogJobHandler")
|
||||||
|
@Service
|
||||||
|
public class DelProductStoreStockLogJobHandler extends IJobHandler {
|
||||||
|
|
||||||
|
private static transient Logger logger = LoggerFactory.getLogger(DelProductStoreStockLogJobHandler.class);
|
||||||
|
|
||||||
|
private static String charset = "UTF-8";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FoodApiProperties foodApiProperties;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ReturnT<String> execute(String... params) throws Exception {
|
||||||
|
XxlJobLogger.log(Constants.APP_TYPE_SIGN + ": JOB, DelProductStoreStockLog PriceAdjust .");
|
||||||
|
logger.info(Constants.APP_TYPE_SIGN + ": JOB, DelProductStoreStockLog PriceAdjust .");
|
||||||
|
|
||||||
|
Map<String, String> paramMap = new HashMap<>();
|
||||||
|
paramMap.put("action", "DelProductStoreStockLog");
|
||||||
|
String[] temp = null;
|
||||||
|
for (String param : params) {
|
||||||
|
logger.info("param:{}", param);
|
||||||
|
temp = StringUtils.split(param, "#");
|
||||||
|
paramMap.put(temp[0], temp[1]);
|
||||||
|
}
|
||||||
|
String sign = SignUtil.rsaSign(SignUtil.getSignCheckContent(paramMap), Constants.OPEN_API_RSA_PRIVATE_KEY, charset);
|
||||||
|
paramMap.put("sign", sign);
|
||||||
|
|
||||||
|
FormBody.Builder formBody = new FormBody.Builder();
|
||||||
|
paramMap.keySet().stream().forEach(key -> formBody.add(key, MapUtils.getString(paramMap, key, "")));
|
||||||
|
|
||||||
|
String url = foodApiProperties.getServerUrl() + "/open/task";
|
||||||
|
OkHttpClient okHttpClient = new OkHttpClient.Builder().connectTimeout(1, TimeUnit.SECONDS).readTimeout(10, TimeUnit.SECONDS).build();
|
||||||
|
final Request request = new Request.Builder().url(url).post(formBody.build()).build();
|
||||||
|
final Response response = okHttpClient.newCall(request).execute();
|
||||||
|
logger.info("response.body:{}----------", response.body());
|
||||||
|
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
result.put("status", 0);
|
||||||
|
result.put("message", "操作失败");
|
||||||
|
|
||||||
|
if (response.isSuccessful()) {
|
||||||
|
String content = response.body().string();
|
||||||
|
logger.info("content:{}----------", content);
|
||||||
|
result = JSONUtil.parseObject(content, new TypeReference<Map<String, Object>>() {
|
||||||
|
});
|
||||||
|
if (result.get("status") != null && StringUtils.equals("1", result.get("status").toString())) {
|
||||||
|
// return ReturnT.SUCCESS;
|
||||||
|
return new ReturnT<String>(JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// return ReturnT.FAIL;
|
||||||
|
return new ReturnT<String>(ReturnT.FAIL_CODE, JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,87 @@
|
|||||||
|
package com.jwsaas.job.executor.service.jobhandler;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.commons.collections4.MapUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.jwsaas.Constants;
|
||||||
|
import com.jwsaas.properties.FoodApiProperties;
|
||||||
|
import com.jwsaas.utils.JSONUtil;
|
||||||
|
import com.jwsaas.utils.SignUtil;
|
||||||
|
import com.xxl.job.core.biz.model.ReturnT;
|
||||||
|
import com.xxl.job.core.handler.IJobHandler;
|
||||||
|
import com.xxl.job.core.handler.annotation.JobHander;
|
||||||
|
import com.xxl.job.core.log.XxlJobLogger;
|
||||||
|
|
||||||
|
import okhttp3.FormBody;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品调价任务Handler
|
||||||
|
*/
|
||||||
|
@JobHander(value = "productPriceAdjustJobHandler")
|
||||||
|
@Service
|
||||||
|
public class ProductPriceAdjustJobHandler extends IJobHandler {
|
||||||
|
|
||||||
|
private static transient Logger logger = LoggerFactory.getLogger(ProductPriceAdjustJobHandler.class);
|
||||||
|
|
||||||
|
private static String charset = "UTF-8";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FoodApiProperties foodApiProperties;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ReturnT<String> execute(String... params) throws Exception {
|
||||||
|
XxlJobLogger.log(Constants.APP_TYPE_SIGN + ": JOB, Product PriceAdjust .");
|
||||||
|
logger.info(Constants.APP_TYPE_SIGN + ": JOB, Product PriceAdjust .");
|
||||||
|
|
||||||
|
Map<String, String> paramMap = new HashMap<>();
|
||||||
|
paramMap.put("action", "ProductPriceAdjust");
|
||||||
|
String[] temp = null;
|
||||||
|
for (String param : params) {
|
||||||
|
logger.info("param:{}", param);
|
||||||
|
temp = StringUtils.split(param, "#");
|
||||||
|
paramMap.put(temp[0], temp[1]);
|
||||||
|
}
|
||||||
|
String sign = SignUtil.rsaSign(SignUtil.getSignCheckContent(paramMap), Constants.OPEN_API_RSA_PRIVATE_KEY, charset);
|
||||||
|
paramMap.put("sign", sign);
|
||||||
|
|
||||||
|
FormBody.Builder formBody = new FormBody.Builder();
|
||||||
|
paramMap.keySet().stream().forEach(key -> formBody.add(key, MapUtils.getString(paramMap, key, "")));
|
||||||
|
|
||||||
|
String url = foodApiProperties.getServerUrl() + "/open/task";
|
||||||
|
final Request request = new Request.Builder().url(url).post(formBody.build()).build();
|
||||||
|
final Response response = new OkHttpClient().newCall(request).execute();
|
||||||
|
logger.info("response.body:{}----------", response.body());
|
||||||
|
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
result.put("status", 0);
|
||||||
|
result.put("message", "操作失败");
|
||||||
|
|
||||||
|
if (response.isSuccessful()) {
|
||||||
|
String content = response.body().string();
|
||||||
|
logger.info("content:{}----------", content);
|
||||||
|
result = JSONUtil.parseObject(content, new TypeReference<Map<String, Object>>() {
|
||||||
|
});
|
||||||
|
|
||||||
|
if (result.get("status") != null && StringUtils.equals("1", result.get("status").toString())) {
|
||||||
|
// return ReturnT.SUCCESS;
|
||||||
|
return new ReturnT<String>(JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// return ReturnT.FAIL;
|
||||||
|
return new ReturnT<String>(ReturnT.FAIL_CODE, JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,83 @@
|
|||||||
|
package com.jwsaas.job.executor.service.jobhandler;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.jwsaas.Constants;
|
||||||
|
import com.jwsaas.properties.FoodApiProperties;
|
||||||
|
import com.jwsaas.utils.JSONUtil;
|
||||||
|
import com.jwsaas.utils.SignUtil;
|
||||||
|
import com.xxl.job.core.biz.model.ReturnT;
|
||||||
|
import com.xxl.job.core.handler.IJobHandler;
|
||||||
|
import com.xxl.job.core.handler.annotation.JobHander;
|
||||||
|
import com.xxl.job.core.log.XxlJobLogger;
|
||||||
|
import okhttp3.FormBody;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
import org.apache.commons.collections4.MapUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 汇总门店出库流水
|
||||||
|
*/
|
||||||
|
@JobHander(value = "productStoreOutCollectDayJobHandler")
|
||||||
|
@Service
|
||||||
|
public class ProductStoreOutCollectDayJobHandler extends IJobHandler {
|
||||||
|
|
||||||
|
private static transient Logger logger = LoggerFactory.getLogger(ProductStoreOutCollectDayJobHandler.class);
|
||||||
|
|
||||||
|
private static String charset = "UTF-8";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FoodApiProperties foodApiProperties;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ReturnT<String> execute(String... params) throws Exception {
|
||||||
|
XxlJobLogger.log(Constants.APP_TYPE_SIGN + ": JOB, StoreOutgoingCollect PriceAdjust .");
|
||||||
|
logger.info(Constants.APP_TYPE_SIGN + ": JOB, StoreOutgoingCollect PriceAdjust .");
|
||||||
|
|
||||||
|
Map<String, String> paramMap = new HashMap<>();
|
||||||
|
paramMap.put("action", "StoreOutgoingCollect");
|
||||||
|
String[] temp = null;
|
||||||
|
for (String param : params) {
|
||||||
|
logger.info("param:{}", param);
|
||||||
|
temp = StringUtils.split(param, "#");
|
||||||
|
paramMap.put(temp[0], temp[1]);
|
||||||
|
}
|
||||||
|
String sign = SignUtil.rsaSign(SignUtil.getSignCheckContent(paramMap), Constants.OPEN_API_RSA_PRIVATE_KEY, charset);
|
||||||
|
paramMap.put("sign", sign);
|
||||||
|
|
||||||
|
FormBody.Builder formBody = new FormBody.Builder();
|
||||||
|
paramMap.keySet().stream().forEach(key -> formBody.add(key, MapUtils.getString(paramMap, key, "")));
|
||||||
|
|
||||||
|
String url = foodApiProperties.getServerUrl() + "/open/task";
|
||||||
|
final Request request = new Request.Builder().url(url).post(formBody.build()).build();
|
||||||
|
final Response response = new OkHttpClient().newCall(request).execute();
|
||||||
|
logger.info("response.body:{}----------", response.body());
|
||||||
|
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
result.put("status", 0);
|
||||||
|
result.put("message", "操作失败");
|
||||||
|
|
||||||
|
if (response.isSuccessful()) {
|
||||||
|
String content = response.body().string();
|
||||||
|
logger.info("content:{}----------", content);
|
||||||
|
result = JSONUtil.parseObject(content, new TypeReference<Map<String, Object>>() {
|
||||||
|
});
|
||||||
|
if (result.get("status") != null && StringUtils.equals("1", result.get("status").toString())) {
|
||||||
|
// return ReturnT.SUCCESS;
|
||||||
|
return new ReturnT<String>(JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// return ReturnT.FAIL;
|
||||||
|
return new ReturnT<String>(ReturnT.FAIL_CODE, JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,82 @@
|
|||||||
|
package com.jwsaas.job.executor.service.jobhandler;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.jwsaas.Constants;
|
||||||
|
import com.jwsaas.properties.FoodApiProperties;
|
||||||
|
import com.jwsaas.utils.JSONUtil;
|
||||||
|
import com.jwsaas.utils.SignUtil;
|
||||||
|
import com.xxl.job.core.biz.model.ReturnT;
|
||||||
|
import com.xxl.job.core.handler.IJobHandler;
|
||||||
|
import com.xxl.job.core.handler.annotation.JobHander;
|
||||||
|
import com.xxl.job.core.log.XxlJobLogger;
|
||||||
|
import okhttp3.FormBody;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
import org.apache.commons.collections4.MapUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Administrator on 2019\8\28 0028.
|
||||||
|
*/
|
||||||
|
@JobHander(value = "programPromotionTicketFinishJobHandler")
|
||||||
|
@Service
|
||||||
|
public class ProgramPromotionTicketFinishJobHandler extends IJobHandler {
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(ProgramPromotionTicketFinishJobHandler.class);
|
||||||
|
private static String charset = "UTF-8";
|
||||||
|
@Autowired
|
||||||
|
private FoodApiProperties foodApiProperties;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ReturnT<String> execute(String... params) throws Exception {
|
||||||
|
XxlJobLogger.log(Constants.APP_TYPE_SIGN + ": JOB, ProgramPromotionTicket Finish .");
|
||||||
|
logger.info(Constants.APP_TYPE_SIGN + ": JOB, ProgramPromotionTicket Finish .");
|
||||||
|
|
||||||
|
Map<String, String> paramMap = new HashMap<>();
|
||||||
|
paramMap.put("action", "ProgramPromotionTicketFinish");
|
||||||
|
String[] temp = null;
|
||||||
|
for (String param : params) {
|
||||||
|
logger.info("param:{}", param);
|
||||||
|
temp = StringUtils.split(param, "#");
|
||||||
|
paramMap.put(temp[0], temp[1]);
|
||||||
|
}
|
||||||
|
String sign = SignUtil.rsaSign(SignUtil.getSignCheckContent(paramMap), Constants.OPEN_API_RSA_PRIVATE_KEY, charset);
|
||||||
|
paramMap.put("sign", sign);
|
||||||
|
|
||||||
|
FormBody.Builder formBody = new FormBody.Builder();
|
||||||
|
paramMap.keySet().stream().forEach(key -> formBody.add(key, MapUtils.getString(paramMap, key, "")));
|
||||||
|
|
||||||
|
String url = foodApiProperties.getServerUrl() + "/open/task";
|
||||||
|
final Request request = new Request.Builder().url(url).post(formBody.build()).build();
|
||||||
|
final Response response = new OkHttpClient().newCall(request).execute();
|
||||||
|
logger.info("response.body:{}----------", response.body());
|
||||||
|
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
result.put("status", 0);
|
||||||
|
result.put("message", "操作失败");
|
||||||
|
|
||||||
|
if (response.isSuccessful()) {
|
||||||
|
String content = response.body().string();
|
||||||
|
logger.info("content:{}----------", content);
|
||||||
|
result = JSONUtil.parseObject(content, new TypeReference<Map<String, Object>>() {
|
||||||
|
});
|
||||||
|
|
||||||
|
if (result.get("status") != null && StringUtils.equals("1", result.get("status").toString())) {
|
||||||
|
// return ReturnT.SUCCESS;
|
||||||
|
return new ReturnT<String>(JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// return ReturnT.FAIL;
|
||||||
|
return new ReturnT<String>(ReturnT.FAIL_CODE, JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,83 @@
|
|||||||
|
package com.jwsaas.job.executor.service.jobhandler;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.jwsaas.Constants;
|
||||||
|
import com.jwsaas.properties.FoodApiProperties;
|
||||||
|
import com.jwsaas.utils.JSONUtil;
|
||||||
|
import com.jwsaas.utils.SignUtil;
|
||||||
|
import com.xxl.job.core.biz.model.ReturnT;
|
||||||
|
import com.xxl.job.core.handler.IJobHandler;
|
||||||
|
import com.xxl.job.core.handler.annotation.JobHander;
|
||||||
|
import com.xxl.job.core.log.XxlJobLogger;
|
||||||
|
import okhttp3.FormBody;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
import org.apache.commons.collections4.MapUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Administrator on 2019\8\28 0028.
|
||||||
|
*/
|
||||||
|
|
||||||
|
@JobHander(value = "programPromotionTicketStartJobHandler")
|
||||||
|
@Service
|
||||||
|
public class ProgramPromotionTicketStartJobHandler extends IJobHandler {
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(ProgramPromotionTicketStartJobHandler.class);
|
||||||
|
private static String charset = "UTF-8";
|
||||||
|
@Autowired
|
||||||
|
private FoodApiProperties foodApiProperties;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ReturnT<String> execute(String... params) throws Exception {
|
||||||
|
XxlJobLogger.log(Constants.APP_TYPE_SIGN + ": JOB, ProgramPromotionTicket Start .");
|
||||||
|
logger.info(Constants.APP_TYPE_SIGN + ": JOB, ProgramPromotionTicket Start .");
|
||||||
|
|
||||||
|
Map<String, String> paramMap = new HashMap<>();
|
||||||
|
paramMap.put("action", "ProgramPromotionTicketStart");
|
||||||
|
String[] temp = null;
|
||||||
|
for (String param : params) {
|
||||||
|
logger.info("param:{}", param);
|
||||||
|
temp = StringUtils.split(param, "#");
|
||||||
|
paramMap.put(temp[0], temp[1]);
|
||||||
|
}
|
||||||
|
String sign = SignUtil.rsaSign(SignUtil.getSignCheckContent(paramMap), Constants.OPEN_API_RSA_PRIVATE_KEY, charset);
|
||||||
|
paramMap.put("sign", sign);
|
||||||
|
|
||||||
|
FormBody.Builder formBody = new FormBody.Builder();
|
||||||
|
paramMap.keySet().stream().forEach(key -> formBody.add(key, MapUtils.getString(paramMap, key, "")));
|
||||||
|
|
||||||
|
String url = foodApiProperties.getServerUrl() + "/open/task";
|
||||||
|
final Request request = new Request.Builder().url(url).post(formBody.build()).build();
|
||||||
|
final Response response = new OkHttpClient().newCall(request).execute();
|
||||||
|
logger.info("response.body:{}----------", response.body());
|
||||||
|
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
result.put("status", 0);
|
||||||
|
result.put("message", "操作失败");
|
||||||
|
|
||||||
|
if (response.isSuccessful()) {
|
||||||
|
String content = response.body().string();
|
||||||
|
logger.info("content:{}----------", content);
|
||||||
|
result = JSONUtil.parseObject(content, new TypeReference<Map<String, Object>>() {
|
||||||
|
});
|
||||||
|
|
||||||
|
if (result.get("status") != null && StringUtils.equals("1", result.get("status").toString())) {
|
||||||
|
// return ReturnT.SUCCESS;
|
||||||
|
return new ReturnT<String>(JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// return ReturnT.FAIL;
|
||||||
|
return new ReturnT<String>(ReturnT.FAIL_CODE, JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,83 @@
|
|||||||
|
package com.jwsaas.job.executor.service.jobhandler;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.jwsaas.Constants;
|
||||||
|
import com.jwsaas.properties.FoodApiProperties;
|
||||||
|
import com.jwsaas.utils.JSONUtil;
|
||||||
|
import com.jwsaas.utils.SignUtil;
|
||||||
|
import com.xxl.job.core.biz.model.ReturnT;
|
||||||
|
import com.xxl.job.core.handler.IJobHandler;
|
||||||
|
import com.xxl.job.core.handler.annotation.JobHander;
|
||||||
|
import com.xxl.job.core.log.XxlJobLogger;
|
||||||
|
import okhttp3.FormBody;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
import org.apache.commons.collections4.MapUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Administrator on 2019\8\28 0028.
|
||||||
|
*/
|
||||||
|
@JobHander(value = "programPromotionTicketStatusChangeJobHandler")
|
||||||
|
@Service
|
||||||
|
public class ProgramPromotionTicketStatusChangeJobHandler extends IJobHandler {
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(ProgramPromotionTicketStatusChangeJobHandler.class);
|
||||||
|
private static String charset = "UTF-8";
|
||||||
|
@Autowired
|
||||||
|
private FoodApiProperties foodApiProperties;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ReturnT<String> execute(String... params) throws Exception {
|
||||||
|
XxlJobLogger.log(Constants.APP_TYPE_SIGN + ": JOB, ProgramPromotionTicket Status Change .");
|
||||||
|
logger.info(Constants.APP_TYPE_SIGN + ": JOB, ProgramPromotionTicket Status Change .");
|
||||||
|
|
||||||
|
Map<String, String> paramMap = new HashMap<>();
|
||||||
|
paramMap.put("action", "ProgramPromotionTicketStatusChange");
|
||||||
|
String[] temp = null;
|
||||||
|
for (String param : params) {
|
||||||
|
logger.info("param:{}", param);
|
||||||
|
temp = StringUtils.split(param, "#");
|
||||||
|
paramMap.put(temp[0], temp[1]);
|
||||||
|
}
|
||||||
|
String sign = SignUtil.rsaSign(SignUtil.getSignCheckContent(paramMap), Constants.OPEN_API_RSA_PRIVATE_KEY, charset);
|
||||||
|
paramMap.put("sign", sign);
|
||||||
|
|
||||||
|
FormBody.Builder formBody = new FormBody.Builder();
|
||||||
|
paramMap.keySet().stream().forEach(key -> formBody.add(key, MapUtils.getString(paramMap, key, "")));
|
||||||
|
|
||||||
|
String url = foodApiProperties.getServerUrl() + "/open/task";
|
||||||
|
final Request request = new Request.Builder().url(url).post(formBody.build()).build();
|
||||||
|
final Response response = new OkHttpClient().newCall(request).execute();
|
||||||
|
logger.info("response.body:{}----------", response.body());
|
||||||
|
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
result.put("status", 0);
|
||||||
|
result.put("message", "操作失败");
|
||||||
|
|
||||||
|
if (response.isSuccessful()) {
|
||||||
|
String content = response.body().string();
|
||||||
|
logger.info("content:{}----------", content);
|
||||||
|
result = JSONUtil.parseObject(content, new TypeReference<Map<String, Object>>() {
|
||||||
|
});
|
||||||
|
|
||||||
|
if (result.get("status") != null && StringUtils.equals("1", result.get("status").toString())) {
|
||||||
|
// return ReturnT.SUCCESS;
|
||||||
|
return new ReturnT<String>(JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// return ReturnT.FAIL;
|
||||||
|
return new ReturnT<String>(ReturnT.FAIL_CODE, JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,85 @@
|
|||||||
|
package com.jwsaas.job.executor.service.jobhandler;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.commons.collections4.MapUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.jwsaas.Constants;
|
||||||
|
import com.jwsaas.properties.FoodApiProperties;
|
||||||
|
import com.jwsaas.utils.JSONUtil;
|
||||||
|
import com.jwsaas.utils.SignUtil;
|
||||||
|
import com.xxl.job.core.biz.model.ReturnT;
|
||||||
|
import com.xxl.job.core.handler.IJobHandler;
|
||||||
|
import com.xxl.job.core.handler.annotation.JobHander;
|
||||||
|
import com.xxl.job.core.log.XxlJobLogger;
|
||||||
|
|
||||||
|
import okhttp3.FormBody;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 促销单结束任务Handler
|
||||||
|
*/
|
||||||
|
@JobHander(value = "promotionTicketFinishJobHandler")
|
||||||
|
@Service
|
||||||
|
public class PromotionTicketFinishJobHandler extends IJobHandler {
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(PromotionTicketFinishJobHandler.class);
|
||||||
|
private static String charset = "UTF-8";
|
||||||
|
@Autowired
|
||||||
|
private FoodApiProperties foodApiProperties;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ReturnT<String> execute(String... params) throws Exception {
|
||||||
|
XxlJobLogger.log(Constants.APP_TYPE_SIGN + ": JOB, PromotionTicket Finish .");
|
||||||
|
logger.info(Constants.APP_TYPE_SIGN + ": JOB, PromotionTicket Finish .");
|
||||||
|
|
||||||
|
Map<String, String> paramMap = new HashMap<>();
|
||||||
|
paramMap.put("action", "PromotionTicketFinish");
|
||||||
|
String[] temp = null;
|
||||||
|
for (String param : params) {
|
||||||
|
logger.info("param:{}", param);
|
||||||
|
temp = StringUtils.split(param, "#");
|
||||||
|
paramMap.put(temp[0], temp[1]);
|
||||||
|
}
|
||||||
|
String sign = SignUtil.rsaSign(SignUtil.getSignCheckContent(paramMap), Constants.OPEN_API_RSA_PRIVATE_KEY, charset);
|
||||||
|
paramMap.put("sign", sign);
|
||||||
|
|
||||||
|
FormBody.Builder formBody = new FormBody.Builder();
|
||||||
|
paramMap.keySet().stream().forEach(key -> formBody.add(key, MapUtils.getString(paramMap, key, "")));
|
||||||
|
|
||||||
|
String url = foodApiProperties.getServerUrl() + "/open/task";
|
||||||
|
final Request request = new Request.Builder().url(url).post(formBody.build()).build();
|
||||||
|
final Response response = new OkHttpClient().newCall(request).execute();
|
||||||
|
logger.info("response.body:{}----------", response.body());
|
||||||
|
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
result.put("status", 0);
|
||||||
|
result.put("message", "操作失败");
|
||||||
|
|
||||||
|
if (response.isSuccessful()) {
|
||||||
|
String content = response.body().string();
|
||||||
|
logger.info("content:{}----------", content);
|
||||||
|
result = JSONUtil.parseObject(content, new TypeReference<Map<String, Object>>() {
|
||||||
|
});
|
||||||
|
|
||||||
|
if (result.get("status") != null && StringUtils.equals("1", result.get("status").toString())) {
|
||||||
|
// return ReturnT.SUCCESS;
|
||||||
|
return new ReturnT<String>(JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// return ReturnT.FAIL;
|
||||||
|
return new ReturnT<String>(ReturnT.FAIL_CODE, JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,83 @@
|
|||||||
|
package com.jwsaas.job.executor.service.jobhandler;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.jwsaas.Constants;
|
||||||
|
import com.jwsaas.properties.FoodApiProperties;
|
||||||
|
import com.jwsaas.utils.JSONUtil;
|
||||||
|
import com.jwsaas.utils.SignUtil;
|
||||||
|
import com.xxl.job.core.biz.model.ReturnT;
|
||||||
|
import com.xxl.job.core.handler.IJobHandler;
|
||||||
|
import com.xxl.job.core.handler.annotation.JobHander;
|
||||||
|
import com.xxl.job.core.log.XxlJobLogger;
|
||||||
|
import okhttp3.FormBody;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
import org.apache.commons.collections4.MapUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 促销单开始任务Handler
|
||||||
|
*/
|
||||||
|
@JobHander(value = "promotionTicketStartJobHandler")
|
||||||
|
@Service
|
||||||
|
public class PromotionTicketStartJobHandler extends IJobHandler {
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(PromotionTicketStartJobHandler.class);
|
||||||
|
private static String charset = "UTF-8";
|
||||||
|
@Autowired
|
||||||
|
private FoodApiProperties foodApiProperties;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ReturnT<String> execute(String... params) throws Exception {
|
||||||
|
XxlJobLogger.log(Constants.APP_TYPE_SIGN + ": JOB, PromotionTicket Start .");
|
||||||
|
logger.info(Constants.APP_TYPE_SIGN + ": JOB, PromotionTicket Start .");
|
||||||
|
|
||||||
|
Map<String, String> paramMap = new HashMap<>();
|
||||||
|
paramMap.put("action", "PromotionTicketStart");
|
||||||
|
String[] temp = null;
|
||||||
|
for (String param : params) {
|
||||||
|
logger.info("param:{}", param);
|
||||||
|
temp = StringUtils.split(param, "#");
|
||||||
|
paramMap.put(temp[0], temp[1]);
|
||||||
|
}
|
||||||
|
String sign = SignUtil.rsaSign(SignUtil.getSignCheckContent(paramMap), Constants.OPEN_API_RSA_PRIVATE_KEY, charset);
|
||||||
|
paramMap.put("sign", sign);
|
||||||
|
|
||||||
|
FormBody.Builder formBody = new FormBody.Builder();
|
||||||
|
paramMap.keySet().stream().forEach(key -> formBody.add(key, MapUtils.getString(paramMap, key, "")));
|
||||||
|
|
||||||
|
String url = foodApiProperties.getServerUrl() + "/open/task";
|
||||||
|
final Request request = new Request.Builder().url(url).post(formBody.build()).build();
|
||||||
|
final Response response = new OkHttpClient().newCall(request).execute();
|
||||||
|
logger.info("response.body:{}----------", response.body());
|
||||||
|
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
result.put("status", 0);
|
||||||
|
result.put("message", "操作失败");
|
||||||
|
|
||||||
|
if (response.isSuccessful()) {
|
||||||
|
String content = response.body().string();
|
||||||
|
logger.info("content:{}----------", content);
|
||||||
|
result = JSONUtil.parseObject(content, new TypeReference<Map<String, Object>>() {
|
||||||
|
});
|
||||||
|
|
||||||
|
if (result.get("status") != null && StringUtils.equals("1", result.get("status").toString())) {
|
||||||
|
// return ReturnT.SUCCESS;
|
||||||
|
return new ReturnT<String>(JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// return ReturnT.FAIL;
|
||||||
|
return new ReturnT<String>(ReturnT.FAIL_CODE, JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,85 @@
|
|||||||
|
package com.jwsaas.job.executor.service.jobhandler;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.commons.collections4.MapUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.jwsaas.Constants;
|
||||||
|
import com.jwsaas.properties.FoodApiProperties;
|
||||||
|
import com.jwsaas.utils.JSONUtil;
|
||||||
|
import com.jwsaas.utils.SignUtil;
|
||||||
|
import com.xxl.job.core.biz.model.ReturnT;
|
||||||
|
import com.xxl.job.core.handler.IJobHandler;
|
||||||
|
import com.xxl.job.core.handler.annotation.JobHander;
|
||||||
|
import com.xxl.job.core.log.XxlJobLogger;
|
||||||
|
|
||||||
|
import okhttp3.FormBody;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 促销单状态调整任务Handler
|
||||||
|
*/
|
||||||
|
@JobHander(value = "promotionTicketStatusChangeJobHandler")
|
||||||
|
@Service
|
||||||
|
public class PromotionTicketStatusChangeJobHandler extends IJobHandler {
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(PromotionTicketStatusChangeJobHandler.class);
|
||||||
|
private static String charset = "UTF-8";
|
||||||
|
@Autowired
|
||||||
|
private FoodApiProperties foodApiProperties;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ReturnT<String> execute(String... params) throws Exception {
|
||||||
|
XxlJobLogger.log(Constants.APP_TYPE_SIGN + ": JOB, PromotionTicket Status Change .");
|
||||||
|
logger.info(Constants.APP_TYPE_SIGN + ": JOB, PromotionTicket Status Change .");
|
||||||
|
|
||||||
|
Map<String, String> paramMap = new HashMap<>();
|
||||||
|
paramMap.put("action", "PromotionTicketStatusChange");
|
||||||
|
String[] temp = null;
|
||||||
|
for (String param : params) {
|
||||||
|
logger.info("param:{}", param);
|
||||||
|
temp = StringUtils.split(param, "#");
|
||||||
|
paramMap.put(temp[0], temp[1]);
|
||||||
|
}
|
||||||
|
String sign = SignUtil.rsaSign(SignUtil.getSignCheckContent(paramMap), Constants.OPEN_API_RSA_PRIVATE_KEY, charset);
|
||||||
|
paramMap.put("sign", sign);
|
||||||
|
|
||||||
|
FormBody.Builder formBody = new FormBody.Builder();
|
||||||
|
paramMap.keySet().stream().forEach(key -> formBody.add(key, MapUtils.getString(paramMap, key, "")));
|
||||||
|
|
||||||
|
String url = foodApiProperties.getServerUrl() + "/open/task";
|
||||||
|
final Request request = new Request.Builder().url(url).post(formBody.build()).build();
|
||||||
|
final Response response = new OkHttpClient().newCall(request).execute();
|
||||||
|
logger.info("response.body:{}----------", response.body());
|
||||||
|
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
result.put("status", 0);
|
||||||
|
result.put("message", "操作失败");
|
||||||
|
|
||||||
|
if (response.isSuccessful()) {
|
||||||
|
String content = response.body().string();
|
||||||
|
logger.info("content:{}----------", content);
|
||||||
|
result = JSONUtil.parseObject(content, new TypeReference<Map<String, Object>>() {
|
||||||
|
});
|
||||||
|
|
||||||
|
if (result.get("status") != null && StringUtils.equals("1", result.get("status").toString())) {
|
||||||
|
// return ReturnT.SUCCESS;
|
||||||
|
return new ReturnT<String>(JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// return ReturnT.FAIL;
|
||||||
|
return new ReturnT<String>(ReturnT.FAIL_CODE, JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,85 @@
|
|||||||
|
package com.jwsaas.job.executor.service.jobhandler;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.jwsaas.Constants;
|
||||||
|
import com.jwsaas.properties.FoodApiProperties;
|
||||||
|
import com.jwsaas.utils.JSONUtil;
|
||||||
|
import com.jwsaas.utils.SignUtil;
|
||||||
|
import com.xxl.job.core.biz.model.ReturnT;
|
||||||
|
import com.xxl.job.core.handler.IJobHandler;
|
||||||
|
import com.xxl.job.core.handler.annotation.JobHander;
|
||||||
|
import com.xxl.job.core.log.XxlJobLogger;
|
||||||
|
import okhttp3.FormBody;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
import org.apache.commons.collections4.MapUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店费用定时扣款任务结束
|
||||||
|
* Created by Administrator on 2019\11\20 0020.
|
||||||
|
*/
|
||||||
|
@JobHander(value = "storeTimeCostTaskFinishJobHandler")
|
||||||
|
@Service
|
||||||
|
public class StoreTimeCostTaskFinishJobHandler extends IJobHandler {
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(StoreTimeCostTaskFinishJobHandler.class);
|
||||||
|
private static String charset = "UTF-8";
|
||||||
|
@Autowired
|
||||||
|
private FoodApiProperties foodApiProperties;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ReturnT<String> execute(String... params) throws Exception {
|
||||||
|
XxlJobLogger.log(Constants.APP_TYPE_SIGN + ": JOB, StoreTimeCostTaskFinish Start .");
|
||||||
|
logger.info(Constants.APP_TYPE_SIGN + ": JOB, StoreTimeCostTaskFinish Start .");
|
||||||
|
|
||||||
|
Map<String, String> paramMap = new HashMap<>();
|
||||||
|
paramMap.put("action", "StoreTimeCostTaskFinish");
|
||||||
|
String[] temp = null;
|
||||||
|
for (String param : params) {
|
||||||
|
logger.info("param:{}", param);
|
||||||
|
temp = StringUtils.split(param, "#");
|
||||||
|
paramMap.put(temp[0], temp[1]);
|
||||||
|
paramMap.put(temp[2], temp[3]);
|
||||||
|
}
|
||||||
|
String sign = SignUtil.rsaSign(SignUtil.getSignCheckContent(paramMap), Constants.OPEN_API_RSA_PRIVATE_KEY, charset);
|
||||||
|
paramMap.put("sign", sign);
|
||||||
|
|
||||||
|
FormBody.Builder formBody = new FormBody.Builder();
|
||||||
|
paramMap.keySet().stream().forEach(key -> formBody.add(key, MapUtils.getString(paramMap, key, "")));
|
||||||
|
|
||||||
|
String url = foodApiProperties.getServerUrl() + "/open/task";
|
||||||
|
final Request request = new Request.Builder().url(url).post(formBody.build()).build();
|
||||||
|
final Response response = new OkHttpClient().newCall(request).execute();
|
||||||
|
logger.info("response.body:{}----------", response.body());
|
||||||
|
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
result.put("status", 0);
|
||||||
|
result.put("message", "操作失败");
|
||||||
|
|
||||||
|
if (response.isSuccessful()) {
|
||||||
|
String content = response.body().string();
|
||||||
|
logger.info("content:{}----------", content);
|
||||||
|
result = JSONUtil.parseObject(content, new TypeReference<Map<String, Object>>() {
|
||||||
|
});
|
||||||
|
|
||||||
|
if (result.get("status") != null && StringUtils.equals("1", result.get("status").toString())) {
|
||||||
|
// return ReturnT.SUCCESS;
|
||||||
|
return new ReturnT<String>(JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// return ReturnT.FAIL;
|
||||||
|
return new ReturnT<String>(ReturnT.FAIL_CODE, JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,85 @@
|
|||||||
|
package com.jwsaas.job.executor.service.jobhandler;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.jwsaas.Constants;
|
||||||
|
import com.jwsaas.properties.FoodApiProperties;
|
||||||
|
import com.jwsaas.utils.JSONUtil;
|
||||||
|
import com.jwsaas.utils.SignUtil;
|
||||||
|
import com.xxl.job.core.biz.model.ReturnT;
|
||||||
|
import com.xxl.job.core.handler.IJobHandler;
|
||||||
|
import com.xxl.job.core.handler.annotation.JobHander;
|
||||||
|
import com.xxl.job.core.log.XxlJobLogger;
|
||||||
|
import okhttp3.FormBody;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
import org.apache.commons.collections4.MapUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品调价任务Handler
|
||||||
|
*/
|
||||||
|
@JobHander(value = "weixinGoodsAdjustPriceJobHandler")
|
||||||
|
@Service
|
||||||
|
public class WeixinGoodsAdjustPriceJobHandler extends IJobHandler {
|
||||||
|
|
||||||
|
private static transient Logger logger = LoggerFactory.getLogger(WeixinGoodsAdjustPriceJobHandler.class);
|
||||||
|
|
||||||
|
private static String charset = "UTF-8";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FoodApiProperties foodApiProperties;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ReturnT<String> execute(String... params) throws Exception {
|
||||||
|
XxlJobLogger.log(Constants.APP_TYPE_SIGN + ": JOB, WeixinGoods PriceAdjust .");
|
||||||
|
logger.info(Constants.APP_TYPE_SIGN + ": JOB, WeixinGoods PriceAdjust .");
|
||||||
|
|
||||||
|
Map<String, String> paramMap = new HashMap<>();
|
||||||
|
paramMap.put("action", "WxAdjustPriceTicket");
|
||||||
|
String[] temp = null;
|
||||||
|
for (String param : params) {
|
||||||
|
logger.info("param:{}", param);
|
||||||
|
temp = StringUtils.split(param, "#");
|
||||||
|
paramMap.put(temp[0], temp[1]);
|
||||||
|
}
|
||||||
|
String sign = SignUtil.rsaSign(SignUtil.getSignCheckContent(paramMap), Constants.OPEN_API_RSA_PRIVATE_KEY, charset);
|
||||||
|
paramMap.put("sign", sign);
|
||||||
|
|
||||||
|
FormBody.Builder formBody = new FormBody.Builder();
|
||||||
|
paramMap.keySet().stream().forEach(key -> formBody.add(key, MapUtils.getString(paramMap, key, "")));
|
||||||
|
|
||||||
|
String url = foodApiProperties.getServerUrl() + "/open/task";
|
||||||
|
final Request request = new Request.Builder().url(url).post(formBody.build()).build();
|
||||||
|
final Response response = new OkHttpClient().newCall(request).execute();
|
||||||
|
logger.info("response.body:{}----------", response.body());
|
||||||
|
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
result.put("status", 0);
|
||||||
|
result.put("message", "操作失败");
|
||||||
|
|
||||||
|
if (response.isSuccessful()) {
|
||||||
|
String content = response.body().string();
|
||||||
|
logger.info("content:{}----------", content);
|
||||||
|
result = JSONUtil.parseObject(content, new TypeReference<Map<String, Object>>() {
|
||||||
|
});
|
||||||
|
|
||||||
|
if (result.get("status") != null && StringUtils.equals("1", result.get("status").toString())) {
|
||||||
|
// return ReturnT.SUCCESS;
|
||||||
|
return new ReturnT<String>(JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// return ReturnT.FAIL;
|
||||||
|
return new ReturnT<String>(ReturnT.FAIL_CODE, JSONUtil.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.jwsaas.properties;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class FoodApiProperties {
|
||||||
|
|
||||||
|
@Value("${food.api.serverUrl}")
|
||||||
|
private String serverUrl;
|
||||||
|
|
||||||
|
public String getServerUrl() {
|
||||||
|
return serverUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setServerUrl(String serverUrl) {
|
||||||
|
this.serverUrl = serverUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package com.jwsaas.utils;
|
||||||
|
|
||||||
|
public final class HexUtils {
|
||||||
|
/**
|
||||||
|
* Used to build output as Hex
|
||||||
|
*/
|
||||||
|
private static final char[] DIGITS_LOWER = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to build output as Hex
|
||||||
|
*/
|
||||||
|
private static final char[] DIGITS_UPPER = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
|
||||||
|
|
||||||
|
private static char[] encodeHex(final byte[] data, final char[] toDigits) {
|
||||||
|
final int l = data.length;
|
||||||
|
final char[] out = new char[l << 1];
|
||||||
|
// two characters form the hex value.
|
||||||
|
for (int i = 0, j = 0; i < l; i++) {
|
||||||
|
out[j++] = toDigits[(0xF0 & data[i]) >>> 4];
|
||||||
|
out[j++] = toDigits[0x0F & data[i]];
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String encodeHexString(final byte[] data) {
|
||||||
|
return new String(encodeHex(data, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static char[] encodeHex(final byte[] data, final boolean toLowerCase) {
|
||||||
|
return encodeHex(data, toLowerCase ? DIGITS_LOWER : DIGITS_UPPER);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String encodeHexString(byte[] digest, boolean isLow) {
|
||||||
|
return new String(encodeHex(digest, isLow));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.jwsaas.utils;
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public class JSONException extends RuntimeException {
|
||||||
|
|
||||||
|
public JSONException(){
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public JSONException(String message){
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public JSONException(String message, Throwable cause){
|
||||||
|
super(message, cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,167 @@
|
|||||||
|
package com.jwsaas.utils;
|
||||||
|
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
|
||||||
|
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
||||||
|
import com.fasterxml.jackson.core.JsonEncoding;
|
||||||
|
import com.fasterxml.jackson.core.JsonGenerator;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
import com.fasterxml.jackson.databind.JsonSerializer;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.fasterxml.jackson.databind.SerializationConfig;
|
||||||
|
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||||
|
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||||
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
|
|
||||||
|
public class JSONUtil {
|
||||||
|
|
||||||
|
protected static Logger logger = LoggerFactory.getLogger(JSONUtil.class);
|
||||||
|
|
||||||
|
private static ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
private static final String charsetName = "UTF-8";
|
||||||
|
|
||||||
|
static {
|
||||||
|
objectMapper.setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
|
||||||
|
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||||
|
|
||||||
|
SerializationConfig serializationConfig = objectMapper.getSerializationConfig();
|
||||||
|
serializationConfig = serializationConfig.without(SerializationFeature.WRAP_ROOT_VALUE)
|
||||||
|
.with(SerializationFeature.INDENT_OUTPUT);
|
||||||
|
SerializerProvider serializerProvider = objectMapper.getSerializerProvider();
|
||||||
|
serializerProvider.setNullValueSerializer(new JsonSerializer<Object>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(Object value, JsonGenerator jgen, SerializerProvider serializers)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
jgen.writeString("");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// public static ObjectMapper getObjectMapper() {
|
||||||
|
// return CollectionUtils.deepCopy(objectMapper);
|
||||||
|
// }
|
||||||
|
|
||||||
|
public static String toJSONString(Object object) {
|
||||||
|
ByteArrayOutputStream bos = new ByteArrayOutputStream(1024);
|
||||||
|
try {
|
||||||
|
JsonGenerator jsonGenerator = objectMapper.getFactory().createGenerator(bos, JsonEncoding.UTF8);
|
||||||
|
objectMapper.writeValue(jsonGenerator, object);
|
||||||
|
return bos.toString(charsetName);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new JSONException(e.getMessage(), e);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
bos.close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
logger.error("toJSONString(bos.close) Exception ", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JsonNode parseJsonNode(String text) {
|
||||||
|
try {
|
||||||
|
return objectMapper.readTree(text);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new JSONException(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> T parseObject(String text, Class<T> clazz) {
|
||||||
|
try {
|
||||||
|
return objectMapper.readValue(text, clazz);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new JSONException(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> T parseObject(String text, Class<T> clazz, String charsetName) {
|
||||||
|
try {
|
||||||
|
return objectMapper.readValue(text.getBytes(charsetName), clazz);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new JSONException(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> T parseObject(String text, TypeReference<T> valueTypeRef) {
|
||||||
|
try {
|
||||||
|
return objectMapper.readValue(objectMapper.getFactory().createParser(text), valueTypeRef);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new JSONException(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ObjectNode createObjectNode() {
|
||||||
|
try {
|
||||||
|
return objectMapper.createObjectNode();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new JSONException(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从json中读取tagPath处的值 tagPath用 :分隔
|
||||||
|
*
|
||||||
|
* @param json
|
||||||
|
* @param tagPath
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static List<String> readValueFromJson(String json, String tagPath) throws Exception {
|
||||||
|
// 返回值
|
||||||
|
List<String> value = new ArrayList<String>();
|
||||||
|
if (StringUtils.isBlank(json) || StringUtils.isBlank(tagPath)) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
String[] path = tagPath.split(":");
|
||||||
|
JsonNode node = objectMapper.readTree(json);
|
||||||
|
getJsonValue(node, path, value, 1);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void getJsonValue(JsonNode node, String[] path, List<String> values, int nextIndex) {
|
||||||
|
if (node == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 是路径的最后就直接取值
|
||||||
|
if (nextIndex == path.length) {
|
||||||
|
if (node.isArray()) {
|
||||||
|
for (int i = 0; i < node.size(); i++) {
|
||||||
|
JsonNode child = node.get(i).get(path[nextIndex - 1]);
|
||||||
|
if (child == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
values.add(child.toString());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
JsonNode child = node.get(path[nextIndex - 1]);
|
||||||
|
if (child != null) {
|
||||||
|
values.add(child.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 判断是Node下是集合还是一个节点
|
||||||
|
node = node.get(path[nextIndex - 1]);
|
||||||
|
if (node.isArray()) {
|
||||||
|
for (int i = 0; i < node.size(); i++) {
|
||||||
|
getJsonValue(node.get(i), path, values, nextIndex + 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
getJsonValue(node, path, values, nextIndex + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package com.jwsaas.utils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
public class SignUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用私钥对信息生成数字签名
|
||||||
|
*/
|
||||||
|
public static String rsaSign(String content, String privateKey, String charset) throws Exception {
|
||||||
|
try {
|
||||||
|
byte[] data = null;
|
||||||
|
if (StringUtils.isBlank(charset)) {
|
||||||
|
data = content.getBytes();
|
||||||
|
} else {
|
||||||
|
data = content.getBytes(charset);
|
||||||
|
}
|
||||||
|
return RSASignature.sign(data, privateKey);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new Exception("RSAcontent = " + content + ",charset = " + charset, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getSignCheckContent(Map<String, String> params) {
|
||||||
|
if (params == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
params.remove("sign");
|
||||||
|
|
||||||
|
StringBuffer content = new StringBuffer();
|
||||||
|
List<String> keys = new ArrayList<String>(params.keySet());
|
||||||
|
Collections.sort(keys);
|
||||||
|
|
||||||
|
for (int i = 0; i < keys.size(); i++) {
|
||||||
|
String key = keys.get(i);
|
||||||
|
String value = params.get(key);
|
||||||
|
content.append((i == 0 ? "" : "&") + key + "=" + value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return content.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||||
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||||
|
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
|
||||||
|
|
||||||
|
<dubbo:application name="${application.name}" owner="${application.owner}"
|
||||||
|
organization="jwsaas" />
|
||||||
|
|
||||||
|
<dubbo:registry protocol="zookeeper" client="curator"
|
||||||
|
address="${zk.connect}" file="${dubbo.cache.address}" />
|
||||||
|
|
||||||
|
</beans>
|
@ -0,0 +1,14 @@
|
|||||||
|
#Global
|
||||||
|
global.name=JW_Food
|
||||||
|
global.version=1.0
|
||||||
|
global.description=\u5de8\u4e3a\u9910\u996e2.0\u8ba1\u5212\u4efb\u52a1\u6267\u884c\u5668
|
||||||
|
global.encoding=UTF-8
|
||||||
|
global.locale=zh_CN
|
||||||
|
|
||||||
|
# web port
|
||||||
|
server.port=39002
|
||||||
|
# log config
|
||||||
|
logging.config=classpath:logback.xml
|
||||||
|
|
||||||
|
#\u5f00\u653e\u5e73\u53f0\u53c2\u6570
|
||||||
|
food.api.serverUrl=http://127.0.0.1:8000/openApi
|
@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns:context="http://www.springframework.org/schema/context"
|
||||||
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||||
|
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||||
|
http://www.springframework.org/schema/context
|
||||||
|
http://www.springframework.org/schema/context/spring-context.xsd">
|
||||||
|
|
||||||
|
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||||
|
<property name="fileEncoding" value="utf-8" />
|
||||||
|
<property name="locations">
|
||||||
|
<list>
|
||||||
|
<value>classpath*:xxl-job-executor.properties</value>
|
||||||
|
<value>classpath*:application.properties</value>
|
||||||
|
</list>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<!-- ********************************* 基础配置 ********************************* -->
|
||||||
|
|
||||||
|
<!-- 配置01、JobHandler 扫描路径 -->
|
||||||
|
<context:component-scan base-package="com.xxl.job.executor.service.jobhandler" />
|
||||||
|
|
||||||
|
<!-- 配置02、执行器 -->
|
||||||
|
<bean id="xxlJobExecutor" class="com.xxl.job.core.executor.XxlJobExecutor" init-method="start" destroy-method="destroy" >
|
||||||
|
<!-- 执行器IP[选填],为空则自动获取 -->
|
||||||
|
<property name="ip" value="${xxl.job.executor.ip}" />
|
||||||
|
<!-- 执行器端口号[必须] -->
|
||||||
|
<property name="port" value="${xxl.job.executor.port}" />
|
||||||
|
<!-- 执行器AppName[选填],为空则关闭自动注册 -->
|
||||||
|
<property name="appName" value="${xxl.job.executor.appname}" />
|
||||||
|
<!-- 执行器注册中心地址[选填],为空则关闭自动注册 -->
|
||||||
|
<property name="adminAddresses" value="${xxl.job.admin.addresses}" />
|
||||||
|
<!-- 执行器日志路径[必填] -->
|
||||||
|
<property name="logPath" value="${xxl.job.executor.logpath}" />
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
</beans>
|
@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration debug="false" scan="true" scanPeriod="1 seconds">
|
||||||
|
|
||||||
|
<contextName>logback</contextName>
|
||||||
|
<property name="log.path" value="/data/applogs/xxl-job/xxl-job-executor-example.log"/>
|
||||||
|
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<!-- <filter class="ch.qos.logback.classic.filter.ThresholdFilter" >
|
||||||
|
<level>WARN</level>
|
||||||
|
</filter>-->
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{HH:mm:ss.SSS} %contextName [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log.path}.%d{yyyy-MM-dd}.zip</fileNamePattern>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%date %level [%thread] %logger{36} [%file : %line] %msg%n
|
||||||
|
</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="console"/>
|
||||||
|
<appender-ref ref="file"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--<logger name="com.xxl.job.executor.service.info" level="WARN" additivity="false">
|
||||||
|
<appender-ref ref="console"/>
|
||||||
|
<appender-ref ref="file"/>
|
||||||
|
</logger>-->
|
||||||
|
|
||||||
|
</configuration>
|
@ -0,0 +1,11 @@
|
|||||||
|
### xxl-job admin address list, such as "http://address" or "http://address01,http://address02"
|
||||||
|
xxl.job.admin.addresses=http://127.0.0.1:8900/job/schedule
|
||||||
|
|
||||||
|
### xxl-job executor address
|
||||||
|
xxl.job.executor.appname=JW_Food
|
||||||
|
xxl.job.executor.ip=
|
||||||
|
xxl.job.executor.port=9998
|
||||||
|
|
||||||
|
### xxl-job log path
|
||||||
|
xxl.job.executor.logpath=/data/applogs/xxl-job/jobhandler/
|
||||||
|
|
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||||
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||||
|
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
|
||||||
|
|
||||||
|
<dubbo:application name="${application.name}" owner="${application.owner}"
|
||||||
|
organization="jwsaas" />
|
||||||
|
|
||||||
|
<dubbo:registry protocol="zookeeper" client="curator"
|
||||||
|
address="${zk.connect}" file="${dubbo.cache.address}" />
|
||||||
|
|
||||||
|
</beans>
|
@ -0,0 +1,14 @@
|
|||||||
|
#Global
|
||||||
|
global.name=JW_Food
|
||||||
|
global.version=1.0
|
||||||
|
global.description=\u5de8\u4e3a\u9910\u996e2.0\u8ba1\u5212\u4efb\u52a1\u6267\u884c\u5668
|
||||||
|
global.encoding=UTF-8
|
||||||
|
global.locale=zh_CN
|
||||||
|
|
||||||
|
# web port
|
||||||
|
server.port=39002
|
||||||
|
# log config
|
||||||
|
logging.config=classpath:logback.xml
|
||||||
|
|
||||||
|
#\u5f00\u653e\u5e73\u53f0\u53c2\u6570
|
||||||
|
food.api.serverUrl=http://127.0.0.1:8000/openApi
|
@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns:context="http://www.springframework.org/schema/context"
|
||||||
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||||
|
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||||
|
http://www.springframework.org/schema/context
|
||||||
|
http://www.springframework.org/schema/context/spring-context.xsd">
|
||||||
|
|
||||||
|
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||||
|
<property name="fileEncoding" value="utf-8" />
|
||||||
|
<property name="locations">
|
||||||
|
<list>
|
||||||
|
<value>classpath*:xxl-job-executor.properties</value>
|
||||||
|
<value>classpath*:application.properties</value>
|
||||||
|
</list>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<!-- ********************************* 基础配置 ********************************* -->
|
||||||
|
|
||||||
|
<!-- 配置01、JobHandler 扫描路径 -->
|
||||||
|
<context:component-scan base-package="com.xxl.job.executor.service.jobhandler" />
|
||||||
|
|
||||||
|
<!-- 配置02、执行器 -->
|
||||||
|
<bean id="xxlJobExecutor" class="com.xxl.job.core.executor.XxlJobExecutor" init-method="start" destroy-method="destroy" >
|
||||||
|
<!-- 执行器IP[选填],为空则自动获取 -->
|
||||||
|
<property name="ip" value="${xxl.job.executor.ip}" />
|
||||||
|
<!-- 执行器端口号[必须] -->
|
||||||
|
<property name="port" value="${xxl.job.executor.port}" />
|
||||||
|
<!-- 执行器AppName[选填],为空则关闭自动注册 -->
|
||||||
|
<property name="appName" value="${xxl.job.executor.appname}" />
|
||||||
|
<!-- 执行器注册中心地址[选填],为空则关闭自动注册 -->
|
||||||
|
<property name="adminAddresses" value="${xxl.job.admin.addresses}" />
|
||||||
|
<!-- 执行器日志路径[必填] -->
|
||||||
|
<property name="logPath" value="${xxl.job.executor.logpath}" />
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
</beans>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue