【7.2.2】初始化expand模块

pull/29/head
fengshuonan 2022-03-29 23:27:13 +08:00
parent f9241328f7
commit 84925b434d
26 changed files with 566 additions and 0 deletions

40
kernel-s-expand/.gitignore vendored Normal file
View File

@ -0,0 +1,40 @@
*.class
# Package Files #
*.jar
*.war
*.ear
target/
# eclipse
.settings/
.classpath
.project
logs/
# idea
.idea/
*.iml
*velocity.log*
### STS ###
.apt_generated
.factorypath
.springBeans
### IntelliJ IDEA ###
.idea
*.iws
*.ipr
### NetBeans ###
nbproject/private/
build/
nbbuild/
dist/
nbdist/
.nb-gradle/
*.log
tmp/

View File

@ -0,0 +1 @@
# 拓展字段

View File

@ -0,0 +1 @@
# api模块存放接口、常量、异常、枚举等模块规则相关类

View File

@ -0,0 +1,37 @@
<?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>
<parent>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-s-expand</artifactId>
<version>7.2.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>expand-api</artifactId>
<packaging>jar</packaging>
<dependencies>
<!--config模块的api-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>config-api</artifactId>
<version>${roses.version}</version>
</dependency>
<!--参数校验模块-->
<!--用在控制器,参数校验-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>validator-api</artifactId>
<version>${roses.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,36 @@
/*
* Copyright [2020-2030] [https://www.stylefeng.cn]
*
* 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
*
* http://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.
*
* GunsAPACHE LICENSE 2.0使
*
* 1.LICENSE
* 2.Guns
* 3.
* 4. https://gitee.com/stylefeng/guns
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kernel.expand.modular.api;
/**
* Api
*
* @author fengshuonan
* @date 2022-03-29 23:14:31
*/
public interface ExpandApi {
}

View File

@ -0,0 +1,45 @@
/*
* Copyright [2020-2030] [https://www.stylefeng.cn]
*
* 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
*
* http://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.
*
* GunsAPACHE LICENSE 2.0使
*
* 1.LICENSE
* 2.Guns
* 3.
* 4. https://gitee.com/stylefeng/guns
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kernel.expand.modular.api.constants;
/**
*
*
* @author fengshuonan
* @date 2022-03-29 23:14:31
*/
public interface ExpandConstants {
/**
*
*/
String EXPAND_MODULE_NAME = "kernel-s-expand";
/**
*
*/
String EXPAND_EXCEPTION_STEP_CODE = "99";
}

View File

@ -0,0 +1,33 @@
package cn.stylefeng.roses.kernel.expand.modular.api.enums;
import lombok.Getter;
/**
*
*
* @author fengshuonan
* @date 2022-03-29 23:14:31
*/
@Getter
public enum DemoEnum {
/**
* markdown
*/
MARKDOWN(1, "markdown格式"),
/**
*
*/
TEXT(2, "富文本格式");
private final Integer code;
private final String message;
DemoEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
}

View File

@ -0,0 +1,48 @@
/*
* Copyright [2020-2030] [https://www.stylefeng.cn]
*
* 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
*
* http://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.
*
* GunsAPACHE LICENSE 2.0使
*
* 1.LICENSE
* 2.Guns
* 3.
* 4. https://gitee.com/stylefeng/guns
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kernel.expand.modular.api.exception;
import cn.hutool.core.util.StrUtil;
import cn.stylefeng.roses.kernel.expand.modular.api.constants.ExpandConstants;
import cn.stylefeng.roses.kernel.rule.exception.AbstractExceptionEnum;
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
/**
*
*
* @author fengshuonan
* @date 2022-03-29 23:14:31
*/
public class ExpandException extends ServiceException {
public ExpandException(AbstractExceptionEnum exception, Object... params) {
super(ExpandConstants.EXPAND_MODULE_NAME, exception.getErrorCode(), StrUtil.format(exception.getUserTip(), params));
}
public ExpandException(AbstractExceptionEnum exception) {
super(ExpandConstants.EXPAND_MODULE_NAME, exception);
}
}

View File

@ -0,0 +1,61 @@
/*
* Copyright [2020-2030] [https://www.stylefeng.cn]
*
* 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
*
* http://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.
*
* GunsAPACHE LICENSE 2.0使
*
* 1.LICENSE
* 2.Guns
* 3.
* 4. https://gitee.com/stylefeng/guns
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kernel.expand.modular.api.exception.enums;
import cn.stylefeng.roses.kernel.expand.modular.api.constants.ExpandConstants;
import cn.stylefeng.roses.kernel.rule.constants.RuleConstants;
import cn.stylefeng.roses.kernel.rule.exception.AbstractExceptionEnum;
import lombok.Getter;
/**
*
*
* @author fengshuonan
* @date 2022-03-29 23:14:31
*/
@Getter
public enum ExpandExceptionEnum implements AbstractExceptionEnum {
/**
*
*/
CANT_FIND_EXPAND(RuleConstants.BUSINESS_ERROR_TYPE_CODE + ExpandConstants.EXPAND_EXCEPTION_STEP_CODE + "01", "查询不到对应拓展字段,具体信息:{}");
/**
*
*/
private final String errorCode;
/**
*
*/
private final String userTip;
ExpandExceptionEnum(String errorCode, String userTip) {
this.errorCode = errorCode;
this.userTip = userTip;
}
}

View File

@ -0,0 +1 @@
# 业务模块-存放CRUD相关业务

View File

@ -0,0 +1,66 @@
<?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>
<parent>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-s-expand</artifactId>
<version>7.2.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>expand-business</artifactId>
<packaging>jar</packaging>
<dependencies>
<!--拓展字段api-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>expand-api</artifactId>
<version>${roses.version}</version>
</dependency>
<!--拓展字段SDK模块-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>expand-sdk</artifactId>
<version>${roses.version}</version>
</dependency>
<!--system业务api-->
<!--调用用户相关业务-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>system-api</artifactId>
<version>${roses.version}</version>
</dependency>
<!--资源api模块-->
<!--用在资源控制器,资源扫描上-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>scanner-api</artifactId>
<version>${roses.version}</version>
</dependency>
<!--数据库sdk-->
<!--数据库dao框架-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>db-sdk-mp</artifactId>
<version>${roses.version}</version>
</dependency>
<!--web模块-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1 @@
package cn.stylefeng.roses.kernel.expand.modular.modular.controller;

View File

@ -0,0 +1 @@
package cn.stylefeng.roses.kernel.expand.modular.modular.entity;

View File

@ -0,0 +1 @@
package cn.stylefeng.roses.kernel.expand.modular.modular.enums;

View File

@ -0,0 +1 @@
package cn.stylefeng.roses.kernel.expand.modular.modular.mapper;

View File

@ -0,0 +1 @@
package cn.stylefeng.roses.kernel.expand.modular.modular.pojo;

View File

@ -0,0 +1 @@
package cn.stylefeng.roses.kernel.expand.modular.modular.service;

View File

@ -0,0 +1 @@
# SDK模块存放一些本模块通用的工具处理类等

View File

@ -0,0 +1,29 @@
<?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>
<parent>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-s-expand</artifactId>
<version>7.2.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>expand-sdk</artifactId>
<packaging>jar</packaging>
<dependencies>
<!--拓展字段api-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>expand-api</artifactId>
<version>${roses.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1 @@
package cn.stylefeng.roses.kernel.expand.modular.sdk;

View File

@ -0,0 +1,2 @@
# Spring Boot自动装配

View File

@ -0,0 +1,29 @@
<?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>
<parent>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-s-expand</artifactId>
<version>7.2.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>expand-spring-boot-starter</artifactId>
<packaging>jar</packaging>
<dependencies>
<!--拓展字段业务模块-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>expand-business</artifactId>
<version>${roses.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,38 @@
/*
* Copyright [2020-2030] [https://www.stylefeng.cn]
*
* 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
*
* http://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.
*
* GunsAPACHE LICENSE 2.0使
*
* 1.LICENSE
* 2.Guns
* 3.
* 4. https://gitee.com/stylefeng/guns
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kernel.expand.modular.starter;
import org.springframework.context.annotation.Configuration;
/**
*
*
* @author fengshuonan
* @date 2022-03-29 23:14:31
*/
@Configuration
public class ExpandAutoConfiguration {
}

View File

@ -0,0 +1,2 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
cn.stylefeng.roses.kernel.expand.modular.starter.ExpandAutoConfiguration

86
kernel-s-expand/pom.xml Normal file
View File

@ -0,0 +1,86 @@
<?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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.2</version>
</parent>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-s-expand</artifactId>
<version>7.2.1</version>
<packaging>pom</packaging>
<modules>
<module>expand-api</module>
<module>expand-business</module>
<module>expand-sdk</module>
<module>expand-spring-boot-starter</module>
</modules>
<properties>
<java.version>1.8</java.version>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<roses.version>7.2.1</roses.version>
</properties>
<dependencies>
<!-- 开发规则 -->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-a-rule</artifactId>
<version>${roses.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<attach>true</attach>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
</build>
</project>

View File

@ -91,6 +91,9 @@
<!--字典业务模块-->
<module>kernel-s-dict</module>
<!--字段拓展业务-->
<module>kernel-s-expand</module>
<!--系统消息模块-->
<module>kernel-s-message</module>