新增找尋進出校園的位置
This commit is contained in:
parent
cd0b1ed9fa
commit
1563577166
@ -218,6 +218,27 @@ namespace WebApi_data_value.Controllers
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region 尋找所有進出校園的地點
|
||||||
|
///<summary>
|
||||||
|
///尋找所有進出校園的地點
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("location_name")]
|
||||||
|
public async Task<IEnumerable<object>> Get_in_Yuntech_location_name()
|
||||||
|
{
|
||||||
|
var location_name_table = await _context.yuntech_in_car_table
|
||||||
|
.GroupBy(c=>c.location)
|
||||||
|
.Select(group => new
|
||||||
|
{
|
||||||
|
location_name = group.Key,
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
return location_name_table;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region 新增資料
|
#region 新增資料
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -17,8 +17,8 @@ builder.Services.AddCors();
|
|||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
|
|
||||||
// 連線PostgreSQL資料庫
|
// 連線PostgreSQL資料庫
|
||||||
//var connectionString = "Server=140.125.20.183;UserID=postgres;password=EL404el404;Database=postgres;port=5432;Search Path=public;CommandTimeout=1800";
|
var connectionString = "Server=140.125.20.183;UserID=postgres;password=EL404el404;Database=postgres;port=5432;Search Path=public;CommandTimeout=1800";
|
||||||
var connectionString = "Server=127.0.0.1;UserID=postgres;password=EL404el404;Database=postgres;port=5432;Search Path=public;CommandTimeout=1800";
|
//var connectionString = "Server=127.0.0.1;UserID=postgres;password=EL404el404;Database=postgres;port=5432;Search Path=public;CommandTimeout=1800";
|
||||||
builder.Services.AddDbContext<SqlContext>(opt => opt.UseNpgsql(connectionString));
|
builder.Services.AddDbContext<SqlContext>(opt => opt.UseNpgsql(connectionString));
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user