提交 057d4a9e 作者: 方治民

Initial commit

上级
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
### VS Code ###
.vscode/
dependencies {
implementation project(":basic-auth")
implementation project(":basic-common:core")
implementation project(":basic-common:util")
implementation project(":basic-common:swagger")
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
runtimeOnly 'mysql:mysql-connector-java'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
implementation 'io.swagger:swagger-annotations:1.6.3'
}
test {
useJUnitPlatform()
}
package com.yiring.app;
import com.yiring.common.swagger.SwaggerConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.data.jpa.convert.threeten.Jsr310JpaConverters;
@EntityScan(basePackageClasses = { Application.class, Jsr310JpaConverters.class })
@SpringBootApplication(scanBasePackageClasses = {SwaggerConfig.class})
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
package com.yiring.app.web;
import com.yiring.common.core.Result;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "Hello World")
@RestController
public class HelloController {
@GetMapping("/")
public Result<String> hello() {
return Result.ok("😎 Hello World!");
}
}
server:
port: 8080
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/basic?useSSL=false&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
username: root
password: 123456
jpa:
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
show-sql: true
open-in-view: true
hibernate:
ddl-auto: update
\ No newline at end of file
package com.yiring;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class ApplicationTests {
@Test
void contextLoads() {
}
}
dependencies {
implementation project(':basic-common:core')
implementation 'cn.dev33:sa-token-spring-boot-starter:1.27.0'
}
test {
useJUnitPlatform()
}
\ No newline at end of file
# Sa-Token配置
sa-token:
# token名称 (同时也是cookie名称)
token-name: satoken
# token有效期,单位s 默认30天, -1代表永不过期
timeout: 2592000
# token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
activity-timeout: -1
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
is-concurrent: true
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
is-share: false
# token风格
token-style: uuid
# 是否输出操作日志
is-log: false
\ No newline at end of file
dependencies {
}
\ No newline at end of file
dependencies {
implementation 'org.aspectj:aspectjweaver:1.9.7'
implementation 'io.swagger:swagger-annotations:1.6.3'
implementation 'org.springframework.boot:spring-boot-starter-web'
}
\ No newline at end of file
package com.yiring.common.aspect;
import com.yiring.common.constant.DateFormatter;
import com.yiring.common.core.Result;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
/**
* 请求接口切面,记录接口耗时
*
* @author ifzm
* @version 0.1
*/
@Aspect
@Component
public class RequestAspect {
@Pointcut("@annotation(org.springframework.web.bind.annotation.PostMapping) || @annotation(org.springframework.web.bind.annotation.GetMapping) || @annotation(org.springframework.web.bind.annotation.ExceptionHandler)")
public void apiPointCut() {
}
@Around("apiPointCut()")
public Object around(ProceedingJoinPoint point) throws Throwable {
long start = System.currentTimeMillis();
Object result = point.proceed();
long end = System.currentTimeMillis();
if (result instanceof Result) {
((Result<?>) result).setTimestamp(LocalDateTime.now().format(DateFormatter.DATE_TIME));
((Result<?>) result).setTimes(String.format("%.3fs", (double) (end - start) / 1000));
}
return result;
}
}
package com.yiring.common.constant;
import lombok.experimental.UtilityClass;
import java.time.format.DateTimeFormatter;
/**
* 初始化一下常用的日期格式化规则
*
* @author ifzm
* @version 0.1
* 2019/3/22 14:08
*/
@SuppressWarnings({ "unused" })
@UtilityClass
public class DateFormatter {
/**
* DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
*/
public final DateTimeFormatter DATE_TIME = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
/**
* DateTimeFormatter.ofPattern("yyyy-MM-dd")
*/
public final DateTimeFormatter DATE = DateTimeFormatter.ofPattern("yyyy-MM-dd");
/**
* DateTimeFormatter.ofPattern("HH:mm:ss")
*/
public final DateTimeFormatter TIME = DateTimeFormatter.ofPattern("HH:mm:ss");
}
package com.yiring.common.core;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.FieldDefaults;
import lombok.extern.slf4j.Slf4j;
import java.io.Serializable;
/**
* 标准的响应对象(所有的接口响应内容格式都应该是一致的)
*
* @author fangzhimin
* @version 1.1
* 2018/9/4 11:05
*/
@SuppressWarnings({ "unchecked", "unused" })
@ApiModel("请求响应标准")
@JsonInclude(JsonInclude.Include.NON_NULL)
@Slf4j
@Data
@Builder
@FieldDefaults(level = AccessLevel.PRIVATE)
public class Result<T extends Serializable> implements Serializable {
private static final long serialVersionUID = -4802543396830024571L;
/**
* 接口响应时间
*/
@ApiModelProperty(value = "响应时间", example = "2021-01-01 00:00:00")
String timestamp;
/**
* 接口耗时(单位:秒)通常在调试阶段出现
*/
@ApiModelProperty(value = "耗时", example = "0.001s")
String times;
/**
* 响应状态码
*/
@ApiModelProperty(value = "状态码", example = "200")
Integer status;
/**
* 响应消息
*/
@ApiModelProperty(value = "消息", example = "OK")
String message;
/**
* 详细信息,通常为参数校验结果或自定义消息
*/
@ApiModelProperty(value = "详细信息", example = "Details message ...")
String details;
/**
* 异常信息,通常在出现服务器错误时会出现该异常
*/
@ApiModelProperty(value = "异常信息", notes = "出现错误时会出现该字段", example = "Error message ...")
String error;
/**
* 响应内容
*/
@ApiModelProperty("内容")
T body;
/**
* 返回成功响应内容(默认)
*
* @return Result
* @see com.yiring.common.core.Status
*/
public static <T extends Serializable> Result<T> ok() {
return (Result<T>) Result.builder()
.status(Status.OK.value())
.message(Status.OK.getReasonPhrase())
.build();
}
/**
* 返回自定义body的成功响应内容
*
* @param body {@link Object}
* @return Result
*/
public static <T extends Serializable> Result<T> ok(T body) {
return (Result<T>) Result.builder()
.status(Status.OK.value())
.message(Status.OK.getReasonPhrase())
.body(body)
.build();
}
/**
* 返回失败响应内容
*
* @return Result
* @see Status#BAD_REQUEST
*/
public static <T extends Serializable> Result<T> no(Status status) {
return no(status, null, null);
}
/**
* 返回失败响应内容
*
* @return Result
* @see Status
*/
public static <T extends Serializable> Result<T> no(Status status, String details) {
return no(status, details, null);
}
/**
* 返回失败响应内容
*
* @return Result
* @see Status
*/
public static <T extends Serializable> Result<T> no(Status status, Throwable error) {
return no(status, null, error);
}
/**
* 返回失败响应内容
*
* @return Result
* @see Status
*/
public static <T extends Serializable> Result<T> no(Status status, String details, Throwable error) {
Result<T> result = (Result<T>) Result.builder()
.status(status.value())
.message(status.getReasonPhrase())
.details(details)
.build();
if (error != null) {
result.setError(error.getMessage());
}
return result;
}
}
package com.yiring.common.core;
import org.springframework.lang.Nullable;
/**
* API 响应状态码
* 包含系统和业务两个维度
*/
@SuppressWarnings({ "unused" })
public enum Status {
/**
* 成功
*/
OK(200, "OK"),
/**
* 用户认证失败
*/
NON_AUTHORITATIVE_INFORMATION(203, "认证失败"),
/**
* 失败的请求,通常是一些验证错误
*/
BAD_REQUEST(400, "FAIL"),
/**
* 鉴权失败
*/
UNAUTHORIZED(401, "凭证过期"),
/**
* Token 错误/失效
*/
FORBIDDEN(403, "Token 错误/失效"),
/**
* 找不到资源
*/
NOT_FOUND(404, "Not Found"),
/**
* 不支持的请求类型
*/
METHOD_NOT_ALLOWED(405, "不支持的请求类型"),
/**
* 参数校验失败
*/
EXPECTATION_FAILED(417, "无效参数"),
/**
* 服务器错误
*/
INTERNAL_SERVER_ERROR(500, "服务器错误"),
/**
* 未知错误
*/
UNKNOWN_ERROR(500, "服务器错误"),
/**
* API 未实现
*/
NOT_IMPLEMENTED(501, "API 未实现"),
/**
* 服务异常(网关提醒)
*/
BAD_GATEWAY(502, "Bad Gateway"),
/**
* 服务暂停(网关提醒)
*/
SERVICE_UNAVAILABLE(503, "Service Unavailable");
private final int value;
private final String reasonPhrase;
Status(int value, String reasonPhrase) {
this.value = value;
this.reasonPhrase = reasonPhrase;
}
/**
* Return the enum constant of this type with the specified numeric value.
*
* @param statusCode the numeric value of the enum to be returned
* @return the enum constant with the specified numeric value
* @throws IllegalArgumentException if this enum has no constant for the specified numeric value
*/
public static Status valueOf(int statusCode) {
Status status = resolve(statusCode);
if (status == null) {
throw new IllegalArgumentException("No matching constant for [" + statusCode + "]");
}
return status;
}
/**
* Resolve the given status code to an {@code ResultStatus}, if possible.
*
* @param statusCode the HTTP status code (potentially non=standard)
* @return the corresponding {@code ResultStatus}, or {@code null} if not found
* @since 5.0
*/
@Nullable
public static Status resolve(int statusCode) {
for (Status status : values()) {
if (status.value == statusCode) {
return status;
}
}
return null;
}
/**
* Return the integer value of this status code.
*/
public int value() {
return this.value;
}
/**
* Return the reason phrase of this status code.
*/
public String getReasonPhrase() {
return this.reasonPhrase;
}
/**
* Return a string representation of this status code.
*/
@Override
public String toString() {
return this.value + " " + name();
}
}
dependencies {
implementation project(":basic-common:core")
implementation 'org.springframework.boot:spring-boot-starter-web'
// swagger
implementation 'com.github.xiaoymin:knife4j-spring-boot-starter:3.0.3'
}
\ No newline at end of file
package com.yiring.common;
\ No newline at end of file
package com.yiring.common.swagger;
import com.yiring.common.core.Status;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Profile;
import org.springframework.http.HttpMethod;
import springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration;
import springfox.documentation.builders.*;
import springfox.documentation.schema.ScalarType;
import springfox.documentation.service.*;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Collectors;
/**
* Swagger Config
*
* @author ifzm
* @version 0.1
* 2019/3/11 19:13
*/
@Slf4j
@Profile(value = { "dev", "test", "preview" })
@Configuration
@Import(BeanValidatorPluginsConfiguration.class)
public class SwaggerConfig {
@Value("${spring.application.name}")
String applicationName;
@Value("${spring.server.port}")
String serverPort;
@Bean
public Docket api() {
return api(PathSelectors.any());
}
private Docket api(Predicate<String> paths) {
log.info("API Doc: http://localhost:{}/doc.html", serverPort);
return new Docket(DocumentationType.SWAGGER_2)
.groupName("default")
.apiInfo(apiInfo())
.useDefaultResponseMessages(false)
.globalRequestParameters(buildGlobalRequestParameters())
.globalResponses(HttpMethod.GET, buildGlobalResponseMessage())
.globalResponses(HttpMethod.POST, buildGlobalResponseMessage())
.select()
.apis(RequestHandlerSelectors.withClassAnnotation(Api.class))
.paths(paths)
.build();
}
private ApiInfo apiInfo() {
String url = "https://yiring.com";
return new ApiInfoBuilder()
.title("Swagger 接口文档.")
.description(applicationName)
.version("1.0")
.termsOfServiceUrl(url)
.contact(new Contact("YiRing", url, "developer@yiring.com"))
.build();
}
/**
* 构建全局请求参数
*
* @return Token 等自定义全局参数/Header
*/
private List<RequestParameter> buildGlobalRequestParameters() {
List<RequestParameter> parameters = new ArrayList<>();
parameters.add(new RequestParameterBuilder()
.name("Authorization")
.description("Auth Token")
.required(true)
.in(ParameterType.HEADER)
.query(q -> q.model(m -> m.scalarModel(ScalarType.STRING)))
.build());
return parameters;
}
/**
* 构建全局响应消息
*
* @return 所有自定义状态码消息
*/
private List<Response> buildGlobalResponseMessage() {
return Arrays.stream(Status.values())
.map(status -> new ResponseBuilder()
.code(String.valueOf(status.value()))
.description(status.getReasonPhrase())
.build())
.collect(Collectors.toList());
}
}
knife4j:
enable: false
setting:
enableSwaggerModels: false
\ No newline at end of file
plugins {
id 'org.springframework.boot' version '2.5.6'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
group = 'com.yiring'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
allprojects {
repositories {
mavenLocal()
maven { url 'https://maven.aliyun.com/repository/public' }
mavenCentral()
}
}
subprojects {
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'java'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
}
\ No newline at end of file
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$(ls -ld "$app_path")
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
APP_HOME=$(cd "${APP_HOME:-./}" && pwd -P) || exit
APP_NAME="Gradle"
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn() {
echo "$*"
} >&2
die() {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$(uname)" in #(
CYGWIN*) cygwin=true ;; #(
Darwin*) darwin=true ;; #(
MSYS* | MINGW*) msys=true ;; #(
NONSTOP*) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ]; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop"; then
case $MAX_FD in #(
max*)
MAX_FD=$(ulimit -H -n) ||
warn "Could not query maximum file descriptor limit"
;;
esac
case $MAX_FD in #(
'' | soft) : ;; #(
*)
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
;;
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys"; then
APP_HOME=$(cygpath --path --mixed "$APP_HOME")
CLASSPATH=$(cygpath --path --mixed "$CLASSPATH")
JAVACMD=$(cygpath --unix "$JAVACMD")
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg; do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*)
t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ]
;; #(
*) false ;;
esac
then
arg=$(cygpath --path --ignore --mixed "$arg")
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
pluginManagement {
repositories {
maven { url "https://maven.aliyun.com/repository/gradle-plugin"
}
}
}
rootProject.name = 'basic'
include 'app'
include 'basic-auth'
include 'basic-common'
include 'basic-common:core'
include 'basic-common:util'
include 'basic-common:swagger'
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论