You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
2.4 KiB
88 lines
2.4 KiB
4 years ago
|
using Microsoft.AspNetCore.Authorization;
|
||
|
using Microsoft.AspNetCore.Mvc;
|
||
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Threading.Tasks;
|
||
|
using Volo.Abp.Application.Dtos;
|
||
|
using Volo.Abp.Application.Services;
|
||
|
using Volo.Abp.Domain.Repositories;
|
||
|
using Win_in.Sfs.Scp.WebApi.ASNs;
|
||
|
|
||
|
namespace Win_in.Sfs.Scp.WebApi.Parts
|
||
|
{
|
||
|
/// <summary>
|
||
|
///零件服务
|
||
|
/// </summary>
|
||
|
[AllowAnonymous]
|
||
|
[Route("api/SCP/Part")]
|
||
|
[ApiExplorerSettings(GroupName = SwaggerGroupConsts.ScpWebApi)]
|
||
|
|
||
|
public class PartAppService : CrudAppService<Part, PartDTO, Guid,InputDTO, PartCreateDTO, PartUpdateDTO>, IPartAppService
|
||
|
{
|
||
|
private readonly IPartRepository _partRepository;
|
||
|
|
||
|
public PartAppService(IPartRepository repository) : base(repository)
|
||
|
{
|
||
|
_partRepository = repository;
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
///获取一条数据 (Get a piece of data)
|
||
|
/// </summary>
|
||
|
/// <param name="id"></param>
|
||
|
/// <returns></returns>
|
||
|
[HttpGet]
|
||
|
[Route("{id}")]
|
||
|
public override Task<PartDTO> GetAsync(Guid id)
|
||
|
{
|
||
|
return base.GetAsync(id);
|
||
|
}
|
||
|
|
||
|
|
||
|
/// <summary>
|
||
|
///获取数据列表 (Get data list)
|
||
|
/// </summary>
|
||
|
/// <param name="id"></param>
|
||
|
/// <returns></returns>
|
||
|
[HttpGet]
|
||
|
[Route("")]
|
||
|
public override Task<PagedResultDto<PartDTO>> GetListAsync(InputDTO input)
|
||
|
{
|
||
|
return base.GetListAsync(input);
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 新增实体 (Create New entity)
|
||
|
/// </summary>
|
||
|
/// <returns></returns>
|
||
|
[HttpPost]
|
||
|
[Route("")]
|
||
|
public override Task<PartDTO> CreateAsync(PartCreateDTO input)
|
||
|
{
|
||
|
return base.CreateAsync(input);
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 修改实体 (Modify entity)
|
||
|
/// </summary>
|
||
|
/// <returns></returns>
|
||
|
[HttpPut]
|
||
|
[Route("{id}")]
|
||
|
public override Task<PartDTO> UpdateAsync(Guid id, PartUpdateDTO input)
|
||
|
{
|
||
|
return base.UpdateAsync(id, input);
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 删除实体 (Delete entity)
|
||
|
/// </summary>
|
||
|
/// <param name="id">ID</param>
|
||
|
/// <returns>无</returns>
|
||
|
[HttpDelete]
|
||
|
[Route("{id}")]
|
||
|
public override Task DeleteAsync(Guid id)
|
||
|
{
|
||
|
return base.DeleteAsync(id);
|
||
|
}
|
||
|
}
|
||
|
}
|