admin 初始化

This commit is contained in:
zk
2026-07-10 11:44:17 +08:00
parent 45f4c3d96f
commit 4585c824b7
11 changed files with 400 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jiayunet</groupId>
<artifactId>back_end</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>admin</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.jiayunet</groupId>
<artifactId>manager</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
</dependencies>
<build>
<finalName>admin</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.6.13</version>
<configuration>
<fork>true</fork>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,22 @@
package org.jiayunet;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* B 端管理后台启动类
*
* @author zk
*/
@SpringBootApplication(scanBasePackages = "org.jiayunet")
@MapperScan("org.jiayunet.**.mapper")
@EnableScheduling
@EnableAspectJAutoProxy
public class AdminApplication {
public static void main(String[] args) {
SpringApplication.run(AdminApplication.class, args);
}
}
@@ -0,0 +1,27 @@
package org.jiayunet.admin.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* 页面路由控制器(返回 Thymeleaf 视图名,不走 UnifiedResponseBodyAdvice
*
* @author zk
*/
@Controller
@RequestMapping("/page")
public class PageController {
/** 登录页 */
@GetMapping("/login")
public String login() {
return "login";
}
/** 管理后台首页(需登录) */
@GetMapping("/index")
public String index() {
return "index";
}
}
@@ -0,0 +1,67 @@
# tomcat 端口配置
server:
port: 8081
# 数据源配置
spring:
datasource:
url: jdbc:mysql://${MYSQL_HOST:192.168.31.105}:${MYSQL_PORT:3306}/${DB_NAME:offerpie}?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
username: ${MYSQL_USERNAME:root}
password: ${MYSQL_PASSWORD:123456}
driver-class-name: com.mysql.cj.jdbc.Driver
redis:
host: ${REDIS_HOST:192.168.31.105}
password: ${REDIS_PASSWORD:123456}
port: ${REDIS_PORT:6379}
timeout: 8s
database: 0
# 开发环境关闭模板缓存,方便调试
thymeleaf:
cache: false
# 电子邮箱
email:
status: close
account: ${EMAIL_ACCOUNT:xxx@163.com}
authorization: ${EMAIL_AUTHORIZATION:123456}
# 微信支付
wx_pay:
status: close
# 支付宝支付
alipay:
status: close
app:
# 加密秘钥配置
secret:
token: ${SECRET_TOKEN:Aa123123}
# 登陆配置
login:
token:
exceed_time: 5184000
device_online_quantity: 3
# 短信
sms:
service_provider: aliyun
aliyun:
access_key_id: LTAI5tJBVUUJhB7yp14UDzVf
access_key_secret: Opf0iO5FKNrdwI63DPhXazW7utAGTj
oss:
service_provider: aliyun
aliyun:
access_key_id: LTAI5tEdLKKQUKhTyUpfH5Mk
access_key_secret: RjUdTrq0V5qA4b3BUElNhXqs3ZLp5k
# 防刷配置
prevent_replay:
if_open: false
interval_time: 20
limit_number: 20
# 开放接口(登录页面 + 静态资源 + 登录接口)
ignore:
urls: "/public/**,/page/**,/static/**,/css/**,/js/**,/img/**,/favicon.ico"
@@ -0,0 +1,64 @@
# tomcat 端口配置
server:
port: 8081
# 数据源配置
spring:
datasource:
url: jdbc:mysql://${MYSQL_HOST:8.163.14.142}:${MYSQL_PORT:30006}/${DB_NAME:offerpie}?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
username: ${MYSQL_USERNAME:root}
password: ${MYSQL_PASSWORD:^CgDatabase2020}
driver-class-name: com.mysql.cj.jdbc.Driver
redis:
host: ${REDIS_HOST:8.163.14.142}
password: ${REDIS_PASSWORD:#8kPCdAsser}
port: ${REDIS_PORT:30089}
timeout: 10s
database: 0
# 电子邮箱
email:
status: close
account: ${EMAIL_ACCOUNT:xxx@163.com}
authorization: ${EMAIL_AUTHORIZATION:123456}
# 微信支付
wx_pay:
status: close
# 支付宝支付
alipay:
status: close
app:
# 加密秘钥配置
secret:
token: ${SECRET_TOKEN:Aa123123}
# 登陆配置
login:
token:
exceed_time: 5184000
device_online_quantity: 3
# 短信
sms:
service_provider: aliyun
aliyun:
access_key_id: LTAI5tJBVUUJhB7yp14UDzVf
access_key_secret: Opf0iO5FKNrdwI63DPhXazW7utAGTj
oss:
service_provider: aliyun
aliyun:
access_key_id: LTAI5tEdLKKQUKhTyUpfH5Mk
access_key_secret: RjUdTrq0V5qA4b3BUElNhXqs3ZLp5k
# 防刷配置
prevent_replay:
if_open: false
interval_time: 20
limit_number: 20
# 开放接口
ignore:
urls: "/public/**,/page/**,/static/**,/css/**,/js/**,/img/**,/favicon.ico"
@@ -0,0 +1,64 @@
# tomcat 端口配置
server:
port: 8081
# 数据源配置
spring:
datasource:
url: jdbc:mysql://${MYSQL_HOST:8.163.14.142}:${MYSQL_PORT:30006}/${DB_NAME:offerpie_test}?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
username: ${MYSQL_USERNAME:root}
password: ${MYSQL_PASSWORD:^CgDatabase2020}
driver-class-name: com.mysql.cj.jdbc.Driver
redis:
host: ${REDIS_HOST:8.163.14.142}
password: ${REDIS_PASSWORD:#8kPCdAsser}
port: ${REDIS_PORT:30089}
timeout: 10s
database: 1
# 电子邮箱
email:
status: close
account: ${EMAIL_ACCOUNT:xxx@163.com}
authorization: ${EMAIL_AUTHORIZATION:123456}
# 微信支付
wx_pay:
status: close
# 支付宝支付
alipay:
status: close
app:
# 加密秘钥配置
secret:
token: ${SECRET_TOKEN:Aa123123}
# 登陆配置
login:
token:
exceed_time: 5184000
device_online_quantity: 3
# 短信
sms:
service_provider: aliyun
aliyun:
access_key_id: LTAI5tJBVUUJhB7yp14UDzVf
access_key_secret: Opf0iO5FKNrdwI63DPhXazW7utAGTj
oss:
service_provider: aliyun
aliyun:
access_key_id: LTAI5tEdLKKQUKhTyUpfH5Mk
access_key_secret: RjUdTrq0V5qA4b3BUElNhXqs3ZLp5k
# 防刷配置
prevent_replay:
if_open: false
interval_time: 20
limit_number: 20
# 开放接口
ignore:
urls: "/public/**,/page/**,/static/**,/css/**,/js/**,/img/**,/favicon.ico"
+77
View File
@@ -0,0 +1,77 @@
# tomcat config
server:
tomcat:
accept-count: 100
threads:
max: 200
min-spare: 10
servlet:
context-path: /admin
# spring config
spring:
application:
name: admin
profiles:
active: ${PROFILES_ACTIVE:dev}
datasource:
hikari:
maximum-pool-size: 50
minimum-idle: 20
connection-timeout: 5000
idle-timeout: 300000
max-lifetime: 900000
servlet:
multipart:
max-file-size: 4MB
max-request-size: 20MB
# Thymeleaf 配置
thymeleaf:
prefix: classpath:/templates/
suffix: .html
mode: HTML
encoding: UTF-8
# 开启静态资源映射
web:
resources:
add-mappings: true
static-locations: classpath:/static/
cache:
redis:
cache-null-values: true
key-prefix: "${spring.application.name}:"
time-to-live: 24h
jackson:
default-property-inclusion: non_null
property-naming-strategy: LOWER_CAMEL_CASE
serialization:
fail-on-empty-beans: false
write-date-keys-as-timestamps: true
write-date-timestamps-as-nanoseconds: false
write-dates-as-timestamps: true
deserialization:
fail-on-unknown-properties: false
fail-on-numbers-for-enums: true
read-date-timestamps-as-nanoseconds: false
# mybatis plus config
mybatis-plus:
mapper-locations: classpath*:mapper/**/*.xml
global-config:
db-config:
id-type: assign_id
insert-strategy: not_null
update-strategy: not_null
logic-delete-field: isDelete
logic-delete-value: '1'
logic-not-delete-value: '0'
configuration:
map-underscore-to-camel-case: true
auto-mapping-unknown-column-behavior: warning
cache-enabled: false
call-setters-on-nulls: true
jdbc-type-for-null: 'null'
# 日志
logging:
level:
org:
mybatis: info
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>OfferPie 管理后台</title>
</head>
<body>
<h1>OfferPie 管理后台 - 首页</h1>
<p>管理后台首页占位 - 待实现</p>
</body>
</html>
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>OfferPie 管理后台 - 登录</title>
</head>
<body>
<h1>OfferPie 管理后台</h1>
<p>登录页面占位 - 待实现</p>
</body>
</html>