1
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
package com.example.mini_program;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableAsync
|
||||
@MapperScan("com.example.mini_program.mapper")
|
||||
public class MiniProgramApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -7,28 +7,9 @@ spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://txy.588580.xyz:3306/mini?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: 123
|
||||
password: 271922abF
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
redis:
|
||||
# Redis 服务器地址
|
||||
host: localhost
|
||||
# Redis 服务器端口
|
||||
port: 6379
|
||||
# Redis 数据库索引(默认 0)
|
||||
database: 0
|
||||
# 连接超时时间(毫秒)
|
||||
timeout: 5000
|
||||
# 连接池配置
|
||||
lettuce:
|
||||
pool:
|
||||
# 最大连接数
|
||||
max-active: 8
|
||||
# 最大空闲连接数
|
||||
max-idle: 8
|
||||
# 最小空闲连接数
|
||||
min-idle: 0
|
||||
# 连接耗尽时的最大等待时间(负值表示无限等待)
|
||||
max-wait: -1ms
|
||||
|
||||
# 微信小程序配置
|
||||
wx:
|
||||
miniapp:
|
||||
@@ -40,6 +21,6 @@ wx:
|
||||
# MyBatis配置
|
||||
mybatis:
|
||||
mapper-locations: classpath:mapper/*.xml
|
||||
type-aliases-package: com.example.demo.mini.entity
|
||||
type-aliases-package: com.example.mini_program.entity
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
@@ -0,0 +1,19 @@
|
||||
-- 微信用户表
|
||||
CREATE TABLE IF NOT EXISTS `wx_user` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`openid` varchar(64) NOT NULL COMMENT '微信用户openid',
|
||||
`nickname` varchar(100) DEFAULT NULL COMMENT '用户昵称',
|
||||
`avatar_url` varchar(500) DEFAULT NULL COMMENT '头像URL',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`last_login_time` datetime DEFAULT NULL COMMENT '最后登录时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_openid` (`openid`),
|
||||
KEY `idx_last_login` (`last_login_time`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='微信用户表';
|
||||
|
||||
-- 插入用户数据
|
||||
INSERT INTO `wx_user` (`openid`, `nickname`, `avatar_url`, `create_time`, `last_login_time`) VALUES
|
||||
('ogzdF3d3Z494n28mxsUUHvASiePE', 'i', 'wxfile://tmp_087ba7d96bc1da49c25cf77a6c2b6a90f03fffddcc59aecf.png', '2026-04-18 16:26:24', '2026-04-20 17:47:25'),
|
||||
('ogzdF3Vv42nydiUnY6lEW0ufK4Q0', '23', 'http://tmp/q2RwR6L5kT1v2b4bd91956654d901dfa7b6cd59aa006.jpeg', '2026-04-18 16:32:42', '2026-04-20 16:42:43'),
|
||||
('ogzdF3a-l23Vfpq14b7QEp1VEukg', NULL, NULL, '2026-04-21 01:24:29', '2026-04-21 01:24:29');
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.example.demo.mini.mapper.VisitApplicationMapper">
|
||||
<mapper namespace="com.example.mini_program.mapper.VisitApplicationMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.example.demo.mini.entity.VisitApplication">
|
||||
<resultMap id="BaseResultMap" type="com.example.mini_program.entity.VisitApplication">
|
||||
<id column="id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="phone" property="phone"/>
|
||||
|
||||
Reference in New Issue
Block a user