milimoe 2827c53d14
补全数据库表、查询常量类 (#118)
* 补充数据库表

* 更新sqlite

* 添加商店相关的数据库常量类

* add Update_UpdateRoomMaster

* 修改常量类

* 添加  NOTICE 文件

* 添加市场、报价、库存的数据库常量类

* 优化表结构和查询常量类

* 添加 UserCenter 和 Inventory 相关枚举;数据表和 Query 常量类修改

* 添加报价的核心操作

* 涉及库存的物品获取应该使用 Guid 而不是 ItemId

---------

Co-authored-by: yeziuku <yezi@wrss.org>
2025-04-04 23:39:49 +08:00

49 lines
2.4 KiB
C#

using Milimoe.FunGame.Core.Api.Transmittal;
namespace Milimoe.FunGame.Core.Library.SQLScript.Common
{
public class UserLogs : Constant
{
public const string TableName = "UserLogs";
public const string Column_Id = "Id";
public const string Column_UserId = "UserId";
public const string Column_Title = "Title";
public const string Column_Description = "Description";
public const string Column_Remark = "Remark";
public const string Column_CreateTime = "CreateTime";
public static string Insert_UserLog(SQLHelper SQLHelper, long UserId, string Title, string Description = "", string Remark = "")
{
SQLHelper.Parameters["@UserId"] = UserId;
SQLHelper.Parameters["@Title"] = Title;
SQLHelper.Parameters["@Description"] = Description;
SQLHelper.Parameters["@Remark"] = Remark;
SQLHelper.Parameters["@CreateTime"] = DateTime.Now;
return $"{Command_Insert} {Command_Into} {TableName} ({Column_UserId}, {Column_Title}, {Column_Description}, {Column_Remark}, {Column_CreateTime}) {Command_Values} (@UserId, @Title, @Description, @Remark, @CreateTime)";
}
public static string Select_GetUserLog(SQLHelper SQLHelper, long Id)
{
SQLHelper.Parameters["@Id"] = Id;
return $"{Command_Select} {Command_All} {Command_From} {TableName} {Command_Where} {Column_Id} = @Id";
}
public static string Select_GetUserLogsByUserId(SQLHelper SQLHelper, long UserId)
{
SQLHelper.Parameters["@UserId"] = UserId;
return $"{Command_Select} {Command_All} {Command_From} {TableName} {Command_Where} {Column_UserId} = @UserId";
}
public static string Update_UserLog(SQLHelper SQLHelper, long Id, long UserId, string Title, string Description, string Remark)
{
SQLHelper.Parameters["@Id"] = Id;
SQLHelper.Parameters["@UserId"] = UserId;
SQLHelper.Parameters["@Title"] = Title;
SQLHelper.Parameters["@Description"] = Description;
SQLHelper.Parameters["@Remark"] = Remark;
SQLHelper.Parameters["@CreateTime"] = DateTime.Now;
return $"{Command_Update} {TableName} {Command_Set} {Column_UserId} = @UserId, {Column_Title} = @Title, {Column_Description} = @Description, {Column_Remark} = @Remark, {Column_CreateTime} = @CreateTime {Command_Where} {Column_Id} = @Id";
}
}
}