├── .gitattributes
├── .gitignore
├── Common
├── Common.csproj
├── DeepCopyHelper.cs
└── Properties
│ └── AssemblyInfo.cs
├── FastSchool.BLL
├── AccountBLL.cs
├── BaseBLL.cs
├── CommodityBLL.cs
├── FastSchool.BLL.csproj
├── OrderBLL.cs
└── UserBLL.cs
├── FastSchool.Common
├── FastSchool.Common.csproj
├── MemoryCache.cs
└── RandomNumber.cs
├── FastSchool.Interface
├── FastSchool.Interface.csproj
├── IAccountBLL.cs
├── IBaseBLL.cs
├── ICache.cs
├── ICommodityBLL.cs
├── IOrderBLL.cs
└── IUserBLL.cs
├── FastSchool.Model
├── BaseModel.cs
├── Commodity.cs
├── Enum
│ ├── EnumExpressType.cs
│ └── EnumOrderState.cs
├── FastSchool.Model.csproj
├── FastSchoolDBContext.cs
├── Migrations
│ ├── 20181121020849_INIT.Designer.cs
│ ├── 20181121020849_INIT.cs
│ └── FastSchoolDBContextModelSnapshot.cs
├── Order.cs
└── User.cs
├── FastSchool.WebApi
├── Controllers
│ ├── AccountController.cs
│ ├── CommodityController.cs
│ ├── OrderController.cs
│ ├── TestController.cs
│ └── UserController.cs
├── FastSchool.WebApi.csproj
├── Filters
│ ├── ExceptionFilter.cs
│ └── ModelStateFilter.cs
├── Models
│ ├── ResultModel.cs
│ ├── ViewModelBase.cs
│ ├── ViewModelCommodity.cs
│ ├── ViewModelOrder.cs
│ ├── ViewModelOrderInfo.cs
│ └── ViewModelUser.cs
├── Program.cs
├── Properties
│ ├── PublishProfiles
│ │ └── FolderProfile.pubxml
│ └── launchSettings.json
├── Startup.cs
├── appsettings.Development.json
├── appsettings.json
└── nlog.config
├── FastSchool.sln
├── FastSchoolApp.Common
├── AccountHelper.cs
├── DeepCopyHelper.cs
├── FastSchoolApp.Common.csproj
├── HttpHelper.cs
└── JsonHelper.cs
├── FastSchoolApp.Model
├── AccountUserData.cs
├── BaseModel.cs
├── Commodity.cs
├── EnumOrderState.cs
├── ExpressTypeEnum.cs
├── FastSchoolApp.Model.csproj
├── ResultModel.cs
├── User.cs
├── UserOrder.cs
└── UserOrderInfo.cs
├── FastSchoolApp.Services
├── AccountService.cs
├── BaseServices.cs
├── FastSchoolApp.Services.csproj
├── HomeService.cs
└── UserService.cs
├── FastSchoolApp.ViewModel
├── AffirmOrderModel.cs
├── BaseModel.cs
├── Class1.cs
├── ExpressTypeEnum.cs
├── FastSchoolApp.ViewModel.csproj
├── NewInfoDetailedModel.cs
├── NewInfoModel.cs
├── OrderStatusEnum.cs
├── RegisterModel.cs
├── SecurityModel.cs
├── SendNewInfoModel.cs
├── UserDataModel.cs
└── UserOrderModel.cs
├── FastSchoolApp
├── FastSchoolApp.Android
│ ├── Assets
│ │ └── AboutAssets.txt
│ ├── FastSchoolApp.Android.csproj
│ ├── MainActivity.cs
│ ├── Properties
│ │ ├── AndroidManifest.xml
│ │ └── AssemblyInfo.cs
│ ├── Resources
│ │ ├── AboutResources.txt
│ │ ├── Resource.designer.cs
│ │ ├── drawable
│ │ │ ├── bg.jpg
│ │ │ ├── fasong.png
│ │ │ ├── faxian.png
│ │ │ ├── gerenzhongxin.png
│ │ │ ├── home.png
│ │ │ ├── icon_hulianwang.png
│ │ │ ├── kg.jpg
│ │ │ ├── logbg.jpg
│ │ │ ├── suotou.png
│ │ │ ├── xiaoyuhao.png
│ │ │ └── yonghu.png
│ │ ├── layout
│ │ │ ├── Tabbar.axml
│ │ │ └── Toolbar.axml
│ │ ├── mipmap-anydpi-v26
│ │ │ ├── icon.xml
│ │ │ └── icon_round.xml
│ │ ├── mipmap-hdpi
│ │ │ ├── Icon.png
│ │ │ └── launcher_foreground.png
│ │ ├── mipmap-mdpi
│ │ │ ├── icon.png
│ │ │ └── launcher_foreground.png
│ │ ├── mipmap-xhdpi
│ │ │ ├── Icon.png
│ │ │ └── launcher_foreground.png
│ │ ├── mipmap-xxhdpi
│ │ │ ├── Icon.png
│ │ │ └── launcher_foreground.png
│ │ ├── mipmap-xxxhdpi
│ │ │ ├── Icon.png
│ │ │ └── launcher_foreground.png
│ │ └── values
│ │ │ ├── colors.xml
│ │ │ └── styles.xml
│ └── SplashActivity.cs
├── FastSchoolApp.iOS
│ ├── AppDelegate.cs
│ ├── Entitlements.plist
│ ├── FastSchoolApp.iOS.csproj
│ ├── Info.plist
│ ├── Main.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── Resources
│ │ └── LaunchScreen.storyboard
└── FastSchoolApp
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── FastSchoolApp.csproj
│ ├── Files
│ └── UserData.json
│ ├── Home
│ ├── AffirmOrder.xaml
│ ├── AffirmOrder.xaml.cs
│ ├── HomeMasterDetailPage.xaml
│ ├── HomeMasterDetailPage.xaml.cs
│ ├── HomeMasterDetailPageMaster.xaml
│ ├── HomeMasterDetailPageMaster.xaml.cs
│ ├── HomeMasterDetailPageMenuItem.cs
│ ├── NewInfo.xaml
│ ├── NewInfo.xaml.cs
│ ├── NewInfoDetailed.xaml
│ ├── NewInfoDetailed.xaml.cs
│ ├── SendNewInfo.xaml
│ └── SendNewInfo.xaml.cs
│ ├── Login
│ ├── LoginPage.xaml
│ ├── LoginPage.xaml.cs
│ ├── Register.xaml
│ └── Register.xaml.cs
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── User
│ ├── OrderInfo.xaml
│ ├── OrderInfo.xaml.cs
│ ├── Security.xaml
│ ├── Security.xaml.cs
│ ├── UserData.xaml
│ ├── UserData.xaml.cs
│ ├── UserOrder.xaml
│ ├── UserOrder.xaml.cs
│ ├── UserTabbedPage.xaml
│ └── UserTabbedPage.xaml.cs
│ └── ViewModel
│ ├── AffirmOrderModel.cs
│ ├── BaseModel.cs
│ ├── NewInfoDetailedModel.cs
│ ├── NewInfoModel.cs
│ ├── OrderStatusEnum.cs
│ ├── RegisterModel.cs
│ ├── SecurityModel.cs
│ ├── SendNewInfoModel.cs
│ ├── UserDataModel.cs
│ ├── UserOrderInfoModel.cs
│ └── UserOrderModel.cs
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/Common/Common.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {856FC8F9-81D5-4C62-8E1D-56EDFC30DDA0}
8 | Library
9 | Properties
10 | Common
11 | Common
12 | v4.6.1
13 | 512
14 | true
15 | SAK
16 | SAK
17 | SAK
18 | SAK
19 |
20 |
21 | true
22 | full
23 | false
24 | bin\Debug\
25 | DEBUG;TRACE
26 | prompt
27 | 4
28 | 7.1
29 |
30 |
31 | pdbonly
32 | true
33 | bin\Release\
34 | TRACE
35 | prompt
36 | 4
37 | 7.1
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/Common/DeepCopyHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.Serialization.Formatters.Binary;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Xml.Serialization;
9 |
10 | namespace Common
11 | {
12 | ///
13 | /// 对象的深度拷贝(序列化的方式)
14 | ///
15 | public class DeepCopyHelper
16 | {
17 | ///
18 | /// xml序列化的方式实现深拷贝
19 | ///
20 | ///
21 | ///
22 | ///
23 | public static T XmlDeepCopy(T t)
24 | {
25 | //创建Xml序列化对象
26 | XmlSerializer xml = new XmlSerializer(typeof(T));
27 | using (MemoryStream ms = new MemoryStream())//创建内存流
28 | {
29 | //将对象序列化到内存中
30 | xml.Serialize(ms, t);
31 | ms.Position = default;//将内存流的位置设为0
32 | return (T)xml.Deserialize(ms);//继续反序列化
33 | }
34 | }
35 |
36 | ///
37 | /// 二进制序列化的方式进行深拷贝
38 | /// 确保需要拷贝的类里的所有成员已经标记为 [Serializable] 如果没有加该特性特报错
39 | ///
40 | ///
41 | ///
42 | ///
43 | public static T BinaryDeepCopy(T t)
44 | {
45 | //创建二进制序列化对象
46 | BinaryFormatter bf = new BinaryFormatter();
47 | using (MemoryStream ms = new MemoryStream())//创建内存流
48 | {
49 | //将对象序列化到内存中
50 | bf.Serialize(ms, t);
51 | ms.Position = default;//将内存流的位置设为0
52 | return (T)bf.Deserialize(ms);//继续反序列化
53 | }
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/Common/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的一般信息由以下
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Common")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Common")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
19 | //请将此类型的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("856fc8f9-81d5-4c62-8e1d-56edfc30dda0")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
33 | //通过使用 "*",如下所示:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/FastSchool.BLL/AccountBLL.cs:
--------------------------------------------------------------------------------
1 | using FastSchool.Interface;
2 | using Microsoft.EntityFrameworkCore;
3 | using System;
4 |
5 | namespace FastSchool.BLL
6 | {
7 | public class AccountBLL : BaseBLL, IAccountBLL
8 | {
9 | public AccountBLL(DbContext dbContext) : base(dbContext)
10 | {
11 |
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/FastSchool.BLL/CommodityBLL.cs:
--------------------------------------------------------------------------------
1 | using FastSchool.Interface;
2 | using FastSchool.Model;
3 | using Microsoft.EntityFrameworkCore;
4 | using Microsoft.EntityFrameworkCore.Query;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 |
10 | namespace FastSchool.BLL
11 | {
12 | public class CommodityBLL : BaseBLL, ICommodityBLL
13 | {
14 | public CommodityBLL(DbContext dbContext) : base(dbContext)
15 | {
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/FastSchool.BLL/FastSchool.BLL.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SAK
5 | SAK
6 | SAK
7 | SAK
8 |
9 |
10 |
11 | netcoreapp2.1
12 | 7.1
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/FastSchool.BLL/OrderBLL.cs:
--------------------------------------------------------------------------------
1 | using FastSchool.Interface;
2 | using FastSchool.Model;
3 | using Microsoft.EntityFrameworkCore;
4 | using Microsoft.EntityFrameworkCore.Query;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Linq.Expressions;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 |
12 | namespace FastSchool.BLL
13 | {
14 | public class OrderBLL : BaseBLL, IOrderBLL
15 | {
16 | public OrderBLL(DbContext dbContext) : base(dbContext)
17 | {
18 |
19 | }
20 |
21 | ///
22 | /// 创建订单
23 | ///
24 | ///
25 | ///
26 | ///
27 | public async Task CreateOrderAsync(Order order, Commodity commodity)
28 | {
29 | commodity.IsDelete = true;
30 | DbContext.Update(commodity);
31 | await DbContext.AddAsync(order);
32 | var result = await DbContext.SaveChangesAsync();
33 | return result > 0;
34 | }
35 |
36 | //public async Task GetOrderIncludeEntiyAsync(Expression> whereLanbda, Expression>[] expressions)
37 | //{
38 |
39 | // var result = DbContext.Set().AsNoTracking().IgnoreQueryFilters().Where(whereLanbda);
40 | // foreach (var item in expressions)
41 | // {
42 | // result = result.Include(item);
43 | // }
44 | // /*.Include(expression).ToList();*/
45 | // return await result.FirstOrDefaultAsync();
46 | // //await DbContext.Set().AsNoTracking().Where(whereLanbda).Include(expressions.FirstOrDefault()).IgnoreQueryFilters().FirstOrDefaultAsync();
47 | //}
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/FastSchool.BLL/UserBLL.cs:
--------------------------------------------------------------------------------
1 | using FastSchool.Interface;
2 | using FastSchool.Model;
3 | using Microsoft.EntityFrameworkCore;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace FastSchool.BLL
10 | {
11 | public class UserBLL : BaseBLL, IUserBLL
12 | {
13 | public UserBLL(DbContext dbContext) : base(dbContext)
14 | {
15 | }
16 |
17 | public async Task ContainsAsync(User user)
18 | {
19 | return await base.DbSet().ContainsAsync(user);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/FastSchool.Common/FastSchool.Common.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SAK
5 | SAK
6 | SAK
7 | SAK
8 |
9 |
10 |
11 | netcoreapp2.1
12 | 7.1
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/FastSchool.Common/MemoryCache.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FastSchool.Interface;
3 | using Microsoft.Extensions.Caching.Memory;
4 |
5 | namespace FastSchool.Common
6 | {
7 | public class MemoryCache : ICache
8 | {
9 | public IMemoryCache Cache { get; }
10 | public MemoryCache(IMemoryCache memoryCache)
11 | {
12 | Cache = memoryCache;
13 | }
14 |
15 | public void Set(object key, T Tvalue)
16 | {
17 | Cache.Set(key, Tvalue);
18 | }
19 |
20 | public T Get(object key)
21 | {
22 | var b = Cache.TryGetValue(key, out T value);
23 | return b ? value : default;
24 | }
25 |
26 | public void Remove(object key)
27 | {
28 | Cache.Remove(key);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/FastSchool.Common/RandomNumber.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace FastSchool.Common
6 | {
7 | public class RandomNumber
8 | {
9 | private static Random Random { get; }
10 | static RandomNumber()
11 | {
12 | Random = new Random(Guid.NewGuid().GetHashCode());
13 | }
14 |
15 | ///
16 | /// 随机数产生
17 | ///
18 | /// 最大传入11
19 | ///
20 | public static int GetRandomNumber(int forNumber = 1)
21 | {
22 | string result = default;
23 | if (forNumber > 11)
24 | return default;
25 |
26 | for (int i = 0; i < forNumber; i++)
27 | {
28 | result += Random.Next(0, 10);
29 | }
30 | return int.Parse(result);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/FastSchool.Interface/FastSchool.Interface.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SAK
5 | SAK
6 | SAK
7 | SAK
8 |
9 |
10 |
11 | netcoreapp2.1
12 | 7.1
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/FastSchool.Interface/IAccountBLL.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FastSchool.Interface
8 | {
9 | public interface IAccountBLL:IBaseBLL
10 | {
11 |
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/FastSchool.Interface/IBaseBLL.cs:
--------------------------------------------------------------------------------
1 | using FastSchool.Model;
2 | using Microsoft.EntityFrameworkCore;
3 | using Microsoft.EntityFrameworkCore.Query;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Linq.Expressions;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace FastSchool.Interface
12 | {
13 | public interface IBaseBLL
14 | {
15 | Task AddAsync(T t) where T : BaseModel;
16 | Task AddRangeAsync(IEnumerable