diff --git a/kernel-s-group/README.md b/kernel-s-group/README.md new file mode 100644 index 000000000..c7f463666 --- /dev/null +++ b/kernel-s-group/README.md @@ -0,0 +1 @@ +# 业务分组 \ No newline at end of file diff --git a/kernel-s-group/group-api/README.md b/kernel-s-group/group-api/README.md new file mode 100644 index 000000000..27e91dc89 --- /dev/null +++ b/kernel-s-group/group-api/README.md @@ -0,0 +1 @@ +# api模块,存放接口、常量、异常、枚举等模块规则相关类 \ No newline at end of file diff --git a/kernel-s-group/group-api/pom.xml b/kernel-s-group/group-api/pom.xml new file mode 100644 index 000000000..8153f940e --- /dev/null +++ b/kernel-s-group/group-api/pom.xml @@ -0,0 +1,37 @@ + + + 4.0.0 + + + cn.stylefeng.roses + kernel-s-group + 7.2.3 + ../pom.xml + + + group-api + + jar + + + + + + cn.stylefeng.roses + config-api + ${roses.version} + + + + + + cn.stylefeng.roses + validator-api + ${roses.version} + + + + + diff --git a/kernel-s-group/group-api/src/main/java/cn/stylefeng/roses/kernel/group/api/GroupApi.java b/kernel-s-group/group-api/src/main/java/cn/stylefeng/roses/kernel/group/api/GroupApi.java new file mode 100644 index 000000000..0d4b93286 --- /dev/null +++ b/kernel-s-group/group-api/src/main/java/cn/stylefeng/roses/kernel/group/api/GroupApi.java @@ -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. + * + * Guns采用APACHE 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.group.api; + +/** + * 业务分组Api + * + * @author fengshuonan + * @date 2022-06-24 17:15:41 + */ +public interface GroupApi { + + +} diff --git a/kernel-s-group/group-api/src/main/java/cn/stylefeng/roses/kernel/group/api/constants/GroupConstants.java b/kernel-s-group/group-api/src/main/java/cn/stylefeng/roses/kernel/group/api/constants/GroupConstants.java new file mode 100644 index 000000000..e6a0fb9bc --- /dev/null +++ b/kernel-s-group/group-api/src/main/java/cn/stylefeng/roses/kernel/group/api/constants/GroupConstants.java @@ -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. + * + * Guns采用APACHE 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.group.api.constants; + +/** + * 业务分组业务 + * + * @author fengshuonan + * @date 2022-06-24 17:15:41 + */ +public interface GroupConstants { + + /** + * 业务分组模块名称 + */ + String GROUP_MODULE_NAME = "kernel-s-group"; + + /** + * 异常枚举的步进值 + */ + String GROUP_EXCEPTION_STEP_CODE = "99"; + +} diff --git a/kernel-s-group/group-api/src/main/java/cn/stylefeng/roses/kernel/group/api/enums/DemoEnum.java b/kernel-s-group/group-api/src/main/java/cn/stylefeng/roses/kernel/group/api/enums/DemoEnum.java new file mode 100644 index 000000000..f1a5e7fc6 --- /dev/null +++ b/kernel-s-group/group-api/src/main/java/cn/stylefeng/roses/kernel/group/api/enums/DemoEnum.java @@ -0,0 +1,33 @@ +package cn.stylefeng.roses.kernel.group.api.enums; + +import lombok.Getter; + +/** + * 一个示例 + * + * @author fengshuonan + * @date 2022-06-24 17:15:41 + */ +@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; + } + +} diff --git a/kernel-s-group/group-api/src/main/java/cn/stylefeng/roses/kernel/group/api/exception/GroupException.java b/kernel-s-group/group-api/src/main/java/cn/stylefeng/roses/kernel/group/api/exception/GroupException.java new file mode 100644 index 000000000..4096fd778 --- /dev/null +++ b/kernel-s-group/group-api/src/main/java/cn/stylefeng/roses/kernel/group/api/exception/GroupException.java @@ -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. + * + * Guns采用APACHE 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.group.api.exception; + +import cn.hutool.core.util.StrUtil; +import cn.stylefeng.roses.kernel.group.api.constants.GroupConstants; +import cn.stylefeng.roses.kernel.rule.exception.AbstractExceptionEnum; +import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException; + +/** + * 业务分组异常 + * + * @author fengshuonan + * @date 2022-06-24 17:15:41 + */ +public class GroupException extends ServiceException { + + public GroupException(AbstractExceptionEnum exception, Object... params) { + super(GroupConstants.GROUP_MODULE_NAME, exception.getErrorCode(), StrUtil.format(exception.getUserTip(), params)); + } + + public GroupException(AbstractExceptionEnum exception) { + super(GroupConstants.GROUP_MODULE_NAME, exception); + } + +} diff --git a/kernel-s-group/group-api/src/main/java/cn/stylefeng/roses/kernel/group/api/exception/enums/GroupExceptionEnum.java b/kernel-s-group/group-api/src/main/java/cn/stylefeng/roses/kernel/group/api/exception/enums/GroupExceptionEnum.java new file mode 100644 index 000000000..6ababadb3 --- /dev/null +++ b/kernel-s-group/group-api/src/main/java/cn/stylefeng/roses/kernel/group/api/exception/enums/GroupExceptionEnum.java @@ -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. + * + * Guns采用APACHE 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.group.api.exception.enums; + +import cn.stylefeng.roses.kernel.group.api.constants.GroupConstants; +import cn.stylefeng.roses.kernel.rule.constants.RuleConstants; +import cn.stylefeng.roses.kernel.rule.exception.AbstractExceptionEnum; +import lombok.Getter; + +/** + * 业务分组的异常枚举 + * + * @author fengshuonan + * @date 2022-06-24 17:15:41 + */ +@Getter +public enum GroupExceptionEnum implements AbstractExceptionEnum { + + /** + * 查询不到对应业务分组 + */ + CANT_FIND_GROUP(RuleConstants.BUSINESS_ERROR_TYPE_CODE + GroupConstants.GROUP_EXCEPTION_STEP_CODE + "01", "查询不到对应业务分组,具体信息:{}"); + + /** + * 错误编码 + */ + private final String errorCode; + + /** + * 提示用户信息 + */ + private final String userTip; + + GroupExceptionEnum(String errorCode, String userTip) { + this.errorCode = errorCode; + this.userTip = userTip; + } + +} diff --git a/kernel-s-group/group-business/README.md b/kernel-s-group/group-business/README.md new file mode 100644 index 000000000..7a3f68b56 --- /dev/null +++ b/kernel-s-group/group-business/README.md @@ -0,0 +1 @@ +# 业务模块-存放CRUD相关业务 \ No newline at end of file diff --git a/kernel-s-group/group-business/pom.xml b/kernel-s-group/group-business/pom.xml new file mode 100644 index 000000000..81f5f4b10 --- /dev/null +++ b/kernel-s-group/group-business/pom.xml @@ -0,0 +1,59 @@ + + + 4.0.0 + + + cn.stylefeng.roses + kernel-s-group + 7.2.3 + ../pom.xml + + + group-business + + jar + + + + + + cn.stylefeng.roses + group-api + ${roses.version} + + + + + + cn.stylefeng.roses + system-api + ${roses.version} + + + + + + cn.stylefeng.roses + scanner-api + ${roses.version} + + + + + + cn.stylefeng.roses + db-sdk-mp + ${roses.version} + + + + + org.springframework.boot + spring-boot-starter-web + + + + + diff --git a/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/controller/package-info.java b/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/controller/package-info.java new file mode 100644 index 000000000..2c9ba1fdc --- /dev/null +++ b/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/controller/package-info.java @@ -0,0 +1 @@ +package cn.stylefeng.roses.kernel.group.modular.controller; \ No newline at end of file diff --git a/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/entity/package-info.java b/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/entity/package-info.java new file mode 100644 index 000000000..0d11a5893 --- /dev/null +++ b/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/entity/package-info.java @@ -0,0 +1 @@ +package cn.stylefeng.roses.kernel.group.modular.entity; \ No newline at end of file diff --git a/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/enums/package-info.java b/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/enums/package-info.java new file mode 100644 index 000000000..a0224da91 --- /dev/null +++ b/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/enums/package-info.java @@ -0,0 +1 @@ +package cn.stylefeng.roses.kernel.group.modular.enums; \ No newline at end of file diff --git a/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/mapper/package-info.java b/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/mapper/package-info.java new file mode 100644 index 000000000..d7d2a76bb --- /dev/null +++ b/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/mapper/package-info.java @@ -0,0 +1 @@ +package cn.stylefeng.roses.kernel.group.modular.mapper; \ No newline at end of file diff --git a/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/pojo/package-info.java b/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/pojo/package-info.java new file mode 100644 index 000000000..05483230f --- /dev/null +++ b/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/pojo/package-info.java @@ -0,0 +1 @@ +package cn.stylefeng.roses.kernel.group.modular.pojo; \ No newline at end of file diff --git a/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/service/package-info.java b/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/service/package-info.java new file mode 100644 index 000000000..a154ecbfd --- /dev/null +++ b/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/service/package-info.java @@ -0,0 +1 @@ +package cn.stylefeng.roses.kernel.group.modular.service; \ No newline at end of file diff --git a/kernel-s-group/group-spring-boot-starter/README.md b/kernel-s-group/group-spring-boot-starter/README.md new file mode 100644 index 000000000..ab408c724 --- /dev/null +++ b/kernel-s-group/group-spring-boot-starter/README.md @@ -0,0 +1,2 @@ +# Spring Boot自动装配 + diff --git a/kernel-s-group/group-spring-boot-starter/pom.xml b/kernel-s-group/group-spring-boot-starter/pom.xml new file mode 100644 index 000000000..c2796c8e4 --- /dev/null +++ b/kernel-s-group/group-spring-boot-starter/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + + + cn.stylefeng.roses + kernel-s-group + 7.2.3 + ../pom.xml + + + group-spring-boot-starter + + jar + + + + + + cn.stylefeng.roses + group-business + ${roses.version} + + + + + diff --git a/kernel-s-group/group-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/group/starter/GroupAutoConfiguration.java b/kernel-s-group/group-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/group/starter/GroupAutoConfiguration.java new file mode 100644 index 000000000..962cfeddf --- /dev/null +++ b/kernel-s-group/group-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/group/starter/GroupAutoConfiguration.java @@ -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. + * + * Guns采用APACHE 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.group.starter; + +import org.springframework.context.annotation.Configuration; + +/** + * 业务分组自动装配 + * + * @author fengshuonan + * @date 2022-06-24 17:15:41 + */ +@Configuration +public class GroupAutoConfiguration { + +} diff --git a/kernel-s-group/group-spring-boot-starter/src/main/resources/META-INF/spring.factories b/kernel-s-group/group-spring-boot-starter/src/main/resources/META-INF/spring.factories new file mode 100644 index 000000000..e9598c2ab --- /dev/null +++ b/kernel-s-group/group-spring-boot-starter/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ + cn.stylefeng.roses.kernel.group.starter.GroupAutoConfiguration diff --git a/kernel-s-group/pom.xml b/kernel-s-group/pom.xml new file mode 100644 index 000000000..f49222f64 --- /dev/null +++ b/kernel-s-group/pom.xml @@ -0,0 +1,36 @@ + + + 4.0.0 + + + cn.stylefeng.roses + roses-kernel + 7.2.3 + ../pom.xml + + + kernel-s-group + + pom + + + group-api + group-business + group-spring-boot-starter + + + + + + + cn.stylefeng.roses + kernel-a-rule + ${roses.version} + + + + + + diff --git a/pom.xml b/pom.xml index 4e511ceff..e59b24384 100644 --- a/pom.xml +++ b/pom.xml @@ -94,6 +94,9 @@ kernel-s-expand + + kernel-s-group + kernel-s-message