功能:用户可修改恋人历史消息+完善礼物、换装、音色种类
This commit is contained in:
parent
3e6b6c361e
commit
907ca22b60
Binary file not shown.
8
lover/migrations/add_message_edit_fields.sql
Normal file
8
lover/migrations/add_message_edit_fields.sql
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
-- 添加消息编辑相关字段
|
||||||
|
ALTER TABLE nf_chat_message
|
||||||
|
ADD COLUMN is_edited TINYINT(1) DEFAULT 0 COMMENT '是否被编辑过',
|
||||||
|
ADD COLUMN original_content TEXT COMMENT '原始内容',
|
||||||
|
ADD COLUMN edited_at DATETIME COMMENT '编辑时间';
|
||||||
|
|
||||||
|
-- 添加索引
|
||||||
|
CREATE INDEX idx_message_edited ON nf_chat_message(is_edited, session_id);
|
||||||
|
|
@ -320,6 +320,10 @@ class ChatMessage(Base):
|
||||||
tts_duration_ms = Column(Integer)
|
tts_duration_ms = Column(Integer)
|
||||||
tts_error = Column(String(255))
|
tts_error = Column(String(255))
|
||||||
created_at = Column(DateTime, default=datetime.utcnow)
|
created_at = Column(DateTime, default=datetime.utcnow)
|
||||||
|
# 编辑相关字段
|
||||||
|
is_edited = Column(Boolean, default=False)
|
||||||
|
original_content = Column(Text)
|
||||||
|
edited_at = Column(DateTime)
|
||||||
|
|
||||||
|
|
||||||
class ChatSummary(Base):
|
class ChatSummary(Base):
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1162,3 +1162,123 @@ def get_chat_config(
|
||||||
is_vip=_is_vip(user_row),
|
is_vip=_is_vip(user_row),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# ==================== 消息编辑功能 ====================
|
||||||
|
|
||||||
|
class EditMessageIn(BaseModel):
|
||||||
|
new_content: str = Field(..., min_length=1, max_length=4000, description="新的消息内容")
|
||||||
|
regenerate_reply: bool = Field(default=True, description="是否重新生成AI回复")
|
||||||
|
|
||||||
|
|
||||||
|
class EditMessageOut(BaseModel):
|
||||||
|
message_id: int
|
||||||
|
new_content: str
|
||||||
|
regenerated: bool
|
||||||
|
new_reply: Optional[str] = None
|
||||||
|
|
||||||
|
|
||||||
|
@router.put("/messages/{message_id}/edit", response_model=ApiResponse[EditMessageOut])
|
||||||
|
def edit_message(
|
||||||
|
message_id: int,
|
||||||
|
payload: EditMessageIn,
|
||||||
|
db: Session = Depends(get_db),
|
||||||
|
user: AuthedUser = Depends(get_current_user),
|
||||||
|
):
|
||||||
|
"""
|
||||||
|
编辑历史消息并可选重新生成AI回复
|
||||||
|
"""
|
||||||
|
# 1. 查找消息
|
||||||
|
msg = (
|
||||||
|
db.query(ChatMessage)
|
||||||
|
.filter(ChatMessage.id == message_id, ChatMessage.user_id == user.id)
|
||||||
|
.with_for_update()
|
||||||
|
.first()
|
||||||
|
)
|
||||||
|
if not msg:
|
||||||
|
raise HTTPException(status_code=404, detail="消息不存在")
|
||||||
|
|
||||||
|
# 允许编辑AI消息(lover角色)
|
||||||
|
if msg.role not in ["user", "lover"]:
|
||||||
|
raise HTTPException(status_code=400, detail="只能编辑用户或AI消息")
|
||||||
|
|
||||||
|
# 2. 保存原始内容(首次编辑时)
|
||||||
|
if not msg.is_edited:
|
||||||
|
msg.original_content = msg.content
|
||||||
|
|
||||||
|
# 3. 更新消息
|
||||||
|
msg.content = payload.new_content
|
||||||
|
msg.is_edited = True
|
||||||
|
msg.edited_at = datetime.utcnow()
|
||||||
|
db.add(msg)
|
||||||
|
db.flush()
|
||||||
|
|
||||||
|
# 4. 删除该消息之后的摘要(需要重新生成)
|
||||||
|
db.query(ChatSummary).filter(
|
||||||
|
ChatSummary.session_id == msg.session_id,
|
||||||
|
ChatSummary.upto_seq >= msg.seq
|
||||||
|
).delete()
|
||||||
|
db.flush()
|
||||||
|
|
||||||
|
new_reply = None
|
||||||
|
regenerated = False
|
||||||
|
|
||||||
|
# 5. 重新生成AI回复(仅当编辑用户消息时)
|
||||||
|
if payload.regenerate_reply and msg.role == "user":
|
||||||
|
# 找到紧接着的AI回复
|
||||||
|
next_lover_msg = (
|
||||||
|
db.query(ChatMessage)
|
||||||
|
.filter(
|
||||||
|
ChatMessage.session_id == msg.session_id,
|
||||||
|
ChatMessage.seq == msg.seq + 1,
|
||||||
|
ChatMessage.role == "lover"
|
||||||
|
)
|
||||||
|
.with_for_update()
|
||||||
|
.first()
|
||||||
|
)
|
||||||
|
|
||||||
|
if next_lover_msg:
|
||||||
|
# 获取会话和恋人信息
|
||||||
|
session = db.query(ChatSession).filter(ChatSession.id == msg.session_id).first()
|
||||||
|
lover = db.query(Lover).filter(Lover.id == msg.lover_id).first()
|
||||||
|
|
||||||
|
if session and lover:
|
||||||
|
# 构建上下文(使用修改后的消息)
|
||||||
|
inner_voice_enabled = session.inner_voice_enabled or False
|
||||||
|
context_messages = _build_context_messages(db, session, lover, user, inner_voice_enabled)
|
||||||
|
|
||||||
|
# 调用LLM重新生成
|
||||||
|
llm_result = chat_completion(
|
||||||
|
context_messages,
|
||||||
|
temperature=settings.LLM_TEMPERATURE,
|
||||||
|
max_tokens=settings.LLM_MAX_TOKENS,
|
||||||
|
seed=_pick_llm_seed(),
|
||||||
|
)
|
||||||
|
|
||||||
|
new_reply = llm_result.content or ""
|
||||||
|
if not inner_voice_enabled:
|
||||||
|
new_reply = _strip_inner_voice_text(new_reply)
|
||||||
|
|
||||||
|
# 更新AI回复
|
||||||
|
next_lover_msg.content = new_reply
|
||||||
|
next_lover_msg.is_edited = True
|
||||||
|
next_lover_msg.edited_at = datetime.utcnow()
|
||||||
|
next_lover_msg.token_input = (llm_result.usage or {}).get("input_tokens")
|
||||||
|
next_lover_msg.token_output = (llm_result.usage or {}).get("output_tokens")
|
||||||
|
db.add(next_lover_msg)
|
||||||
|
db.flush()
|
||||||
|
|
||||||
|
regenerated = True
|
||||||
|
|
||||||
|
# 触发摘要重新生成
|
||||||
|
_maybe_generate_summary(db, session, upto_seq=next_lover_msg.seq)
|
||||||
|
|
||||||
|
return success_response(
|
||||||
|
EditMessageOut(
|
||||||
|
message_id=msg.id,
|
||||||
|
new_content=msg.content,
|
||||||
|
regenerated=regenerated,
|
||||||
|
new_reply=new_reply,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,11 @@
|
||||||
: (myavatar ? myavatar : '/static/images/avatar.png')" mode="aspectFill">
|
: (myavatar ? myavatar : '/static/images/avatar.png')" mode="aspectFill">
|
||||||
</image>
|
</image>
|
||||||
<view class="message-content">
|
<view class="message-content">
|
||||||
<view class="message-bubble">
|
<!-- AI消息添加编辑按钮 -->
|
||||||
|
<view v-if="item.role === 'lover'" class="edit-icon" @click="onMessageLongPress(item)">
|
||||||
|
<text>✏️</text>
|
||||||
|
</view>
|
||||||
|
<view class="message-bubble" @longpress="onMessageLongPress(item)">
|
||||||
<!-- 视频消息特殊处理 -->
|
<!-- 视频消息特殊处理 -->
|
||||||
<view v-if="isVideoMessage(item.content)" class="video-message-container">
|
<view v-if="isVideoMessage(item.content)" class="video-message-container">
|
||||||
<!-- 提取并显示文本部分 -->
|
<!-- 提取并显示文本部分 -->
|
||||||
|
|
@ -233,6 +237,24 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<ai ref="aiRef" @renderText="renderText" />
|
<ai ref="aiRef" @renderText="renderText" />
|
||||||
|
|
||||||
|
<!-- 消息编辑弹窗 -->
|
||||||
|
<view class="edit-modal" v-if="editModalVisible" @click="editModalVisible = false">
|
||||||
|
<view class="edit-content" @click.stop>
|
||||||
|
<view class="edit-title">编辑消息</view>
|
||||||
|
<textarea
|
||||||
|
v-model="editingMessage.content"
|
||||||
|
class="edit-textarea"
|
||||||
|
placeholder="请输入消息内容"
|
||||||
|
maxlength="4000">
|
||||||
|
</textarea>
|
||||||
|
<view class="edit-tip">编辑后将更新AI的记忆,下次对话时生效</view>
|
||||||
|
<view class="edit-buttons">
|
||||||
|
<view class="edit-btn cancel" @click="cancelEdit">取消</view>
|
||||||
|
<view class="edit-btn confirm" @click="confirmEdit">确认</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -325,7 +347,12 @@
|
||||||
currentVideoUrl: '', // 添加当前视频URL变量
|
currentVideoUrl: '', // 添加当前视频URL变量
|
||||||
singSongsList: [], //歌曲列表
|
singSongsList: [], //歌曲列表
|
||||||
songId: 0,
|
songId: 0,
|
||||||
chatBackground: '' // 聊天背景
|
chatBackground: '', // 聊天背景
|
||||||
|
// 消息编辑相关
|
||||||
|
editModalVisible: false,
|
||||||
|
editingMessage: null,
|
||||||
|
baseURL: 'http://127.0.0.1:8080',
|
||||||
|
baseURLPy: 'http://127.0.0.1:8000',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
|
@ -1746,6 +1773,77 @@
|
||||||
console.log('已停止轮询监听1');
|
console.log('已停止轮询监听1');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 长按消息
|
||||||
|
onMessageLongPress(message) {
|
||||||
|
// 只能编辑AI的消息
|
||||||
|
if (message.role !== 'lover') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.editingMessage = {
|
||||||
|
id: message.id,
|
||||||
|
content: message.content,
|
||||||
|
seq: message.seq
|
||||||
|
};
|
||||||
|
this.editModalVisible = true;
|
||||||
|
},
|
||||||
|
// 取消编辑
|
||||||
|
cancelEdit() {
|
||||||
|
this.editModalVisible = false;
|
||||||
|
this.editingMessage = null;
|
||||||
|
},
|
||||||
|
// 确认编辑
|
||||||
|
confirmEdit() {
|
||||||
|
if (!this.editingMessage.content.trim()) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '消息内容不能为空',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
uni.showLoading({ title: '更新中...' });
|
||||||
|
|
||||||
|
uni.request({
|
||||||
|
url: this.baseURLPy + `/chat/messages/${this.editingMessage.id}/edit`,
|
||||||
|
method: 'PUT',
|
||||||
|
header: {
|
||||||
|
'token': uni.getStorageSync("token") || "",
|
||||||
|
'Authorization': (uni.getStorageSync("token") ? ('Bearer ' + uni.getStorageSync("token")) : ""),
|
||||||
|
'X-User-Id': '84'
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
new_content: this.editingMessage.content,
|
||||||
|
regenerate_reply: false // 不重新生成回复,只更新记忆
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
uni.hideLoading();
|
||||||
|
if (res.data.code === 1) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '编辑成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
|
||||||
|
// 刷新消息列表
|
||||||
|
this.sessionInit();
|
||||||
|
this.editModalVisible = false;
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.data.msg || '编辑失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
uni.hideLoading();
|
||||||
|
console.error('编辑消息失败', error);
|
||||||
|
uni.showToast({
|
||||||
|
title: '编辑失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
// 页面卸载时停止轮询
|
// 页面卸载时停止轮询
|
||||||
onUnload() {
|
onUnload() {
|
||||||
|
|
@ -1918,6 +2016,28 @@
|
||||||
|
|
||||||
.message-content {
|
.message-content {
|
||||||
max-width: 70%;
|
max-width: 70%;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 编辑图标 */
|
||||||
|
.edit-icon {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: -50rpx; /* AI消息在左边,图标也在左边 */
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: rgba(255, 255, 255, 0.9);
|
||||||
|
border-radius: 50%;
|
||||||
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
|
||||||
|
cursor: pointer;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit-icon text {
|
||||||
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.message-bubble {
|
.message-bubble {
|
||||||
|
|
@ -2602,4 +2722,76 @@
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
background: linear-gradient(135deg, #9F47FF 0%, #0053FA 100%), #D8D8D8;
|
background: linear-gradient(135deg, #9F47FF 0%, #0053FA 100%), #D8D8D8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 消息编辑弹窗样式 */
|
||||||
|
.edit-modal {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: rgba(0, 0, 0, 0.5);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
z-index: 9999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit-content {
|
||||||
|
width: 80%;
|
||||||
|
max-width: 600rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
padding: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit-textarea {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 200rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
border: 1rpx solid #ddd;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit-tip {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit-buttons {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit-btn {
|
||||||
|
flex: 1;
|
||||||
|
padding: 20rpx;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit-btn.cancel {
|
||||||
|
background: #f5f5f5;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit-btn.confirm {
|
||||||
|
background: linear-gradient(135deg, #9F47FF 0%, #0053FA 100%);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,4 +1,6 @@
|
||||||
1. 将密码校验删除,因为无法生成模型,用最简单的方法来尝试这些内容。
|
1. 将密码校验删除,因为无法生成模型,用最简单的方法来尝试这些内容。
|
||||||
2. 将Hbuilder的AppId更换成自己的,原本的保留(__UNI__1F3C178)。还是无法正常编译,将下面的插件注释掉不用,Agora-RTC:音视频插件和AudioRecode:录音插件。
|
2. 将Hbuilder的AppId更换成自己的,原本的保留(__UNI__1F3C178)。还是无法正常编译,将下面的插件注释掉不用,Agora-RTC:音视频插件和AudioRecode:录音插件。
|
||||||
3. 增加tab栏但是还没有加上对应的功能
|
3. 增加tab栏但是还没有加上对应的功能
|
||||||
4. 增加聊天背景选择功能,会员可以自定义背景
|
4. 增加聊天背景选择功能,会员可以自定义背景
|
||||||
|
5. 增加恋人消息编辑功能,更新**数据库**,加上一些编辑消息、编辑时间相关字段。用户编辑消息之后恋人不回答,只会更新记忆和摘要的数据库,下一次回答的时候会重新引用这个更新后的记忆。
|
||||||
|
6. lian
|
||||||
115
数据填充_换装种类.sql
Normal file
115
数据填充_换装种类.sql
Normal file
|
|
@ -0,0 +1,115 @@
|
||||||
|
-- ============================================
|
||||||
|
-- 换装种类数据填充(流行服装风格)
|
||||||
|
-- 表名: nf_outfit_items
|
||||||
|
-- 字段说明:
|
||||||
|
-- name: 服装名称
|
||||||
|
-- category: 分类(top=上装, bottom=下装, dress=连衣裙/连体服)
|
||||||
|
-- gender: 适用性别(male=男, female=女, unisex=通用)
|
||||||
|
-- image_url: 服装图片路径(需要上传图片后更新)
|
||||||
|
-- is_free: 是否免费(1=免费, 0=收费)
|
||||||
|
-- price_gold: 金币价格(收费时)
|
||||||
|
-- is_vip_only: 是否仅VIP可见/可用(1=是, 0=否)
|
||||||
|
-- status: 状态(1=上架, 0=下架)
|
||||||
|
-- weigh: 排序权重(数字越大越靠前)
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
-- ========== 上装 (top) - 女性 ==========
|
||||||
|
INSERT INTO `nf_outfit_items` (`name`, `category`, `gender`, `image_url`, `is_free`, `price_gold`, `is_vip_only`, `status`, `weigh`, `createtime`, `updatetime`) VALUES
|
||||||
|
-- 免费基础款
|
||||||
|
('白色T恤', 'top', 'female', '/uploads/outfit/top/white_tshirt.jpg', 1, 0, 0, '1', 100, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('粉色短袖', 'top', 'female', '/uploads/outfit/top/pink_short_sleeve.jpg', 1, 0, 0, '1', 99, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('蓝色衬衫', 'top', 'female', '/uploads/outfit/top/blue_shirt.jpg', 1, 0, 0, '1', 98, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('灰色卫衣', 'top', 'female', '/uploads/outfit/top/gray_sweatshirt.jpg', 1, 0, 0, '1', 97, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
|
||||||
|
-- 收费款
|
||||||
|
('蕾丝吊带上衣', 'top', 'female', '/uploads/outfit/top/lace_strap.jpg', 0, 100, 0, '1', 96, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('一字领露肩上衣', 'top', 'female', '/uploads/outfit/top/off_shoulder.jpg', 0, 80, 0, '1', 95, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('露脐短袖', 'top', 'female', '/uploads/outfit/top/crop_top.jpg', 0, 60, 0, '1', 94, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('雪纺衬衫', 'top', 'female', '/uploads/outfit/top/chiffon_shirt.jpg', 0, 70, 0, '1', 93, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('针织开衫', 'top', 'female', '/uploads/outfit/top/knit_cardigan.jpg', 0, 90, 0, '1', 92, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('小香风外套', 'top', 'female', '/uploads/outfit/top/tweed_jacket.jpg', 0, 150, 0, '1', 91, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
|
||||||
|
-- VIP专属
|
||||||
|
('真丝衬衫', 'top', 'female', '/uploads/outfit/top/silk_shirt.jpg', 0, 200, 1, '1', 90, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('定制礼服上衣', 'top', 'female', '/uploads/outfit/top/custom_dress_top.jpg', 0, 300, 1, '1', 89, UNIX_TIMESTAMP(), UNIX_TIMESTAMP());
|
||||||
|
|
||||||
|
-- ========== 下装 (bottom) - 女性 ==========
|
||||||
|
INSERT INTO `nf_outfit_items` (`name`, `category`, `gender`, `image_url`, `is_free`, `price_gold`, `is_vip_only`, `status`, `weigh`, `createtime`, `updatetime`) VALUES
|
||||||
|
-- 免费基础款
|
||||||
|
('蓝色牛仔裤', 'bottom', 'female', '/uploads/outfit/bottom/blue_jeans.jpg', 1, 0, 0, '1', 100, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('黑色短裙', 'bottom', 'female', '/uploads/outfit/bottom/black_skirt.jpg', 1, 0, 0, '1', 99, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('白色短裤', 'bottom', 'female', '/uploads/outfit/bottom/white_shorts.jpg', 1, 0, 0, '1', 98, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('灰色运动裤', 'bottom', 'female', '/uploads/outfit/bottom/gray_sweatpants.jpg', 1, 0, 0, '1', 97, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
|
||||||
|
-- 收费款
|
||||||
|
('A字半身裙', 'bottom', 'female', '/uploads/outfit/bottom/a_line_skirt.jpg', 0, 80, 0, '1', 96, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('高腰阔腿裤', 'bottom', 'female', '/uploads/outfit/bottom/high_waist_pants.jpg', 0, 100, 0, '1', 95, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('百褶短裙', 'bottom', 'female', '/uploads/outfit/bottom/pleated_skirt.jpg', 0, 70, 0, '1', 94, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('包臀裙', 'bottom', 'female', '/uploads/outfit/bottom/pencil_skirt.jpg', 0, 90, 0, '1', 93, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('破洞牛仔裤', 'bottom', 'female', '/uploads/outfit/bottom/ripped_jeans.jpg', 0, 60, 0, '1', 92, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('西装裤', 'bottom', 'female', '/uploads/outfit/bottom/suit_pants.jpg', 0, 120, 0, '1', 91, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
|
||||||
|
-- VIP专属
|
||||||
|
('真丝长裙', 'bottom', 'female', '/uploads/outfit/bottom/silk_long_skirt.jpg', 0, 250, 1, '1', 90, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('定制礼服下装', 'bottom', 'female', '/uploads/outfit/bottom/custom_dress_bottom.jpg', 0, 350, 1, '1', 89, UNIX_TIMESTAMP(), UNIX_TIMESTAMP());
|
||||||
|
|
||||||
|
-- ========== 连衣裙/连体服 (dress) - 女性 ==========
|
||||||
|
INSERT INTO `nf_outfit_items` (`name`, `category`, `gender`, `image_url`, `is_free`, `price_gold`, `is_vip_only`, `status`, `weigh`, `createtime`, `updatetime`) VALUES
|
||||||
|
-- 免费基础款
|
||||||
|
('白色连衣裙', 'dress', 'female', '/uploads/outfit/dress/white_dress.jpg', 1, 0, 0, '1', 100, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('碎花连衣裙', 'dress', 'female', '/uploads/outfit/dress/floral_dress.jpg', 1, 0, 0, '1', 99, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('黑色小礼服', 'dress', 'female', '/uploads/outfit/dress/black_dress.jpg', 1, 0, 0, '1', 98, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
|
||||||
|
-- 日常风格
|
||||||
|
('法式复古连衣裙', 'dress', 'female', '/uploads/outfit/dress/french_vintage.jpg', 0, 150, 0, '1', 97, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('甜美公主裙', 'dress', 'female', '/uploads/outfit/dress/princess_dress.jpg', 0, 180, 0, '1', 96, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('优雅长裙', 'dress', 'female', '/uploads/outfit/dress/elegant_long_dress.jpg', 0, 200, 0, '1', 95, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('吊带连衣裙', 'dress', 'female', '/uploads/outfit/dress/strapless_dress.jpg', 0, 120, 0, '1', 94, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('雪纺连衣裙', 'dress', 'female', '/uploads/outfit/dress/chiffon_dress.jpg', 0, 160, 0, '1', 93, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
|
||||||
|
-- 主题风格
|
||||||
|
('JK制服', 'dress', 'female', '/uploads/outfit/dress/jk_uniform.jpg', 0, 200, 0, '1', 92, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('汉服', 'dress', 'female', '/uploads/outfit/dress/hanfu.jpg', 0, 300, 0, '1', 91, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('洛丽塔', 'dress', 'female', '/uploads/outfit/dress/lolita.jpg', 0, 350, 0, '1', 90, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('和服', 'dress', 'female', '/uploads/outfit/dress/kimono.jpg', 0, 280, 0, '1', 89, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('魔法少女装', 'dress', 'female', '/uploads/outfit/dress/magical_girl.jpg', 0, 250, 0, '1', 88, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
|
||||||
|
-- 季节限定
|
||||||
|
('夏日比基尼', 'dress', 'female', '/uploads/outfit/dress/summer_bikini.jpg', 0, 150, 0, '1', 87, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('冬季毛衣裙', 'dress', 'female', '/uploads/outfit/dress/winter_sweater_dress.jpg', 0, 180, 0, '1', 86, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('圣诞装', 'dress', 'female', '/uploads/outfit/dress/christmas_dress.jpg', 0, 200, 0, '1', 85, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
|
||||||
|
-- VIP专属
|
||||||
|
('定制晚礼服', 'dress', 'female', '/uploads/outfit/dress/custom_evening_dress.jpg', 0, 500, 1, '1', 84, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('高级定制婚纱', 'dress', 'female', '/uploads/outfit/dress/custom_wedding_dress.jpg', 0, 1000, 1, '1', 83, UNIX_TIMESTAMP(), UNIX_TIMESTAMP());
|
||||||
|
|
||||||
|
-- ========== 上装 (top) - 男性 ==========
|
||||||
|
INSERT INTO `nf_outfit_items` (`name`, `category`, `gender`, `image_url`, `is_free`, `price_gold`, `is_vip_only`, `status`, `weigh`, `createtime`, `updatetime`) VALUES
|
||||||
|
-- 免费基础款
|
||||||
|
('白色T恤', 'top', 'male', '/uploads/outfit/top/male_white_tshirt.jpg', 1, 0, 0, '1', 100, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('蓝色衬衫', 'top', 'male', '/uploads/outfit/top/male_blue_shirt.jpg', 1, 0, 0, '1', 99, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('黑色卫衣', 'top', 'male', '/uploads/outfit/top/male_black_sweatshirt.jpg', 1, 0, 0, '1', 98, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
|
||||||
|
-- 收费款
|
||||||
|
('休闲Polo衫', 'top', 'male', '/uploads/outfit/top/polo_shirt.jpg', 0, 80, 0, '1', 97, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('商务衬衫', 'top', 'male', '/uploads/outfit/top/business_shirt.jpg', 0, 100, 0, '1', 96, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('运动背心', 'top', 'male', '/uploads/outfit/top/sports_tank.jpg', 0, 60, 0, '1', 95, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('牛仔外套', 'top', 'male', '/uploads/outfit/top/denim_jacket.jpg', 0, 120, 0, '1', 94, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('西装外套', 'top', 'male', '/uploads/outfit/top/suit_jacket.jpg', 0, 200, 0, '1', 93, UNIX_TIMESTAMP(), UNIX_TIMESTAMP());
|
||||||
|
|
||||||
|
-- ========== 下装 (bottom) - 男性 ==========
|
||||||
|
INSERT INTO `nf_outfit_items` (`name`, `category`, `gender`, `image_url`, `is_free`, `price_gold`, `is_vip_only`, `status`, `weigh`, `createtime`, `updatetime`) VALUES
|
||||||
|
-- 免费基础款
|
||||||
|
('蓝色牛仔裤', 'bottom', 'male', '/uploads/outfit/bottom/male_blue_jeans.jpg', 1, 0, 0, '1', 100, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('黑色休闲裤', 'bottom', 'male', '/uploads/outfit/bottom/male_black_pants.jpg', 1, 0, 0, '1', 99, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
|
||||||
|
-- 收费款
|
||||||
|
('运动短裤', 'bottom', 'male', '/uploads/outfit/bottom/sports_shorts.jpg', 0, 50, 0, '1', 98, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('卡其裤', 'bottom', 'male', '/uploads/outfit/bottom/khaki_pants.jpg', 0, 80, 0, '1', 97, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('西装裤', 'bottom', 'male', '/uploads/outfit/bottom/suit_pants_male.jpg', 0, 150, 0, '1', 96, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('工装裤', 'bottom', 'male', '/uploads/outfit/bottom/cargo_pants.jpg', 0, 100, 0, '1', 95, UNIX_TIMESTAMP(), UNIX_TIMESTAMP());
|
||||||
|
|
||||||
|
-- ========== 通用款 (unisex) ==========
|
||||||
|
INSERT INTO `nf_outfit_items` (`name`, `category`, `gender`, `image_url`, `is_free`, `price_gold`, `is_vip_only`, `status`, `weigh`, `createtime`, `updatetime`) VALUES
|
||||||
|
('基础T恤', 'top', 'unisex', '/uploads/outfit/top/basic_tshirt.jpg', 1, 0, 0, '1', 100, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('运动裤', 'bottom', 'unisex', '/uploads/outfit/bottom/sweatpants.jpg', 1, 0, 0, '1', 99, UNIX_TIMESTAMP(), UNIX_TIMESTAMP());
|
||||||
59
数据填充_礼物种类.sql
Normal file
59
数据填充_礼物种类.sql
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
-- ============================================
|
||||||
|
-- 礼物种类数据填充(流行虚拟礼物)
|
||||||
|
-- 表名: nf_gifts
|
||||||
|
-- 字段说明:
|
||||||
|
-- name: 礼物名称
|
||||||
|
-- title: 礼物标题/描述
|
||||||
|
-- price: 礼物价格(金币)
|
||||||
|
-- intimacy_value: 亲密度增加值
|
||||||
|
-- image: 礼物图片路径(需要上传图片后更新)
|
||||||
|
-- weigh: 排序权重(数字越大越靠前)
|
||||||
|
-- status: 状态(1=上架,0=下架)
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
-- 经济类礼物(10-50金币)
|
||||||
|
INSERT INTO `nf_gifts` (`name`, `title`, `price`, `intimacy_value`, `image`, `weigh`, `status`, `createtime`, `updatetime`) VALUES
|
||||||
|
('玫瑰花', '送她一朵玫瑰花,表达你的爱意', 10.00, 10, '/uploads/gifts/rose.png', 100, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('棒棒糖', '甜甜的棒棒糖,甜到心里', 10.00, 10, '/uploads/gifts/lollipop.png', 99, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('咖啡', '一杯香浓咖啡,温暖她的心', 15.00, 15, '/uploads/gifts/coffee.png', 98, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('冰淇淋', '夏日清凉,甜蜜相伴', 15.00, 15, '/uploads/gifts/icecream.png', 97, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('小蛋糕', '精致小蛋糕,甜蜜时光', 20.00, 20, '/uploads/gifts/cake.png', 96, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('巧克力', '浓情巧克力,爱意满满', 20.00, 20, '/uploads/gifts/chocolate.png', 95, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('奶茶', '香醇奶茶,温暖陪伴', 25.00, 25, '/uploads/gifts/milktea.png', 94, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('小星星', '闪闪小星星,照亮她的心', 30.00, 30, '/uploads/gifts/star.png', 93, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('爱心气球', '浪漫爱心气球,传递爱意', 35.00, 35, '/uploads/gifts/heart_balloon.png', 92, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('小礼物盒', '神秘礼物盒,惊喜不断', 40.00, 40, '/uploads/gifts/gift_box.png', 91, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('彩虹', '美丽彩虹,带来好运', 50.00, 50, '/uploads/gifts/rainbow.png', 90, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP());
|
||||||
|
|
||||||
|
-- 中档礼物(50-200金币)
|
||||||
|
INSERT INTO `nf_gifts` (`name`, `title`, `price`, `intimacy_value`, `image`, `weigh`, `status`, `createtime`, `updatetime`) VALUES
|
||||||
|
('香槟', '庆祝时刻,香槟相伴', 50.00, 50, '/uploads/gifts/champagne.png', 89, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('钻石', '璀璨钻石,永恒的爱', 80.00, 80, '/uploads/gifts/diamond.png', 88, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('王冠', '女王王冠,尊贵象征', 100.00, 100, '/uploads/gifts/crown.png', 87, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('爱心', '大爱心,满满爱意', 100.00, 100, '/uploads/gifts/big_heart.png', 86, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('月亮', '皎洁月亮,浪漫夜晚', 120.00, 120, '/uploads/gifts/moon.png', 85, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('烟花', '绚丽烟花,浪漫绽放', 150.00, 150, '/uploads/gifts/fireworks.png', 84, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('水晶球', '魔法水晶球,许愿成真', 150.00, 150, '/uploads/gifts/crystal_ball.png', 83, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('玫瑰花束', '99朵玫瑰,长长久久', 180.00, 180, '/uploads/gifts/rose_bouquet.png', 82, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('星星项链', '闪亮星星项链,点缀美丽', 200.00, 200, '/uploads/gifts/star_necklace.png', 81, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP());
|
||||||
|
|
||||||
|
-- 高级礼物(200-500金币)
|
||||||
|
INSERT INTO `nf_gifts` (`name`, `title`, `price`, `intimacy_value`, `image`, `weigh`, `status`, `createtime`, `updatetime`) VALUES
|
||||||
|
('跑车', '豪华跑车,速度与激情', 300.00, 300, '/uploads/gifts/sports_car.png', 80, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('飞机', '私人飞机,自由翱翔', 400.00, 400, '/uploads/gifts/airplane.png', 79, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('游艇', '豪华游艇,海上浪漫', 450.00, 450, '/uploads/gifts/yacht.png', 78, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('城堡', '梦幻城堡,公主的梦', 500.00, 500, '/uploads/gifts/castle.png', 77, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP());
|
||||||
|
|
||||||
|
-- 特殊礼物(500+金币)
|
||||||
|
INSERT INTO `nf_gifts` (`name`, `title`, `price`, `intimacy_value`, `image`, `weigh`, `status`, `createtime`, `updatetime`) VALUES
|
||||||
|
('宇宙飞船', '探索宇宙,无限可能', 600.00, 600, '/uploads/gifts/spaceship.png', 76, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('时光机', '穿越时空,回到过去', 800.00, 800, '/uploads/gifts/time_machine.png', 75, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('魔法棒', '神奇魔法棒,实现愿望', 1000.00, 1000, '/uploads/gifts/magic_wand.png', 74, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('永恒之心', '永恒之心,永不分离', 1314.00, 1314, '/uploads/gifts/eternal_heart.png', 73, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP());
|
||||||
|
|
||||||
|
-- 节日限定礼物
|
||||||
|
INSERT INTO `nf_gifts` (`name`, `title`, `price`, `intimacy_value`, `image`, `weigh`, `status`, `createtime`, `updatetime`) VALUES
|
||||||
|
('圣诞树', '圣诞树,节日氛围', 200.00, 200, '/uploads/gifts/christmas_tree.png', 72, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('情人节巧克力', '情人节限定,甜蜜加倍', 520.00, 520, '/uploads/gifts/valentine_chocolate.png', 71, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('生日蛋糕', '生日蛋糕,生日快乐', 188.00, 188, '/uploads/gifts/birthday_cake.png', 70, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
|
||||||
|
('万圣节南瓜', '万圣节南瓜,神秘有趣', 150.00, 150, '/uploads/gifts/halloween_pumpkin.png', 69, '1', UNIX_TIMESTAMP(), UNIX_TIMESTAMP());
|
||||||
75
数据填充_音色种类.sql
Normal file
75
数据填充_音色种类.sql
Normal file
|
|
@ -0,0 +1,75 @@
|
||||||
|
-- ============================================
|
||||||
|
-- 音色种类数据填充(流行AI语音合成音色)
|
||||||
|
-- 表名: nf_voice_library
|
||||||
|
-- 字段说明:
|
||||||
|
-- name: 音色名称
|
||||||
|
-- gender: 性别(male=男, female=女)
|
||||||
|
-- style_tag: 风格标签
|
||||||
|
-- avatar_url: 音色头像URL
|
||||||
|
-- sample_audio_url: 试听音频URL
|
||||||
|
-- tts_model_id: TTS模型ID(根据实际使用的TTS服务填写)
|
||||||
|
-- voice_code: 语音合成参数(根据实际TTS服务填写)
|
||||||
|
-- is_default: 是否默认(1=是, 0=否)
|
||||||
|
-- is_owned: 是否已拥有(1=是, 0=否)
|
||||||
|
-- price_gold: 解锁所需金币(0=免费)
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
-- ========== 女性音色 ==========
|
||||||
|
INSERT INTO `nf_voice_library` (`name`, `gender`, `style_tag`, `avatar_url`, `sample_audio_url`, `tts_model_id`, `voice_code`, `is_default`, `is_owned`, `price_gold`, `createtime`, `updatetime`, `deletetime`) VALUES
|
||||||
|
-- 免费基础音色
|
||||||
|
('温柔甜美', 'female', '温柔甜美', '/uploads/voice/avatar/sweet.jpg', '/uploads/voice/sample/sweet.mp3', 'cosyvoice-v2', 'sweet_voice', 1, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('清纯可爱', 'female', '清纯可爱', '/uploads/voice/avatar/cute.jpg', '/uploads/voice/sample/cute.mp3', 'cosyvoice-v2', 'cute_voice', 0, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('活泼开朗', 'female', '活泼开朗', '/uploads/voice/avatar/cheerful.jpg', '/uploads/voice/sample/cheerful.mp3', 'cosyvoice-v2', 'cheerful_voice', 0, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
|
||||||
|
-- 收费音色 - 日常风格
|
||||||
|
('成熟御姐', 'female', '成熟御姐', '/uploads/voice/avatar/mature.jpg', '/uploads/voice/sample/mature.mp3', 'cosyvoice-v2', 'mature_voice', 0, 0, 50, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('知性优雅', 'female', '知性优雅', '/uploads/voice/avatar/elegant.jpg', '/uploads/voice/sample/elegant.mp3', 'cosyvoice-v2', 'elegant_voice', 0, 0, 80, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('温柔邻家', 'female', '温柔邻家', '/uploads/voice/avatar/neighbor.jpg', '/uploads/voice/sample/neighbor.mp3', 'cosyvoice-v2', 'neighbor_voice', 0, 0, 60, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('元气少女', 'female', '元气少女', '/uploads/voice/avatar/energetic.jpg', '/uploads/voice/sample/energetic.mp3', 'cosyvoice-v2', 'energetic_voice', 0, 0, 70, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('清冷女神', 'female', '清冷女神', '/uploads/voice/avatar/cool.jpg', '/uploads/voice/sample/cool.mp3', 'cosyvoice-v2', 'cool_voice', 0, 0, 100, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
|
||||||
|
-- 收费音色 - 特殊风格
|
||||||
|
('萝莉音', 'female', '萝莉音', '/uploads/voice/avatar/loli.jpg', '/uploads/voice/sample/loli.mp3', 'cosyvoice-v2', 'loli_voice', 0, 0, 120, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('御姐音', 'female', '御姐音', '/uploads/voice/avatar/onee.jpg', '/uploads/voice/sample/onee.mp3', 'cosyvoice-v2', 'onee_voice', 0, 0, 120, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('软萌音', 'female', '软萌音', '/uploads/voice/avatar/soft.jpg', '/uploads/voice/sample/soft.mp3', 'cosyvoice-v2', 'soft_voice', 0, 0, 100, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('磁性低音', 'female', '磁性低音', '/uploads/voice/avatar/magnetic.jpg', '/uploads/voice/sample/magnetic.mp3', 'cosyvoice-v2', 'magnetic_voice', 0, 0, 150, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('空灵仙音', 'female', '空灵仙音', '/uploads/voice/avatar/ethereal.jpg', '/uploads/voice/sample/ethereal.mp3', 'cosyvoice-v2', 'ethereal_voice', 0, 0, 200, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
|
||||||
|
-- 收费音色 - 角色风格
|
||||||
|
('古风女声', 'female', '古风女声', '/uploads/voice/avatar/ancient.jpg', '/uploads/voice/sample/ancient.mp3', 'cosyvoice-v2', 'ancient_voice', 0, 0, 180, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('日系少女', 'female', '日系少女', '/uploads/voice/avatar/japanese.jpg', '/uploads/voice/sample/japanese.mp3', 'cosyvoice-v2', 'japanese_voice', 0, 0, 150, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('韩系甜美', 'female', '韩系甜美', '/uploads/voice/avatar/korean.jpg', '/uploads/voice/sample/korean.mp3', 'cosyvoice-v2', 'korean_voice', 0, 0, 150, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('欧美性感', 'female', '欧美性感', '/uploads/voice/avatar/sexy.jpg', '/uploads/voice/sample/sexy.mp3', 'cosyvoice-v2', 'sexy_voice', 0, 0, 200, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
|
||||||
|
-- VIP专属音色
|
||||||
|
('定制专属音色', 'female', '定制专属', '/uploads/voice/avatar/custom.jpg', '/uploads/voice/sample/custom.mp3', 'cosyvoice-v2', 'custom_voice', 0, 0, 500, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('AI歌手音色', 'female', 'AI歌手', '/uploads/voice/avatar/singer.jpg', '/uploads/voice/sample/singer.mp3', 'cosyvoice-v2', 'singer_voice', 0, 0, 300, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL);
|
||||||
|
|
||||||
|
-- ========== 男性音色 ==========
|
||||||
|
INSERT INTO `nf_voice_library` (`name`, `gender`, `style_tag`, `avatar_url`, `sample_audio_url`, `tts_model_id`, `voice_code`, `is_default`, `is_owned`, `price_gold`, `createtime`, `updatetime`, `deletetime`) VALUES
|
||||||
|
-- 免费基础音色
|
||||||
|
('阳光少年', 'male', '阳光少年', '/uploads/voice/avatar/male_sunny.jpg', '/uploads/voice/sample/male_sunny.mp3', 'cosyvoice-v2', 'sunny_voice', 1, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('温暖大叔', 'male', '温暖大叔', '/uploads/voice/avatar/male_warm.jpg', '/uploads/voice/sample/male_warm.mp3', 'cosyvoice-v2', 'warm_voice', 0, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('干净清爽', 'male', '干净清爽', '/uploads/voice/avatar/male_clean.jpg', '/uploads/voice/sample/male_clean.mp3', 'cosyvoice-v2', 'clean_voice', 0, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
|
||||||
|
-- 收费音色 - 日常风格
|
||||||
|
('成熟稳重', 'male', '成熟稳重', '/uploads/voice/avatar/male_mature.jpg', '/uploads/voice/sample/male_mature.mp3', 'cosyvoice-v2', 'mature_male_voice', 0, 0, 50, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('磁性低音', 'male', '磁性低音', '/uploads/voice/avatar/male_magnetic.jpg', '/uploads/voice/sample/male_magnetic.mp3', 'cosyvoice-v2', 'magnetic_male_voice', 0, 0, 100, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('温柔暖男', 'male', '温柔暖男', '/uploads/voice/avatar/male_gentle.jpg', '/uploads/voice/sample/male_gentle.mp3', 'cosyvoice-v2', 'gentle_male_voice', 0, 0, 80, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('活力青年', 'male', '活力青年', '/uploads/voice/avatar/male_vigorous.jpg', '/uploads/voice/sample/male_vigorous.mp3', 'cosyvoice-v2', 'vigorous_male_voice', 0, 0, 70, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('睿智精英', 'male', '睿智精英', '/uploads/voice/avatar/male_wise.jpg', '/uploads/voice/sample/male_wise.mp3', 'cosyvoice-v2', 'wise_male_voice', 0, 0, 120, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
|
||||||
|
-- 收费音色 - 特殊风格
|
||||||
|
('少年音', 'male', '少年音', '/uploads/voice/avatar/male_boy.jpg', '/uploads/voice/sample/male_boy.mp3', 'cosyvoice-v2', 'boy_voice', 0, 0, 100, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('大叔音', 'male', '大叔音', '/uploads/voice/avatar/male_uncle.jpg', '/uploads/voice/sample/male_uncle.mp3', 'cosyvoice-v2', 'uncle_voice', 0, 0, 120, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('沙哑磁性', 'male', '沙哑磁性', '/uploads/voice/avatar/male_husky.jpg', '/uploads/voice/sample/male_husky.mp3', 'cosyvoice-v2', 'husky_voice', 0, 0, 150, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('清亮高音', 'male', '清亮高音', '/uploads/voice/avatar/male_clear.jpg', '/uploads/voice/sample/male_clear.mp3', 'cosyvoice-v2', 'clear_male_voice', 0, 0, 100, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
|
||||||
|
-- 收费音色 - 角色风格
|
||||||
|
('古风男声', 'male', '古风男声', '/uploads/voice/avatar/male_ancient.jpg', '/uploads/voice/sample/male_ancient.mp3', 'cosyvoice-v2', 'ancient_male_voice', 0, 0, 180, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('日系少年', 'male', '日系少年', '/uploads/voice/avatar/male_japanese.jpg', '/uploads/voice/sample/male_japanese.mp3', 'cosyvoice-v2', 'japanese_male_voice', 0, 0, 150, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('欧美硬汉', 'male', '欧美硬汉', '/uploads/voice/avatar/male_tough.jpg', '/uploads/voice/sample/male_tough.mp3', 'cosyvoice-v2', 'tough_voice', 0, 0, 200, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
|
||||||
|
-- VIP专属音色
|
||||||
|
('定制专属音色', 'male', '定制专属', '/uploads/voice/avatar/male_custom.jpg', '/uploads/voice/sample/male_custom.mp3', 'cosyvoice-v2', 'custom_male_voice', 0, 0, 500, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL),
|
||||||
|
('AI歌手音色', 'male', 'AI歌手', '/uploads/voice/avatar/male_singer.jpg', '/uploads/voice/sample/male_singer.mp3', 'cosyvoice-v2', 'singer_male_voice', 0, 0, 300, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), NULL);
|
||||||
182
数据填充说明.md
Normal file
182
数据填充说明.md
Normal file
|
|
@ -0,0 +1,182 @@
|
||||||
|
# 数据填充说明文档
|
||||||
|
|
||||||
|
## 📦 礼物种类数据 (`数据填充_礼物种类.sql`)
|
||||||
|
|
||||||
|
### 数据分类
|
||||||
|
1. **经济类礼物**(10-50金币)
|
||||||
|
- 玫瑰花、棒棒糖、咖啡、冰淇淋、小蛋糕、巧克力、奶茶、小星星、爱心气球、小礼物盒、彩虹
|
||||||
|
- 共11种,亲密度增加值:10-50
|
||||||
|
|
||||||
|
2. **中档礼物**(50-200金币)
|
||||||
|
- 香槟、钻石、王冠、爱心、月亮、烟花、水晶球、玫瑰花束、星星项链
|
||||||
|
- 共9种,亲密度增加值:50-200
|
||||||
|
|
||||||
|
3. **高级礼物**(200-500金币)
|
||||||
|
- 跑车、飞机、游艇、城堡
|
||||||
|
- 共4种,亲密度增加值:200-500
|
||||||
|
|
||||||
|
4. **特殊礼物**(500+金币)
|
||||||
|
- 宇宙飞船、时光机、魔法棒、永恒之心(1314金币)
|
||||||
|
- 共4种,亲密度增加值:600-1314
|
||||||
|
|
||||||
|
5. **节日限定礼物**
|
||||||
|
- 圣诞树、情人节巧克力、生日蛋糕、万圣节南瓜
|
||||||
|
- 共4种,价格:150-520金币
|
||||||
|
|
||||||
|
**总计:32种礼物**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 👗 换装种类数据 (`数据填充_换装种类.sql`)
|
||||||
|
|
||||||
|
### 数据分类
|
||||||
|
|
||||||
|
#### 女性上装 (top)
|
||||||
|
- **免费款**:白色T恤、粉色短袖、蓝色衬衫、灰色卫衣(4种)
|
||||||
|
- **收费款**:蕾丝吊带上衣、一字领露肩上衣、露脐短袖、雪纺衬衫、针织开衫、小香风外套(6种)
|
||||||
|
- **VIP专属**:真丝衬衫、定制礼服上衣(2种)
|
||||||
|
- **小计**:12种
|
||||||
|
|
||||||
|
#### 女性下装 (bottom)
|
||||||
|
- **免费款**:蓝色牛仔裤、黑色短裙、白色短裤、灰色运动裤(4种)
|
||||||
|
- **收费款**:A字半身裙、高腰阔腿裤、百褶短裙、包臀裙、破洞牛仔裤、西装裤(6种)
|
||||||
|
- **VIP专属**:真丝长裙、定制礼服下装(2种)
|
||||||
|
- **小计**:12种
|
||||||
|
|
||||||
|
#### 女性连衣裙/连体服 (dress)
|
||||||
|
- **免费款**:白色连衣裙、碎花连衣裙、黑色小礼服(3种)
|
||||||
|
- **日常风格**:法式复古、甜美公主裙、优雅长裙、吊带连衣裙、雪纺连衣裙(5种)
|
||||||
|
- **主题风格**:JK制服、汉服、洛丽塔、和服、魔法少女装(5种)
|
||||||
|
- **季节限定**:夏日比基尼、冬季毛衣裙、圣诞装(3种)
|
||||||
|
- **VIP专属**:定制晚礼服、高级定制婚纱(2种)
|
||||||
|
- **小计**:18种
|
||||||
|
|
||||||
|
#### 男性上装 (top)
|
||||||
|
- **免费款**:白色T恤、蓝色衬衫、黑色卫衣(3种)
|
||||||
|
- **收费款**:休闲Polo衫、商务衬衫、运动背心、牛仔外套、西装外套(5种)
|
||||||
|
- **小计**:8种
|
||||||
|
|
||||||
|
#### 男性下装 (bottom)
|
||||||
|
- **免费款**:蓝色牛仔裤、黑色休闲裤(2种)
|
||||||
|
- **收费款**:运动短裤、卡其裤、西装裤、工装裤(4种)
|
||||||
|
- **小计**:6种
|
||||||
|
|
||||||
|
#### 通用款 (unisex)
|
||||||
|
- 基础T恤、运动裤(2种)
|
||||||
|
|
||||||
|
**总计:58种服装**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🎤 音色种类数据 (`数据填充_音色种类.sql`)
|
||||||
|
|
||||||
|
### 数据分类
|
||||||
|
|
||||||
|
#### 女性音色
|
||||||
|
- **免费基础音色**(3种)
|
||||||
|
- 温柔甜美(默认)、清纯可爱、活泼开朗
|
||||||
|
|
||||||
|
- **收费音色 - 日常风格**(5种)
|
||||||
|
- 成熟御姐(50金币)、知性优雅(80金币)、温柔邻家(60金币)、元气少女(70金币)、清冷女神(100金币)
|
||||||
|
|
||||||
|
- **收费音色 - 特殊风格**(5种)
|
||||||
|
- 萝莉音(120金币)、御姐音(120金币)、软萌音(100金币)、磁性低音(150金币)、空灵仙音(200金币)
|
||||||
|
|
||||||
|
- **收费音色 - 角色风格**(4种)
|
||||||
|
- 古风女声(180金币)、日系少女(150金币)、韩系甜美(150金币)、欧美性感(200金币)
|
||||||
|
|
||||||
|
- **VIP专属音色**(2种)
|
||||||
|
- 定制专属音色(500金币)、AI歌手音色(300金币)
|
||||||
|
|
||||||
|
- **小计**:19种女性音色
|
||||||
|
|
||||||
|
#### 男性音色
|
||||||
|
- **免费基础音色**(3种)
|
||||||
|
- 阳光少年(默认)、温暖大叔、干净清爽
|
||||||
|
|
||||||
|
- **收费音色 - 日常风格**(5种)
|
||||||
|
- 成熟稳重(50金币)、磁性低音(100金币)、温柔暖男(80金币)、活力青年(70金币)、睿智精英(120金币)
|
||||||
|
|
||||||
|
- **收费音色 - 特殊风格**(4种)
|
||||||
|
- 少年音(100金币)、大叔音(120金币)、沙哑磁性(150金币)、清亮高音(100金币)
|
||||||
|
|
||||||
|
- **收费音色 - 角色风格**(3种)
|
||||||
|
- 古风男声(180金币)、日系少年(150金币)、欧美硬汉(200金币)
|
||||||
|
|
||||||
|
- **VIP专属音色**(2种)
|
||||||
|
- 定制专属音色(500金币)、AI歌手音色(300金币)
|
||||||
|
|
||||||
|
- **小计**:17种男性音色
|
||||||
|
|
||||||
|
**总计:36种音色**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📝 使用说明
|
||||||
|
|
||||||
|
### 1. 执行SQL文件
|
||||||
|
```sql
|
||||||
|
-- 在MySQL数据库中依次执行以下文件:
|
||||||
|
-- 1. 数据填充_礼物种类.sql
|
||||||
|
-- 2. 数据填充_换装种类.sql
|
||||||
|
-- 3. 数据填充_音色种类.sql
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. 注意事项
|
||||||
|
|
||||||
|
#### 图片路径
|
||||||
|
- 所有 `image` 和 `image_url` 字段中的路径都是示例路径
|
||||||
|
- **需要根据实际情况上传图片并更新路径**
|
||||||
|
- 建议图片命名规范:
|
||||||
|
- 礼物:`/uploads/gifts/礼物名称.png`
|
||||||
|
- 换装:`/uploads/outfit/分类/服装名称.jpg`
|
||||||
|
- 音色:`/uploads/voice/avatar/音色名称.jpg`
|
||||||
|
|
||||||
|
#### 音频路径
|
||||||
|
- 音色的 `sample_audio_url` 需要上传实际的试听音频文件
|
||||||
|
- 建议路径:`/uploads/voice/sample/音色名称.mp3`
|
||||||
|
|
||||||
|
#### TTS模型配置
|
||||||
|
- `tts_model_id` 和 `voice_code` 字段需要根据实际使用的TTS服务填写
|
||||||
|
- 当前示例使用的是 `cosyvoice-v2`,请根据实际情况修改
|
||||||
|
|
||||||
|
#### 时间戳
|
||||||
|
- SQL中使用 `UNIX_TIMESTAMP()` 自动生成当前时间戳
|
||||||
|
- 如果需要指定时间,可以替换为具体的时间戳值
|
||||||
|
|
||||||
|
### 3. 数据调整建议
|
||||||
|
|
||||||
|
1. **价格调整**:根据实际运营策略调整金币价格
|
||||||
|
2. **亲密度值**:根据游戏平衡性调整亲密度增加值
|
||||||
|
3. **排序权重**:根据受欢迎程度调整 `weigh` 值(数字越大越靠前)
|
||||||
|
4. **VIP专属**:可以根据需要调整哪些物品设为VIP专属
|
||||||
|
|
||||||
|
### 4. 扩展建议
|
||||||
|
|
||||||
|
- **礼物**:可以添加更多节日限定、季节限定礼物
|
||||||
|
- **换装**:可以添加更多主题风格(如:职业装、运动装、睡衣等)
|
||||||
|
- **音色**:可以添加更多角色风格(如:机器人、小动物、精灵等)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📊 数据统计
|
||||||
|
|
||||||
|
| 类型 | 免费数量 | 收费数量 | VIP专属 | 总计 |
|
||||||
|
|------|---------|---------|---------|------|
|
||||||
|
| 礼物 | 0 | 28 | 0 | 32 |
|
||||||
|
| 换装 | 15 | 39 | 4 | 58 |
|
||||||
|
| 音色 | 6 | 28 | 4 | 36 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚠️ 重要提示
|
||||||
|
|
||||||
|
1. **执行前备份数据库**
|
||||||
|
2. **检查表结构是否匹配**
|
||||||
|
3. **图片和音频文件需要单独上传**
|
||||||
|
4. **TTS参数需要根据实际服务配置**
|
||||||
|
5. **建议先在测试环境执行,确认无误后再在生产环境执行**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
生成时间:2026年2月1日
|
||||||
Loading…
Reference in New Issue
Block a user