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
6fbd9cc9
Commit
6fbd9cc9
authored
Nov 25, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交文件站点管理
parent
9ab267fa
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
244 additions
and
10 deletions
+244
-10
RB_File_Store.cs
Edu.Model/Public/RB_File_Store.cs
+5
-8
Edu.Module.Public.csproj
Edu.Module.Public/Edu.Module.Public.csproj
+12
-0
PublicModule.cs
Edu.Module.Public/PublicModule.cs
+62
-0
RB_File_StoreRepository.cs
Edu.Repository/Public/RB_File_StoreRepository.cs
+50
-0
PublicController.cs
Edu.WebApi/Controllers/Public/PublicController.cs
+114
-2
Edu.WebApi.csproj
Edu.WebApi/Edu.WebApi.csproj
+1
-0
No files found.
Edu.Model/Public/RB_File_Store.cs
View file @
6fbd9cc9
...
...
@@ -17,14 +17,14 @@ namespace Edu.Model.Public
public
int
ID
{
get
;
set
;
}
/// <summary>
///
商户id
///
集团编号
/// </summary>
public
int
Tenant
Id
{
get
;
set
;
}
public
int
Group_
Id
{
get
;
set
;
}
/// <summary>
///
小程序id
///
学校编号
/// </summary>
public
int
MallBase
Id
{
get
;
set
;
}
public
int
School_
Id
{
get
;
set
;
}
/// <summary>
/// 0-否1-是
...
...
@@ -65,10 +65,7 @@ namespace Edu.Model.Public
/// 自定义域名
/// </summary>
public
string
SecretId
{
get
;
set
;
}
/// <summary>
/// 图片样式接口(七牛)
/// </summary>
public
string
ImgStyle
{
get
;
set
;
}
}
}
Edu.Module.Public/Edu.Module.Public.csproj
0 → 100644
View file @
6fbd9cc9
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Edu.Model\Edu.Model.csproj" />
<ProjectReference Include="..\Edu.Repository\Edu.Repository.csproj" />
</ItemGroup>
</Project>
Edu.Module.Public/PublicModule.cs
0 → 100644
View file @
6fbd9cc9
using
System
;
using
System.Collections.Generic
;
using
Edu.Model.Public
;
using
Edu.Repository.Public
;
using
VT.FW.DB
;
namespace
Edu.Module.Public
{
public
class
PublicModule
{
private
readonly
RB_File_StoreRepository
storeRepository
=
new
RB_File_StoreRepository
();
#
region
上传设置
/// <summary>
/// 获取上传存储信息
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_File_Store
>
GetFileStoreList
(
RB_File_Store
query
)
{
return
storeRepository
.
GetListRepository
(
query
);
}
/// <summary>
/// 新增/修改存储位置
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
AddOrUpdateFileStore
(
RB_File_Store
model
)
{
bool
result
=
false
;
int
id
=
0
;
if
(
model
.
ID
==
0
)
{
id
=
storeRepository
.
Insert
(
model
);
result
=
id
>
0
;
}
else
{
id
=
model
.
ID
;
result
=
storeRepository
.
Update
(
model
);
}
//判断当前的是否设置成默认没有
if
(
model
.
IsDefault
==
1
&&
result
)
//将其他的默认赋值成0
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_File_Store
.
IsDefault
),
0
},
};
List
<
WhereHelper
>
whereHelpers
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_File_Store
.
Group_Id
),
FiledValue
=
model
.
Group_Id
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_File_Store
.
School_Id
),
FiledValue
=
model
.
School_Id
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_File_Store
.
ID
),
FiledValue
=
id
,
OperatorEnum
=
OperatorEnum
.
NotEqual
},
};
storeRepository
.
Update
(
fileds
,
whereHelpers
);
}
return
result
;
}
#
endregion
}
}
Edu.Repository/Public/RB_File_StoreRepository.cs
0 → 100644
View file @
6fbd9cc9
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
Edu.Model.Public
;
namespace
Edu.Repository.Public
{
/// <summary>
/// 上传设置仓储层
/// </summary>
public
class
RB_File_StoreRepository
:
BaseRepository
<
RB_File_Store
>
{
/// <summary>
/// 表名称
/// </summary>
public
string
TableName
{
get
{
return
nameof
(
RB_File_Store
);
}
}
/// <summary>
/// 获取上传存储信息
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_File_Store
>
GetListRepository
(
RB_File_Store
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE
{
nameof
(
RB_File_Store
.
Status
)}
=0"
);
if
(
query
!=
null
)
{
if
(
query
.
Group_Id
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_File_Store
.
Group_Id
)}
=
{
query
.
Group_Id
}
"
);
}
if
(
query
.
School_Id
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_File_Store
.
School_Id
)}
=
{
query
.
School_Id
}
"
);
}
if
(
query
.
StoreType
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_File_Store
.
StoreType
)}
=
{(
int
)
query
.
StoreType
}
"
);
}
if
(
query
.
IsDefault
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_File_Store
.
IsDefault
)}
=
{
query
.
IsDefault
}
"
);
}
}
return
Get
<
RB_File_Store
>(
builder
.
ToString
()).
ToList
();
}
}
}
Edu.WebApi/Controllers/Public/PublicController.cs
View file @
6fbd9cc9
...
...
@@ -4,7 +4,9 @@ using System.Linq;
using
Edu.Cache.User
;
using
Edu.Common.API
;
using
Edu.Common.Plugin
;
using
Edu.Model.Public
;
using
Edu.Model.ViewModel.System
;
using
Edu.Module.Public
;
using
Edu.Module.System
;
using
Edu.WebApi.Filter
;
using
Microsoft.AspNetCore.Cors
;
...
...
@@ -36,6 +38,11 @@ namespace Edu.WebApi.Controllers.Public
/// </summary>
private
readonly
RoleModule
roleModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
RoleModule
>();
/// <summary>
/// 公共处理类对象
/// </summary>
private
readonly
PublicModule
publicModule
=
new
PublicModule
();
#
region
省市区
/// <summary>
...
...
@@ -269,6 +276,111 @@ namespace Edu.WebApi.Controllers.Public
#
endregion
#
region
上传设置
public
ApiResult
GetFileStoreList
()
{
var
parms
=
RequestParm
;
var
query
=
new
RB_File_Store
();
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
School_Id
=
base
.
UserInfo
.
School_Id
;
var
list
=
publicModule
.
GetFileStoreList
(
query
);
return
ApiResult
.
Success
(
"获取成功"
,
list
);
}
/// <summary>
/// 新增/修改上传设置
/// </summary>
/// <returns></returns>
public
ApiResult
AddOrUpdateFileStore
()
{
var
parms
=
RequestParm
;
var
query
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
RB_File_Store
>(
RequestParm
.
Msg
.
ToString
());
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
School_Id
=
base
.
UserInfo
.
School_Id
;
if
(
query
==
null
)
{
return
ApiResult
.
Failed
(
"请传入上传设置信息"
);
}
else
{
if
((
int
)
query
.
StoreType
==
0
)
{
return
ApiResult
.
Failed
(
"请选择存储位置"
);
}
if
(
query
.
ID
==
0
)
{
query
.
CreateDate
=
System
.
DateTime
.
Now
;
}
query
.
UpdateDate
=
System
.
DateTime
.
Now
;
bool
result
=
publicModule
.
AddOrUpdateFileStore
(
query
);
if
(
result
)
{
return
ApiResult
.
Success
(
"上传设置保存成功"
);
}
else
{
return
ApiResult
.
Failed
(
"上传设置保存失败"
);
}
}
}
/// <summary>
/// 获取上传信息的详情
/// </summary>
/// <returns></returns>
public
ApiResult
GetFileStoreDetail
()
{
var
parms
=
RequestParm
;
var
query
=
new
RB_File_Store
();
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
School_Id
=
base
.
UserInfo
.
School_Id
;
var
model
=
publicModule
.
GetFileStoreList
(
query
).
FirstOrDefault
();
if
(
model
==
null
)
{
model
=
new
RB_File_Store
();
}
return
ApiResult
.
Success
(
"获取成功"
,
model
);
}
/// <summary>
/// 获取触发事件枚举
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetStoreTypeEnumList
()
{
var
list
=
EnumHelper
.
EnumToList
(
typeof
(
Common
.
Enum
.
Public
.
StoreTypeEnum
));
return
ApiResult
.
Success
(
""
,
list
);
}
/// <summary>
/// 获取默认上传信息的详情
/// </summary>
/// <returns></returns>
public
ApiResult
GetDefaultFileStore
()
{
var
query
=
new
RB_File_Store
();
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
School_Id
=
base
.
UserInfo
.
School_Id
;
var
model
=
publicModule
.
GetFileStoreList
(
query
).
Where
(
x
=>
x
.
IsDefault
==
1
).
FirstOrDefault
();
if
(
model
==
null
)
{
model
=
new
RB_File_Store
();
}
return
ApiResult
.
Success
(
"获取成功"
,
model
);
}
#
endregion
/// <summary>
/// 获取角色权限
/// </summary>
...
...
@@ -276,7 +388,7 @@ namespace Edu.WebApi.Controllers.Public
[
HttpPost
]
public
ApiResult
GetRolePermission
()
{
var
roleId
=
base
.
ParmJObj
.
GetInt
(
"Role_Id"
);
var
roleId
=
base
.
ParmJObj
.
GetInt
(
"Role_Id"
);
var
list
=
roleModule
.
GetRolePermissionModule
(
roleId
);
return
ApiResult
.
Success
(
data
:
list
);
}
...
...
@@ -290,7 +402,7 @@ namespace Edu.WebApi.Controllers.Public
var
roleMenu
=
base
.
ParmJObj
.
GetStringValue
(
"roleMenu"
);
var
roleFunction
=
base
.
ParmJObj
.
GetStringValue
(
"roleFunction"
);
var
rolePermissionList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
RB_Role_Permission_ViewModel
>>(
roleMenu
);
var
roleFunctionList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
RB_Role_FunctionPermission_ViewModel
>>(
roleFunction
);
var
roleFunctionList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
RB_Role_FunctionPermission_ViewModel
>>(
roleFunction
);
bool
flag
=
roleModule
.
SetRolePermissionModule
(
rolePermissionList
,
roleFunctionList
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
Edu.WebApi/Edu.WebApi.csproj
View file @
6fbd9cc9
...
...
@@ -26,6 +26,7 @@
<ProjectReference Include="..\Edu.Common\Edu.Common.csproj" />
<ProjectReference Include="..\Edu.Model\Edu.Model.csproj" />
<ProjectReference Include="..\Edu.Module.Course\Edu.Module.Course.csproj" />
<ProjectReference Include="..\Edu.Module.Public\Edu.Module.Public.csproj" />
<ProjectReference Include="..\Edu.Module.Question\Edu.Module.Question.csproj" />
<ProjectReference Include="..\Edu.Module.System\Edu.Module.System.csproj" />
<ProjectReference Include="..\Edu.Module.User\Edu.Module.User.csproj" />
...
...
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