Initial import from local backup (Documents-Playground/pakerpale)

This commit is contained in:
jeonghwa
2026-07-03 05:27:03 +09:00
commit 7543d94a37
38 changed files with 21641 additions and 0 deletions

17
Models/User.cs Normal file
View File

@@ -0,0 +1,17 @@
using Microsoft.EntityFrameworkCore;
namespace Auth.api.Models
{
public class User
{
public int userID { get; set; }
public string userName { get; set; }
public string name { get; set; }
public string email { get; set; }
public string password { get; set; }
}
}

79
Models/UserContext.cs Normal file
View File

@@ -0,0 +1,79 @@
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using Microsoft.Extensions.Logging;
namespace Auth.api.Models
{
public class UserContext
{
public string ConnectionString { get; set; }
public UserContext(string connectionString)
{
this.ConnectionString = connectionString;
}
// private MySqlConnection GetConnection()
// {
// return new MySqlConnection(ConnectionString);
// }
public List<User> GetAllUsers()
{
List<User> list = new List<User>();
// using (MySqlConnection conn = GetConnection())
// {
// conn.Open();
// MySqlCommand cmd = new MySqlCommand("select * from cm_user where 1 limit 10", conn);
// using (var reader = cmd.ExecuteReader())
// {
// while (reader.Read())
// {
// list.Add(new User()
// {
// userID = Convert.ToInt32(reader["userID"]),
// userName = reader["userName"].ToString(),
// name = reader["name"].ToString(),
// email = reader["email"].ToString(),
// password = reader["password"].ToString()
// });
// }
// }
// }
return list;
}
public List<User> GetUserByUserId()
{
List<User> list = new List<User>();
// using (MySqlConnection conn = GetConnection())
// {
// conn.Open();
// MySqlCommand cmd = new MySqlCommand("select * from cm_user where t 10", conn);
// using (var reader = cmd.ExecuteReader())
// {
// while (reader.Read())
// {
// list.Add(new User()
// {
// userID = Convert.ToInt32(reader["userID"]),
// userName = reader["userName"].ToString(),
// name = reader["name"].ToString(),
// email = reader["email"].ToString(),
// password = reader["password"].ToString()
// });
// }
// }
// }
return list;
}
}
}