mirror of
http://git.xinwangdao.com/cnnc-embedded-parts-detect/detect.git
synced 2025-06-24 21:44:12 +08:00
37 lines
1.5 KiB
C#
37 lines
1.5 KiB
C#
using detect.gui.Models.Entities;
|
|
using detect.gui.Services.Detect;
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Routing;
|
|
using Splat;
|
|
|
|
namespace detect.gui.Api.System;
|
|
|
|
public class DetectTaskApi
|
|
{
|
|
public DetectTaskApi(IEndpointRouteBuilder? webApp)
|
|
{
|
|
// // all
|
|
// webApp?.MapGet("/v1/system/device/all", () => Locator.Current.GetService<VapDeviceService>()!.ListAll());
|
|
//
|
|
// // search
|
|
// webApp?.MapGet("/v1/system/device/search", ([FromQuery] int? regionId, [FromQuery] string? name, [FromQuery] string? ip, [FromQuery]int pageNum = 1, [FromQuery]int pageSize = 10) =>
|
|
// Locator.Current.GetService<VapDeviceService>()!.Search(regionId, name, ip, pageNum, pageSize));
|
|
//
|
|
// // id
|
|
// webApp?.MapGet("/v1/system/device/{id:long}", ([FromRoute] long id) =>
|
|
// Locator.Current.GetService<VapDeviceService>()!.ListById(id));
|
|
//
|
|
// // add
|
|
// webApp?.MapPost("/v1/system/device/", ([FromBody] DeviceEntity entity) =>
|
|
// Locator.Current.GetService<VapDeviceService>()!.AddData(entity));
|
|
//
|
|
// // update
|
|
// webApp?.MapPut("/v1/system/device/", ([FromBody] DeviceEntity entity) =>
|
|
// Locator.Current.GetService<VapDeviceService>()!.UpdateData(entity));
|
|
//
|
|
// // delete
|
|
// webApp?.MapDelete("/v1/system/device/{id:long}", ([FromRoute] long id) =>
|
|
// Locator.Current.GetService<VapDeviceService>()!.DeleteById(id));
|
|
}
|
|
} |