Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
Education
Commits
218d6e2d
Commit
218d6e2d
authored
Apr 07, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增实体类
parent
f1863477
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
937 additions
and
1 deletion
+937
-1
NavTypeEnum.cs
Edu.Common/Enum/Web/NavTypeEnum.cs
+52
-0
RB_Web_Menu.cs
Edu.Model/Entity/Web/RB_Web_Menu.cs
+81
-0
RB_Web_Nav.cs
Edu.Model/Entity/Web/RB_Web_Nav.cs
+72
-0
RB_Web_Menu_ViewModel.cs
Edu.Model/ViewModel/Web/RB_Web_Menu_ViewModel.cs
+14
-0
RB_Web_Nav_ViewModel.cs
Edu.Model/ViewModel/Web/RB_Web_Nav_ViewModel.cs
+18
-0
Edu.Module.Web.csproj
Edu.Module.Web/Edu.Module.Web.csproj
+14
-0
WebMenuModule.cs
Edu.Module.Web/WebMenuModule.cs
+100
-0
WebNavModule.cs
Edu.Module.Web/WebNavModule.cs
+98
-0
RB_Web_MenuRepository.cs
Edu.Repository/Web/RB_Web_MenuRepository.cs
+93
-0
RB_Web_NavRepository.cs
Edu.Repository/Web/RB_Web_NavRepository.cs
+111
-0
WebController.cs
Edu.WebApi/Controllers/Web/WebController.cs
+50
-0
WebManagerController.cs
Edu.WebApi/Controllers/Web/WebManagerController.cs
+225
-0
Edu.WebApi.csproj
Edu.WebApi/Edu.WebApi.csproj
+1
-0
education.sln
education.sln
+8
-1
No files found.
Edu.Common/Enum/Web/NavTypeEnum.cs
0 → 100644
View file @
218d6e2d
using
Edu.Common.Plugin
;
namespace
Edu.Common.Enum.Web
{
/// <summary>
/// 导航类型枚举
/// </summary>
public
enum
NavTypeEnum
{
/// <summary>
/// 首页
/// </summary>
[
EnumField
(
"首页"
)]
Home
=
1
,
/// <summary>
/// 日语培训
/// </summary>
[
EnumField
(
"日语培训"
)]
JapaneseTraining
=
2
,
/// <summary>
/// 留学服务
/// </summary>
[
EnumField
(
"留学服务"
)]
StudyAbroadService
=
3
,
/// <summary>
/// 就业服务
/// </summary>
[
EnumField
(
"就业服务"
)]
EmploymentServices
=
4
,
/// <summary>
/// 媒体中心
/// </summary>
[
EnumField
(
"媒体中心"
)]
MediaCenter
=
5
,
/// <summary>
/// 关于我们
/// </summary>
[
EnumField
(
"关于我们"
)]
AboutUs
=
6
,
/// <summary>
/// 加入我们
/// </summary>
[
EnumField
(
"加入我们"
)]
JoinUs
=
7
,
}
}
Edu.Model/Entity/Web/RB_Web_Menu.cs
0 → 100644
View file @
218d6e2d
using
Edu.Common.Enum
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.Web
{
/// <summary>
/// 网站菜单管理实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Web_Menu
{
/// <summary>
/// 菜单编号
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 菜单名称
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
/// 菜单地址
/// </summary>
public
string
MenuUrl
{
get
;
set
;
}
/// <summary>
/// 父节点编号
/// </summary>
public
int
ParentId
{
get
;
set
;
}
/// <summary>
/// 菜单等级
/// </summary>
public
int
MenuLevel
{
get
;
set
;
}
/// <summary>
/// 样式名称
/// </summary>
public
string
ClassName
{
get
;
set
;
}
/// <summary>
/// 图标地址
/// </summary>
public
string
Icon
{
get
;
set
;
}
/// <summary>
/// 排序
/// </summary>
public
int
SortNum
{
get
;
set
;
}
/// <summary>
/// 删除状态
/// </summary>
public
DateStateEnum
Status
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
DateTime
CreateDate
{
get
;
set
;
}
/// <summary>
/// 创建人编号
/// </summary>
public
int
CreateBy
{
get
;
set
;
}
/// <summary>
/// 集团编号
/// </summary>
public
int
Group_Id
{
get
;
set
;
}
/// <summary>
/// 学校编号
/// </summary>
public
int
School_Id
{
get
;
set
;
}
}
}
Edu.Model/Entity/Web/RB_Web_Nav.cs
0 → 100644
View file @
218d6e2d
using
Edu.Common.Enum
;
using
Edu.Common.Enum.Web
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.Web
{
/// <summary>
/// 网站导航管理实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Web_Nav
{
/// <summary>
/// 主键编号
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 导航大标题
/// </summary>
public
string
NavTitle
{
get
;
set
;
}
/// <summary>
/// 导航子标题
/// </summary>
public
string
SubTitle
{
get
;
set
;
}
/// <summary>
/// 导航背景图片
/// </summary>
public
string
BgImg
{
get
;
set
;
}
/// <summary>
/// 导航地址
/// </summary>
public
string
LinkUrl
{
get
;
set
;
}
/// <summary>
/// 导航类型
/// </summary>
public
NavTypeEnum
NavType
{
get
;
set
;
}
/// <summary>
/// 删除状态
/// </summary>
public
DateStateEnum
Status
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
DateTime
CreateDate
{
get
;
set
;
}
/// <summary>
/// 创建人编号
/// </summary>
public
int
CreateBy
{
get
;
set
;
}
/// <summary>
/// 集团编号
/// </summary>
public
int
Group_Id
{
get
;
set
;
}
/// <summary>
/// 学校编号
/// </summary>
public
int
School_Id
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Web/RB_Web_Menu_ViewModel.cs
0 → 100644
View file @
218d6e2d
using
Edu.Model.Entity.Web
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.Web
{
/// <summary>
/// 网站菜单管理视图实体类
/// </summary>
public
class
RB_Web_Menu_ViewModel
:
RB_Web_Menu
{
}
}
Edu.Model/ViewModel/Web/RB_Web_Nav_ViewModel.cs
0 → 100644
View file @
218d6e2d
using
Edu.Model.Entity.Web
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.Web
{
/// <summary>
/// 网站导航管理试图实体类
/// </summary>
public
class
RB_Web_Nav_ViewModel
:
RB_Web_Nav
{
/// <summary>
/// 网站导航名称
/// </summary>
public
string
NavTypeName
{
get
{
return
Common
.
Plugin
.
EnumHelper
.
ToName
(
this
.
NavType
);
}
}
}
}
\ No newline at end of file
Edu.Module.Web/Edu.Module.Web.csproj
0 → 100644
View file @
218d6e2d
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Edu.Aop\Edu.Aop.csproj" />
<ProjectReference Include="..\Edu.Common\Edu.Common.csproj" />
<ProjectReference Include="..\Edu.Model\Edu.Model.csproj" />
<ProjectReference Include="..\Edu.Repository\Edu.Repository.csproj" />
</ItemGroup>
</Project>
Edu.Module.Web/WebMenuModule.cs
0 → 100644
View file @
218d6e2d
using
Edu.Model.ViewModel.Web
;
using
Edu.Repository.Web
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Edu.Module.Web
{
/// <summary>
/// 网站菜单管理处理类
/// </summary>
public
class
WebMenuModule
{
/// <summary>
/// 网站菜单管理仓储层对象
/// </summary>
private
readonly
RB_Web_MenuRepository
web_MenuRepository
=
new
RB_Web_MenuRepository
();
/// <summary>
/// 获取网站菜单分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示调试</param>
/// <param name="rowsCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Web_Menu_ViewModel
>
GetWebMenuPageModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Web_Menu_ViewModel
query
)
{
return
web_MenuRepository
.
GetWebMenuPageRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
}
/// <summary>
/// 获取网站菜单列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Web_Menu_ViewModel
>
GetWebMenuListModule
(
RB_Web_Menu_ViewModel
query
)
{
return
web_MenuRepository
.
GetWebMenuListRepository
(
query
);
}
/// <summary>
/// 新增修改网站前台菜单
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetWebMenuModule
(
RB_Web_Menu_ViewModel
model
)
{
bool
flag
=
false
;
if
(
model
.
Id
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Web_Menu_ViewModel
.
Name
),
model
.
Name
},
{
nameof
(
RB_Web_Menu_ViewModel
.
MenuUrl
),
model
.
MenuUrl
},
{
nameof
(
RB_Web_Menu_ViewModel
.
ParentId
),
model
.
ParentId
},
{
nameof
(
RB_Web_Menu_ViewModel
.
MenuLevel
),
model
.
MenuLevel
},
{
nameof
(
RB_Web_Menu_ViewModel
.
ClassName
),
model
.
ClassName
},
{
nameof
(
RB_Web_Menu_ViewModel
.
Icon
),
model
.
Icon
},
{
nameof
(
RB_Web_Menu_ViewModel
.
SortNum
),
model
.
SortNum
},
};
flag
=
web_MenuRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Web_Menu_ViewModel
.
Id
),
model
.
Id
));
}
else
{
var
newId
=
web_MenuRepository
.
Insert
(
model
);
model
.
Id
=
newId
;
flag
=
newId
>
0
;
}
return
flag
;
}
/// <summary>
/// 根据编号获取网站菜单详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public
RB_Web_Menu_ViewModel
GetWebMenuModule
(
object
Id
)
{
return
web_MenuRepository
.
GetEntity
<
RB_Web_Menu_ViewModel
>(
Id
);
}
/// <summary>
/// 修改网站菜单状态
/// </summary>
/// <param name="Id"></param>
/// <param name="Status">0-正常,1-删除</param>
/// <returns></returns>
public
bool
RemoveWebMenuStatusModule
(
int
Id
,
int
Status
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Web_Menu_ViewModel
.
Status
),
Status
},
};
var
flag
=
web_MenuRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Web_Menu_ViewModel
.
Id
),
Id
));
return
flag
;
}
}
}
Edu.Module.Web/WebNavModule.cs
0 → 100644
View file @
218d6e2d
using
Edu.Model.ViewModel.Web
;
using
Edu.Repository.Web
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Edu.Module.Web
{
/// <summary>
/// 网站导航处理类
/// </summary>
public
class
WebNavModule
{
/// <summary>
/// 网站导航仓储层对象
/// </summary>
private
readonly
RB_Web_NavRepository
web_NavRepository
=
new
RB_Web_NavRepository
();
/// <summary>
/// 获取网站导航分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示调试</param>
/// <param name="rowsCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Web_Nav_ViewModel
>
GetWebNavPageModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Web_Nav_ViewModel
query
)
{
return
web_NavRepository
.
GetWebNavPageRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
}
/// <summary>
/// 获取网站导航列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Web_Nav_ViewModel
>
GetWebNavListModule
(
RB_Web_Nav_ViewModel
query
)
{
return
web_NavRepository
.
GetWebNavListRepository
(
query
);
}
/// <summary>
/// 新增修改导航
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetWebNavModule
(
RB_Web_Nav_ViewModel
model
)
{
bool
flag
;
if
(
model
.
Id
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Web_Nav_ViewModel
.
NavTitle
),
model
.
NavTitle
},
{
nameof
(
RB_Web_Nav_ViewModel
.
SubTitle
),
model
.
SubTitle
},
{
nameof
(
RB_Web_Nav_ViewModel
.
BgImg
),
model
.
BgImg
},
{
nameof
(
RB_Web_Nav_ViewModel
.
LinkUrl
),
model
.
LinkUrl
},
{
nameof
(
RB_Web_Nav_ViewModel
.
NavType
),
model
.
NavType
},
};
flag
=
web_NavRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Web_Nav_ViewModel
.
Id
),
model
.
Id
));
}
else
{
var
newId
=
web_NavRepository
.
Insert
(
model
);
model
.
Id
=
newId
;
flag
=
newId
>
0
;
}
return
flag
;
}
/// <summary>
/// 根据编号获取网站导航详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public
RB_Web_Nav_ViewModel
GetWebNavModule
(
object
Id
)
{
return
web_NavRepository
.
GetEntity
<
RB_Web_Nav_ViewModel
>(
Id
);
}
/// <summary>
/// 修改网站导航状态
/// </summary>
/// <param name="Id"></param>
/// <param name="Status">0-正常,1-删除</param>
/// <returns></returns>
public
bool
RemoveWebNavStatusModule
(
int
Id
,
int
Status
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Web_Nav_ViewModel
.
Status
),
Status
},
};
var
flag
=
web_NavRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Web_Nav_ViewModel
.
Id
),
Id
));
return
flag
;
}
}
}
Edu.Repository/Web/RB_Web_MenuRepository.cs
0 → 100644
View file @
218d6e2d
using
Edu.Common.Enum
;
using
Edu.Model.Entity.Web
;
using
Edu.Model.ViewModel.Web
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
namespace
Edu.Repository.Web
{
/// <summary>
/// 网站菜单管理仓储层
/// </summary>
public
class
RB_Web_MenuRepository
:
BaseRepository
<
RB_Web_Menu
>
{
/// <summary>
/// 获取网站菜单分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示调试</param>
/// <param name="rowsCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Web_Menu_ViewModel
>
GetWebMenuPageRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Web_Menu_ViewModel
query
)
{
rowsCount
=
0
;
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
@"
SELECT A.*
FROM RB_Web_Menu AS A
WHERE 1=1
"
);
if
(
query
==
null
)
{
return
new
List
<
RB_Web_Menu_ViewModel
>();
}
else
{
if
(
query
.
Group_Id
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Web_Menu_ViewModel
.
Group_Id
),
query
.
Group_Id
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
Name
))
{
builder
.
AppendFormat
(
" AND A.{0} LIKE @Name "
,
nameof
(
RB_Web_Menu_ViewModel
.
Name
));
parameters
.
Add
(
"Name"
,
"%"
+
query
.
Name
.
Trim
()
+
"%"
);
}
if
(
query
.
Status
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Web_Menu_ViewModel
.
Status
),
(
int
)
query
.
Status
);
}
}
return
GetPage
<
RB_Web_Menu_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
}
/// <summary>
/// 获取网站菜单列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Web_Menu_ViewModel
>
GetWebMenuListRepository
(
RB_Web_Menu_ViewModel
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
@"
SELECT A.*
FROM RB_Web_Menu AS A
WHERE 1=1
"
);
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Web_Menu_ViewModel
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
if
(
query
==
null
)
{
return
new
List
<
RB_Web_Menu_ViewModel
>();
}
else
{
if
(
query
.
Group_Id
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Web_Menu_ViewModel
.
Group_Id
),
query
.
Group_Id
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
Name
))
{
builder
.
AppendFormat
(
" AND A.{0} LIKE @Name "
,
nameof
(
RB_Web_Menu_ViewModel
.
Name
));
parameters
.
Add
(
"Name"
,
"%"
+
query
.
Name
.
Trim
()
+
"%"
);
}
}
return
Get
<
RB_Web_Menu_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
}
}
Edu.Repository/Web/RB_Web_NavRepository.cs
0 → 100644
View file @
218d6e2d
using
Edu.Common.Enum
;
using
Edu.Model.Entity.Web
;
using
Edu.Model.ViewModel.Web
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
namespace
Edu.Repository.Web
{
/// <summary>
/// 网站导航仓储层
/// </summary>
public
class
RB_Web_NavRepository
:
BaseRepository
<
RB_Web_Nav
>
{
/// <summary>
/// 获取网站导航分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示调试</param>
/// <param name="rowsCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Web_Nav_ViewModel
>
GetWebNavPageRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Web_Nav_ViewModel
query
)
{
rowsCount
=
0
;
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
@"
SELECT A.*
FROM rb_web_nav AS A
WHERE 1=1
"
);
if
(
query
==
null
)
{
return
new
List
<
RB_Web_Nav_ViewModel
>();
}
else
{
if
(
query
.
Group_Id
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Web_Nav_ViewModel
.
Group_Id
),
query
.
Group_Id
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
NavTitle
))
{
builder
.
AppendFormat
(
" AND A.{0} LIKE @NavTitle "
,
nameof
(
RB_Web_Nav_ViewModel
.
NavTitle
));
parameters
.
Add
(
"NavTitle"
,
"%"
+
query
.
NavTitle
.
Trim
()
+
"%"
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
SubTitle
))
{
builder
.
AppendFormat
(
" AND A.{0} LIKE @NavTitle "
,
nameof
(
RB_Web_Nav_ViewModel
.
SubTitle
));
parameters
.
Add
(
"SubTitle"
,
"%"
+
query
.
SubTitle
.
Trim
()
+
"%"
);
}
if
(
query
.
NavType
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Web_Nav_ViewModel
.
NavType
),
(
int
)
query
.
NavType
);
}
if
(
query
.
Status
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Web_Nav_ViewModel
.
Status
),
(
int
)
query
.
Status
);
}
}
return
GetPage
<
RB_Web_Nav_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
}
/// <summary>
/// 获取网站导航列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Web_Nav_ViewModel
>
GetWebNavListRepository
(
RB_Web_Nav_ViewModel
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
@"
SELECT A.*
FROM rb_web_nav AS A
WHERE 1=1
"
);
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Web_Nav_ViewModel
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
if
(
query
==
null
)
{
return
new
List
<
RB_Web_Nav_ViewModel
>();
}
else
{
if
(
query
.
Group_Id
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Web_Nav_ViewModel
.
Group_Id
),
query
.
Group_Id
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
NavTitle
))
{
builder
.
AppendFormat
(
" AND A.{0} LIKE @NavTitle "
,
nameof
(
RB_Web_Nav_ViewModel
.
NavTitle
));
parameters
.
Add
(
"NavTitle"
,
"%"
+
query
.
NavTitle
.
Trim
()
+
"%"
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
SubTitle
))
{
builder
.
AppendFormat
(
" AND A.{0} LIKE @NavTitle "
,
nameof
(
RB_Web_Nav_ViewModel
.
SubTitle
));
parameters
.
Add
(
"SubTitle"
,
"%"
+
query
.
SubTitle
.
Trim
()
+
"%"
);
}
if
(
query
.
NavType
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Web_Nav_ViewModel
.
NavType
),
(
int
)
query
.
NavType
);
}
}
return
Get
<
RB_Web_Nav_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
}
}
Edu.WebApi/Controllers/Web/WebController.cs
0 → 100644
View file @
218d6e2d
using
Edu.Common.API
;
using
Edu.Common.Enum.Web
;
using
Edu.Common.Plugin
;
using
Edu.Model.ViewModel.Web
;
using
Edu.Module.Web
;
using
Edu.WebApi.Filter
;
using
Microsoft.AspNetCore.Authorization
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Mvc
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
namespace
Edu.WebApi.Controllers.Web
{
/// <summary>
/// 网站前端接口
/// </summary>
[
Route
(
"api/[controller]/[action]"
)]
[
ApiExceptionFilter
]
[
ApiController
]
[
EnableCors
(
"AllowCors"
)]
public
class
WebController
:
BaseController
{
/// <summary>
/// 网站导航处理类对象
/// </summary>
private
readonly
WebNavModule
navModule
=
new
WebNavModule
();
/// <summary>
/// 获取网站导航列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
AllowAnonymous
]
public
ApiResult
GetWebNavList
()
{
var
query
=
new
RB_Web_Nav_ViewModel
()
{
NavTitle
=
base
.
ParmJObj
.
GetStringValue
(
"NavTitle"
),
SubTitle
=
base
.
ParmJObj
.
GetStringValue
(
"SubTitle"
),
NavType
=
(
NavTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"NavType"
),
Group_Id
=
base
.
ParmJObj
.
GetInt
(
"Group_Id"
),
};
var
list
=
navModule
.
GetWebNavListModule
(
query
);
return
ApiResult
.
Success
(
data
:
list
);
}
}
}
Edu.WebApi/Controllers/Web/WebManagerController.cs
0 → 100644
View file @
218d6e2d
using
Edu.Common.API
;
using
Edu.Common.Enum
;
using
Edu.Common.Enum.Web
;
using
Edu.Common.Plugin
;
using
Edu.Model.ViewModel.Web
;
using
Edu.Module.Web
;
using
Edu.WebApi.Filter
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Mvc
;
using
System
;
namespace
Edu.WebApi.Controllers.Web
{
[
Route
(
"api/[controller]/[action]"
)]
[
ApiExceptionFilter
]
[
ApiController
]
[
EnableCors
(
"AllowCors"
)]
public
class
WebManagerController
:
BaseController
{
/// <summary>
/// 网站导航处理类对象
/// </summary>
private
readonly
WebNavModule
navModule
=
new
WebNavModule
();
/// <summary>
/// 网站菜单管理处理类对象
/// </summary>
private
readonly
WebMenuModule
menuModule
=
new
WebMenuModule
();
#
region
网站导航管理
/// <summary>
/// 获取网站导航列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetWebNavList
()
{
var
query
=
new
RB_Web_Nav_ViewModel
()
{
NavTitle
=
base
.
ParmJObj
.
GetStringValue
(
"NavTitle"
),
SubTitle
=
base
.
ParmJObj
.
GetStringValue
(
"SubTitle"
),
NavType
=
(
NavTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"NavType"
),
};
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
var
list
=
navModule
.
GetWebNavListModule
(
query
);
return
ApiResult
.
Success
(
data
:
list
);
}
/// <summary>
/// 获取网站导航分页
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetWebNavPage
()
{
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Web_Nav_ViewModel
()
{
NavTitle
=
base
.
ParmJObj
.
GetStringValue
(
"NavTitle"
),
SubTitle
=
base
.
ParmJObj
.
GetStringValue
(
"SubTitle"
),
NavType
=(
NavTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"NavType"
),
Status
=(
DateStateEnum
)
base
.
ParmJObj
.
GetInt
(
"Status"
),
};
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
var
list
=
navModule
.
GetWebNavPageModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
list
;
return
ApiResult
.
Success
(
data
:
list
);
}
/// <summary>
/// 新增修改网站导航
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetWebNav
()
{
var
extModel
=
new
RB_Web_Nav_ViewModel
()
{
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
),
NavTitle
=
base
.
ParmJObj
.
GetStringValue
(
"NavTitle"
),
SubTitle
=
base
.
ParmJObj
.
GetStringValue
(
"SubTitle"
),
NavType
=
(
NavTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"NavType"
),
LinkUrl
=
base
.
ParmJObj
.
GetStringValue
(
"LinkUrl"
),
BgImg
=
base
.
ParmJObj
.
GetStringValue
(
"BgImg"
),
};
extModel
.
School_Id
=
base
.
UserInfo
.
School_Id
;
extModel
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
extModel
.
CreateBy
=
base
.
UserInfo
.
Id
;
extModel
.
CreateDate
=
DateTime
.
Now
;
extModel
.
Status
=
DateStateEnum
.
Normal
;
bool
flag
=
navModule
.
SetWebNavModule
(
extModel
);
return
flag
?
ApiResult
.
Success
(
data
:
extModel
)
:
ApiResult
.
Failed
();
}
/// <summary>
/// 获取网站导航详情
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetWebNav
()
{
var
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
,
0
);
var
extModel
=
navModule
.
GetWebNavModule
(
Id
);
return
ApiResult
.
Success
(
data
:
extModel
);
}
/// <summary>
/// 修改网站导航状态
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
RemoveWebNavStatus
()
{
var
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
,
0
);
var
Status
=
base
.
ParmJObj
.
GetInt
(
"Status"
,
0
);
var
flag
=
navModule
.
RemoveWebNavStatusModule
(
Id
,
Status
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 获取导航类型列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetNavTypeList
()
{
var
list
=
Common
.
Plugin
.
EnumHelper
.
EnumToList
(
typeof
(
NavTypeEnum
));
return
ApiResult
.
Success
(
data
:
list
);
}
#
endregion
#
region
网站菜单管理
/// <summary>
/// 获取网站菜单列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetWebMenuList
()
{
var
query
=
new
RB_Web_Menu_ViewModel
()
{
Name
=
base
.
ParmJObj
.
GetStringValue
(
"Name"
),
};
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
var
list
=
menuModule
.
GetWebMenuListModule
(
query
);
return
ApiResult
.
Success
(
data
:
list
);
}
/// <summary>
/// 获取网站菜单分页
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetWebMenuPage
()
{
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Web_Menu_ViewModel
()
{
Name
=
base
.
ParmJObj
.
GetStringValue
(
"Name"
),
Status
=
(
DateStateEnum
)
base
.
ParmJObj
.
GetInt
(
"Status"
),
};
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
var
list
=
menuModule
.
GetWebMenuPageModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
list
;
return
ApiResult
.
Success
(
data
:
list
);
}
/// <summary>
/// 新增修改网站菜单
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetWebMenu
()
{
var
extModel
=
new
RB_Web_Menu_ViewModel
()
{
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
),
Name
=
base
.
ParmJObj
.
GetStringValue
(
"Name"
),
MenuUrl
=
base
.
ParmJObj
.
GetStringValue
(
"MenuUrl"
),
ParentId
=
base
.
ParmJObj
.
GetInt
(
"ParentId"
),
MenuLevel
=
base
.
ParmJObj
.
GetInt
(
"MenuLevel"
),
ClassName
=
base
.
ParmJObj
.
GetStringValue
(
"ClassName"
),
Icon
=
base
.
ParmJObj
.
GetStringValue
(
"Icon"
),
SortNum
=
base
.
ParmJObj
.
GetInt
(
"SortNum"
),
};
extModel
.
CreateBy
=
base
.
UserInfo
.
Id
;
extModel
.
CreateDate
=
DateTime
.
Now
;
extModel
.
Status
=
DateStateEnum
.
Normal
;
bool
flag
=
menuModule
.
SetWebMenuModule
(
extModel
);
return
flag
?
ApiResult
.
Success
(
data
:
extModel
)
:
ApiResult
.
Failed
();
}
/// <summary>
/// 获取网站菜单详情
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetWebMenu
()
{
var
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
,
0
);
var
extModel
=
menuModule
.
GetWebMenuModule
(
Id
);
return
ApiResult
.
Success
(
data
:
extModel
);
}
/// <summary>
/// 修改网站菜单状态
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
RemoveWebMenuStatus
()
{
var
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
,
0
);
var
Status
=
base
.
ParmJObj
.
GetInt
(
"Status"
,
0
);
var
flag
=
menuModule
.
RemoveWebMenuStatusModule
(
Id
,
Status
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
#
endregion
}
}
Edu.WebApi/Edu.WebApi.csproj
View file @
218d6e2d
...
...
@@ -37,6 +37,7 @@
<ProjectReference Include="..\Edu.Module.StudyAbroad\Edu.Module.StudyAbroad.csproj" />
<ProjectReference Include="..\Edu.Module.System\Edu.Module.System.csproj" />
<ProjectReference Include="..\Edu.Module.User\Edu.Module.User.csproj" />
<ProjectReference Include="..\Edu.Module.Web\Edu.Module.Web.csproj" />
<ProjectReference Include="..\Edu.Repository\Edu.Repository.csproj" />
<ProjectReference Include="..\Edu.ThirdCore\Edu.ThirdCore.csproj" />
</ItemGroup>
...
...
education.sln
View file @
218d6e2d
...
...
@@ -56,7 +56,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Module.OKR", "Edu.Modul
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Test", "Edu.Test\Edu.Test.csproj", "{672E00D8-BF3A-43D0-81DF-A7A70E28DD92}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edu.Module.StudyAbroad", "Edu.Module.StudyAbroad\Edu.Module.StudyAbroad.csproj", "{2ED4527A-351A-49C0-94E0-D926F6EE2844}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Module.StudyAbroad", "Edu.Module.StudyAbroad\Edu.Module.StudyAbroad.csproj", "{2ED4527A-351A-49C0-94E0-D926F6EE2844}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edu.Module.Web", "Edu.Module.Web\Edu.Module.Web.csproj", "{380ACD87-3D6C-474C-A0ED-A91BD8E26081}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
...
...
@@ -136,6 +138,10 @@ Global
{2ED4527A-351A-49C0-94E0-D926F6EE2844}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2ED4527A-351A-49C0-94E0-D926F6EE2844}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2ED4527A-351A-49C0-94E0-D926F6EE2844}.Release|Any CPU.Build.0 = Release|Any CPU
{380ACD87-3D6C-474C-A0ED-A91BD8E26081}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{380ACD87-3D6C-474C-A0ED-A91BD8E26081}.Debug|Any CPU.Build.0 = Debug|Any CPU
{380ACD87-3D6C-474C-A0ED-A91BD8E26081}.Release|Any CPU.ActiveCfg = Release|Any CPU
{380ACD87-3D6C-474C-A0ED-A91BD8E26081}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
...
...
@@ -157,6 +163,7 @@ Global
{FF7B1BD4-0F06-4D22-91EB-9140E65A87AE} = {5B0BC66C-B15F-4174-8966-0968C61F816F}
{DA20EF60-D6D6-4EE3-950B-96F231A2F6F2} = {7AC0A4EC-3215-4FF2-96DC-DE8325ED6915}
{2ED4527A-351A-49C0-94E0-D926F6EE2844} = {7AC0A4EC-3215-4FF2-96DC-DE8325ED6915}
{380ACD87-3D6C-474C-A0ED-A91BD8E26081} = {7AC0A4EC-3215-4FF2-96DC-DE8325ED6915}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8763B446-FAB1-46BF-9743-F2628533241B}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment