image:图片压缩,sql迁移表

This commit is contained in:
zerosaturation 2026-05-17 19:55:22 +08:00
parent 45d3adc373
commit 3f8a8ba470
74 changed files with 643 additions and 1 deletions

View File

@ -1777,3 +1777,107 @@ ALTER TABLE ONLY public.fan_profiles
\unrestrict sMtfDGEC88HGZIJke0nEBhyCFPngc2Pj7gKFCpH88m7WybaopqjS9o0UnzJwYTx \unrestrict sMtfDGEC88HGZIJke0nEBhyCFPngc2Pj7gKFCpH88m7WybaopqjS9o0UnzJwYTx
-- =====================================================
-- V6: materials and asset_material_relations (2026-05-15)
-- =====================================================
-- materials 素材主表
CREATE TABLE IF NOT EXISTS public.materials (
id BIGSERIAL PRIMARY KEY,
oss_key VARCHAR(255) NOT NULL,
original_name VARCHAR(255) NOT NULL,
file_size BIGINT NOT NULL,
mime_type VARCHAR(100) NOT NULL,
width INT,
height INT,
hash VARCHAR(64) NOT NULL,
created_by BIGINT NOT NULL,
star_id BIGINT NOT NULL DEFAULT 0,
created_at BIGINT NOT NULL,
updated_at BIGINT NOT NULL,
deleted_at BIGINT
);
CREATE UNIQUE INDEX IF NOT EXISTS uk_materials_oss_key ON public.materials(oss_key);
CREATE INDEX IF NOT EXISTS idx_materials_hash ON public.materials(hash);
CREATE INDEX IF NOT EXISTS idx_materials_created_by ON public.materials(created_by);
CREATE INDEX IF NOT EXISTS idx_materials_star_id ON public.materials(star_id);
-- asset_material_relations 资产-素材关联表
CREATE TABLE IF NOT EXISTS public.asset_material_relations (
id BIGSERIAL PRIMARY KEY,
asset_id BIGINT NOT NULL,
material_id BIGINT NOT NULL,
material_type VARCHAR(50) NOT NULL,
layer_order INT NOT NULL DEFAULT 0,
pos_x DOUBLE PRECISION,
pos_y DOUBLE PRECISION,
opacity DOUBLE PRECISION DEFAULT 1.0,
rotation DOUBLE PRECISION DEFAULT 0,
scale_x DOUBLE PRECISION DEFAULT 1.0,
scale_y DOUBLE PRECISION DEFAULT 1.0,
version INT NOT NULL DEFAULT 1,
created_at BIGINT NOT NULL,
updated_at BIGINT NOT NULL,
deleted_at BIGINT
);
CREATE INDEX IF NOT EXISTS idx_amr_asset_id ON public.asset_material_relations(asset_id) WHERE deleted_at IS NULL;
CREATE INDEX IF NOT EXISTS idx_amr_material_id ON public.asset_material_relations(material_id) WHERE deleted_at IS NULL;
CREATE INDEX IF NOT EXISTS idx_amr_asset_type_layer ON public.asset_material_relations(asset_id, material_type, layer_order) WHERE deleted_at IS NULL;
CREATE UNIQUE INDEX IF NOT EXISTS uk_amr_asset_type_active ON public.asset_material_relations(asset_id, material_type) WHERE deleted_at IS NULL;
CREATE UNIQUE INDEX IF NOT EXISTS uk_amr_asset_layer_active ON public.asset_material_relations(asset_id, layer_order) WHERE deleted_at IS NULL;
-- user_mint_count 铸爱次数表
CREATE TABLE IF NOT EXISTS public.user_mint_count (
id BIGSERIAL PRIMARY KEY,
user_id BIGINT NOT NULL,
star_id BIGINT NOT NULL,
mint_count INT NOT NULL DEFAULT 0,
revenue_boost_bps INT NOT NULL DEFAULT 0,
updated_at BIGINT NOT NULL,
CONSTRAINT uk_user_mint_count_user_star UNIQUE (user_id, star_id)
);
CREATE INDEX IF NOT EXISTS idx_user_mint_count_user ON public.user_mint_count USING btree (user_id);
CREATE INDEX IF NOT EXISTS idx_user_mint_count_star ON public.user_mint_count USING btree (star_id);
-- mint_cost_config 铸爱阶梯配置表
CREATE TABLE IF NOT EXISTS public.mint_cost_config (
id BIGSERIAL PRIMARY KEY,
mint_count INT NOT NULL,
cost_crystal BIGINT NOT NULL,
probability BIGINT NOT NULL DEFAULT 0,
reward_type VARCHAR(50) DEFAULT NULL,
reward_value BIGINT NOT NULL DEFAULT 0,
description VARCHAR(255),
updated_at BIGINT NOT NULL,
CONSTRAINT uk_mint_cost_config_mint_count UNIQUE (mint_count)
);
-- 插入铸爱阶梯数据
INSERT INTO public.mint_cost_config (mint_count, cost_crystal, probability, reward_type, reward_value, description, updated_at)
VALUES
(1, 2, 0, NULL, 0, '第1次', 1773322573872),
(2, 4, 0, NULL, 0, '第2次', 1773322573872),
(3, 8, 0, NULL, 0, '第3次', 1773322573872),
(4, 16, 0, NULL, 0, '第4次', 1773322573872),
(5, 32, 0, NULL, 0, '第5次', 1773322573872),
(6, 64, 0, NULL, 0, '第6次', 1773322573872),
(7, 128, 0, NULL, 0, '第7次', 1773322573872),
(8, 256, 0, NULL, 0, '第8次', 1773322573872),
(9, 512, 20, '收益提升', 5, '小保底', 1773322573872),
(10, 1024, 100, '收益提升', 5, '大保底', 1773322573872)
ON CONFLICT (mint_count) DO UPDATE SET
cost_crystal = EXCLUDED.cost_crystal,
probability = EXCLUDED.probability,
reward_type = EXCLUDED.reward_type,
reward_value = EXCLUDED.reward_value,
description = EXCLUDED.description,
updated_at = EXCLUDED.updated_at;
-- materials 外键
ALTER TABLE public.asset_material_relations
ADD CONSTRAINT fk_amr_material
FOREIGN KEY (material_id) REFERENCES public.materials(id) ON DELETE RESTRICT;

View File

@ -0,0 +1,352 @@
-- V6__consolidated_migrations.sql
-- 整合所有分散的迁移脚本2026-05-15
-- 包含: materials, asset_material_relations, 经济系统表, 字段修改等
-- =====================================================
-- Part 1: materials 素材主表
-- =====================================================
CREATE TABLE IF NOT EXISTS public.materials (
id BIGSERIAL PRIMARY KEY,
oss_key VARCHAR(255) NOT NULL,
original_name VARCHAR(255) NOT NULL,
file_size BIGINT NOT NULL,
mime_type VARCHAR(100) NOT NULL,
width INT,
height INT,
hash VARCHAR(64) NOT NULL,
created_by BIGINT NOT NULL,
star_id BIGINT NOT NULL DEFAULT 0,
created_at BIGINT NOT NULL,
updated_at BIGINT NOT NULL,
deleted_at BIGINT
);
CREATE UNIQUE INDEX IF NOT EXISTS uk_materials_oss_key ON public.materials(oss_key);
CREATE INDEX IF NOT EXISTS idx_materials_hash ON public.materials(hash);
CREATE INDEX IF NOT EXISTS idx_materials_created_by ON public.materials(created_by);
CREATE INDEX IF NOT EXISTS idx_materials_star_id ON public.materials(star_id);
COMMENT ON TABLE public.materials IS '素材主表';
-- =====================================================
-- Part 2: asset_material_relations 资产-素材关联表
-- =====================================================
CREATE TABLE IF NOT EXISTS public.asset_material_relations (
id BIGSERIAL PRIMARY KEY,
asset_id BIGINT NOT NULL,
material_id BIGINT NOT NULL,
material_type VARCHAR(50) NOT NULL,
layer_order INT NOT NULL DEFAULT 0,
pos_x DOUBLE PRECISION,
pos_y DOUBLE PRECISION,
opacity DOUBLE PRECISION DEFAULT 1.0,
rotation DOUBLE PRECISION DEFAULT 0,
scale_x DOUBLE PRECISION DEFAULT 1.0,
scale_y DOUBLE PRECISION DEFAULT 1.0,
version INT NOT NULL DEFAULT 1,
created_at BIGINT NOT NULL,
updated_at BIGINT NOT NULL,
deleted_at BIGINT
);
CREATE INDEX IF NOT EXISTS idx_amr_asset_id ON public.asset_material_relations(asset_id) WHERE deleted_at IS NULL;
CREATE INDEX IF NOT EXISTS idx_amr_material_id ON public.asset_material_relations(material_id) WHERE deleted_at IS NULL;
CREATE INDEX IF NOT EXISTS idx_amr_asset_type_layer ON public.asset_material_relations(asset_id, material_type, layer_order) WHERE deleted_at IS NULL;
CREATE UNIQUE INDEX IF NOT EXISTS uk_amr_asset_type_active ON public.asset_material_relations(asset_id, material_type) WHERE deleted_at IS NULL;
CREATE UNIQUE INDEX IF NOT EXISTS uk_amr_asset_layer_active ON public.asset_material_relations(asset_id, layer_order) WHERE deleted_at IS NULL;
COMMENT ON TABLE public.asset_material_relations IS '资产-素材关联表';
-- 外键约束(如果 assets 表已存在)
DO $$
BEGIN
IF EXISTS (SELECT 1 FROM pg_tables WHERE tablename = 'assets') THEN
ALTER TABLE public.asset_material_relations
ADD CONSTRAINT fk_amr_asset
FOREIGN KEY (asset_id) REFERENCES public.assets(id) ON DELETE CASCADE;
END IF;
EXCEPTION WHEN others THEN
RAISE NOTICE 'Foreign key constraint for asset_material_relations skipped: %', SQLERRM;
END $$;
DO $$
BEGIN
IF EXISTS (SELECT 1 FROM pg_tables WHERE tablename = 'materials') THEN
ALTER TABLE public.asset_material_relations
ADD CONSTRAINT fk_amr_material
FOREIGN KEY (material_id) REFERENCES public.materials(id) ON DELETE RESTRICT;
END IF;
EXCEPTION WHEN others THEN
RAISE NOTICE 'Foreign key constraint for asset_material_relations skipped: %', SQLERRM;
END $$;
-- =====================================================
-- Part 3: user_mint_count 铸爱次数表
-- =====================================================
CREATE TABLE IF NOT EXISTS public.user_mint_count (
id BIGSERIAL PRIMARY KEY,
user_id BIGINT NOT NULL,
star_id BIGINT NOT NULL,
mint_count INT NOT NULL DEFAULT 0,
revenue_boost_bps INT NOT NULL DEFAULT 0,
updated_at BIGINT NOT NULL,
CONSTRAINT uk_user_mint_count_user_star UNIQUE (user_id, star_id)
);
CREATE INDEX IF NOT EXISTS idx_user_mint_count_user ON public.user_mint_count USING btree (user_id);
CREATE INDEX IF NOT EXISTS idx_user_mint_count_star ON public.user_mint_count USING btree (star_id);
COMMENT ON TABLE public.user_mint_count IS '用户在某偶像下的累计铸爱次数与收益加成(基点)';
-- =====================================================
-- Part 4: mint_cost_config 铸爱阶梯配置表
-- =====================================================
CREATE TABLE IF NOT EXISTS public.mint_cost_config (
id BIGSERIAL PRIMARY KEY,
mint_count INT NOT NULL,
cost_crystal BIGINT NOT NULL,
probability BIGINT NOT NULL DEFAULT 0,
reward_type VARCHAR(50) DEFAULT NULL,
reward_value BIGINT NOT NULL DEFAULT 0,
description VARCHAR(255),
updated_at BIGINT NOT NULL,
CONSTRAINT uk_mint_cost_config_mint_count UNIQUE (mint_count)
);
COMMENT ON TABLE public.mint_cost_config IS '铸爱次数阶梯消耗与保底配置';
-- 插入铸爱阶梯数据
INSERT INTO public.mint_cost_config (mint_count, cost_crystal, probability, reward_type, reward_value, description, updated_at)
VALUES
(1, 2, 0, NULL, 0, '第1次', 1773322573872),
(2, 4, 0, NULL, 0, '第2次', 1773322573872),
(3, 8, 0, NULL, 0, '第3次', 1773322573872),
(4, 16, 0, NULL, 0, '第4次', 1773322573872),
(5, 32, 0, NULL, 0, '第5次', 1773322573872),
(6, 64, 0, NULL, 0, '第6次', 1773322573872),
(7, 128, 0, NULL, 0, '第7次', 1773322573872),
(8, 256, 0, NULL, 0, '第8次', 1773322573872),
(9, 512, 20, '收益提升', 5, '小保底', 1773322573872),
(10, 1024, 100, '收益提升', 5, '大保底', 1773322573872)
ON CONFLICT (mint_count) DO UPDATE SET
cost_crystal = EXCLUDED.cost_crystal,
probability = EXCLUDED.probability,
reward_type = EXCLUDED.reward_type,
reward_value = EXCLUDED.reward_value,
description = EXCLUDED.description,
updated_at = EXCLUDED.updated_at;
-- =====================================================
-- Part 5: 字段修改迁移
-- =====================================================
-- 5.1 exhibitions 表添加 deleted_at 字段
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_name = 'exhibitions' AND column_name = 'deleted_at'
) THEN
ALTER TABLE public.exhibitions ADD COLUMN deleted_at BIGINT;
RAISE NOTICE 'Column deleted_at added to exhibitions table';
ELSE
RAISE NOTICE 'Column deleted_at already exists in exhibitions table';
END IF;
END $$;
-- 5.2 assets 表添加 material_type 字段
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_name = 'assets' AND column_name = 'material_type'
) THEN
ALTER TABLE public.assets ADD COLUMN material_type VARCHAR(50);
RAISE NOTICE 'Column material_type added to assets table';
ELSE
RAISE NOTICE 'Column material_type already exists in assets table';
END IF;
END $$;
-- 5.3 activities 表添加 icon 字段
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_name = 'activities' AND column_name = 'icon'
) THEN
ALTER TABLE public.activities ADD COLUMN icon VARCHAR(500) DEFAULT '';
RAISE NOTICE 'Column icon added to activities table';
ELSE
RAISE NOTICE 'Column icon already exists in activities table';
END IF;
END $$;
-- 5.4 activities 表添加 overall_end_time 字段
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_name = 'activities' AND column_name = 'overall_end_time'
) THEN
ALTER TABLE public.activities ADD COLUMN overall_end_time BIGINT DEFAULT 0;
RAISE NOTICE 'Column overall_end_time added to activities table';
ELSE
RAISE NOTICE 'Column overall_end_time already exists in activities table';
END IF;
END $$;
-- 5.5 fan_profiles 表添加 avatar_url 字段
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_name = 'fan_profiles' AND column_name = 'avatar_url'
) THEN
ALTER TABLE public.fan_profiles ADD COLUMN avatar_url VARCHAR(500);
RAISE NOTICE 'Column avatar_url added to fan_profiles table';
ELSE
RAISE NOTICE 'Column avatar_url already exists in fan_profiles table';
END IF;
END $$;
-- 5.6 assets 表添加 is_original 字段
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_name = 'assets' AND column_name = 'is_original'
) THEN
ALTER TABLE public.assets ADD COLUMN is_original BOOLEAN DEFAULT false;
RAISE NOTICE 'Column is_original added to assets table';
ELSE
RAISE NOTICE 'Column is_original already exists in assets table';
END IF;
END $$;
-- 5.7 activities 表添加 theme 字段
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_name = 'activities' AND column_name = 'theme'
) THEN
ALTER TABLE public.activities ADD COLUMN theme VARCHAR(100);
RAISE NOTICE 'Column theme added to activities table';
ELSE
RAISE NOTICE 'Column theme already exists in activities table';
END IF;
END $$;
-- =====================================================
-- Part 6: 索引和约束修改
-- =====================================================
-- 6.1 asset_likes 表唯一约束修改(添加 star_id
DO $$
BEGIN
IF EXISTS (
SELECT 1 FROM pg_constraint WHERE conname = 'uk_asset_likes_user_asset'
) THEN
ALTER TABLE public.asset_likes DROP CONSTRAINT uk_asset_likes_user_asset;
RAISE NOTICE 'Old constraint uk_asset_likes_user_asset dropped';
END IF;
EXCEPTION WHEN others THEN
RAISE NOTICE 'Constraint uk_asset_likes_user_asset not found or already dropped: %', SQLERRM;
END $$;
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM pg_constraint WHERE conname = 'uk_asset_likes_user_asset_star'
) THEN
ALTER TABLE public.asset_likes ADD CONSTRAINT uk_asset_likes_user_asset_star UNIQUE (user_id, asset_id, star_id);
RAISE NOTICE 'New constraint uk_asset_likes_user_asset_star added';
END IF;
EXCEPTION WHEN others THEN
RAISE NOTICE 'Constraint uk_asset_likes_user_asset_star already exists: %', SQLERRM;
END $$;
-- 6.2 exhibitions 表唯一约束移除asset_id
DO $$
BEGIN
IF EXISTS (
SELECT 1 FROM pg_constraint WHERE conname = 'uk_asset'
) THEN
ALTER TABLE public.exhibitions DROP CONSTRAINT uk_asset;
RAISE NOTICE 'Constraint uk_asset dropped from exhibitions table';
END IF;
EXCEPTION WHEN others THEN
RAISE NOTICE 'Constraint uk_asset not found or already dropped: %', SQLERRM;
END $$;
-- 6.3 exhibitions 表添加 idx_asset 普通索引
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM pg_indexes WHERE indexname = 'idx_asset' AND schemaname = 'public'
) THEN
CREATE INDEX idx_asset ON public.exhibitions(asset_id);
RAISE NOTICE 'Index idx_asset created on exhibitions table';
END IF;
EXCEPTION WHEN others THEN
RAISE NOTICE 'Index idx_asset already exists: %', SQLERRM;
END $$;
-- =====================================================
-- Migration completed
-- =====================================================
DO $$
BEGIN
RAISE NOTICE 'V6__consolidated_migrations completed successfully';
END $$;
-- 素材主表
CREATE TABLE materials (
id BIGSERIAL PRIMARY KEY,
oss_key VARCHAR(255) NOT NULL,
original_name VARCHAR(255) NOT NULL,
file_size BIGINT NOT NULL,
mime_type VARCHAR(100) NOT NULL,
width INT,
height INT,
hash VARCHAR(64) NOT NULL,
created_by BIGINT NOT NULL,
star_id BIGINT NOT NULL DEFAULT 0,
created_at BIGINT NOT NULL,
updated_at BIGINT NOT NULL,
deleted_at BIGINT
);
CREATE UNIQUE INDEX uk_materials_oss_key ON materials(oss_key);
CREATE INDEX idx_materials_hash ON materials(hash);
CREATE INDEX idx_materials_created_by ON materials(created_by);
CREATE INDEX idx_materials_star_id ON materials(star_id);
-- 资产-素材关联表
CREATE TABLE asset_material_relations (
id BIGSERIAL PRIMARY KEY,
asset_id BIGINT NOT NULL REFERENCES assets(id) ON DELETE CASCADE,
material_id BIGINT NOT NULL REFERENCES materials(id) ON DELETE RESTRICT,
material_type VARCHAR(50) NOT NULL,
layer_order INT NOT NULL DEFAULT 0,
pos_x DOUBLE PRECISION,
pos_y DOUBLE PRECISION,
opacity DOUBLE PRECISION DEFAULT 1.0,
rotation DOUBLE PRECISION DEFAULT 0,
scale_x DOUBLE PRECISION DEFAULT 1.0,
scale_y DOUBLE PRECISION DEFAULT 1.0,
version INT NOT NULL DEFAULT 1,
created_at BIGINT NOT NULL,
updated_at BIGINT NOT NULL,
deleted_at BIGINT
);
-- 索引
CREATE INDEX idx_amr_asset_id ON asset_material_relations(asset_id) WHERE deleted_at IS NULL;
CREATE INDEX idx_amr_material_id ON asset_material_relations(material_id) WHERE deleted_at IS NULL;
CREATE INDEX idx_amr_asset_type_layer ON asset_material_relations(asset_id, material_type, layer_order) WHERE deleted_at IS NULL;
-- 部分唯一索引(软删除感知)
CREATE UNIQUE INDEX uk_amr_asset_type_active ON asset_material_relations(asset_id, material_type) WHERE deleted_at IS NULL;
CREATE UNIQUE INDEX uk_amr_asset_layer_active ON asset_material_relations(asset_id, layer_order) WHERE deleted_at IS NULL;

View File

@ -0,0 +1,147 @@
-- V7: 插入广场mock数据资产 (2026-05-17)
-- 将mockData.js中的图片数据写入assets和asset_registry表
-- 按图片顺序分配asset_id使用真实user_id循环分配
BEGIN;
-- 用户ID列表30个真实用户
-- 1, 2, 8, 13, 14, 15, 16, 17, 18, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 49, 50
-- =====================================================
-- 1. 人气榜 MOCK_RENQIWANG (22条, asset_id: 10001-10022)
-- =====================================================
INSERT INTO assets (id, owner_uid, star_id, name, cover_url, material_url, description, grade, tags, visibility, status, like_count, is_original, created_at, updated_at, is_active, material_type)
VALUES
(10001, 42, 87, '星光璀璨', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-01.png', NULL, NULL, NULL, NULL, 'public', 0, 250, false, 1773322573872, 1773322573872, true, NULL),
(10002, 2, 87, '爱的绽放', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-02.png', NULL, NULL, NULL, NULL, 'public', 0, 220, false, 1773322573872, 1773322573872, true, NULL),
(10003, 8, 87, '温暖守护', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-03.png', NULL, NULL, NULL, NULL, 'public', 0, 200, false, 1773322573872, 1773322573872, true, NULL),
(10004, 13, 87, '甜蜜暴击', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-04.png', NULL, NULL, NULL, NULL, 'public', 0, 180, false, 1773322573872, 1773322573872, true, NULL),
(10005, 14, 87, '闪耀舞台', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-05.png', NULL, NULL, NULL, NULL, 'public', 0, 150, false, 1773322573872, 1773322573872, true, NULL),
(10006, 15, 87, '为你疯狂', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-06.png', NULL, NULL, NULL, NULL, 'public', 0, 120, false, 1773322573872, 1773322573872, true, NULL),
(10007, 16, 87, '心动时刻', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-07.png', NULL, NULL, NULL, NULL, 'public', 0, 100, false, 1773322573872, 1773322573872, true, NULL),
(10008, 17, 87, '永相随', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-08.png', NULL, NULL, NULL, NULL, 'public', 0, 80, false, 1773322573872, 1773322573872, true, NULL),
(10009, 18, 87, '粉红泡泡', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-09.png', NULL, NULL, NULL, NULL, 'public', 0, 70, false, 1773322573872, 1773322573872, true, NULL),
(10010, 29, 87, '爱的力量', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-10.png', NULL, NULL, NULL, NULL, 'public', 0, 60, false, 1773322573872, 1773322573872, true, NULL),
(10011, 30, 87, '璀璨星河', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-11.png', NULL, NULL, NULL, NULL, 'public', 0, 55, false, 1773322573872, 1773322573872, true, NULL),
(10012, 31, 87, '梦幻泡影', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-12.png', NULL, NULL, NULL, NULL, 'public', 0, 50, false, 1773322573872, 1773322573872, true, NULL),
(10013, 32, 87, '温柔以待', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-13.png', NULL, NULL, NULL, NULL, 'public', 0, 45, false, 1773322573872, 1773322573872, true, NULL),
(10014, 33, 87, '心动信号', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-14.png', NULL, NULL, NULL, NULL, 'public', 0, 40, false, 1773322573872, 1773322573872, true, NULL),
(10015, 34, 87, '甜蜜时光', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-15.png', NULL, NULL, NULL, NULL, 'public', 0, 38, false, 1773322573872, 1773322573872, true, NULL),
(10016, 35, 87, '爱在当下', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-16.png', NULL, NULL, NULL, NULL, 'public', 0, 35, false, 1773322573872, 1773322573872, true, NULL),
(10017, 36, 87, '幸福味道', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-17.png', NULL, NULL, NULL, NULL, 'public', 0, 32, false, 1773322573872, 1773322573872, true, NULL),
(10018, 37, 87, '心动不已', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-18.png', NULL, NULL, NULL, NULL, 'public', 0, 30, false, 1773322573872, 1773322573872, true, NULL),
(10019, 38, 87, '爱的告白', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-19.png', NULL, NULL, NULL, NULL, 'public', 0, 28, false, 1773322573872, 1773322573872, true, NULL),
(10020, 39, 87, '粉色回忆', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-20.png', NULL, NULL, NULL, NULL, 'public', 0, 25, false, 1773322573872, 1773322573872, true, NULL),
(10021, 40, 87, '暖暖情谊', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-21.png', NULL, NULL, NULL, NULL, 'public', 0, 23, false, 1773322573872, 1773322573872, true, NULL),
(10022, 41, 87, '心动瞬间', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-22.png', NULL, NULL, NULL, NULL, 'public', 0, 22, false, 1773322573872, 1773322573872, true, NULL);
-- =====================================================
-- 2. 潜力之星 MOCK_QIANLIXING (19条, asset_id: 20001-20019)
-- =====================================================
INSERT INTO assets (id, owner_uid, star_id, name, cover_url, material_url, description, grade, tags, visibility, status, like_count, is_original, created_at, updated_at, is_active, material_type)
VALUES
(20001, 42, 87, '初露锋芒', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-01.png', NULL, NULL, NULL, NULL, 'public', 0, 200, false, 1773322573872, 1773322573872, true, NULL),
(20002, 43, 87, '蓄势待发', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-04.png', NULL, NULL, NULL, NULL, 'public', 0, 180, false, 1773322573872, 1773322573872, true, NULL),
(20003, 44, 87, '冉冉升起', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-07.png', NULL, NULL, NULL, NULL, 'public', 0, 150, false, 1773322573872, 1773322573872, true, NULL),
(20004, 45, 87, '明日之星', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-10.png', NULL, NULL, NULL, NULL, 'public', 0, 120, false, 1773322573872, 1773322573872, true, NULL),
(20005, 46, 87, '潜力无限', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-13.png', NULL, NULL, NULL, NULL, 'public', 0, 100, false, 1773322573872, 1773322573872, true, NULL),
(20006, 47, 87, '闪耀新星', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-16.png', NULL, NULL, NULL, NULL, 'public', 0, 80, false, 1773322573872, 1773322573872, true, NULL),
(20007, 49, 87, '小荷才露', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-19.png', NULL, NULL, NULL, NULL, 'public', 0, 65, false, 1773322573872, 1773322573872, true, NULL),
(20008, 50, 87, '锋芒初现', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-22.png', NULL, NULL, NULL, NULL, 'public', 0, 55, false, 1773322573872, 1773322573872, true, NULL),
(20009, 43, 87, '闪闪发光', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-25.png', NULL, NULL, NULL, NULL, 'public', 0, 45, false, 1773322573872, 1773322573872, true, NULL),
(20010, 2, 87, '未来可期', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-28.png', NULL, NULL, NULL, NULL, 'public', 0, 38, false, 1773322573872, 1773322573872, true, NULL),
(20011, 8, 87, '新秀登场', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-31.png', NULL, NULL, NULL, NULL, 'public', 0, 32, false, 1773322573872, 1773322573872, true, NULL),
(20012, 13, 87, '星火燎原', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-34.png', NULL, NULL, NULL, NULL, 'public', 0, 28, false, 1773322573872, 1773322573872, true, NULL),
(20013, 14, 87, '曙光初现', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-37.png', NULL, NULL, NULL, NULL, 'public', 0, 24, false, 1773322573872, 1773322573872, true, NULL),
(20014, 15, 87, '新光乍现', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-40.png', NULL, NULL, NULL, NULL, 'public', 0, 20, false, 1773322573872, 1773322573872, true, NULL),
(20015, 16, 87, '萌芽破土', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-43.png', NULL, NULL, NULL, NULL, 'public', 0, 18, false, 1773322573872, 1773322573872, true, NULL),
(20016, 17, 87, '蓄力绽放', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-46.png', NULL, NULL, NULL, NULL, 'public', 0, 16, false, 1773322573872, 1773322573872, true, NULL),
(20017, 18, 87, '初绽光芒', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-49.png', NULL, NULL, NULL, NULL, 'public', 0, 14, false, 1773322573872, 1773322573872, true, NULL),
(20018, 29, 87, '潜力萌发', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-52.png', NULL, NULL, NULL, NULL, 'public', 0, 12, false, 1773322573872, 1773322573872, true, NULL),
(20019, 30, 87, '新生力量', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-02.png', NULL, NULL, NULL, NULL, 'public', 0, 11, false, 1773322573872, 1773322573872, true, NULL);
-- =====================================================
-- 3. 新鲜上架 MOCK_XINXIANSHANG (27条, asset_id: 30001-30027)
-- =====================================================
INSERT INTO assets (id, owner_uid, star_id, name, cover_url, material_url, description, grade, tags, visibility, status, like_count, is_original, created_at, updated_at, is_active, material_type)
VALUES
(30001, 31, 87, '刚刚发布', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-28.png', NULL, NULL, NULL, NULL, 'public', 0, 28, false, 1773322573872, 1773322573872, true, NULL),
(30002, 32, 87, '今日新鲜', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-29.png', NULL, NULL, NULL, NULL, 'public', 0, 25, false, 1773322573872, 1773322573872, true, NULL),
(30003, 33, 87, '刚出锅', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-30.png', NULL, NULL, NULL, NULL, 'public', 0, 22, false, 1773322573872, 1773322573872, true, NULL),
(30004, 34, 87, '热乎的', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-31.png', NULL, NULL, NULL, NULL, 'public', 0, 20, false, 1773322573872, 1773322573872, true, NULL),
(30005, 35, 87, '新品上市', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-32.png', NULL, NULL, NULL, NULL, 'public', 0, 18, false, 1773322573872, 1773322573872, true, NULL),
(30006, 36, 87, '今日首发', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-33.png', NULL, NULL, NULL, NULL, 'public', 0, 15, false, 1773322573872, 1773322573872, true, NULL),
(30007, 37, 87, '刚出炉', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-34.png', NULL, NULL, NULL, NULL, 'public', 0, 12, false, 1773322573872, 1773322573872, true, NULL),
(30008, 38, 87, '最新创作', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-35.png', NULL, NULL, NULL, NULL, 'public', 0, 10, false, 1773322573872, 1773322573872, true, NULL),
(30009, 39, 87, '新鲜出炉', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-36.png', NULL, NULL, NULL, NULL, 'public', 0, 8, false, 1773322573872, 1773322573872, true, NULL),
(30010, 40, 87, '首发作品', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-37.png', NULL, NULL, NULL, NULL, 'public', 0, 5, false, 1773322573872, 1773322573872, true, NULL),
(30011, 41, 87, '全新上线', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-38.png', NULL, NULL, NULL, NULL, 'public', 0, 3, false, 1773322573872, 1773322573872, true, NULL),
(30012, 42, 87, '新星登场', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-39.png', NULL, NULL, NULL, NULL, 'public', 0, 2, false, 1773322573872, 1773322573872, true, NULL),
(30013, 43, 87, '首发惊喜', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-40.png', NULL, NULL, NULL, NULL, 'public', 0, 1, false, 1773322573872, 1773322573872, true, NULL),
(30014, 44, 87, '今日上新', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-41.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(30015, 45, 87, '新作出炉', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-42.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(30016, 46, 87, '新鲜血液', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-43.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(30017, 47, 87, '最新面世', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-44.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(30018, 49, 87, '全新创作', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-45.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(30019, 50, 87, '新晋发布', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-46.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(30020, 44, 87, '新潮上线', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-47.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(30021, 2, 87, '新锐登场', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-48.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(30022, 8, 87, '新意满满', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-49.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(30023, 13, 87, '新潮涌动', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-50.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(30024, 14, 87, '新鲜感', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-51.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(30025, 15, 87, '新视角', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-52.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(30026, 16, 87, '新派作品', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-53.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(30027, 17, 87, '新星璀璨', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-01.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL);
-- =====================================================
-- 4. 随机寻宝 MOCK_SUIJIXUNBAO (37条, asset_id: 40001-40037)
-- =====================================================
INSERT INTO assets (id, owner_uid, star_id, name, cover_url, material_url, description, grade, tags, visibility, status, like_count, is_original, created_at, updated_at, is_active, material_type)
VALUES
(40001, 18, 87, '神秘宝藏1', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-18.png', NULL, NULL, NULL, NULL, 'public', 0, 35, false, 1773322573872, 1773322573872, true, NULL),
(40002, 29, 87, '神秘宝藏2', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-05.png', NULL, NULL, NULL, NULL, 'public', 0, 140, false, 1773322573872, 1773322573872, true, NULL),
(40003, 30, 87, '神秘宝藏3', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-31.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(40004, 31, 87, '神秘宝藏4', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-12.png', NULL, NULL, NULL, NULL, 'public', 0, 68, false, 1773322573872, 1773322573872, true, NULL),
(40005, 32, 87, '神秘宝藏5', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-02.png', NULL, NULL, NULL, NULL, 'public', 0, 210, false, 1773322573872, 1773322573872, true, NULL),
(40006, 33, 87, '神秘宝藏6', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-25.png', NULL, NULL, NULL, NULL, 'public', 0, 12, false, 1773322573872, 1773322573872, true, NULL),
(40007, 34, 87, '神秘宝藏7', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-09.png', NULL, NULL, NULL, NULL, 'public', 0, 95, false, 1773322573872, 1773322573872, true, NULL),
(40008, 35, 87, '神秘宝藏8', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-36.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(40009, 36, 87, '神秘宝藏9', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-20.png', NULL, NULL, NULL, NULL, 'public', 0, 28, false, 1773322573872, 1773322573872, true, NULL),
(40010, 37, 87, '神秘宝藏10', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-07.png', NULL, NULL, NULL, NULL, 'public', 0, 110, false, 1773322573872, 1773322573872, true, NULL),
(40011, 38, 87, '神秘宝藏11', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-33.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(40012, 39, 87, '神秘宝藏12', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-14.png', NULL, NULL, NULL, NULL, 'public', 0, 55, false, 1773322573872, 1773322573872, true, NULL),
(40013, 40, 87, '神秘宝藏13', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-01.png', NULL, NULL, NULL, NULL, 'public', 0, 230, false, 1773322573872, 1773322573872, true, NULL),
(40014, 41, 87, '神秘宝藏14', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-28.png', NULL, NULL, NULL, NULL, 'public', 0, 5, false, 1773322573872, 1773322573872, true, NULL),
(40015, 42, 87, '神秘宝藏15', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-22.png', NULL, NULL, NULL, NULL, 'public', 0, 22, false, 1773322573872, 1773322573872, true, NULL),
(40016, 43, 87, '神秘宝藏16', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-10.png', NULL, NULL, NULL, NULL, 'public', 0, 88, false, 1773322573872, 1773322573872, true, NULL),
(40017, 44, 87, '神秘宝藏17', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-35.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(40018, 45, 87, '神秘宝藏18', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-16.png', NULL, NULL, NULL, NULL, 'public', 0, 42, false, 1773322573872, 1773322573872, true, NULL),
(40019, 46, 87, '神秘宝藏19', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-03.png', NULL, NULL, NULL, NULL, 'public', 0, 185, false, 1773322573872, 1773322573872, true, NULL),
(40020, 47, 87, '神秘宝藏20', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-29.png', NULL, NULL, NULL, NULL, 'public', 0, 3, false, 1773322573872, 1773322573872, true, NULL),
(40021, 49, 87, '神秘宝藏21', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-08.png', NULL, NULL, NULL, NULL, 'public', 0, 105, false, 1773322573872, 1773322573872, true, NULL),
(40022, 50, 87, '神秘宝藏22', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-24.png', NULL, NULL, NULL, NULL, 'public', 0, 15, false, 1773322573872, 1773322573872, true, NULL),
(40023, 45, 87, '神秘宝藏23', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-11.png', NULL, NULL, NULL, NULL, 'public', 0, 75, false, 1773322573872, 1773322573872, true, NULL),
(40024, 2, 87, '神秘宝藏24', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-34.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(40025, 8, 87, '神秘宝藏25', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-19.png', NULL, NULL, NULL, NULL, 'public', 0, 32, false, 1773322573872, 1773322573872, true, NULL),
(40026, 13, 87, '神秘宝藏26', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-30.png', NULL, NULL, NULL, NULL, 'public', 0, 2, false, 1773322573872, 1773322573872, true, NULL),
(40027, 14, 87, '神秘宝藏27', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-06.png', NULL, NULL, NULL, NULL, 'public', 0, 120, false, 1773322573872, 1773322573872, true, NULL),
(40028, 15, 87, '神秘宝藏28', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-27.png', NULL, NULL, NULL, NULL, 'public', 0, 8, false, 1773322573872, 1773322573872, true, NULL),
(40029, 16, 87, '神秘宝藏29', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-23.png', NULL, NULL, NULL, NULL, 'public', 0, 18, false, 1773322573872, 1773322573872, true, NULL),
(40030, 17, 87, '神秘宝藏30', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-04.png', NULL, NULL, NULL, NULL, 'public', 0, 160, false, 1773322573872, 1773322573872, true, NULL),
(40031, 18, 87, '神秘宝藏31', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-32.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(40032, 29, 87, '神秘宝藏32', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-13.png', NULL, NULL, NULL, NULL, 'public', 0, 62, false, 1773322573872, 1773322573872, true, NULL),
(40033, 30, 87, '神秘宝藏33', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-37.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(40034, 31, 87, '神秘宝藏34', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-21.png', NULL, NULL, NULL, NULL, 'public', 0, 25, false, 1773322573872, 1773322573872, true, NULL),
(40035, 32, 87, '神秘宝藏35', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-35.png', NULL, NULL, NULL, NULL, 'public', 0, 0, false, 1773322573872, 1773322573872, true, NULL),
(40036, 33, 87, '神秘宝藏36', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-17.png', NULL, NULL, NULL, NULL, 'public', 0, 38, false, 1773322573872, 1773322573872, true, NULL),
(40037, 34, 87, '神秘宝藏37', 'https://top-fans-test.oss-cn-shanghai.aliyuncs.com/asset/1/87/image-26.png', NULL, NULL, NULL, NULL, 'public', 0, 10, false, 1773322573872, 1773322573872, true, NULL);
-- =====================================================
-- 5. 批量插入 asset_registry 记录
-- =====================================================
INSERT INTO asset_registry (id, asset_id, asset_type, owner_uid, star_id, grade, collection_category, activity_id, activity_type, status, like_count, display_status, created_at, updated_at)
SELECT id, id, 'artwork', owner_uid, star_id, NULL, NULL, NULL, NULL, 0, like_count, 0, 1773322573872, 1773322573872
FROM assets
WHERE id >= 10000;
COMMIT;

View File

@ -0,0 +1,39 @@
-- V8: 将mock资产插入展示表exhibitions (2026-05-17)
-- 为所有mock资产(asset_id: 10001-40037)创建展示记录
-- 结束时间 = 开始时间 + 1个月
BEGIN;
-- 获取当前时间戳(毫秒)作为开始时间
DO $$
DECLARE
start_ts bigint := (EXTRACT(EPOCH FROM NOW()) * 1000)::bigint;
expire_ts bigint := (EXTRACT(EPOCH FROM NOW()) * 1000)::bigint + (30::bigint * 24 * 60 * 60 * 1000); -- 加1个月
slot_ids bigint[];
slot_rec record;
asset_rec record;
i int := 0;
BEGIN
-- 收集star_id=87的所有可用slot_id
SELECT array_agg(slot_id ORDER BY slot_id) INTO slot_ids FROM booth_slots WHERE star_id = 87;
-- 为每个mock资产创建展示记录
FOR asset_rec IN SELECT id, owner_uid FROM assets WHERE id >= 10000 ORDER BY id LOOP
-- 循环分配slot_id
IF array_length(slot_ids, 1) > 0 THEN
i := (i % array_length(slot_ids, 1)) + 1;
-- 获取对应slot的host_profile_id
SELECT host_profile_id INTO slot_rec FROM booth_slots WHERE slot_id = slot_ids[i];
INSERT INTO exhibitions (asset_id, slot_id, host_profile_id, occupier_uid, occupier_star_id, start_time, expire_at, created_at, updated_at)
VALUES (asset_rec.id, slot_ids[i], slot_rec.host_profile_id, asset_rec.owner_uid, 87, start_ts, expire_ts, start_ts, start_ts)
ON CONFLICT (asset_id) WHERE deleted_at IS NULL DO NOTHING;
END IF;
END LOOP;
END $$;
-- 将asset_registry的display_status设为1
UPDATE asset_registry SET display_status = 1 WHERE id >= 10000;
COMMIT;

View File

@ -1,7 +1,7 @@
// ========== 模拟数据配置 ========== // ========== 模拟数据配置 ==========
// 是否使用模拟数据(开发调试时设为 true上线后改为 false // 是否使用模拟数据(开发调试时设为 true上线后改为 false
export const USE_MOCK_DATA = true export const USE_MOCK_DATA = false
// 模拟图片列表 // 模拟图片列表
const MOCK_IMAGES = [ const MOCK_IMAGES = [

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 536 KiB

After

Width:  |  Height:  |  Size: 514 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 525 KiB

After

Width:  |  Height:  |  Size: 494 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 819 KiB

After

Width:  |  Height:  |  Size: 784 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 799 KiB

After

Width:  |  Height:  |  Size: 775 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1002 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 696 KiB

After

Width:  |  Height:  |  Size: 664 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 578 KiB

After

Width:  |  Height:  |  Size: 565 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 660 KiB

After

Width:  |  Height:  |  Size: 636 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 988 KiB

After

Width:  |  Height:  |  Size: 951 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1019 KiB

After

Width:  |  Height:  |  Size: 996 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 598 KiB

After

Width:  |  Height:  |  Size: 510 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 852 KiB

After

Width:  |  Height:  |  Size: 805 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 792 KiB

After

Width:  |  Height:  |  Size: 757 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 539 KiB

After

Width:  |  Height:  |  Size: 531 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 543 KiB

After

Width:  |  Height:  |  Size: 514 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 762 KiB

After

Width:  |  Height:  |  Size: 737 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 612 KiB

After

Width:  |  Height:  |  Size: 592 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 369 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 967 KiB

After

Width:  |  Height:  |  Size: 952 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 977 KiB

After

Width:  |  Height:  |  Size: 933 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 911 KiB

After

Width:  |  Height:  |  Size: 861 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1008 KiB

After

Width:  |  Height:  |  Size: 981 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 664 KiB

After

Width:  |  Height:  |  Size: 653 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 KiB

After

Width:  |  Height:  |  Size: 793 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 554 KiB

After

Width:  |  Height:  |  Size: 516 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 834 KiB

After

Width:  |  Height:  |  Size: 802 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 883 KiB

After

Width:  |  Height:  |  Size: 859 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 972 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 KiB

After

Width:  |  Height:  |  Size: 580 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 552 KiB

After

Width:  |  Height:  |  Size: 521 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 982 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 990 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 525 KiB

After

Width:  |  Height:  |  Size: 514 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1011 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 949 KiB

After

Width:  |  Height:  |  Size: 921 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 802 KiB

After

Width:  |  Height:  |  Size: 776 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 695 KiB

After

Width:  |  Height:  |  Size: 671 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 526 KiB

After

Width:  |  Height:  |  Size: 516 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 MiB

After

Width:  |  Height:  |  Size: 775 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 MiB

After

Width:  |  Height:  |  Size: 946 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 593 KiB

After

Width:  |  Height:  |  Size: 581 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 525 KiB

After

Width:  |  Height:  |  Size: 522 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 739 KiB

After

Width:  |  Height:  |  Size: 695 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 KiB

After

Width:  |  Height:  |  Size: 604 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 615 KiB

After

Width:  |  Height:  |  Size: 604 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 KiB

After

Width:  |  Height:  |  Size: 857 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 895 KiB

After

Width:  |  Height:  |  Size: 862 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 758 KiB

After

Width:  |  Height:  |  Size: 704 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 808 KiB

After

Width:  |  Height:  |  Size: 724 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 703 KiB

After

Width:  |  Height:  |  Size: 670 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 560 KiB

After

Width:  |  Height:  |  Size: 513 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 623 KiB

After

Width:  |  Height:  |  Size: 575 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 519 KiB

After

Width:  |  Height:  |  Size: 470 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 897 KiB

After

Width:  |  Height:  |  Size: 858 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 603 KiB

After

Width:  |  Height:  |  Size: 524 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 587 KiB

After

Width:  |  Height:  |  Size: 537 KiB