增加前端国际化刷新查询接口
This commit is contained in:
@@ -38,7 +38,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public Guid? Id { get; set; }
|
||||
public int State { get; set; }
|
||||
public string Description { get; set; } = string.Empty;
|
||||
public string Code { get; set; }
|
||||
public string Code { get; set; } = string.Empty;
|
||||
public string Value { get; set; } = string.Empty;
|
||||
public string ValueCN { get; set; } = string.Empty;
|
||||
|
||||
@@ -46,6 +46,13 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
}
|
||||
|
||||
|
||||
public class InternationalizationSimpleDto
|
||||
{
|
||||
public string Code { get; set; } = string.Empty;
|
||||
public string Value { get; set; } = string.Empty;
|
||||
public string ValueCN { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ using IRaCIS.Core.Domain.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
/// <summary>
|
||||
@@ -24,22 +26,37 @@ namespace IRaCIS.Core.Application.Service
|
||||
_internationalizationRepository = internationalizationRepository;
|
||||
}
|
||||
|
||||
|
||||
[AllowAnonymous]
|
||||
|
||||
public async Task<List<InternationalizationSimpleDto>> GetFrontInternationalizationList()
|
||||
{
|
||||
|
||||
var list = await _internationalizationRepository.Where(t => t.InternationalizationType == 0).Select(t => new InternationalizationSimpleDto()
|
||||
{
|
||||
Code = t.Code,
|
||||
Value = t.Value,
|
||||
ValueCN = t.ValueCN
|
||||
}).ToListAsync();
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<InternationalizationView>> GetInternationalizationList(InternationalizationQuery inQuery)
|
||||
{
|
||||
|
||||
var internationalizationQueryable =_internationalizationRepository
|
||||
.WhereIf(inQuery.Description!=null,t=>t.Description.Contains(inQuery.Description))
|
||||
var internationalizationQueryable = _internationalizationRepository
|
||||
.WhereIf(inQuery.Description != null, t => t.Description.Contains(inQuery.Description))
|
||||
.WhereIf(inQuery.Code != null, t => t.Code.Contains(inQuery.Code))
|
||||
.WhereIf(inQuery.State != null, t => t.State==inQuery.State)
|
||||
.WhereIf(inQuery.InternationalizationType != null, t => t.InternationalizationType == inQuery.InternationalizationType)
|
||||
|
||||
.WhereIf(inQuery.State != null, t => t.State == inQuery.State)
|
||||
.WhereIf(inQuery.InternationalizationType != null, t => t.InternationalizationType == inQuery.InternationalizationType)
|
||||
.WhereIf(inQuery.Value != null, t => t.Value.Contains(inQuery.Value))
|
||||
.WhereIf(inQuery.ValueCN != null, t => t.ValueCN.Contains(inQuery.ValueCN))
|
||||
.ProjectTo<InternationalizationView>(_mapper.ConfigurationProvider);
|
||||
.WhereIf(inQuery.ValueCN != null, t => t.ValueCN.Contains(inQuery.ValueCN))
|
||||
.ProjectTo<InternationalizationView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var pageList = await internationalizationQueryable
|
||||
.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? "Id" : inQuery.SortField,
|
||||
.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(InternationalizationView.State) : inQuery.SortField,
|
||||
inQuery.Asc);
|
||||
|
||||
return pageList;
|
||||
@@ -56,7 +73,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
IsVerify = true
|
||||
};
|
||||
|
||||
var entity = await _internationalizationRepository.InsertOrUpdateAsync(addOrEditInternationalization, true,verifyExp1);
|
||||
var entity = await _internationalizationRepository.InsertOrUpdateAsync(addOrEditInternationalization, true, verifyExp1);
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user