From d2641d40fa4a87b508c0a33ed5bb8ee2195a4f5c Mon Sep 17 00:00:00 2001 From: yubaolee <01211987> Date: Sat, 23 May 2015 12:10:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=A8=8B=E5=BA=8F=E6=A1=86?= =?UTF-8?q?=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OpenAuth.App/DTO/LoginResponse.cs | 2 - OpenAuth.App/MenuApp.cs | 7 +- OpenAuth.App/OpenAuth.App.csproj | 4 + OpenAuth.Domain/Model/Button.cs | 12 +- OpenAuth.Domain/Model/DataPermission.cs | 9 +- OpenAuth.Domain/Model/Department.cs | 8 +- OpenAuth.Domain/Model/Menu.cs | 11 +- OpenAuth.Domain/Model/Role.cs | 11 +- OpenAuth.Domain/Model/RoleMenuButton.cs | 13 - OpenAuth.Domain/Model/User.cs | 2 +- OpenAuth.Domain/ModelBehavior/User.cs | 24 + OpenAuth.Domain/OpenAuth.Domain.csproj | 3 +- OpenAuth.Domain/Service/MenuService.cs | 24 +- OpenAuth.Infrastructure/ListExtention.cs | 27 ++ .../Mapping/RoleMenuButtonMap.cs | 51 --- .../OpenAuth.Infrastructure.csproj | 39 +- .../Repository/BaseRepository.cs | 12 - .../App.config | 2 +- .../DB.config | 0 .../Mapping/ButtonMap.cs | 9 +- .../Mapping/DataPermissionMap.cs | 3 +- .../Mapping/DepartmentMap.cs | 9 +- .../Mapping/MenuMap.cs | 8 +- .../Mapping/RoleMap.cs | 8 +- .../Mapping/UserMap.cs | 2 +- .../OpenAuth.Repository.csproj | 81 ++++ .../OpenAuthDBContext.cs | 7 +- .../Properties/AssemblyInfo.cs | 36 ++ .../Repository/BaseRepository.cs | 7 + .../Repository/UserRepository.cs | 4 +- .../packages.config | 0 OpenAuth.UnitTest/DbContextTest.cs | 3 +- OpenAuth.UnitTest/DepartmentTest.cs | 3 +- OpenAuth.UnitTest/LoginTest.cs | 2 +- OpenAuth.UnitTest/OpenAuth.UnitTest.csproj | 4 + OpenAuth.UnitTest/Properties/AssemblyInfo.cs | 1 - OpenAuth.Web/Controllers/AccountController.cs | 8 +- OpenAuth.Web/Controllers/ButtonController.cs | 20 + OpenAuth.Web/Controllers/MenuController.cs | 13 +- OpenAuth.Web/OpenAuth.Web.csproj | 6 + OpenAuth.Web/Views/Button/List.cshtml | 127 ++++++ OpenAuth.Web/Views/Home/Index.cshtml | 422 +----------------- OpenAuth.Web/Views/Menu/LeftMenu.cshtml | 14 +- OpenAuth.sln | 11 +- 44 files changed, 434 insertions(+), 635 deletions(-) delete mode 100644 OpenAuth.Domain/Model/RoleMenuButton.cs create mode 100644 OpenAuth.Domain/ModelBehavior/User.cs create mode 100644 OpenAuth.Infrastructure/ListExtention.cs delete mode 100644 OpenAuth.Infrastructure/Mapping/RoleMenuButtonMap.cs delete mode 100644 OpenAuth.Infrastructure/Repository/BaseRepository.cs rename {OpenAuth.Infrastructure => OpenAuth.Repository}/App.config (87%) rename {OpenAuth.Infrastructure => OpenAuth.Repository}/DB.config (100%) rename {OpenAuth.Infrastructure => OpenAuth.Repository}/Mapping/ButtonMap.cs (86%) rename {OpenAuth.Infrastructure => OpenAuth.Repository}/Mapping/DataPermissionMap.cs (94%) rename {OpenAuth.Infrastructure => OpenAuth.Repository}/Mapping/DepartmentMap.cs (86%) rename {OpenAuth.Infrastructure => OpenAuth.Repository}/Mapping/MenuMap.cs (92%) rename {OpenAuth.Infrastructure => OpenAuth.Repository}/Mapping/RoleMap.cs (91%) rename {OpenAuth.Infrastructure => OpenAuth.Repository}/Mapping/UserMap.cs (97%) create mode 100644 OpenAuth.Repository/OpenAuth.Repository.csproj rename {OpenAuth.Infrastructure => OpenAuth.Repository}/OpenAuthDBContext.cs (82%) create mode 100644 OpenAuth.Repository/Properties/AssemblyInfo.cs create mode 100644 OpenAuth.Repository/Repository/BaseRepository.cs rename {OpenAuth.Infrastructure => OpenAuth.Repository}/Repository/UserRepository.cs (87%) rename {OpenAuth.Infrastructure => OpenAuth.Repository}/packages.config (100%) create mode 100644 OpenAuth.Web/Controllers/ButtonController.cs create mode 100644 OpenAuth.Web/Views/Button/List.cshtml diff --git a/OpenAuth.App/DTO/LoginResponse.cs b/OpenAuth.App/DTO/LoginResponse.cs index 835f425f..dfff341a 100644 --- a/OpenAuth.App/DTO/LoginResponse.cs +++ b/OpenAuth.App/DTO/LoginResponse.cs @@ -9,7 +9,5 @@ namespace OpenAuth.App.DTO { public string UserId { get; set; } public string UserName { get; set; } - - public IList UserRoleNames { get; set; } } } diff --git a/OpenAuth.App/MenuApp.cs b/OpenAuth.App/MenuApp.cs index 24b2c429..f012a0fc 100644 --- a/OpenAuth.App/MenuApp.cs +++ b/OpenAuth.App/MenuApp.cs @@ -26,12 +26,13 @@ namespace OpenAuth.App { _menuService = service; } - public MenuForUserResponse LoadFor(MenuForUserRequest request) + public MenuForUserResponse LoadMenus() { var response = new MenuForUserResponse(); - foreach (var menu in _menuService.GetMenuFor(request.UserId)) + var user = LoginCacheApp.GetLogin(); + if (user != null) { - response.Menus.Add(menu); + // response.Menus = } return response; } diff --git a/OpenAuth.App/OpenAuth.App.csproj b/OpenAuth.App/OpenAuth.App.csproj index 5d2c3652..05dc54e7 100644 --- a/OpenAuth.App/OpenAuth.App.csproj +++ b/OpenAuth.App/OpenAuth.App.csproj @@ -55,6 +55,10 @@ {6108da8e-92a1-4abe-b9f5-26d64d55ca2c} OpenAuth.Domain + + {adae08c0-de22-41f7-9f94-0e62ae327c25} + OpenAuth.Infrastructure +
- + diff --git a/OpenAuth.Infrastructure/DB.config b/OpenAuth.Repository/DB.config similarity index 100% rename from OpenAuth.Infrastructure/DB.config rename to OpenAuth.Repository/DB.config diff --git a/OpenAuth.Infrastructure/Mapping/ButtonMap.cs b/OpenAuth.Repository/Mapping/ButtonMap.cs similarity index 86% rename from OpenAuth.Infrastructure/Mapping/ButtonMap.cs rename to OpenAuth.Repository/Mapping/ButtonMap.cs index 64eea53c..8a753190 100644 --- a/OpenAuth.Infrastructure/Mapping/ButtonMap.cs +++ b/OpenAuth.Repository/Mapping/ButtonMap.cs @@ -1,18 +1,17 @@ using System.Data.Entity.ModelConfiguration; -using OpenAuth.Domain; using OpenAuth.Domain.Model; -namespace OpenAuth.Infrastructure.Mapping +namespace OpenAuth.Repository.Mapping { public class ButtonMap : EntityTypeConfiguration - Welcome to Ace (v1), - the lightweight, feature-rich, easy to use and well-documented admin template. - +
-
-
-
-

RECENT

-
- -
-
-
-
-
-
-

Sortable Lists

-
    -
  • - -
    - 42% -
    -
  • -
  • - -
    -
    - - - -
    -
    -
  • -
  • - -
    - - -
    -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
-
- - - -
-
-
-
- Bob's avatar -
- -
- -
20 min
-
- pending -
- - -
-
-
-
- -
-
- Joe's Avatar -
- -
- -
1 hour
-
- pending -
- - -
-
-
-
- -
-
- Jim's Avatar -
- -
- -
2 hour
-
- pending -
- - -
-
-
-
-
-
- Alex's Avatar -
- -
- -
3 hour
-
blocked
-
-
-
-
- Bob's Avatar -
- -
- -
6 hour
-
approved
-
-
- -
-
- Susan's Avatar -
- -
- -
yesterday
-
approved
-
-
- -
-
- Phil's Avatar -
- -
- -
2 days ago
-
online
-
-
- -
-
- Alexa's Avatar -
- -
- -
3 days ago
-
approved
-
-
-
- -
-
- - - -
-
-
-
- Bob's Avatar -
- -
- -
6 min
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque commodo massa sed ipsum porttitor facilisis … -
-
- -
-
- - -
-
-
- - -
-
- Jennifer's Avatar -
- -
- -
15 min
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque commodo massa sed ipsum porttitor facilisis … -
-
- -
- - -
-
- - -
-
- Joe's Avatar -
- -
- -
22 min
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque commodo massa sed ipsum porttitor facilisis … -
-
- -
- - -
-
- - -
-
- Rita's Avatar -
- -
- -
50 min
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque commodo massa sed ipsum porttitor facilisis … -
-
- -
- - -
-
- -
- -
- -
- -
-
-
-
- - -
-
- -
-
- -
-

Conversation

-
- -
-
- -
-
-
- Alexa's Avatar -
- -
-
4 sec
- -
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque commodo massa sed ipsum porttitor facilisis.
- -
- -
-
-
- - -
-
- John's Avatar -
- -
-
38 sec
- -
Raw denim you probably haven't heard of them jean shorts Austin.
- -
- -
-
-
- - -
-
- Bob's avatar -
- -
-
2 min
-
Bob admin
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque commodo massa sed ipsum porttitor facilisis.
- -
- -
-
-
- - -
-
- Jim's Avatar -
- -
-
3 min
- -
Raw denim you probably haven't heard of them jean shorts Austin.
- -
- -
-
-
- - -
-
- Alexa's Avatar -
- -
-
4 min
- -
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- -
- -
-
-
-
- -
-
- - -
-
- -
-
- -
-
diff --git a/OpenAuth.Web/Views/Menu/LeftMenu.cshtml b/OpenAuth.Web/Views/Menu/LeftMenu.cshtml index fb967936..f55e7bbc 100644 --- a/OpenAuth.Web/Views/Menu/LeftMenu.cshtml +++ b/OpenAuth.Web/Views/Menu/LeftMenu.cshtml @@ -34,8 +34,8 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/OpenAuth.sln b/OpenAuth.sln index 7da517c1..f218efa6 100644 --- a/OpenAuth.sln +++ b/OpenAuth.sln @@ -11,7 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3 Domain(领域层)", "3 Do EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "4 Infrastructure(基础设施层)", "4 Infrastructure(基础设施层)", "{EE008F5F-FD7F-407F-B201-6486BDE6B9F1}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "5 Test(测试)", "5 Test(测试)", "{C59DF46D-7815-462B-9FFF-750B2120B75B}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "6 Test(测试)", "6 Test(测试)", "{C59DF46D-7815-462B-9FFF-750B2120B75B}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenAuth.Web", "OpenAuth.Web\OpenAuth.Web.csproj", "{814246F3-BC71-43CC-8CD4-2A107F2B3B52}" EndProject @@ -23,6 +23,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenAuth.Infrastructure", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenAuth.UnitTest", "OpenAuth.UnitTest\OpenAuth.UnitTest.csproj", "{2E6B5B73-7757-43F0-8AC8-3030F7C191B8}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "5 Repository", "5 Repository", "{7A38939E-FC9B-44A9-BD3D-E0CE438624E6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenAuth.Repository", "OpenAuth.Repository\OpenAuth.Repository.csproj", "{E8DF8DEA-E2CF-4BDB-8F4F-3F8205B0E03A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -49,6 +53,10 @@ Global {2E6B5B73-7757-43F0-8AC8-3030F7C191B8}.Debug|Any CPU.Build.0 = Debug|Any CPU {2E6B5B73-7757-43F0-8AC8-3030F7C191B8}.Release|Any CPU.ActiveCfg = Release|Any CPU {2E6B5B73-7757-43F0-8AC8-3030F7C191B8}.Release|Any CPU.Build.0 = Release|Any CPU + {E8DF8DEA-E2CF-4BDB-8F4F-3F8205B0E03A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E8DF8DEA-E2CF-4BDB-8F4F-3F8205B0E03A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E8DF8DEA-E2CF-4BDB-8F4F-3F8205B0E03A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E8DF8DEA-E2CF-4BDB-8F4F-3F8205B0E03A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -59,6 +67,7 @@ Global {6108DA8E-92A1-4ABE-B9F5-26D64D55CA2C} = {7618C0B1-D556-40C2-B2DD-CCECDC4E46B6} {ADAE08C0-DE22-41F7-9F94-0E62AE327C25} = {EE008F5F-FD7F-407F-B201-6486BDE6B9F1} {2E6B5B73-7757-43F0-8AC8-3030F7C191B8} = {C59DF46D-7815-462B-9FFF-750B2120B75B} + {E8DF8DEA-E2CF-4BDB-8F4F-3F8205B0E03A} = {7A38939E-FC9B-44A9-BD3D-E0CE438624E6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.2\lib\NET35