com.diboot.devtools.v2.OOOO00O0OO0O0O00 Maven / Gradle / Ivy
The newest version!
/**
* Copyright (c) dibo.ltd, https://www.dibo.ltd, https://www.diboot.com
*
* ---- 版权声明 ----
* Diboot相关商标、软件著作权、专利等全部知识产权隶属于苏州帝博信息技术有限公司。
* Diboot devtools 非开源项目,如您有devtools相关定制化需求,请至官网(https://www.dibo.ltd)联系帝博信息商务。
*
* 《中华人民共和国刑法》规定:破坏计算机信息系统罪,处五年以下有期徒刑或者拘役;后果特别严重的,处五年以上有期徒刑。
* 侵犯知识产权罪:处三年以下有期徒刑、拘役或管制,并处罚金;情节特别严重的,处三年以上七年以下有期徒刑,并处罚金。
*
* 任何尝试破解、破坏devtools、侵犯diboot知识产权的行为,我们将不惜一切代价追究到底!
*
*/
package com.diboot.devtools.v2;
import com.diboot.core.util.S;
import com.diboot.core.util.V;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@Slf4j
@Getter
@Setter
@ConfigurationProperties(prefix = "diboot.devtools")
public class OOOO00O0OO0O0O00 {
private String codesAuthor;
private String codesCopyright;
private String codesVersion;
private String outputPath;
private String outputPathBase;
private String outputPathEntity;
private String outputPathVo;
private String outputPathDto;
private String outputPathService;
private String outputPathServiceImpl;
private String outputPathMapper;
private String outputPathMapperXml;
private String outputPathController;
private String outputPathHandler;
private String outputPathExcelHandle;
private String outputPathAdminUi;
private String outputPathMobileUi;
private String outputPathSql;
private boolean generateMapperXml = true;
private Boolean enableSwagger;
private Boolean enableLombok;
private String license;
private String cloudGatewayUri = "http://localhost:8000";
private String cloudAuthClientId = "platform";
private String cloudAuthClientSecret = "diboot";
private String cloudAuthUsername = "admin";
private String cloudAuthPassword = "123456";
private ModuleStrategy modulePathStrategy = ModuleStrategy.AfterLayer;
private boolean middleTableIgnore = true;
public enum ModuleStrategy {
AsNormal, BeforeLayer, AfterLayer
}
public String l1ll1llll1ll1l1() {
return l111l1111ll1ll1() + "user-center";
}
public String l111l1111ll1ll1() {
String formatCloudGatewayUri = cloudGatewayUri;
if (!S.endsWith(formatCloudGatewayUri, "/")) {
formatCloudGatewayUri += "/";
}
return formatCloudGatewayUri;
}
public boolean ll11l1lll1l1lll() {
O0OO00OOOO0OO0O0 config = OO0O0OOOOO0O0O00.l11111l1ll1ll1l();
if (config.getAuthor() == null) {
log.warn("请配置devtools参数 - 代码作者:diboot.devtools.codes-author");
}
if (getOutputPathAdminUi() == null && getOutputPathMobileUi() == null) {
log.warn("如需使用前端生成,请配置devtools前端项目路径:diboot.devtools.output-path-*-ui");
}
if (getOutputPath() != null) {
return true;
}
List layers = new ArrayList<>();
if (getOutputPathEntity() == null) {
layers.add("Entity");
}
if (getOutputPathDto() == null) {
layers.add("DTO");
}
if (getOutputPathVo() == null) {
layers.add("VO");
}
if (getOutputPathController() == null) {
layers.add("Controller");
}
if (getOutputPathMapper() == null) {
layers.add("Mapper");
}
if (getOutputPathService() == null) {
layers.add("Service");
}
if (V.notEmpty(layers)) {
log.warn("请配置devtools参数 - 各层代码生成路径:{}。如无自定义需求,可只配置根路径: diboot.devtools.output-path", S.join(layers));
return false;
}
if (getOutputPathSql() == null) {
log.warn("请配置devtools参数 - SQL文件输出路径:diboot.devtools.output-path-sql");
}
if (V.isEmpty(layers)) {
return true;
}
layers.clear();
return false;
}
}