code cleanup
This commit is contained in:
parent
c8200f556f
commit
6a7131ff85
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[submodule "server/lib/tigon"]
|
||||||
|
path = server/lib/tigon
|
||||||
|
url = git@git.pudong-hot.com:donghuang/tigon.git
|
@ -10,9 +10,9 @@
|
|||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.pudonghot.ambition</groupId>
|
<groupId>com.pudonghot.ambition</groupId>
|
||||||
<artifactId>web-parent</artifactId>
|
<artifactId>ambition-crm</artifactId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
<relativePath>../web-parent</relativePath>
|
<relativePath>../</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
@ -22,8 +22,23 @@
|
|||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.pudonghot.ambition</groupId>
|
<groupId>me.chyxion.tigon</groupId>
|
||||||
<artifactId>util</artifactId>
|
<artifactId>tigon-web</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-logging</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<!-- Log -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-log4j2</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-codec</groupId>
|
||||||
|
<artifactId>commons-codec</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.pudonghot.ambition</groupId>
|
<groupId>com.pudonghot.ambition</groupId>
|
||||||
@ -39,7 +54,7 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
<groupId>me.chyxion.tigon</groupId>
|
||||||
<artifactId>tigon-shiro-spring-boot</artifactId>
|
<artifactId>tigon-shiro</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
@ -55,6 +70,11 @@
|
|||||||
<artifactId>joda-time</artifactId>
|
<artifactId>joda-time</artifactId>
|
||||||
<version>2.9.9</version>
|
<version>2.9.9</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
<!-- Test Dependencies -->
|
<!-- Test Dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
@ -73,6 +93,16 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<finalName>${project.build.finalName}</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<profile>
|
||||||
<id>dev</id>
|
<id>dev</id>
|
||||||
|
@ -1,20 +1,15 @@
|
|||||||
package com.pudonghot.ambition.crm;
|
package com.pudonghot.ambition.crm;
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Shaun Chyxion <br>
|
* @author Shaun Chyxion <br>
|
||||||
* chyxion@163.com <br>
|
* chyxion@163.com <br>
|
||||||
* Mar 05, 2017 14:40:30
|
* Mar 05, 2017 14:40:30
|
||||||
*/
|
*/
|
||||||
@EnableAutoConfiguration(exclude = {
|
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
||||||
RedisAutoConfiguration.class,
|
|
||||||
DataSourceAutoConfiguration.class})
|
|
||||||
@ComponentScan("com.pudonghot.ambition.crm")
|
|
||||||
public class AmbitionCRM {
|
public class AmbitionCRM {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,7 +15,7 @@ import org.apache.shiro.authc.AuthenticationInfo;
|
|||||||
import org.apache.shiro.authc.AuthenticationToken;
|
import org.apache.shiro.authc.AuthenticationToken;
|
||||||
import org.apache.shiro.authc.AuthenticationException;
|
import org.apache.shiro.authc.AuthenticationException;
|
||||||
import com.pudonghot.ambition.crm.service.AuthLogService;
|
import com.pudonghot.ambition.crm.service.AuthLogService;
|
||||||
import com.pudonghot.ambition.util.HttpServletRequestUtils;
|
import com.pudonghot.ambition.crm.util.HttpServletRequestUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import com.pudonghot.ambition.crm.service.AuthFailedLogService;
|
import com.pudonghot.ambition.crm.service.AuthFailedLogService;
|
||||||
import com.pudonghot.ambition.crm.form.create.AuthLogFormForCreate;
|
import com.pudonghot.ambition.crm.form.create.AuthLogFormForCreate;
|
||||||
|
@ -39,8 +39,7 @@ public class FileController {
|
|||||||
final File file = fileApi.getFile(fileInfo);
|
final File file = fileApi.getFile(fileInfo);
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
rm = new ResourceModel(file,
|
rm = new ResourceModel(file,
|
||||||
fileInfo.getContentType(), null);
|
fileInfo.getContentType(), fileInfo.getDownloadName());
|
||||||
rm.setName(fileInfo.getDownloadName());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rm != null ?
|
return rm != null ?
|
||||||
|
@ -208,7 +208,7 @@ public class ApplicationServiceSupport
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Throwable.class)
|
@Transactional(rollbackFor = Throwable.class)
|
||||||
public int delete(final String id) {
|
public Application delete(final String id) {
|
||||||
log.info("Delete application [{}].", id);
|
log.info("Delete application [{}].", id);
|
||||||
final Application app = find(id);
|
final Application app = find(id);
|
||||||
Assert.state(app != null, "No application [" + id + "] found");
|
Assert.state(app != null, "No application [" + id + "] found");
|
||||||
@ -224,7 +224,8 @@ public class ApplicationServiceSupport
|
|||||||
attachmentMapper.list(appFileSearch).forEach(
|
attachmentMapper.list(appFileSearch).forEach(
|
||||||
attachment -> fileApi.deleteById(attachment.getFileId()));
|
attachment -> fileApi.deleteById(attachment.getFileId()));
|
||||||
attachmentMapper.delete(appFileSearch);
|
attachmentMapper.delete(appFileSearch);
|
||||||
return mapper.delete(id);
|
mapper.delete(id);
|
||||||
|
return app;
|
||||||
}
|
}
|
||||||
|
|
||||||
private <T extends ApplicationFile> List<T> uploadFiles(
|
private <T extends ApplicationFile> List<T> uploadFiles(
|
||||||
|
@ -40,7 +40,7 @@ public class CustomerIssueServiceSupport
|
|||||||
final CustomerIssue issue = find(id);
|
final CustomerIssue issue = find(id);
|
||||||
Assert.state(issue != null, "No issue [" + id + "] found");
|
Assert.state(issue != null, "No issue [" + id + "] found");
|
||||||
if (!issue.getIssue().equals(form.getIssue()) ||
|
if (!issue.getIssue().equals(form.getIssue()) ||
|
||||||
!form.getEnabled().equals(issue.isEnabled())) {
|
form.isEnabled() != issue.isEnabled()) {
|
||||||
return super.update(form);
|
return super.update(form);
|
||||||
}
|
}
|
||||||
log.info("Issue [{}] not changed", issue);
|
log.info("Issue [{}] not changed", issue);
|
||||||
|
@ -60,7 +60,7 @@ public class HomePageServiceSupport
|
|||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int delete(final String id) {
|
public HomePage delete(final String id) {
|
||||||
final HomePage homePage = find(id);
|
final HomePage homePage = find(id);
|
||||||
Assert.state(homePage != null, "No home page [" + id + "] found");
|
Assert.state(homePage != null, "No home page [" + id + "] found");
|
||||||
Assert.state(!homePage.isEnabled(), "Home page [" + id + "] is enabled");
|
Assert.state(!homePage.isEnabled(), "Home page [" + id + "] is enabled");
|
||||||
|
@ -7,7 +7,7 @@ import me.chyxion.tigon.model.ViewModel;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import com.pudonghot.ambition.crm.model.User;
|
import com.pudonghot.ambition.crm.model.User;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.pudonghot.ambition.util.Sha512Utils;
|
import com.pudonghot.ambition.crm.util.Sha512Utils;
|
||||||
import org.hibernate.validator.constraints.NotBlank;
|
import org.hibernate.validator.constraints.NotBlank;
|
||||||
import com.pudonghot.ambition.crm.mapper.UserMapper;
|
import com.pudonghot.ambition.crm.mapper.UserMapper;
|
||||||
import com.pudonghot.ambition.crm.service.UserService;
|
import com.pudonghot.ambition.crm.service.UserService;
|
||||||
@ -46,7 +46,7 @@ public class UserServiceSupport
|
|||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int delete(final String id) {
|
public User delete(final String id) {
|
||||||
User user = find(id);
|
User user = find(id);
|
||||||
Assert.state(user != null, "No user [" + id + "] found");
|
Assert.state(user != null, "No user [" + id + "] found");
|
||||||
Assert.state(!user.isEnabled(), "User [" + id + "] is enabled");
|
Assert.state(!user.isEnabled(), "User [" + id + "] is enabled");
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.pudonghot.ambition.util;
|
package com.pudonghot.ambition.crm.util;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
@ -1,4 +1,4 @@
|
|||||||
package com.pudonghot.ambition.util;
|
package com.pudonghot.ambition.crm.util;
|
||||||
|
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
import org.apache.commons.codec.binary.Hex;
|
import org.apache.commons.codec.binary.Hex;
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator</artifactId>
|
<artifactId>hibernate-validator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
23
server/lib/pom.xml
Normal file
23
server/lib/pom.xml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project 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/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>ambition-lib</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<name>Ambition Library</name>
|
||||||
|
<description>Ambition Library</description>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>com.pudonghot.ambition</groupId>
|
||||||
|
<artifactId>ambition-crm</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<relativePath>../</relativePath>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<modules>
|
||||||
|
<module>tigon</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
</project>
|
1
server/lib/tigon
Submodule
1
server/lib/tigon
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 7a0c14ba3f821049872595609dbf278cf410cbd5
|
@ -33,10 +33,6 @@
|
|||||||
<groupId>me.chyxion.tigon</groupId>
|
<groupId>me.chyxion.tigon</groupId>
|
||||||
<artifactId>tigon-mybatis</artifactId>
|
<artifactId>tigon-mybatis</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.mybatis</groupId>
|
|
||||||
<artifactId>mybatis-spring</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-jdbc</artifactId>
|
<artifactId>spring-jdbc</artifactId>
|
||||||
@ -51,6 +47,11 @@
|
|||||||
<groupId>mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Test And Optional Dependencies -->
|
<!-- Test And Optional Dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -145,7 +146,7 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
<groupId>me.chyxion.tigon</groupId>
|
||||||
<artifactId>tigon-webmvc-war</artifactId>
|
<artifactId>tigon-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<artifactId>tigon-model</artifactId>
|
<artifactId>tigon-model</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator</artifactId>
|
<artifactId>hibernate-validator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -35,12 +35,13 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
<groupId>me.chyxion.tigon</groupId>
|
||||||
<artifactId>tigon-webmvc-war</artifactId>
|
<artifactId>tigon-web</artifactId>
|
||||||
<scope>${tigon.webmvc.scrope}</scope>
|
<scope>${tigon.webmvc.scrope}</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Test Dependencies -->
|
<!-- Test Dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -19,11 +19,13 @@ public class Application extends M3<String, String> {
|
|||||||
|
|
||||||
// Column Names
|
// Column Names
|
||||||
public static final String NAME = "name";
|
public static final String NAME = "name";
|
||||||
|
public static final String NAME_PREFIX = "name_prefix";
|
||||||
public static final String CONTENT = "content";
|
public static final String CONTENT = "content";
|
||||||
public static final String OWNER = "owner";
|
public static final String OWNER = "owner";
|
||||||
|
|
||||||
// Properties
|
// Properties
|
||||||
private String name;
|
private String name;
|
||||||
|
private String namePrefix;
|
||||||
private String content;
|
private String content;
|
||||||
private String owner;
|
private String owner;
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
# name-pinyin
|
|
@ -1,55 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project 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/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<artifactId>pinyin-util</artifactId>
|
|
||||||
<name>Pinyin Util</name>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>com.pudonghot.ambition</groupId>
|
|
||||||
<artifactId>ambition-crm</artifactId>
|
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
|
||||||
<relativePath>../</relativePath>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.belerweb</groupId>
|
|
||||||
<artifactId>pinyin4j</artifactId>
|
|
||||||
<version>2.5.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<resources>
|
|
||||||
<resource>
|
|
||||||
<filtering>true</filtering>
|
|
||||||
<directory>src/main/resources</directory>
|
|
||||||
<excludes>
|
|
||||||
<exclude>pinyin/*</exclude>
|
|
||||||
</excludes>
|
|
||||||
</resource>
|
|
||||||
<resource>
|
|
||||||
<filtering>false</filtering>
|
|
||||||
<directory>src/main/resources</directory>
|
|
||||||
<includes>
|
|
||||||
<include>pinyin/*</include>
|
|
||||||
</includes>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
<testResources>
|
|
||||||
<testResource>
|
|
||||||
<directory>src/test/resources</directory>
|
|
||||||
<filtering>true</filtering>
|
|
||||||
</testResource>
|
|
||||||
</testResources>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
@ -1,154 +0,0 @@
|
|||||||
package com.pudonghot.ambition.pinyin;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.io.Closeable;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.ObjectInputStream;
|
|
||||||
import net.sourceforge.pinyin4j.PinyinHelper;
|
|
||||||
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
|
|
||||||
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
|
|
||||||
import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
|
|
||||||
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
|
|
||||||
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @version 0.0.1
|
|
||||||
* @since 0.0.1
|
|
||||||
* @author Shaun Chyxion <br>
|
|
||||||
* chyxion@163.com <br>
|
|
||||||
* Apr 23, 2015 1:30:51 PM
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public class PinyinUtil {
|
|
||||||
static final List<String[]> CN_FAMILY_NAMES;
|
|
||||||
static HanyuPinyinOutputFormat PINYIN_FORMAT =
|
|
||||||
new HanyuPinyinOutputFormat();
|
|
||||||
|
|
||||||
static {
|
|
||||||
PINYIN_FORMAT.setCaseType(HanyuPinyinCaseType.LOWERCASE);
|
|
||||||
PINYIN_FORMAT.setToneType(HanyuPinyinToneType.WITH_TONE_NUMBER);
|
|
||||||
PINYIN_FORMAT.setVCharType(HanyuPinyinVCharType.WITH_V);
|
|
||||||
InputStream fin = null;
|
|
||||||
ObjectInputStream oin = null;
|
|
||||||
try {
|
|
||||||
// load names data
|
|
||||||
fin = PinyinUtil.class.getResourceAsStream("/pinyin/cn-family-names.list");
|
|
||||||
oin = new ObjectInputStream(fin);
|
|
||||||
CN_FAMILY_NAMES = (List<String[]>) oin.readObject();
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
throw new IllegalStateException(
|
|
||||||
"Init Name Tool Error Caused", e);
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
close(oin);
|
|
||||||
close(fin);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get name pinyin
|
|
||||||
* @param name
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static String getNamePinyin(String name) {
|
|
||||||
return getNamePinyin(name, null, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get name pinyin
|
|
||||||
* @param name
|
|
||||||
* @param withTone
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static String getNamePinyin(String name, String splitter, boolean withTone) {
|
|
||||||
String pyRtn = null;
|
|
||||||
boolean hasSplitter = splitter != null && !splitter.isEmpty();
|
|
||||||
for (String[] it : CN_FAMILY_NAMES) {
|
|
||||||
String fName = it[0];
|
|
||||||
if (name.startsWith(fName)) {
|
|
||||||
// family name pinyin
|
|
||||||
StringBuilder sbRtn = new StringBuilder();
|
|
||||||
String fNamePy = it[2];
|
|
||||||
if (!withTone) {
|
|
||||||
fNamePy = fNamePy.replaceAll("\\d", "");
|
|
||||||
}
|
|
||||||
// replace splitter
|
|
||||||
fNamePy = fNamePy.replace(" ", hasSplitter ? splitter : "");
|
|
||||||
sbRtn.append(fNamePy);
|
|
||||||
// name pinyin
|
|
||||||
String shortName = name.substring(fName.length());
|
|
||||||
if (shortName != null && !shortName.isEmpty()) {
|
|
||||||
if (hasSplitter) {
|
|
||||||
sbRtn.append(splitter);
|
|
||||||
}
|
|
||||||
sbRtn.append(getDefaultPinyin(shortName, splitter, withTone));
|
|
||||||
}
|
|
||||||
pyRtn = sbRtn.toString();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (pyRtn == null) {
|
|
||||||
pyRtn = getDefaultPinyin(name, splitter, withTone);
|
|
||||||
}
|
|
||||||
return pyRtn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get default pinyin
|
|
||||||
* @param input
|
|
||||||
* @param withTone
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static String getDefaultPinyin(String input, String splitter, boolean withTone) {
|
|
||||||
StringBuilder sbRtn = new StringBuilder();
|
|
||||||
try {
|
|
||||||
if (input != null && !input.isEmpty()) {
|
|
||||||
boolean hasSplitter = splitter != null && !splitter.isEmpty();
|
|
||||||
for (char ch : input.toCharArray()) {
|
|
||||||
String sc = Character.toString(ch);
|
|
||||||
if (sc.matches("^[\u4E00-\u9FA5]$")) {
|
|
||||||
String pinyin =
|
|
||||||
PinyinHelper.toHanyuPinyinStringArray(
|
|
||||||
ch, PINYIN_FORMAT)[0];
|
|
||||||
if (!withTone) {
|
|
||||||
pinyin = pinyin.substring(0, pinyin.length() - 1);
|
|
||||||
}
|
|
||||||
sbRtn.append(pinyin);
|
|
||||||
if (hasSplitter) {
|
|
||||||
sbRtn.append(splitter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
sbRtn.append(sc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// remove last splitter
|
|
||||||
if (hasSplitter) {
|
|
||||||
sbRtn.deleteCharAt(sbRtn.length() - 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (BadHanyuPinyinOutputFormatCombination e) {
|
|
||||||
throw new IllegalStateException(
|
|
||||||
"Get Pinyin Error Caused", e);
|
|
||||||
}
|
|
||||||
return sbRtn.toString().trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* close closeable
|
|
||||||
* @param c
|
|
||||||
*/
|
|
||||||
private static void close(Closeable c) {
|
|
||||||
if (c != null) {
|
|
||||||
try {
|
|
||||||
c.close();
|
|
||||||
}
|
|
||||||
catch (IOException e) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -1,60 +0,0 @@
|
|||||||
package cn.com.flaginfo.utils;
|
|
||||||
|
|
||||||
import net.sourceforge.pinyin4j.PinyinHelper;
|
|
||||||
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
|
|
||||||
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
|
|
||||||
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
|
|
||||||
import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
|
|
||||||
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import com.pudonghot.ambition.pinyin.PinyinUtil;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @version 0.0.1
|
|
||||||
* @since 0.0.1
|
|
||||||
* @author Shaun Chyxion <br />
|
|
||||||
* xiaoning.chen@flaginfo.com.cn <br />
|
|
||||||
* Jan 4, 2015 11:24:35 AM
|
|
||||||
*/
|
|
||||||
public class NameUtilsTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testPinyin() {
|
|
||||||
HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat();
|
|
||||||
format.setCaseType(HanyuPinyinCaseType.LOWERCASE);
|
|
||||||
// format.setToneType(HanyuPinyinToneType.WITH_TONE_MARK);
|
|
||||||
format.setToneType(HanyuPinyinToneType.WITH_TONE_NUMBER);
|
|
||||||
format.setVCharType(HanyuPinyinVCharType.WITH_U_UNICODE);
|
|
||||||
|
|
||||||
char[] input = "陈晓宁".trim().toCharArray();
|
|
||||||
StringBuffer output = new StringBuffer();
|
|
||||||
try {
|
|
||||||
for (int i = 0; i < input.length; i++) {
|
|
||||||
if (Character.toString(input[i]).matches("[\u4E00-\u9FA5]+")) {
|
|
||||||
String[] temp = PinyinHelper.toHanyuPinyinStringArray(input[i], format);
|
|
||||||
for (String s : temp) {
|
|
||||||
System.err.println(s);
|
|
||||||
}
|
|
||||||
output.append(temp[0]);
|
|
||||||
output.append(" ");
|
|
||||||
} else
|
|
||||||
output.append(Character.toString(input[i]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (BadHanyuPinyinOutputFormatCombination e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
System.err.println(output);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testGetPy() {
|
|
||||||
System.err.println(PinyinUtil.getDefaultPinyin("陈晓宁", " ", true));
|
|
||||||
System.err.println(PinyinUtil.getNamePinyin("曾国藩", "", false));
|
|
||||||
System.err.println(PinyinUtil.getNamePinyin("东方不败", "", true));
|
|
||||||
System.err.println(PinyinUtil.getNamePinyin("东方不败", "_", false));
|
|
||||||
System.err.println(PinyinUtil.getDefaultPinyin("曾国藩", " ", true));
|
|
||||||
}
|
|
||||||
}
|
|
411
server/pom.xml
411
server/pom.xml
@ -17,22 +17,14 @@
|
|||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
|
||||||
<start-class></start-class>
|
<start-class></start-class>
|
||||||
<maven.tomcat.port>8080</maven.tomcat.port>
|
|
||||||
<maven.tomcat.path>/</maven.tomcat.path>
|
|
||||||
<web.resources.filtering>false</web.resources.filtering>
|
|
||||||
<slf4j.version>1.7.25</slf4j.version>
|
|
||||||
<log4j.version>2.8.2</log4j.version>
|
|
||||||
<mongodb.version>3.2.0</mongodb.version>
|
|
||||||
<tigon.version>0.0.1-SNAPSHOT</tigon.version>
|
<tigon.version>0.0.1-SNAPSHOT</tigon.version>
|
||||||
<spring.version>4.3.8.RELEASE</spring.version>
|
<spring-boot.version>2.0.3.RELEASE</spring-boot.version>
|
||||||
<spring-boot.version>1.5.10.RELEASE</spring-boot.version>
|
|
||||||
<shiro.version>1.3.2</shiro.version>
|
|
||||||
<aspectj.version>1.8.10</aspectj.version>
|
<aspectj.version>1.8.10</aspectj.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<organization>
|
<organization>
|
||||||
<name>PudongHot</name>
|
<name>PudongHot</name>
|
||||||
<url>http://www.pudonghot.com</url>
|
<url>http://www.pudong-hot.com</url>
|
||||||
</organization>
|
</organization>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
@ -42,7 +34,7 @@
|
|||||||
<email>chyxion@163.com</email>
|
<email>chyxion@163.com</email>
|
||||||
<url>http://chyxion.github.io</url>
|
<url>http://chyxion.github.io</url>
|
||||||
<organization>PudongHot</organization>
|
<organization>PudongHot</organization>
|
||||||
<organizationUrl>http://www.pudonghot.com</organizationUrl>
|
<organizationUrl>http://www.pudong-hot.com</organizationUrl>
|
||||||
<roles>
|
<roles>
|
||||||
<role>architect</role>
|
<role>architect</role>
|
||||||
<role>developer</role>
|
<role>developer</role>
|
||||||
@ -52,11 +44,7 @@
|
|||||||
</developers>
|
</developers>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>web-parent</module>
|
<module>lib</module>
|
||||||
<module>web-common</module>
|
|
||||||
<module>util</module>
|
|
||||||
<module>svg-util</module>
|
|
||||||
<module>pinyin-util</module>
|
|
||||||
<module>model</module>
|
<module>model</module>
|
||||||
<module>mapper</module>
|
<module>mapper</module>
|
||||||
<module>file-api</module>
|
<module>file-api</module>
|
||||||
@ -76,21 +64,6 @@
|
|||||||
<artifactId>web-common</artifactId>
|
<artifactId>web-common</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.pudonghot.ambition</groupId>
|
|
||||||
<artifactId>util</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.pudonghot.ambition</groupId>
|
|
||||||
<artifactId>svg-util</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.pudonghot.ambition</groupId>
|
|
||||||
<artifactId>pinyin-util</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.pudonghot.ambition</groupId>
|
<groupId>com.pudonghot.ambition</groupId>
|
||||||
<artifactId>crm-model</artifactId>
|
<artifactId>crm-model</artifactId>
|
||||||
@ -114,150 +87,18 @@
|
|||||||
<!--tigon-->
|
<!--tigon-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
<groupId>me.chyxion.tigon</groupId>
|
||||||
<artifactId>tigon-model</artifactId>
|
<artifactId>tigon</artifactId>
|
||||||
<version>${tigon.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-mybatis</artifactId>
|
|
||||||
<version>${tigon.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-sequence</artifactId>
|
|
||||||
<version>${tigon.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-webmvc-core</artifactId>
|
|
||||||
<version>${tigon.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-webmvc-spring-boot</artifactId>
|
|
||||||
<version>${tigon.version}</version>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-logging</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-webmvc-war</artifactId>
|
|
||||||
<version>${tigon.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-redis</artifactId>
|
|
||||||
<version>${tigon.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-mybatis-redis-cache</artifactId>
|
|
||||||
<version>${tigon.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-shiro-redis-cache</artifactId>
|
|
||||||
<version>${tigon.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-shiro-core</artifactId>
|
|
||||||
<version>${tigon.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-shiro-war</artifactId>
|
|
||||||
<version>${tigon.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-shiro-spring-boot</artifactId>
|
|
||||||
<version>${tigon.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-service-api</artifactId>
|
|
||||||
<version>${tigon.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-service-support</artifactId>
|
|
||||||
<version>${tigon.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-extjs</artifactId>
|
|
||||||
<version>${tigon.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-freemarker-support</artifactId>
|
|
||||||
<version>${tigon.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-jsp-support</artifactId>
|
|
||||||
<version>${tigon.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-codegen</artifactId>
|
|
||||||
<version>${tigon.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-props-config</artifactId>
|
|
||||||
<version>${tigon.version}</version>
|
<version>${tigon.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--/tigon-->
|
<!--/tigon-->
|
||||||
<dependency>
|
|
||||||
<groupId>com.caucho</groupId>
|
|
||||||
<artifactId>hessian</artifactId>
|
|
||||||
<version>4.0.38</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.googlecode.plist</groupId>
|
|
||||||
<artifactId>dd-plist</artifactId>
|
|
||||||
<version>1.16</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.google.zxing</groupId>
|
|
||||||
<artifactId>core</artifactId>
|
|
||||||
<version>3.2.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.google.zxing</groupId>
|
|
||||||
<artifactId>javase</artifactId>
|
|
||||||
<version>3.2.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.imgscalr</groupId>
|
|
||||||
<artifactId>imgscalr-lib</artifactId>
|
|
||||||
<version>4.2</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- mybatis -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-beanutils</groupId>
|
<groupId>commons-beanutils</groupId>
|
||||||
<artifactId>commons-beanutils</artifactId>
|
<artifactId>commons-beanutils</artifactId>
|
||||||
<!-- <version>1.9.2</version> -->
|
<!-- <version>1.9.2</version> -->
|
||||||
<version>1.8.3</version>
|
<version>1.8.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- /mybatis -->
|
|
||||||
<dependency>
|
|
||||||
<artifactId>spring-core</artifactId>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<version>${spring.version}</version>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>commons-logging</groupId>
|
|
||||||
<artifactId>commons-logging</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jdom</groupId>
|
<groupId>org.jdom</groupId>
|
||||||
<artifactId>jdom</artifactId>
|
<artifactId>jdom</artifactId>
|
||||||
@ -273,76 +114,18 @@
|
|||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
<version>2.4</version>
|
<version>2.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.freemarker</groupId>
|
|
||||||
<artifactId>freemarker</artifactId>
|
|
||||||
<version>2.3.23</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- Slf4j -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-api</artifactId>
|
|
||||||
<version>${slf4j.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>jcl-over-slf4j</artifactId>
|
|
||||||
<version>${slf4j.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- /Slf4j -->
|
|
||||||
<!-- Log4j 2 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
|
||||||
<artifactId>log4j-slf4j-impl</artifactId>
|
|
||||||
<version>${log4j.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- Log4j API and Core implementation required for binding -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
|
||||||
<artifactId>log4j-api</artifactId>
|
|
||||||
<version>${log4j.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
|
||||||
<artifactId>log4j-core</artifactId>
|
|
||||||
<version>${log4j.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- /Log4j 2 -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<artifactId>commons-codec</artifactId>
|
<artifactId>commons-codec</artifactId>
|
||||||
<groupId>commons-codec</groupId>
|
<groupId>commons-codec</groupId>
|
||||||
<version>1.10</version>
|
<version>1.10</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>commons-logging</groupId>
|
|
||||||
<artifactId>commons-logging</artifactId>
|
|
||||||
<version>1.2</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.aliyun.oss</groupId>
|
|
||||||
<artifactId>aliyun-sdk-oss</artifactId>
|
|
||||||
<version>2.5.0</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- Database -->
|
<!-- Database -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
<version>6.0.6</version>
|
<version>6.0.6</version>
|
||||||
<!--<version>5.1.41</version>-->
|
|
||||||
<!--<version>5.1.6</version>-->
|
|
||||||
</dependency>
|
|
||||||
<!-- test -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-test</artifactId>
|
|
||||||
<version>${spring.version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- javax -->
|
<!-- javax -->
|
||||||
<dependency>
|
|
||||||
<groupId>javax.persistence</groupId>
|
|
||||||
<artifactId>persistence-api</artifactId>
|
|
||||||
<version>1.0.2</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.el</groupId>
|
<groupId>javax.el</groupId>
|
||||||
<artifactId>javax.el-api</artifactId>
|
<artifactId>javax.el-api</artifactId>
|
||||||
@ -353,135 +136,16 @@
|
|||||||
<artifactId>javax.servlet-api</artifactId>
|
<artifactId>javax.servlet-api</artifactId>
|
||||||
<version>3.1.0</version>
|
<version>3.1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>javax.mail</groupId>
|
|
||||||
<artifactId>mail</artifactId>
|
|
||||||
<version>1.4.7</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.servlet.jsp.jstl</groupId>
|
|
||||||
<artifactId>jstl-api</artifactId>
|
|
||||||
<version>1.2</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
<version>1.16.14</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.hibernate</groupId>
|
|
||||||
<artifactId>hibernate-validator</artifactId>
|
|
||||||
<version>5.4.0.Final</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- mybatis -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.mybatis</groupId>
|
|
||||||
<artifactId>mybatis</artifactId>
|
|
||||||
<version>3.4.2</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.mybatis</groupId>
|
|
||||||
<artifactId>mybatis-spring</artifactId>
|
|
||||||
<version>1.3.1</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- /mybatis -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>druid</artifactId>
|
<artifactId>druid</artifactId>
|
||||||
<version>1.1.2</version>
|
<version>1.1.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.mongodb</groupId>
|
|
||||||
<artifactId>bson</artifactId>
|
|
||||||
<version>${mongodb.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.data</groupId>
|
|
||||||
<artifactId>spring-data-redis</artifactId>
|
|
||||||
<version>1.6.6.RELEASE</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>redis.clients</groupId>
|
|
||||||
<artifactId>jedis</artifactId>
|
|
||||||
<version>2.9.0</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.apache.shiro/shiro-core -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.shiro</groupId>
|
|
||||||
<artifactId>shiro-core</artifactId>
|
|
||||||
<version>${shiro.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.shiro</groupId>
|
|
||||||
<artifactId>shiro-web</artifactId>
|
|
||||||
<version>${shiro.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.shiro</groupId>
|
|
||||||
<artifactId>shiro-spring</artifactId>
|
|
||||||
<version>${shiro.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<artifactId>commons-fileupload</artifactId>
|
<artifactId>commons-fileupload</artifactId>
|
||||||
<groupId>commons-fileupload</groupId>
|
<groupId>commons-fileupload</groupId>
|
||||||
<version>1.3.2</version>
|
<version>1.3.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- https://mvnrepository.com/artifact/cglib/cglib -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>cglib</groupId>
|
|
||||||
<artifactId>cglib</artifactId>
|
|
||||||
<version>3.2.4</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.aspectj</groupId>
|
|
||||||
<artifactId>aspectjrt</artifactId>
|
|
||||||
<version>${aspectj.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.aspectj</groupId>
|
|
||||||
<artifactId>aspectjweaver</artifactId>
|
|
||||||
<version>${aspectj.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- Spring Boot -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-dependencies</artifactId>
|
|
||||||
<version>${spring-boot.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot</artifactId>
|
|
||||||
<version>${spring-boot.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-autoconfigure</artifactId>
|
|
||||||
<version>${spring-boot.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
|
||||||
<version>${spring-boot.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-test</artifactId>
|
|
||||||
<version>${spring-boot.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- / Spring Boot -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba</groupId>
|
|
||||||
<artifactId>fastjson</artifactId>
|
|
||||||
<version>1.2.41</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- test -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<version>4.12</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
@ -604,6 +268,17 @@
|
|||||||
<destinationFile>src/main/resources/application.yaml</destinationFile>
|
<destinationFile>src/main/resources/application.yaml</destinationFile>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>copy-application-yml-file</id>
|
||||||
|
<phase>generate-resources</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<sourceFile>src/main/resources/application_${project.activeProfiles[0].id}.yml</sourceFile>
|
||||||
|
<destinationFile>src/main/resources/application.yml</destinationFile>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
<execution>
|
<execution>
|
||||||
<id>copy-log4j2-xml-file</id>
|
<id>copy-log4j2-xml-file</id>
|
||||||
<phase>generate-resources</phase>
|
<phase>generate-resources</phase>
|
||||||
@ -685,54 +360,6 @@
|
|||||||
</archive>
|
</archive>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
|
||||||
<version>2.3</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>shade</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<finalName>${project.artifactId}</finalName>
|
|
||||||
<shadedArtifactAttached>true</shadedArtifactAttached>
|
|
||||||
<shadedClassifierName>jar-with-dependencies</shadedClassifierName>
|
|
||||||
<transformers>
|
|
||||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
|
||||||
<mainClass>${start-class}</mainClass>
|
|
||||||
</transformer>
|
|
||||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
|
||||||
<resource>META-INF/spring.handlers</resource>
|
|
||||||
</transformer>
|
|
||||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
|
||||||
<resource>META-INF/spring.schemas</resource>
|
|
||||||
</transformer>
|
|
||||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
|
||||||
<resource>META-INF/spring.tooling</resource>
|
|
||||||
</transformer>
|
|
||||||
</transformers>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.tomcat.maven</groupId>
|
|
||||||
<artifactId>tomcat7-maven-plugin</artifactId>
|
|
||||||
<version>2.2</version>
|
|
||||||
<configuration>
|
|
||||||
<port>${maven.tomcat.port}</port>
|
|
||||||
<path>${maven.tomcat.path}</path>
|
|
||||||
<charset>utf-8</charset>
|
|
||||||
<uriEncoding>utf-8</uriEncoding>
|
|
||||||
<contextReloadable>false</contextReloadable>
|
|
||||||
<systemProperties>
|
|
||||||
<http.port>${maven.tomcat.port}</http.port>
|
|
||||||
<project.basedir>${project.basedir}</project.basedir>
|
|
||||||
</systemProperties>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-help-plugin</artifactId>
|
<artifactId>maven-help-plugin</artifactId>
|
||||||
@ -775,6 +402,7 @@
|
|||||||
<exclude>config_*.properties</exclude>
|
<exclude>config_*.properties</exclude>
|
||||||
<exclude>application_*.properties</exclude>
|
<exclude>application_*.properties</exclude>
|
||||||
<exclude>application_*.yaml</exclude>
|
<exclude>application_*.yaml</exclude>
|
||||||
|
<exclude>application_*.yml</exclude>
|
||||||
<exclude>log4j2_*.xml</exclude>
|
<exclude>log4j2_*.xml</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
</resource>
|
</resource>
|
||||||
@ -790,6 +418,7 @@
|
|||||||
<exclude>config_*.properties</exclude>
|
<exclude>config_*.properties</exclude>
|
||||||
<exclude>application_*.properties</exclude>
|
<exclude>application_*.properties</exclude>
|
||||||
<exclude>application_*.yaml</exclude>
|
<exclude>application_*.yaml</exclude>
|
||||||
|
<exclude>application_*.yml</exclude>
|
||||||
<exclude>log4j2_*.xml</exclude>
|
<exclude>log4j2_*.xml</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
</resource>
|
</resource>
|
||||||
|
@ -1 +0,0 @@
|
|||||||
#umsapp-ota-data-model
|
|
@ -1,63 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project 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/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<artifactId>svg-util</artifactId>
|
|
||||||
<name>Ambition SVG Util</name>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>com.pudonghot.ambition</groupId>
|
|
||||||
<artifactId>ambition-crm</artifactId>
|
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
|
||||||
<relativePath>../</relativePath>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-api</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<artifactId>commons-codec</artifactId>
|
|
||||||
<groupId>commons-codec</groupId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.commons</groupId>
|
|
||||||
<artifactId>commons-lang3</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.xmlgraphics</groupId>
|
|
||||||
<artifactId>xmlgraphics-commons</artifactId>
|
|
||||||
<version>2.1</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.xmlgraphics</groupId>
|
|
||||||
<artifactId>batik-codec</artifactId>
|
|
||||||
<version>1.8</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.xmlgraphics</groupId>
|
|
||||||
<artifactId>batik-transcoder</artifactId>
|
|
||||||
<version>1.8</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- dom4j -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>dom4j</groupId>
|
|
||||||
<artifactId>dom4j</artifactId>
|
|
||||||
<version>1.6.1</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- Test Dependencies -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
|
@ -1,9 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
export MAVEN_OPTS="-noverify -agentpath:/usr/local/JRebel/6.3.2/lib/libjrebel64.dylib -Drebel.dirs=target -Drebel.disable_update=true -Ddev=true"
|
|
||||||
set JAVA_OPTS=$MAVEN_OPTS
|
|
||||||
mvn -Pdev clean tomcat7:run
|
|
||||||
unset JAVA_OPTS
|
|
||||||
unset MAVEN_OPTS
|
|
||||||
|
|
||||||
|
|
@ -1,167 +0,0 @@
|
|||||||
package com.pudonghot.ambition.svg;
|
|
||||||
|
|
||||||
import org.dom4j.Element;
|
|
||||||
import org.dom4j.Document;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import org.dom4j.io.SAXReader;
|
|
||||||
import org.xml.sax.SAXException;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.dom4j.DocumentException;
|
|
||||||
import java.io.ByteArrayInputStream;
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import org.apache.commons.io.IOUtils;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.apache.commons.lang3.CharEncoding;
|
|
||||||
import org.apache.batik.transcoder.TranscoderInput;
|
|
||||||
import org.apache.batik.transcoder.TranscoderOutput;
|
|
||||||
import org.apache.batik.transcoder.image.PNGTranscoder;
|
|
||||||
import org.apache.batik.transcoder.TranscoderException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @version 0.0.1
|
|
||||||
* @since 0.0.1
|
|
||||||
* @author Shaun Chyxion <br>
|
|
||||||
* chyxion@163.com <br>
|
|
||||||
* Aug 9, 2016 5:52:31 PM
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
public class SvgUtil {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param bytesSvg
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static boolean isSvg(byte[] bytesSvg) {
|
|
||||||
return isSvg(new ByteArrayInputStream(bytesSvg));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param insSvg
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static boolean isSvg(InputStream insSvg) {
|
|
||||||
try {
|
|
||||||
read(insSvg);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
log.info("Input Stream Is Not Svg.", e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
IOUtils.closeQuietly(insSvg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param bytesSvg
|
|
||||||
* @param color
|
|
||||||
* @param width
|
|
||||||
* @param height
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static byte[] convertToPng(byte[] bytesSvg, String color, int width, int height) {
|
|
||||||
return convertToPng(bytesSvg,
|
|
||||||
color,
|
|
||||||
toPxOrNull(width),
|
|
||||||
toPxOrNull(height));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param bytesSvg
|
|
||||||
* @param color
|
|
||||||
* @param width
|
|
||||||
* @param height
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static byte[] convertToPng(byte[] bytesSvg, String color, String width, String height) {
|
|
||||||
return convertToPng(new ByteArrayInputStream(bytesSvg), color, width, height);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static byte[] convertToPng(InputStream insSvg, String color, int width, int height) {
|
|
||||||
return convertToPng(insSvg, color, toPxOrNull(width), toPxOrNull(height));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param insSvg
|
|
||||||
* @param color
|
|
||||||
* @param width
|
|
||||||
* @param height
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static byte[] convertToPng(InputStream insSvg, String color, String width, String height) {
|
|
||||||
ByteArrayOutputStream baosPng = null;
|
|
||||||
try {
|
|
||||||
final byte[] bytesSvg = apply(insSvg, color, width, height);
|
|
||||||
baosPng = new ByteArrayOutputStream();
|
|
||||||
final PNGTranscoder transcoder = new PNGTranscoder();
|
|
||||||
transcoder.transcode(
|
|
||||||
new TranscoderInput(new ByteArrayInputStream(bytesSvg)),
|
|
||||||
new TranscoderOutput(baosPng));
|
|
||||||
baosPng.flush();
|
|
||||||
return baosPng.toByteArray();
|
|
||||||
}
|
|
||||||
catch (TranscoderException | IOException e) {
|
|
||||||
throw new IllegalStateException(
|
|
||||||
"Convert SVG To PNG Error Caused", e);
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
IOUtils.closeQuietly(baosPng);
|
|
||||||
IOUtils.closeQuietly(insSvg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static byte[] apply(InputStream insSvg, String color, String width, String height) {
|
|
||||||
return apply0(insSvg, color, width, height).asXML().getBytes(StandardCharsets.UTF_8);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static Document apply0(InputStream insSvg, String color, String width, String height) {
|
|
||||||
Document document = read(insSvg);
|
|
||||||
log.debug("Process SVG [{}] To Color [{}] Width [{}] Height [{}].", document, width, height);
|
|
||||||
Element rootEl = document.getRootElement();
|
|
||||||
if (StringUtils.isNotBlank(width)) {
|
|
||||||
rootEl.attribute("width").setValue(width);
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(height)) {
|
|
||||||
rootEl.attribute("height").setValue(height);
|
|
||||||
}
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
Iterator<Element> paths = (Iterator<Element>) rootEl.elementIterator("path");
|
|
||||||
while (paths.hasNext()) {
|
|
||||||
paths.next().attribute("fill").setValue(color);
|
|
||||||
}
|
|
||||||
return document;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static String toPxOrNull(int size) {
|
|
||||||
return size > 0 ? size + "px" : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static Document read(InputStream insSvg) {
|
|
||||||
SAXReader reader = new SAXReader();
|
|
||||||
// disable validate
|
|
||||||
String feature = "http://apache.org/xml/features/nonvalidating/load-external-dtd";
|
|
||||||
try {
|
|
||||||
reader.setFeature(feature, false);
|
|
||||||
}
|
|
||||||
catch (SAXException e) {
|
|
||||||
throw new IllegalStateException(
|
|
||||||
"SAXReader Disable Feature [" +
|
|
||||||
feature + "] Errro Caused", e);
|
|
||||||
}
|
|
||||||
reader.setEncoding(CharEncoding.UTF_8);
|
|
||||||
reader.setIncludeExternalDTDDeclarations(false);
|
|
||||||
reader.setIncludeInternalDTDDeclarations(false);
|
|
||||||
reader.setValidation(false);
|
|
||||||
try {
|
|
||||||
return reader.read(insSvg);
|
|
||||||
}
|
|
||||||
catch (DocumentException e) {
|
|
||||||
throw new IllegalStateException(
|
|
||||||
"Read SVG Input Stream Error Caused", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
# Config Dev
|
|
||||||
|
|
||||||
# Database
|
|
||||||
db.url=jdbc:mysql://127.0.0.1:3307/echat_sit
|
|
||||||
db.user=flaginfo_echat
|
|
||||||
db.password=echat407
|
|
||||||
|
|
||||||
# Redis
|
|
||||||
redis.host=127.0.0.1
|
|
||||||
redis.port=6379
|
|
||||||
redis.password=0211
|
|
@ -1 +0,0 @@
|
|||||||
#umsapp-ota-data-model
|
|
@ -1,51 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project 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/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<artifactId>util</artifactId>
|
|
||||||
<name>Ambition Util</name>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>com.pudonghot.ambition</groupId>
|
|
||||||
<artifactId>ambition-crm</artifactId>
|
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
|
||||||
<relativePath>../</relativePath>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<artifactId>commons-codec</artifactId>
|
|
||||||
<groupId>commons-codec</groupId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.commons</groupId>
|
|
||||||
<artifactId>commons-lang3</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.hibernate</groupId>
|
|
||||||
<artifactId>hibernate-validator</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-beanutils</groupId>
|
|
||||||
<artifactId>commons-beanutils</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.servlet</groupId>
|
|
||||||
<artifactId>javax.servlet-api</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- Test Dependencies -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
|
@ -1,9 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
export MAVEN_OPTS="-noverify -agentpath:/usr/local/JRebel/6.3.2/lib/libjrebel64.dylib -Drebel.dirs=target -Drebel.disable_update=true -Ddev=true"
|
|
||||||
set JAVA_OPTS=$MAVEN_OPTS
|
|
||||||
mvn -Pdev clean tomcat7:run
|
|
||||||
unset JAVA_OPTS
|
|
||||||
unset MAVEN_OPTS
|
|
||||||
|
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
#flaginfo-web-parent
|
|
@ -1,36 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project 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/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<artifactId>web-common</artifactId>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
<name>PudongHot Ambition Web Common</name>
|
|
||||||
<description>PudongHot Ambition Web Common</description>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>com.pudonghot.ambition</groupId>
|
|
||||||
<artifactId>ambition-crm</artifactId>
|
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
|
||||||
<relativePath>../</relativePath>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-webmvc-core</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- Log -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.servlet</groupId>
|
|
||||||
<artifactId>javax.servlet-api</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
|
@ -1,51 +0,0 @@
|
|||||||
package com.pudonghot.ambition.web.interceptor;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.util.PathMatcher;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
|
||||||
import me.chyxion.tigon.webmvc.TigonHandlerInterceptor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Shaun Chyxion <br>
|
|
||||||
* chyxion@163.com <br>
|
|
||||||
* Mar 19, 2017 21:50:57
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
public class DefaultHttpRequestInterceptor implements TigonHandlerInterceptor {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] includePathPatterns() {
|
|
||||||
return new String[] {"/**"};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] excludePathPatterns() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PathMatcher pathMatcher() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
|
||||||
log.debug("Request [{}] With Params [{}].", request.getRequestURI(), request.getParameterMap());
|
|
||||||
request.setAttribute("startTime", System.currentTimeMillis());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
|
|
||||||
log.info("Request [{}] Took {} ms.",
|
|
||||||
request.getRequestURI(),
|
|
||||||
System.currentTimeMillis() - (Long) request.getAttribute("startTime"));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
|
||||||
http://www.springframework.org/schema/beans/spring-beans.xsd">
|
|
||||||
<bean class="com.pudonghot.ambition.web.interceptor.DefaultHttpRequestInterceptor" />
|
|
||||||
</beans>
|
|
@ -1 +0,0 @@
|
|||||||
#flaginfo-web-parent
|
|
@ -1,61 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project 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/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<artifactId>web-parent</artifactId>
|
|
||||||
<packaging>pom</packaging>
|
|
||||||
<name>PudongHot Ambition Web Parent</name>
|
|
||||||
<description>PudongHot Ambition Web Parent</description>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>com.pudonghot.ambition</groupId>
|
|
||||||
<artifactId>ambition-crm</artifactId>
|
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
|
||||||
<relativePath>../</relativePath>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<project.build.finalName>${project.artifactId}</project.build.finalName>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.chyxion.tigon</groupId>
|
|
||||||
<artifactId>tigon-webmvc-spring-boot</artifactId>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>spring-boot-starter-logging</artifactId>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<!-- Log -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
|
||||||
<artifactId>log4j-slf4j-impl</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
|
||||||
<artifactId>log4j-core</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.pudonghot.ambition</groupId>
|
|
||||||
<artifactId>web-common</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
<build>
|
|
||||||
<finalName>${project.build.finalName}</finalName>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
@ -30,7 +30,7 @@
|
|||||||
image-height=null
|
image-height=null
|
||||||
image-style=(if (is-screen '<md')
|
image-style=(if (is-screen '<md')
|
||||||
'border-radius: 2%; border: 1px solid #DCDCDC; max-width: 90%;'
|
'border-radius: 2%; border: 1px solid #DCDCDC; max-width: 90%;'
|
||||||
'border-radius: 2%; border: 1px solid #DCDCDC; max-width: 56%;')
|
'border-radius: 2%; border: 1px solid #DCDCDC; max-width: 94%;')
|
||||||
previews=images
|
previews=images
|
||||||
index=index}}
|
index=index}}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user