refactor: 案例项目目录规范化并同步 harness
将 apps/、docs/facts(+business/tech-topic)、.overnight-runner 收敛为统一布局,并刷新安装器默认值与 skill 占位符(DESIGNS_DIR→FACTS_DIR)。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
spring:
|
||||
config:
|
||||
import: "classpath:/business-rules/appointment.yml,classpath:/business-rules/auth.yml"
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/consultation_test?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: password
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
sql:
|
||||
init:
|
||||
mode: always
|
||||
schema-locations: classpath:schema.sql
|
||||
data-locations: classpath:data.sql
|
||||
flyway:
|
||||
enabled: false
|
||||
jwt:
|
||||
secret: test-secret-key-for-mysql-tests-only
|
||||
expiration: 86400000
|
||||
17
example-project/apps/backend/src/test/resources/data.sql
Normal file
17
example-project/apps/backend/src/test/resources/data.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
-- Seed admin user (password: password)
|
||||
insert into user (id, email, password, name, phone, role, status, created_by, updated_by)
|
||||
values ('admin-001', 'admin@test.com',
|
||||
'$2a$10$4rDXdT56xLoF0LajF1fKRuZFxxdAd6rM9CuCcZdRrb/k7eRHMTKQq',
|
||||
'管理员', '13800000000', 'ROLE_ADMIN', 'ACTIVE', 'admin-001', 'admin-001');
|
||||
|
||||
-- Seed consultants
|
||||
insert into consultant (id, name, title, bio, specialties, sort_order, created_by, updated_by)
|
||||
values ('c-001', '张医生', '资深心理咨询师', '拥有15年心理咨询经验。', '焦虑症,抑郁症,人际关系', 1, 'admin-001', 'admin-001'),
|
||||
('c-002', '李律师', '企业法律顾问', '10年企业法律顾问经验。', '合同法,劳动法,公司治理', 2, 'admin-001', 'admin-001'),
|
||||
('c-003', '王教练', '职业规划导师', '帮助超过500人实现职业转型。', '职业规划,简历优化', 3, 'admin-001', 'admin-001');
|
||||
|
||||
-- Seed branches
|
||||
insert into branch (id, name, address, phone, status, created_by, updated_by)
|
||||
values ('b-001', '朝阳咨询中心', '北京市朝阳区建国路88号', '010-88880001', 'ACTIVE', 'admin-001', 'admin-001'),
|
||||
('b-002', '海淀咨询中心', '北京市海淀区中关村大街66号', '010-88880002', 'ACTIVE', 'admin-001', 'admin-001'),
|
||||
('b-003', '浦东咨询中心', '上海市浦东新区陆家嘴路100号', '021-68880003', 'ACTIVE', 'admin-001', 'admin-001');
|
||||
72
example-project/apps/backend/src/test/resources/schema.sql
Normal file
72
example-project/apps/backend/src/test/resources/schema.sql
Normal file
@@ -0,0 +1,72 @@
|
||||
drop table if exists branch;
|
||||
drop table if exists appointment;
|
||||
drop table if exists consultant;
|
||||
drop table if exists user;
|
||||
|
||||
create table user (
|
||||
id varchar(64) not null primary key,
|
||||
email varchar(128) not null,
|
||||
password varchar(256) not null,
|
||||
name varchar(64) not null,
|
||||
phone varchar(20),
|
||||
role varchar(20) not null default 'ROLE_USER',
|
||||
status varchar(12) not null default 'ACTIVE',
|
||||
deleted tinyint default 0 not null,
|
||||
created_by varchar(64) not null,
|
||||
created_time datetime default CURRENT_TIMESTAMP not null,
|
||||
updated_by varchar(64) not null,
|
||||
updated_time datetime default CURRENT_TIMESTAMP not null
|
||||
);
|
||||
|
||||
create unique index uk_user_email on user(email);
|
||||
|
||||
create table consultant (
|
||||
id varchar(64) not null primary key,
|
||||
name varchar(64) not null,
|
||||
title varchar(128),
|
||||
bio text,
|
||||
specialties varchar(256),
|
||||
avatar varchar(256),
|
||||
branch_id varchar(64),
|
||||
status varchar(12) not null default 'ACTIVE',
|
||||
sort_order int default 0 not null,
|
||||
created_by varchar(64) not null,
|
||||
created_time datetime default CURRENT_TIMESTAMP not null,
|
||||
updated_by varchar(64) not null,
|
||||
updated_time datetime default CURRENT_TIMESTAMP not null
|
||||
);
|
||||
|
||||
create table appointment (
|
||||
id varchar(64) not null primary key,
|
||||
user_id varchar(64) not null,
|
||||
consultant_id varchar(64) not null,
|
||||
branch_id varchar(64),
|
||||
appointment_date date not null,
|
||||
start_time varchar(10) not null,
|
||||
end_time varchar(10) not null,
|
||||
duration_minutes int not null,
|
||||
status varchar(20) not null default 'PENDING',
|
||||
note text,
|
||||
cancel_reason varchar(256),
|
||||
created_by varchar(64) not null,
|
||||
created_time datetime default CURRENT_TIMESTAMP not null,
|
||||
updated_by varchar(64) not null,
|
||||
updated_time datetime default CURRENT_TIMESTAMP not null
|
||||
);
|
||||
|
||||
create index idx_appointment_user on appointment(user_id);
|
||||
create index idx_appointment_consultant on appointment(consultant_id);
|
||||
create index idx_appointment_date on appointment(appointment_date);
|
||||
create unique index uk_appointment_slot on appointment(consultant_id, appointment_date, start_time);
|
||||
|
||||
create table branch (
|
||||
id varchar(64) primary key,
|
||||
name varchar(100) not null,
|
||||
address varchar(255),
|
||||
phone varchar(20),
|
||||
status varchar(20) not null default 'ACTIVE',
|
||||
created_by varchar(64),
|
||||
created_time datetime not null default CURRENT_TIMESTAMP,
|
||||
updated_by varchar(64),
|
||||
updated_time datetime not null default CURRENT_TIMESTAMP
|
||||
);
|
||||
Reference in New Issue
Block a user