Skip to content

Commit

Permalink
fw-framework 项目初始化
Browse files Browse the repository at this point in the history
  • Loading branch information
liuweijw committed Dec 24, 2017
1 parent 9b2217b commit 3cbdca0
Show file tree
Hide file tree
Showing 50 changed files with 4,080 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.settings

.project

target

.classpath

.project
26 changes: 26 additions & 0 deletions fw-aop/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?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">
<parent>
<artifactId>fw-framework</artifactId>
<groupId>com.framework</groupId>
<version>1.1.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>fw-aop</artifactId>
<groupId>com.fw.api</groupId>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

17 changes: 17 additions & 0 deletions fw-aop/src/main/java/com/fw/api/aop/annotation/NoLogin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.fw.api.aop.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* 当该批注修饰一个controller方法时,在Controller切面中会对请求该方法的 用户进行鉴权。
*/
@Inherited
@Target({ ElementType.TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface NoLogin {

}
26 changes: 26 additions & 0 deletions fw-base/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?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">
<parent>
<artifactId>fw-framework</artifactId>
<groupId>com.framework</groupId>
<version>1.1.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.fw.api</groupId>
<artifactId>fw-base</artifactId>

<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

20 changes: 20 additions & 0 deletions fw-base/src/main/java/com/fw/api/base/editor/DateEditor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.fw.api.base.editor;

import java.beans.PropertyEditorSupport;

import com.fw.api.base.util.DateHelper;

/**
* 防止表单注入
*
* @author LW
*
*/
public class DateEditor extends PropertyEditorSupport {

@Override
public void setAsText(String text) {
setValue(DateHelper.parseDate(text));
}

}
26 changes: 26 additions & 0 deletions fw-base/src/main/java/com/fw/api/base/editor/StringEditor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.fw.api.base.editor;

import java.beans.PropertyEditorSupport;

import org.apache.commons.lang3.StringEscapeUtils;

/**
* 防止表单注入
*
* @author LW
*
*/
public class StringEditor extends PropertyEditorSupport {

@Override
public void setAsText(String text) {
setValue(text == null ? null : StringEscapeUtils.escapeHtml4(text.trim()));
}

@Override
public String getAsText() {
Object value = getValue();
return value != null ? value.toString() : "";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.fw.api.base.exception;

/**
* 业务异常.
*
* @author lw
*/
public class BusinessException extends Exception {

private static final long serialVersionUID = 6194417822203662894L;

public BusinessException() {
super();
}

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

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.fw.api.base.exception;

/**
* 系统业务异常.
*
* @author lw
*/
public class SystemException extends RuntimeException {

private static final long serialVersionUID = -1312066729114650096L;

public SystemException() {
super();
}

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

public SystemException(Throwable cause) {
super(cause);
}

public SystemException(String message, Throwable cause) {
super(message, cause);
}
}
Loading

0 comments on commit 3cbdca0

Please sign in to comment.