Skip to content

Commit

Permalink
chore: 1.0.0 Releases
Browse files Browse the repository at this point in the history
  • Loading branch information
xingyuv committed Jan 16, 2023
1 parent 7f89068 commit eddcb40
Show file tree
Hide file tree
Showing 69 changed files with 345 additions and 272 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Ajplus Captcha , an open source toolset for users,its main Features are as follo
```

# 6. Work Plan
[issues](https://github.com/xingyu4j/captcha-plus/issues)
[issues](https://github.com/xingyuv/captcha-plus/issues)



Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ I Your application is running here: http://localhost:8081
 详细的前后端接入文档,后端示例代码service目录下,前端示例代码view目录下。


# 6 技术支持,如有问题,请提交[Issue](https://github.com/xingyu4j/captcha-plus/issues)
# 6 技术支持,如有问题,请提交[Issue](https://github.com/xingyuv/captcha-plus/issues)

#### 开源不易,劳烦各位star ☺

Expand Down
6 changes: 3 additions & 3 deletions core/captcha-plus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
a.引入jar,已上传至maven中央仓库。
```java
<dependency>
<groupId>com.github.anji-plus</groupId>
<artifactId>captcha</artifactId>
<version>1.1.8</version>
<groupId>com.xingyuv</groupId>
<artifactId>captcha-plus</artifactId>
<version>1.0.0</version>
</dependency>
```
b.修改application.properties,自定义底图和水印,启动后前端就可以请求接口了。[社区底图库](https://gitee.com/anji-plus/AJ-Captcha-Images)
Expand Down
105 changes: 63 additions & 42 deletions core/captcha-plus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,25 @@
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>

<groupId>com.github.xingyu4j</groupId>
<groupId>com.xingyuv</groupId>
<artifactId>captcha-plus</artifactId>
<version>0.0.1</version>
<version>1.0.0</version>

<name>${project.groupId}:${project.artifactId}</name>
<description>captcha-plus.jar</description>
<url>https://github.com/xingyu4j/captcha-plus</url>
<url>https://github.com/xingyuv/captcha-plus</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
<packaging>jar</packaging>

<properties>
Expand Down Expand Up @@ -39,104 +51,113 @@
</license>
</licenses>
<scm>
<connection>scm:git:git://github.com/xingyu4j/captcha-plus.git</connection>
<developerConnection>scm:git:ssh://github.com/xingyu4j/captcha-plus.git</developerConnection>
<url>https://github.com/xingyu4j/captcha-plus/tree/main</url>
<connection>scm:git:git://github.com/xingyuv/captcha-plus.git</connection>
<developerConnection>scm:git:ssh://github.com/xingyuv/captcha-plus.git</developerConnection>
<url>https://github.com/xingyuv/captcha-plus/tree/main</url>
</scm>

<developers>
<developer>
<id>xingyu4j</id>
<name>xingyu4j</name>
<email>xingyu4j@vip.qq.com</email>
<roles>
<role>Developer</role>
</roles>
<timezone>+8</timezone>
</developer>
</developers>

<profiles>
<profile>
<id>releases</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<!-- Source -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Javadoc -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<show>private</show>
<nohelp>true</nohelp>
<charset>UTF-8</charset>
<encoding>UTF-8</encoding>
<docencoding>UTF-8</docencoding>
<additionalparam>-Xdoclint:none</additionalparam>
<!-- TODO 临时解决不规范的javadoc生成报错,后面要规范化后把这行去掉 -->
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<encoding>UTF-8</encoding>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
<!-- GPG -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>site</phase>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<!--Compiler -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<fork>true</fork>
<verbose>true</verbose>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<!--Release -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.1</version>
</plugin>
</plugins>
</build>
<!-- 【注】snapshotRepository 与 repository 中的 id 一定要与 setting.xml 中 server 的 id 保持一致! -->
<distributionManagement>
<snapshotRepository>
<id>releases</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>releases</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</profile>
</profiles>
<!--中央仓库上传配置结束-->

</project>


Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
* 底图类型枚举
*/
public enum CaptchaBaseMapEnum {
/**
* 滑动拼图底图
*/
ORIGINAL("ORIGINAL", "滑动拼图底图"),
/**
* 滑动拼图滑块底图
*/
SLIDING_BLOCK("SLIDING_BLOCK", "滑动拼图滑块底图"),
/**
* 文字点选底图
*/
PIC_CLICK("PIC_CLICK", "文字点选底图");

private String codeValue;
Expand All @@ -24,7 +33,12 @@ public String getCodeDesc() {
return this.codeDesc;
}

//根据codeValue获取枚举
/**
* 根据codeValue获取枚举
*
* @param codeValue 验证值
* @return 枚举
*/
public static CaptchaBaseMapEnum parseFromCodeValue(String codeValue) {
for (CaptchaBaseMapEnum e : CaptchaBaseMapEnum.values()) {
if (e.codeValue.equals(codeValue)) {
Expand All @@ -34,20 +48,34 @@ public static CaptchaBaseMapEnum parseFromCodeValue(String codeValue) {
return null;
}

//根据codeValue获取描述
/**
* 根据codeValue获取描述
*
* @param codeValue 验证值
* @return 描述
*/
public static String getCodeDescByCodeBalue(String codeValue) {
CaptchaBaseMapEnum enumItem = parseFromCodeValue(codeValue);
return enumItem == null ? "" : enumItem.getCodeDesc();
}

//验证codeValue是否有效
/**
* 验证codeValue是否有效
*
* @param codeValue 验证值
* @return 是否有效
*/
public static boolean validateCodeValue(String codeValue) {
return parseFromCodeValue(codeValue) != null;
}

//列出所有值字符串
/**
* 列出所有值字符串
*
* @return 所有值字符串
*/
public static String getString() {
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
for (CaptchaBaseMapEnum e : CaptchaBaseMapEnum.values()) {
buffer.append(e.codeValue).append("--").append(e.getCodeDesc()).append(", ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ public String getCodeDesc() {
return this.codeDesc;
}

//根据codeValue获取枚举
/**
* 根据codeValue获取枚举
*
* @param codeValue codeValue
* @return 枚举
*/
public static CaptchaTypeEnum parseFromCodeValue(String codeValue) {
for (CaptchaTypeEnum e : CaptchaTypeEnum.values()) {
if (e.codeValue.equals(codeValue)) {
Expand All @@ -40,20 +45,34 @@ public static CaptchaTypeEnum parseFromCodeValue(String codeValue) {
return null;
}

//根据codeValue获取描述
/**
* 根据codeValue获取描述
*
* @param codeValue codeValue
* @return 描述
*/
public static String getCodeDescByCodeBalue(String codeValue) {
CaptchaTypeEnum enumItem = parseFromCodeValue(codeValue);
return enumItem == null ? "" : enumItem.getCodeDesc();
}

//验证codeValue是否有效
/**
* 验证codeValue是否有效
*
* @param codeValue codeValue
* @return 是否有效
*/
public static boolean validateCodeValue(String codeValue) {
return parseFromCodeValue(codeValue) != null;
}

//列出所有值字符串
/**
* 所有值字符串
*
* @return 所有值字符串
*/
public static String getString() {
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
for (CaptchaTypeEnum e : CaptchaTypeEnum.values()) {
buffer.append(e.codeValue).append("--").append(e.getCodeDesc()).append(", ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public interface Const {
/**
* 缓存local/redis...
*/
String CAPTCHA_CACHETYPE = "captcha.cacheType";
String CAPTCHA_CACHE_TYPE = "captcha.cacheType";

/**
* 右下角水印文字(我的水印)
Expand Down Expand Up @@ -65,7 +65,7 @@ public interface Const {
/**
* local缓存的阈值
*/
String CAPTCHA_CACAHE_MAX_NUMBER = "captcha.cache.number";
String CAPTCHA_CACHE_MAX_NUMBER = "captcha.cache.number";

/**
* 定时清理过期local缓存,秒
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public String getName() {
* 将入参fieldNames与this.desc组合成错误信息
* {fieldName}不能为空
*
* @param fieldNames
* @param fieldNames 入参
* @return ResponseModel
*/
public ResponseModel parseError(Object... fieldNames) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ public static ResponseModel exceptionMsg(String message) {
return responseModel;
}

@Override
public String toString() {
return "ResponseModel{" + "repCode='" + repCode + '\'' + ", repMsg='"
+ repMsg + '\'' + ", repData=" + repData + '}';
}

public boolean isSuccess() {
return StringUtils.equals(repCode, RepCodeEnum.SUCCESS.getCode());
}
Expand Down Expand Up @@ -113,5 +107,9 @@ public void setRepData(Object repData) {
this.repData = repData;
}


@Override
public String toString() {
return "ResponseModel{" + "repCode='" + repCode + '\'' + ", repMsg='"
+ repMsg + '\'' + ", repData=" + repData + '}';
}
}
Loading

0 comments on commit eddcb40

Please sign in to comment.