This commit is contained in:
Putoo
2026-07-08 19:13:55 +08:00
parent 5d0ebe5077
commit fe2696074b
59 changed files with 1448 additions and 112 deletions

View File

@@ -43,7 +43,7 @@ public class GoodsController : ControllerBase
int count = await _goodsService.GetUserGoodsCount(userId, goodsId);
int UseState = 0;
string[] ShowViewNum = ["Pack", "Weight", "State"]; //显示带数量窗口
string[] ShowView = ["Ship","Drug"]; //显示只能使用1个的窗口
string[] ShowView = ["Ship", "Drug", "Durability"]; //显示只能使用1个的窗口
if (ShowViewNum.Any(it => it == goodsInfo.code))
{
UseState = 1;
@@ -113,7 +113,7 @@ public class GoodsController : ControllerBase
return PoAction.Message(ck);
}
}
#endregion
if (await _goodsService.UpdateUserGoods(userId, 0, goodsId, count, "使用物品"))
@@ -168,11 +168,24 @@ public class GoodsController : ControllerBase
await _weightService.AddUserShip(userId, name, goodsId, speed, weight, copper, sale, remark);
message = $"使用[{goodsInfo.goodsName}],获得{name}+1";
}
if (goodsInfo.code == nameof(GoodsEnum.Code.Drug))
{
message = "使用成功!";
await _goodsService.UseDrug(userId, goodsId, goodsInfo.content);
}
if (goodsInfo.code == nameof(GoodsEnum.Code.Durability))
{
message = "使用成功!";
dynamic _drugConfig = JsonConvert.DeserializeObject<dynamic>(goodsInfo.content);
await _attrService.AddUserStock(userId, goodsId.ToString(), Convert.ToString(_drugConfig.name),
Convert.ToString(_drugConfig.type),
Convert.ToString(_drugConfig.code),
Convert.ToInt64(_drugConfig.num), Convert.ToString(_drugConfig.par),
Convert.ToInt32(_drugConfig.minute));
}
return PoAction.Ok(true, message);
}
else