bindbox-game/test_item_card.sh
邹方成 1ab39d2f5a
Some checks failed
Build docker and publish / linux (1.24.5) (push) Failing after 25s
refactor: 重构项目结构并重命名模块
feat(admin): 新增工会管理功能
feat(activity): 添加活动管理相关服务
feat(user): 实现用户道具卡和积分管理
feat(guild): 新增工会成员管理功能

fix: 修复数据库连接配置
fix: 修正jwtoken导入路径
fix: 解决端口冲突问题

style: 统一代码格式和注释风格
style: 更新项目常量命名

docs: 添加项目框架和开发规范文档
docs: 更新接口文档注释

chore: 移除无用代码和文件
chore: 更新Makefile和配置文件
chore: 清理日志文件

test: 添加道具卡测试脚本
2025-11-14 21:10:00 +08:00

36 lines
1.0 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 测试创建道具卡的脚本
# 登录获取token假设有默认管理员账号
echo "尝试登录获取token..."
LOGIN_RESPONSE=$(curl -s -X POST http://localhost:9991/api/admin/login \
-H "Content-Type: application/json" \
-d '{
"username": "admin",
"password": "21232f297a57a5a743894a0e4a801fc3"
}')
echo "登录响应: $LOGIN_RESPONSE"
# 提取token如果登录成功
TOKEN=$(echo $LOGIN_RESPONSE | grep -o '"token":"[^"]*"' | cut -d'"' -f4)
if [ -n "$TOKEN" ]; then
echo "获取到token: $TOKEN"
# 创建测试道具卡
echo "创建测试道具卡..."
CREATE_RESPONSE=$(curl -s -X POST http://localhost:9991/api/admin/system_item_cards \
-H "Content-Type: application/json" \
-H "Authorization: $TOKEN" \
-d '{
"name": "测试抽奖卡",
"card_type": 1,
"scope_type": 1,
"price": 100,
"effect_type": 1,
"reward_multiplier_x1000": 2000,
"boost_rate_x1000": 0,
"stacking_strategy": 1,
"max_effect_value_x100