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.
89 lines
2.6 KiB
89 lines
2.6 KiB
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,RequestDTO, PartCreateDTO, PartUpdateDTO>, IPartAppService
|
|
{
|
|
private readonly IPartRepository _partRepository;
|
|
|
|
public PartAppService(IPartRepository repository) : base(repository)
|
|
{
|
|
_partRepository = repository;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 按ID获取零件 (Get part by ID)
|
|
/// </summary>
|
|
/// <param name="id">唯一ID(unique ID)</param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[Route("{id}")]
|
|
public override Task<PartDTO> GetAsync(Guid id)
|
|
{
|
|
return base.GetAsync(id);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 按条件获取零件列表 (Get part list by request condition)
|
|
/// </summary>
|
|
/// <param name="requestDTO">请求条件DTO(Request condition DTO)</param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[Route("")]
|
|
public override Task<PagedResultDto<PartDTO>> GetListAsync(RequestDTO requestDTO)
|
|
{
|
|
return base.GetListAsync(requestDTO);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 新增零件(Create New part)
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("")]
|
|
public override Task<PartDTO> CreateAsync(PartCreateDTO partCreateDTO)
|
|
{
|
|
return base.CreateAsync(partCreateDTO);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 按ID修改零件 (Modify part by ID)
|
|
/// </summary>
|
|
/// <param name="id">唯一ID(unique ID)</param>
|
|
/// <returns></returns>
|
|
[HttpPut]
|
|
[Route("{id}")]
|
|
public override Task<PartDTO> UpdateAsync(Guid id, PartUpdateDTO partUpdateDTO)
|
|
{
|
|
return base.UpdateAsync(id, partUpdateDTO);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 按ID删除实体 (Delete part by ID)
|
|
/// </summary>
|
|
/// <param name="id">唯一ID(unique ID)</param>
|
|
/// <returns>无</returns>
|
|
[HttpDelete]
|
|
[Route("{id}")]
|
|
public override Task DeleteAsync(Guid id)
|
|
{
|
|
return base.DeleteAsync(id);
|
|
}
|
|
}
|
|
}
|