You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
2.9 KiB
C#
101 lines
2.9 KiB
C#
using Myshipping.Core;
|
|
using Furion.DependencyInjection;
|
|
using Furion.DynamicApiController;
|
|
using Mapster;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using SqlSugar;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Myshipping.Application.Entity;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Furion;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Furion.DataEncryption;
|
|
using System.Collections.Generic;
|
|
using System.Security.Claims;
|
|
using Microsoft.AspNetCore.Authentication.Cookies;
|
|
using Microsoft.AspNetCore.Authentication;
|
|
using Microsoft.AspNetCore.Identity;
|
|
using Furion.FriendlyException;
|
|
using Furion.Logging;
|
|
using System;
|
|
using Microsoft.Extensions.Logging;
|
|
using System.Reflection;
|
|
using System.ComponentModel;
|
|
using Myshipping.Application.Service.BookingOrder.Dto;
|
|
using Myshipping.Application.ConfigOption;
|
|
using System.IO;
|
|
using Yitter.IdGenerator;
|
|
using Myshipping.Core.Entity;
|
|
using Furion.RemoteRequest.Extensions;
|
|
using System.Net.Http;
|
|
using Myshipping.Core.Service;
|
|
|
|
|
|
namespace Myshipping.Application
|
|
{
|
|
/// <summary>
|
|
/// 数据同步服务
|
|
/// </summary>
|
|
[ApiDescriptionSettings("Application", Name = "DataSync", Order = 1), AllowAnonymous]
|
|
public class DataSyncService : IDynamicApiController, ITransient
|
|
{
|
|
private readonly ILogger<BookingOrderService> _logger;
|
|
private readonly ISysCacheService _cache;
|
|
private readonly SqlSugarRepository<BookingOrder> _rep;
|
|
private readonly SqlSugarRepository<BookingCtn> _repCtn;
|
|
private readonly SqlSugarRepository<SysUser> _repUser;
|
|
private readonly SqlSugarRepository<SysTenant> _repTenant;
|
|
|
|
public DataSyncService(ILogger<BookingOrderService> logger, ISysCacheService cache, SqlSugarRepository<BookingOrder> rep, SqlSugarRepository<BookingCtn> repCtn,
|
|
SqlSugarRepository<SysUser> repUser, SqlSugarRepository<SysTenant> repTenant)
|
|
{
|
|
this._logger = logger;
|
|
this._rep = rep;
|
|
this._repCtn = repCtn;
|
|
this._cache = cache;
|
|
this._repUser = repUser;
|
|
this._repTenant = repTenant;
|
|
}
|
|
|
|
|
|
#region 上传数据
|
|
/// <summary>
|
|
/// 同步客户
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("/DataSync/SyncCustomer"), ApiUser]
|
|
public async Task<long> SyncCustomer(DjyCustomerSyncDto model)
|
|
{
|
|
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#region 下载数据
|
|
|
|
#endregion
|
|
|
|
#region 其他
|
|
[HttpGet("/DataSync/Test"), ApiUser]
|
|
public async Task<string> Test()
|
|
{
|
|
return $"当前用户:{UserManager.UserId} {UserManager.Name} ,当前租户:{UserManager.TENANT_ID} {UserManager.TENANT_NAME},管理员类型:{(UserManager.IsSuperAdmin ? "超级管理员" : (UserManager.IsTenantAdmin ? "租户管理员" : "普通用户"))}";
|
|
}
|
|
#endregion
|
|
}
|
|
}
|