-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
4,080 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.settings | ||
|
||
.project | ||
|
||
target | ||
|
||
.classpath | ||
|
||
.project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
17
fw-aop/src/main/java/com/fw/api/aop/annotation/NoLogin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
20
fw-base/src/main/java/com/fw/api/base/editor/DateEditor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
26
fw-base/src/main/java/com/fw/api/base/editor/StringEditor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() : ""; | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
fw-base/src/main/java/com/fw/api/base/exception/BusinessException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
fw-base/src/main/java/com/fw/api/base/exception/SystemException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
Oops, something went wrong.