liaoxujun@qq.com
2024-02-28 d48b578bd39bf5155c450b192554bb6a62ddfb93
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/***********************************************************************
 *            Project: CoreCms
 *        ProjectName: 核心内容管理系统                                
 *                Web: https://www.corecms.net                      
 *             Author: 大灰灰                                          
 *              Email: jianweie@163.com                                
 *         CreateTime: 2021/1/31 21:45:10
 *        Description: 暂无
 ***********************************************************************/
 
using System.Collections.Generic;
using System.Threading.Tasks;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.DTO;
using CoreCms.Net.Model.ViewModels.UI;
 
namespace CoreCms.Net.IServices
{
    /// <summary>
    ///     地区表 服务工厂接口
    /// </summary>
    public interface ICoreCmsAreaServices : IBaseServices<CoreCmsArea>
    {
        /// <summary>
        ///     获取所有省市区信息
        /// </summary>
        /// <returns></returns>
        Task<List<AreaTreeDto>> GetTreeArea(List<PostAreasTreeNode> checkedAreases, int parentId = 0,
            int currentChecked = 0);
 
 
        /// <summary>
        ///     组装地区数据
        /// </summary>
        List<AreaTreeDto> resolve2(List<CoreCmsArea> allDatas, int parentId, List<PostAreasTreeNode> checkedAreases,
            int currentChecked = 0);
 
 
        /// <summary>
        ///     获取最终地区ID
        /// </summary>
        /// <param name="provinceName">省</param>
        /// <param name="cityName">市</param>
        /// <param name="countyName">县</param>
        /// <param name="postalCode">邮编</param>
        /// <returns></returns>
        Task<int> GetThreeAreaId(string provinceName, string cityName, string countyName, string postalCode);
 
        /// <summary>
        ///     根据areaId获取三级区域名称
        /// </summary>
        /// <param name="areaId"></param>
        /// <param name="cacheAreas"></param>
        /// <returns></returns>
        Task<WebApiCallBack> GetAreaFullName(int areaId, List<CoreCmsArea> cacheAreas = null);
 
        /// <summary>
        ///     根据id来返回省市区信息,如果没有查到,就返回省的列表
        /// </summary>
        List<CoreCmsArea> GetArea(List<CoreCmsArea> cacheAreas, int id = 0);
 
 
        /// <summary>
        ///     获取最终地区ID
        /// </summary>
        /// <param name="provinceName">省</param>
        /// <param name="cityName">市</param>
        /// <param name="countyName">县</param>
        /// <param name="postalCode">邮编</param>
        /// <returns></returns>
        Task<WebApiCallBack> GetAreaId(string provinceName, string cityName, string countyName, string postalCode);
 
        #region 重写增删改查操作===========================================================
 
        /// <summary>
        ///     重写异步插入方法
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<AdminUiCallBack> InsertAsync(CoreCmsArea entity);
 
        /// <summary>
        ///     重写异步更新方法
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<AdminUiCallBack> UpdateAsync(CoreCmsArea entity);
 
        /// <summary>
        ///     重写删除指定ID的数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<AdminUiCallBack> DeleteByIdAsync(object id);
 
        #endregion
 
        /// <summary>
        ///     获取缓存的所有数据
        /// </summary>
        /// <returns></returns>
        Task<List<CoreCmsArea>> GetCaChe();
    }
}