Commit 64d4f18d authored by bing zhang's avatar bing zhang
Browse files

1

parent 539344b2
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Environment-dependent path to Maven home directory
/mavenHomeManager.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="xzs" />
</profile>
</annotationProcessing>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="xzs" options="-parameters" />
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/source/java/src/main/java" charset="UTF-8" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="aliyun-releases" />
<option name="name" value="aliyun-releases" />
<option name="url" value="https://maven.aliyun.com/repository/public" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/source/java/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/testDemo.iml" filepath="$PROJECT_DIR$/.idea/testDemo.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?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>
<groupId>com.mindskip</groupId>
<artifactId>xzs</artifactId>
<version>3.9.0</version>
<packaging>jar</packaging>
<name>xzs</name>
<url>https://www.mindskip.net/xzs.html</url>
<description>学之思开源考试系统 - mysql版,支持多种题型:选择题、多选题、判断题、填空题、解答题以及数学公式,包含PC端、小程序端,扩展性强,部署方便(集成部署、前后端分离部署、docker部署)、界面设计友好、代码结构清晰</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<java.version>1.8</java.version>
<mysql.version>8.0.17</mysql.version>
<spring.boot.version>2.1.6.RELEASE</spring.boot.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<issueManagement>
<system>Gitee Issue</system>
<url>https://gitee.com/mindskip/xzs-mysql/issues</url>
</issueManagement>
<licenses>
<license>
<name>GNU Affero General Public License v3.0</name>
<url>https://www.gnu.org/licenses/agpl-3.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<organization>武汉思维跳跃科技有限公司</organization>
<organizationUrl>https://www.mindskip.net</organizationUrl>
<email>mindskip@qq.com</email>
</developer>
</developers>
<scm>
<connection>scm:git@gitee.com:mindskip/xzs-mysql.git</connection>
<developerConnection>scm:git@gitee.com:mindskip/xzs-mysql.git</developerConnection>
<url>git@gitee.com:mindskip/xzs-mysql.git</url>
</scm>
<repositories>
<repository>
<id>aliyun-releases</id>
<url>https://maven.aliyun.com/repository/public</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring.boot.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.12</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.9</version>
</dependency>
<dependency>
<groupId>org.modelmapper</groupId>
<artifactId>modelmapper</artifactId>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>com.qiniu</groupId>
<artifactId>qiniu-java-sdk</artifactId>
<version>7.2.25</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring.boot.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<!-- hot debug -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<version>${spring.boot.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
</project>
package com.mindskip.xzs;
import com.mindskip.xzs.configuration.property.SystemConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* @version 3.5.0
* @description: The type Xzs application.
* Copyright (C), 2020-2021, 武汉思维跳跃科技有限公司
* @date 2021/12/25 9:45
*/
@SpringBootApplication
@EnableTransactionManagement
@EnableConfigurationProperties(value = { SystemConfig.class})
@EnableCaching
public class XzsApplication {
/**
* The entry point of application.
*
* @param args the input arguments
*/
public static void main(String[] args) {
SpringApplication.run(XzsApplication.class, args);
}
}
package com.mindskip.xzs.base;
import com.mindskip.xzs.context.WebContext;
import com.mindskip.xzs.domain.User;
import com.mindskip.xzs.utility.ModelMapperSingle;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @version 3.3.0
* @description: The type Base api controller.
* Copyright (C), 2019-2021, 武汉思维跳跃科技有限公司
* @date 2021 /5/26 10:45
*/
public class BaseApiController {
/**
* The constant DEFAULT_PAGE_SIZE.
*/
protected final static String DEFAULT_PAGE_SIZE = "10";
/**
* The constant modelMapper.
*/
protected final static ModelMapper modelMapper = ModelMapperSingle.Instance();
/**
* The Web context.
*/
@Autowired
protected WebContext webContext;
/**
* Gets current user.
*
* @return the current user
*/
protected User getCurrentUser() {
return webContext.getCurrentUser();
}
}
package com.mindskip.xzs.base;
/**
* @version 3.3.0
* @description: The type Base entity.
* Copyright (C), 2019-2021, 武汉思维跳跃科技有限公司
* @date 2021 /5/26 10:45
*/
public abstract class BaseEntity {
}
package com.mindskip.xzs.base;
/**
* @version 3.3.0
* @description: The type Base page.
* Copyright (C), 2020-2021, 武汉思维跳跃科技有限公司
* @date 2021/5/25 10:45
*/
public class BasePage {
private Integer pageIndex;
private Integer pageSize;
/**
* Gets page index.
*
* @return the page index
*/
public Integer getPageIndex() {
return pageIndex;
}
/**
* Sets page index.
*
* @param pageIndex the page index
*/
public void setPageIndex(Integer pageIndex) {
this.pageIndex = pageIndex;
}
/**
* Gets page size.
*
* @return the page size
*/
public Integer getPageSize() {
return pageSize;
}
/**
* Sets page size.
*
* @param pageSize the page size
*/
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
}
package com.mindskip.xzs.base;
/**
* @version 3.3.0
* @description: The type Rest response.
* Copyright (C), 2020-2021, 武汉思维跳跃科技有限公司
* @date 2021/5/25 10:45
*/
public class RestResponse<T> {
private int code;
private String message;
private T response;
/**
* Instantiates a new Rest response.
*
* @param code the code
* @param message the message
*/
public RestResponse(int code, String message) {
this.code = code;
this.message = message;
}
/**
* Instantiates a new Rest response.
*
* @param code the code
* @param message the message
* @param response the response
*/
public RestResponse(int code, String message, T response) {
this.code = code;
this.message = message;
this.response = response;
}
/**
* Fail rest response.
*
* @param code the code
* @param msg the msg
* @return the rest response
*/
public static RestResponse fail(Integer code, String msg) {
return new RestResponse<>(code, msg);
}
/**
* Ok rest response.
*
* @return the rest response
*/
public static RestResponse ok() {
SystemCode systemCode = SystemCode.OK;
return new RestResponse<>(systemCode.getCode(), systemCode.getMessage());
}
/**
* Ok rest response.
*
* @param <F> the type parameter
* @param response the response
* @return the rest response
*/
public static <F> RestResponse<F> ok(F response) {
SystemCode systemCode = SystemCode.OK;
return new RestResponse<>(systemCode.getCode(), systemCode.getMessage(), response);
}
/**
* Gets code.
*
* @return the code
*/
public int getCode() {
return code;
}
/**
* Sets code.
*
* @param code the code
*/
public void setCode(int code) {
this.code = code;
}
/**
* Gets message.
*
* @return the message
*/
public String getMessage() {
return message;
}
/**
* Sets message.
*
* @param message the message
*/
public void setMessage(String message) {
this.message = message;
}
/**
* Gets response.
*
* @return the response
*/
public T getResponse() {
return response;
}
/**
* Sets response.
*
* @param response the response
*/
public void setResponse(T response) {
this.response = response;
}
}
package com.mindskip.xzs.base;
/**
* @version 3.3.0
* @description: The enum System code.
* Copyright (C), 2020-2021, 武汉思维跳跃科技有限公司
* @date 2021/5/25 10:45
*/
public enum SystemCode {
/**
* OK
*/
OK(1, "成功"),
/**
* AccessTokenError
*/
AccessTokenError(400, "用户登录令牌失效"),
/**
* UNAUTHORIZED
*/
UNAUTHORIZED(401, "用户未登录"),
/**
* UNAUTHORIZED
*/
AuthError(402, "用户名或密码错误"),
/**
* InnerError
*/
InnerError(500, "系统内部错误"),
/**
* ParameterValidError
*/
ParameterValidError(501, "参数验证错误"),
/**
* AccessDenied
*/
AccessDenied(502, "用户没有权限访问");
/**
* The Code.
*/
int code;
/**
* The Message.
*/
String message;
SystemCode(int code, String message) {
this.code = code;
this.message = message;
}
/**
* Gets code.
*
* @return the code
*/
public int getCode() {
return code;
}
/**
* Gets message.
*
* @return the message
*/
public String getMessage() {
return message;
}
}
package com.mindskip.xzs.configuration.application;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* @version 3.5.0
* @description: The type Application context provider.
* Copyright (C), 2020-2021, 武汉思维跳跃科技有限公司
* @date 2021/12/25 9:45
*/
@Component
public class ApplicationContextProvider implements ApplicationContextAware {
private static ApplicationContext context;
private ApplicationContextProvider() {
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
context = applicationContext;
}
/**
* Gets bean.
*
* @param <T> the type parameter
* @param aClass the a class
* @return the bean
*/
public static <T> T getBean(Class<T> aClass) {
return context.getBean(aClass);
}
/**
* Gets bean.
*
* @param <T> the type parameter
* @param name the name
* @return the bean
*/
@SuppressWarnings("unchecked")
public static <T> T getBean(String name) {
return (T) context.getBean(name);
}
}
package com.mindskip.xzs.configuration.property;
/**
* @version 3.5.0
* @description: The type Cookie config.
* Copyright (C), 2020-2021, 武汉思维跳跃科技有限公司
* @date 2021/12/25 9:45
*/
public class CookieConfig {
/**
* Gets name.
*
* @return the name
*/
public static String getName() {
return "xzs";
}
/**
* Gets interval.
*
* @return the interval
*/
public static Integer getInterval() {
return 30 * 24 * 60 * 60;
}
}
package com.mindskip.xzs.configuration.property;
/**
* @version 3.5.0
* @description: The type Password key config.
* Copyright (C), 2020-2021, 武汉思维跳跃科技有限公司
* @date 2021/12/25 9:45
*/
public class PasswordKeyConfig {
private String publicKey;
private String privateKey;
/**
* Gets public key.
*
* @return the public key
*/
public String getPublicKey() {
return publicKey;
}
/**
* Sets public key.
*
* @param publicKey the public key
*/
public void setPublicKey(String publicKey) {
this.publicKey = publicKey;
}
/**
* Gets private key.
*
* @return the private key
*/
public String getPrivateKey() {
return privateKey;
}
/**
* Sets private key.
*
* @param privateKey the private key
*/
public void setPrivateKey(String privateKey) {
this.privateKey = privateKey;
}
}
package com.mindskip.xzs.configuration.property;
import java.time.Duration;
import java.util.List;
/**
* @version 3.5.0
* @description: The type Qn config.
* Copyright (C), 2020-2021, 武汉思维跳跃科技有限公司
* @date 2021/12/25 9:45
*/
public class QnConfig {
private String url;
private String bucket;
private String accessKey;
private String secretKey;
/**
* Gets url.
*
* @return the url
*/
public String getUrl() {
return url;
}
/**
* Sets url.
*
* @param url the url
*/
public void setUrl(String url) {
this.url = url;
}
/**
* Gets bucket.
*
* @return the bucket
*/
public String getBucket() {
return bucket;
}
/**
* Sets bucket.
*
* @param bucket the bucket
*/
public void setBucket(String bucket) {
this.bucket = bucket;
}
/**
* Gets access key.
*
* @return the access key
*/
public String getAccessKey() {
return accessKey;
}
/**
* Sets access key.
*
* @param accessKey the access key
*/
public void setAccessKey(String accessKey) {
this.accessKey = accessKey;
}
/**
* Gets secret key.
*
* @return the secret key
*/
public String getSecretKey() {
return secretKey;
}
/**
* Sets secret key.
*
* @param secretKey the secret key
*/
public void setSecretKey(String secretKey) {
this.secretKey = secretKey;
}
}
package com.mindskip.xzs.configuration.property;
import org.springframework.boot.context.properties.ConfigurationProperties;
import java.util.List;
/**
* @version 3.5.0
* @description: The type System config.
* Copyright (C), 2020-2021, 武汉思维跳跃科技有限公司
* @date 2021/12/25 9:45
*/
@ConfigurationProperties(prefix = "system")
public class SystemConfig {
private PasswordKeyConfig pwdKey;
private List<String> securityIgnoreUrls;
private WxConfig wx;
private QnConfig qn;
/**
* Gets pwd key.
*
* @return the pwd key
*/
public PasswordKeyConfig getPwdKey() {
return pwdKey;
}
/**
* Sets pwd key.
*
* @param pwdKey the pwd key
*/
public void setPwdKey(PasswordKeyConfig pwdKey) {
this.pwdKey = pwdKey;
}
/**
* Gets security ignore urls.
*
* @return the security ignore urls
*/
public List<String> getSecurityIgnoreUrls() {
return securityIgnoreUrls;
}
/**
* Sets security ignore urls.
*
* @param securityIgnoreUrls the security ignore urls
*/
public void setSecurityIgnoreUrls(List<String> securityIgnoreUrls) {
this.securityIgnoreUrls = securityIgnoreUrls;
}
/**
* Gets wx.
*
* @return the wx
*/
public WxConfig getWx() {
return wx;
}
/**
* Sets wx.
*
* @param wx the wx
*/
public void setWx(WxConfig wx) {
this.wx = wx;
}
/**
* Gets qn.
*
* @return the qn
*/
public QnConfig getQn() {
return qn;
}
/**
* Sets qn.
*
* @param qn the qn
*/
public void setQn(QnConfig qn) {
this.qn = qn;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment