共享驿站

This commit is contained in:
sxu 2025-02-13 14:43:55 +08:00
parent 5edb16da00
commit 23e2ee1e76
9 changed files with 508 additions and 0 deletions

View File

@ -0,0 +1,213 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.bonus</groupId>
<artifactId>bonus-modules</artifactId>
<version>24.12.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>bonus-shared-station</artifactId>
<description>
bonus-modules-shared-station 共享驿站
</description>
<dependencies>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.1</version>
</dependency>
<!--加密依赖包-->
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>${jasypt-spring-boot-starter.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
<!-- SpringCloud Alibaba Nacos -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- SpringCloud Alibaba Nacos Config -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- SpringCloud Alibaba Sentinel -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<!-- SpringBoot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- Swagger UI -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.fox.version}</version>
</dependency>
<!-- Mysql Connector -->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
</dependency>
<!-- bonus Common DataSource -->
<dependency>
<groupId>com.bonus</groupId>
<artifactId>bonus-common-datasource</artifactId>
</dependency>
<!-- bonus Common DataScope -->
<dependency>
<groupId>com.bonus</groupId>
<artifactId>bonus-common-datascope</artifactId>
</dependency>
<!-- bonus Common Log -->
<dependency>
<groupId>com.bonus</groupId>
<artifactId>bonus-common-log</artifactId>
</dependency>
<!-- bonus Common Swagger -->
<dependency>
<groupId>com.bonus</groupId>
<artifactId>bonus-common-swagger</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>30.0-jre</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>com.bonus</groupId>
<artifactId>bonus-common-biz</artifactId>
<version>24.12.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<!-- Apache POI dependencies -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.3</version>
</dependency>
<!-- 支付宝支付-->
<dependency>
<groupId>com.alipay.sdk</groupId>
<artifactId>alipay-sdk-java</artifactId>
<version>4.34.0.ALL</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mybatis-plus.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.0.5</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.11</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.23</version>
<scope>compile</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.redisson/redisson -->
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
<version>3.44.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.rocketmq/rocketmq-spring-boot-starter -->
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-spring-boot-starter</artifactId>
<version>2.3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.amqp/spring-rabbit -->
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-amqp</artifactId>
<version>2.4.8</version>
</dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit</artifactId>
<version>2.4.8</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.eclipse.paho/org.eclipse.paho.mqttv5.client -->
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.mqttv5.client</artifactId>
<version>1.2.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.xuxueli/xxl-job-core -->
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
<version>2.4.0</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.4.2</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,37 @@
package com.bonus.core;
import com.bonus.common.security.annotation.EnableCustomConfig;
import com.bonus.common.security.annotation.EnableRyFeignClients;
import com.bonus.common.swagger.annotation.EnableCustomSwagger2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* 系统模块
*
* @author bonus
*/
@EnableCustomConfig
@EnableCustomSwagger2
@EnableScheduling
@EnableRyFeignClients
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class BonusSharedStationApplication
{
public static void main(String[] args)
{
SpringApplication.run(BonusSharedStationApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 2025博诺思共享驿站启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" +
" | ( ' ) | \\ _. / ' \n" +
" |(_ o _) / _( )_ .' \n" +
" | (_,_).' __ ___(_ o _)' \n" +
" | |\\ \\ | || |(_,_)' \n" +
" | | \\ `' /| `-' / \n" +
" | | \\ / \\ / \n" +
" ''-' `'-' `-..-' ");
}
}

View File

@ -0,0 +1,43 @@
package com.bonus.core.common.utils;
import java.util.ArrayList;
import java.util.List;
public class BaseTreeNode {
private Long id;
private Long parentId;
private List<BaseTreeNode> children;
public void addChild(BaseTreeNode baseTreeNode) {
if (this.children == null) {
this.setChildren(new ArrayList());
}
this.getChildren().add(baseTreeNode);
}
public Long getId() {
return this.id;
}
public Long getParentId() {
return this.parentId;
}
public List<BaseTreeNode> getChildren() {
return this.children;
}
public void setId(final Long id) {
this.id = id;
}
public void setParentId(final Long parentId) {
this.parentId = parentId;
}
public void setChildren(final List<BaseTreeNode> children) {
this.children = children;
}
}

View File

@ -0,0 +1,10 @@
Spring Boot Version: ${spring-boot.version}
Spring Application Name: ${spring.application.name}
_ _
(_) | |
_ __ _ _ ___ _ _ _ ______ ___ _ _ ___ | |_ ___ _ __ ___
| '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \
| | | |_| || (_) || |_| || | \__ \| |_| |\__ \| |_ | __/| | | | | |
|_| \__,_| \___/ \__, ||_| |___/ \__, ||___/ \__| \___||_| |_| |_|
__/ | __/ |
|___/ |___/

View File

@ -0,0 +1,45 @@
# Tomcat
server:
port: 58691
# Spring
spring:
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
namespace: smart_canteen
username: nacos
password: nacos
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
namespace: smart_canteen
username: nacos
password: nacos
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
#加密组件
jasypt:
encryptor:
password: Encrypt
mybatis:
configuration:
map-underscore-to-camel-case: true
system:
sysfile:
prefixOffline: http://localhost:9000/lnyst
prefixOnline: http://localhost:9000/lnyst
bucket: /lnyst
oss:
endpoint: http://localhost:9000

View File

@ -0,0 +1,84 @@
# Spring
spring:
application:
# 应用名称
name: bonus-shared-station
profiles:
# 环境配置
active: smart_canteen_local
messages:
basename: "message_device,message_account,message_adapter,message_allocation,message_attendance,message_auth,message_common,message_customer,message_dorm,message_drp,message_kitchen,message_marketing,message_menu,message_merchant,message_notice,message_nutrition,message_open,message_order,message_pay,message_report,message_supermarket,message_backfield,message_bus"
fallback-to-system-locale: false
mq:
type: ${MQ_TYPE:rabbitmq}
namespace: __yunshitang__
topics:
- name: order #订单
- name: backfield #后场
- name: drp #出入库
- name: supermarket #商超
- name: device #设备
- name: acc #账户
- name: notice #通知
- name: auth #权限
- name: menuai #菜品识别
- name: dishes #菜品
- name: marketing #营销
- name: backfield-mqtt
- name: device-mqtt
- name: customer
- name: pay
- name: canteen
- name: merchant
- name: paddle-ai
rabbitmq:
clean-none-namespace-queue: true
publisher-confirm-type: correlated
publisher-returns: true
username: guest
password: guest
addresses: ${RABBITMQ_ADDRESS:localhost:5672}
address-shuffle-mode: random
connection-timeout: 3000
listener:
simple:
acknowledge-mode: manual
prefetch: ${RABBITMQ_CONSUMER_PREFETCH:10}
rocketmq:
name-server: ${ROCKETMQ_NAME_SERVER:rocketmq-nameserver:9876}
access-key: ${ROCKETMQ_ACCESS_KEY:root@rocket}
secret-key: ${ROCKETMQ_SECRET_KEY:do@u.can}
mqtt-enabled: true
producer:
group: default
alipay:
URL: https://openapi.alipay.com/gateway.do
PID: 2088041561080184
APPID: 2021002125609361
PRIVATE_KEY: MIIEvgIBADANBgkqhkiG9w0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9wKBgQDV0LwXhIHbBzzSJz3MG2HSDHqMsm4FelhaZVW6gYat0XZkIqtXQ3KsPyUJEtJym3pjWT9/7uXT5EUlW5FeKqNmaa3+qFfZUAMLPE2zC7Z0beLtLcbw6RyOv9m5A+GuRFZxKNgna0+jsUGVuaLj7K8NMAjLIeRb9rQy1pnGJBRkSQKBgFyr6OY1+jYKjYxhsjGNKXcaYnfmpPccIFVA8tnNhSgHDNZUwgGHlD9s/i7NJZHav7RC66jLuAokGbY/lp41xEeMmxrZDWLPDL5TZt8OAhRKDnoGdNUw+tAN0Vtzg/etw2KVijTtFGhiWxb3Lwv1FXCDViFpZLmADiu9e6aJsj9dAoGBAK2IuG617pbbFq6vl9lYyYxT5wBYWQ47uHu8vKTfKnZ6zkGecZssiLdSKMwmAB0oJOXPc9QcWe3MYAnFEBw2DygmluxDlE5hK36Nb2Tvs75MD7Bj0noQ4pCC12v1KF57zzhaU9PqkAM8VouLLWe7eOa6ScBZn+3P9Q0EijuPesn/
FORMAT: JSON
CHARSET: UTF-8
SIGN_TYPE: RSA2
ALIPAY_PUBLIC_KEY: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApnqCjevyilI4LcWsrUI7d6zSSc/+xqKO6U0Bmf3yCKRNPNubqHeOQ7Wd9+63lswObGNa6sHYkoZEmoO3WhIRu1ruV1gG3dqnuZ93PNHtoG22S6fPoSwJyB1i1N61dPHV7ikU5Ljq/VJhP05cYH+MiZOb5sx47Ub4KqKghVkyZu6mSlVWu/ojipd0H3kl88QXnF1W3QT1B9DSkODg94u4A28SrJHT+8nkPhOsD8cs5NmwmZJUieFiHh69hEgR+Af2xl1G+LNRWN4vTZ4sWcAnQp+
system:
sysfile:
prefixOffline: http://localhost:9000/lnyst
prefixOnline: http://localhost:9000/lnyst
bucket: /lnyst
max-upload-file-size: ${MAX_UPLOAD_FILE_SIZE:5}
notify:
unify-host: ${NOTIFY_UNIFY_HOST:}
oss:
endpoint: ${OSS_ENDPOINT:http://127.0.0.1:9000}
access-key: ${OSS_ACCESS_KEY:minioadmin}
secret-key: ${OSS_SECRET_KEY:minioadmin}
bucketName: ${OSS_BUCKET:lnyst}
expiresTime: ${OSS_EXPIRES_TIME:604600}
useToken: ${OSS_USE_TOKEN:false}
region: ${OSS_REGION:}
path-style-access: ${OSS_PATH_STYLE:true}
useHttp: ${OSS_USE_HTTP:false}

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<!-- 日志存放路径 -->
<property name="log.path" value="logs/bonus-shared-station" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.bonus" level="debug" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info" />
<appender-ref ref="file_error" />
</root>
</configuration>

View File

@ -12,6 +12,8 @@
<!-- <module>core-aggregator</module>--> <!-- <module>core-aggregator</module>-->
<!-- <module>bonus-cateen</module>--> <!-- <module>bonus-cateen</module>-->
<module>bonus-smart-canteen</module> <module>bonus-smart-canteen</module>
<module>bonus-shared-station</module>
<module>bonus-shared-station</module>
</modules> </modules>
<artifactId>bonus-modules</artifactId> <artifactId>bonus-modules</artifactId>