[操作紀錄] 頁面建置 | API GetList 後端程序建置 | 分頁結構建置 | 存取 OperationLog 程序調整

This commit is contained in:
dev01 2023-05-30 18:29:51 +08:00
parent eb0f45ac83
commit ecda03cb98
5 changed files with 1545 additions and 1415 deletions

View File

@ -67,7 +67,6 @@ namespace FrontendWebApi.ApiControllers
}
}
apiResult.Code = "0000";
apiResult.Data = lightDevices;
}
@ -88,7 +87,7 @@ namespace FrontendWebApi.ApiControllers
try
{
// Operation_log 輸入參數
OperationInput opeInput = new OperationInput() { operation_type = 2 };
OperationLog opeInput = new OperationLog() { operation_type = 2 };
// 取得對應樓層資料
var targetFloor = await backendRepository.GetOneAsync<Floor>($@"
@ -138,8 +137,8 @@ namespace FrontendWebApi.ApiControllers
ScheduleDevices.Add(ScheduleDevice);
}
opeInput.parameter = JsonConvert.SerializeObject(saveSchedule);
await backendRepository.AddMutiByCustomTable(ScheduleDevices, "schedule_device");
saveSchedule.light_schedule_guid = newguid.ToString();
await InsertOperation(opeInput);
}
else
@ -364,7 +363,7 @@ namespace FrontendWebApi.ApiControllers
return Ok(apiResult);
}
public async Task<bool> InsertOperation(OperationInput input)
public async Task<bool> InsertOperation(OperationLog input)
{
try
{
@ -379,7 +378,7 @@ namespace FrontendWebApi.ApiControllers
{ "@floor_tag", input.floor_tag },
{ "@device_guid", input.device_guid },
{ "@action_name", input.action_name },
{ "@parameter", JsonConvert.SerializeObject(input.parameter) },
{ "@parameter", input.parameter },
};
await backendRepository.AddOneByCustomTable(userOperatorLog, "operation_log");

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -139,7 +139,7 @@ namespace FrontendWebApi.Models
public DateTime? enddate { get; set; }
}
public class OperationInput
public class OperationLog
{
public int id { get; set; }
public string user_guid { get; set;}
@ -156,5 +156,17 @@ namespace FrontendWebApi.Models
}
public class OperationLogOutput : OperationLog {
public string user_name { get; set; }
public string content { get; set; }
}
public class OperationLogInput {
public string start_time { get; set; }
public string end_time { get; set; }
public string building_tag{ get; set; }
public short operation_type { get; set; }
}
}

View File

@ -283,4 +283,16 @@ namespace FrontendWebApi.Models
}
}
}
public class BasePageResult {
public int? pageSize { get; set; } = 10;
public int? totalPage { get; set; } = 0;
public int? currentPage { get; set; } = 0;
}
public class PageResult<T> : BasePageResult
{
public T data { get; set; }
}
}