Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
roncoo
roncoo-education
提交
79cf5a17
R
roncoo-education
项目概览
roncoo
/
roncoo-education
10 个月 前同步成功
通知
146
Star
5
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roncoo-education
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
79cf5a17
编写于
3月 13, 2019
作者:
1
1074760496
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增图片,视频,附件可存储在本地的功能
上级
cb99fb03
变更
14
展开全部
隐藏空白更改
内联
并排
Showing
14 changed file
with
1263 addition
and
51 deletion
+1263
-51
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/biz/ApiUploadBiz.java
...com/roncoo/education/course/service/biz/ApiUploadBiz.java
+124
-37
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/dao/FileStorageDao.java
...m/roncoo/education/course/service/dao/FileStorageDao.java
+17
-0
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/dao/impl/FileStorageDaoImpl.java
...education/course/service/dao/impl/FileStorageDaoImpl.java
+44
-0
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/dao/impl/mapper/FileStorageMapper.java
...ion/course/service/dao/impl/mapper/FileStorageMapper.java
+32
-0
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/dao/impl/mapper/entity/FileStorage.java
...on/course/service/dao/impl/mapper/entity/FileStorage.java
+96
-0
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/dao/impl/mapper/entity/FileStorageExample.java
...se/service/dao/impl/mapper/entity/FileStorageExample.java
+661
-0
roncoo-education-course/roncoo-education-course-service/src/main/resources/mybatis/FileStorageMapper.xml
...-service/src/main/resources/mybatis/FileStorageMapper.xml
+246
-0
roncoo-education-util/src/main/java/com/roncoo/education/util/config/SystemUtil.java
...ain/java/com/roncoo/education/util/config/SystemUtil.java
+6
-3
roncoo-education-util/src/main/java/com/roncoo/education/util/enums/FileStorageTypeEnum.java
.../com/roncoo/education/util/enums/FileStorageTypeEnum.java
+22
-0
roncoo-education-util/src/main/java/com/roncoo/education/util/enums/FileTypeEnum.java
...in/java/com/roncoo/education/util/enums/FileTypeEnum.java
+3
-3
roncoo-education-util/src/main/java/com/roncoo/education/util/enums/VideoTypeEnum.java
...n/java/com/roncoo/education/util/enums/VideoTypeEnum.java
+3
-3
roncoo-education-util/src/main/resources/system.properties
roncoo-education-util/src/main/resources/system.properties
+4
-1
roncoo-education-web-boss/src/main/resources/bootstrap.properties
...ducation-web-boss/src/main/resources/bootstrap.properties
+2
-4
roncoo-education-web-boss/src/main/resources/templates/system/sys/set.ftl
...-web-boss/src/main/resources/templates/system/sys/set.ftl
+3
-0
未找到文件。
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/biz/ApiUploadBiz.java
浏览文件 @
79cf5a17
...
...
@@ -12,7 +12,9 @@ import org.springframework.stereotype.Component;
import
org.springframework.web.multipart.MultipartFile
;
import
com.roncoo.education.course.service.dao.CourseVideoDao
;
import
com.roncoo.education.course.service.dao.FileStorageDao
;
import
com.roncoo.education.course.service.dao.impl.mapper.entity.CourseVideo
;
import
com.roncoo.education.course.service.dao.impl.mapper.entity.FileStorage
;
import
com.roncoo.education.system.common.bean.vo.SysVO
;
import
com.roncoo.education.system.feign.IBossSys
;
import
com.roncoo.education.util.aliyun.Aliyun
;
...
...
@@ -20,6 +22,8 @@ import com.roncoo.education.util.aliyun.AliyunUtil;
import
com.roncoo.education.util.base.BaseBiz
;
import
com.roncoo.education.util.base.Result
;
import
com.roncoo.education.util.config.SystemUtil
;
import
com.roncoo.education.util.enums.FileStorageTypeEnum
;
import
com.roncoo.education.util.enums.FileTypeEnum
;
import
com.roncoo.education.util.enums.PlatformEnum
;
import
com.roncoo.education.util.enums.VideoStatusEnum
;
import
com.roncoo.education.util.polyv.PolyvUtil
;
...
...
@@ -40,6 +44,8 @@ public class ApiUploadBiz extends BaseBiz {
@Autowired
private
CourseVideoDao
courseVideoDao
;
@Autowired
private
FileStorageDao
fileStorageDao
;
@Autowired
private
IBossSys
bossSys
;
...
...
@@ -99,48 +105,73 @@ public class ApiUploadBiz extends BaseBiz {
callbackExecutor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
// 2、异步上传到保利威视
UploadFile
uploadFile
=
new
UploadFile
();
uploadFile
.
setTitle
(
fileName
);
uploadFile
.
setDesc
(
fileName
);
uploadFile
.
setTag
(
videoFile
.
getOriginalFilename
());
uploadFile
.
setCataid
(
1L
);
// 获取系统配置信息
SysVO
sys
=
bossSys
.
getSys
();
UploadFileResult
result
=
PolyvUtil
.
uploadFile
(
targetFile
,
uploadFile
,
sys
.
getPolyvWritetoken
());
if
(
result
==
null
)
{
// 上传异常,不再进行处理,定时任务会继续进行处理
return
;
if
(
ObjectUtil
.
isNull
(
sys
))
{
Result
.
error
(
"未配置系统配置表"
);
}
if
(
sys
.
getFileType
().
equals
(
FileTypeEnum
.
LOCAL
.
getCode
()))
{
courseVideo
.
setVideoStatus
(
VideoStatusEnum
.
SUCCES
.
getCode
());
courseVideoDao
.
updateById
(
courseVideo
);
// 根据视频编号、课时ID查询课程视频信息
CourseVideo
courseVideo
=
courseVideoDao
.
getByVideoNoAndPeriodId
(
videoNo
,
Long
.
valueOf
(
0
));
// 根据视频编号更新视频信息
List
<
CourseVideo
>
list
=
courseVideoDao
.
listByVideoNo
(
videoNo
);
for
(
CourseVideo
video
:
list
)
{
video
.
setVideoLength
(
courseVideo
.
getVideoLength
());
video
.
setVideoVid
(
courseVideo
.
getVideoVid
());
video
.
setVideoStatus
(
VideoStatusEnum
.
SUCCES
.
getCode
());
video
.
setVideoOasId
(
courseVideo
.
getVideoOasId
());
courseVideoDao
.
updateById
(
video
);
}
FileStorage
fileStorage
=
new
FileStorage
();
fileStorage
.
setFileName
(
videoFile
.
getOriginalFilename
());
fileStorage
.
setFileNo
(
videoNo
);
fileStorage
.
setFileSize
(
videoFile
.
getSize
());
fileStorage
.
setFileType
(
FileStorageTypeEnum
.
VIDEO
.
getCode
());
fileStorage
.
setFileUrl
(
targetFile
.
toString
());
fileStorageDao
.
save
(
fileStorage
);
}
else
{
// 2、异步上传到保利威视
UploadFile
uploadFile
=
new
UploadFile
();
uploadFile
.
setTitle
(
fileName
);
uploadFile
.
setDesc
(
fileName
);
uploadFile
.
setTag
(
videoFile
.
getOriginalFilename
());
uploadFile
.
setCataid
(
1L
);
courseVideo
.
setVideoLength
(
result
.
getDuration
());
courseVideo
.
setVideoVid
(
result
.
getVid
());
courseVideo
.
setVideoStatus
(
VideoStatusEnum
.
SUCCES
.
getCode
());
courseVideoDao
.
updateById
(
courseVideo
);
// 3、异步上传到阿里云
String
videoOasId
=
AliyunUtil
.
uploadDoc
(
PlatformEnum
.
COURSE
,
targetFile
,
BeanUtil
.
copyProperties
(
sys
,
Aliyun
.
class
));
courseVideo
.
setVideoOasId
(
videoOasId
);
courseVideoDao
.
updateById
(
courseVideo
);
// 根据视频编号、课时ID查询课程视频信息
CourseVideo
courseVideo
=
courseVideoDao
.
getByVideoNoAndPeriodId
(
videoNo
,
Long
.
valueOf
(
0
));
// 根据视频编号更新视频信息
List
<
CourseVideo
>
list
=
courseVideoDao
.
listByVideoNo
(
videoNo
);
for
(
CourseVideo
video
:
list
)
{
video
.
setVideoLength
(
courseVideo
.
getVideoLength
());
video
.
setVideoVid
(
courseVideo
.
getVideoVid
());
video
.
setVideoStatus
(
VideoStatusEnum
.
SUCCES
.
getCode
());
video
.
setVideoOasId
(
courseVideo
.
getVideoOasId
());
courseVideoDao
.
updateById
(
video
);
}
UploadFileResult
result
=
PolyvUtil
.
uploadFile
(
targetFile
,
uploadFile
,
sys
.
getPolyvWritetoken
());
if
(
result
==
null
)
{
// 上传异常,不再进行处理,定时任务会继续进行处理
return
;
}
courseVideo
.
setVideoLength
(
result
.
getDuration
());
courseVideo
.
setVideoVid
(
result
.
getVid
());
courseVideo
.
setVideoStatus
(
VideoStatusEnum
.
SUCCES
.
getCode
());
courseVideoDao
.
updateById
(
courseVideo
);
// 3、异步上传到阿里云
String
videoOasId
=
AliyunUtil
.
uploadDoc
(
PlatformEnum
.
COURSE
,
targetFile
,
BeanUtil
.
copyProperties
(
sys
,
Aliyun
.
class
));
courseVideo
.
setVideoOasId
(
videoOasId
);
courseVideoDao
.
updateById
(
courseVideo
);
// 根据视频编号、课时ID查询课程视频信息
CourseVideo
courseVideo
=
courseVideoDao
.
getByVideoNoAndPeriodId
(
videoNo
,
Long
.
valueOf
(
0
));
// 根据视频编号更新视频信息
List
<
CourseVideo
>
list
=
courseVideoDao
.
listByVideoNo
(
videoNo
);
for
(
CourseVideo
video
:
list
)
{
video
.
setVideoLength
(
courseVideo
.
getVideoLength
());
video
.
setVideoVid
(
courseVideo
.
getVideoVid
());
video
.
setVideoStatus
(
VideoStatusEnum
.
SUCCES
.
getCode
());
video
.
setVideoOasId
(
courseVideo
.
getVideoOasId
());
courseVideoDao
.
updateById
(
video
);
}
// 4、成功删除本地文件
if
(
targetFile
.
isFile
()
&&
targetFile
.
exists
())
{
targetFile
.
delete
();
// 4、成功删除本地文件
if
(
targetFile
.
isFile
()
&&
targetFile
.
exists
())
{
targetFile
.
delete
();
}
}
}
});
...
...
@@ -157,6 +188,34 @@ public class ApiUploadBiz extends BaseBiz {
*/
public
Result
<
String
>
uploadPic
(
MultipartFile
picFile
)
{
if
(
ObjectUtil
.
isNotNull
(
picFile
)
&&
!
picFile
.
isEmpty
())
{
// 获取系统配置信息
SysVO
sys
=
bossSys
.
getSys
();
if
(
ObjectUtil
.
isNull
(
sys
))
{
Result
.
error
(
"未配置系统配置表"
);
}
Long
fileNo
=
IdWorker
.
getId
();
// 1、上传到本地
if
(
sys
.
getFileType
().
equals
(
FileTypeEnum
.
LOCAL
.
getCode
()))
{
File
pic
=
new
File
(
SystemUtil
.
PIC_STORAGE_PATH
+
fileNo
.
toString
()
+
"."
+
StrUtil
.
getSuffix
(
picFile
.
getOriginalFilename
()));
try
{
// 判断文件目录是否存在,不存在就创建文件目录
if
(!
pic
.
getParentFile
().
exists
())
{
pic
.
getParentFile
().
mkdirs
();
// 创建父级文件路径
}
picFile
.
transferTo
(
pic
);
FileStorage
fileStorage
=
new
FileStorage
();
fileStorage
.
setFileName
(
picFile
.
getOriginalFilename
());
fileStorage
.
setFileNo
(
fileNo
);
fileStorage
.
setFileSize
(
picFile
.
getSize
());
fileStorage
.
setFileType
(
FileStorageTypeEnum
.
PICTURE
.
getCode
());
fileStorage
.
setFileUrl
(
pic
.
toString
());
fileStorageDao
.
save
(
fileStorage
);
return
Result
.
success
(
pic
.
toString
());
}
catch
(
Exception
e
)
{
logger
.
error
(
"上传到本地失败"
,
e
);
return
Result
.
error
(
"上传文件出错,请重新上传"
);
}
}
return
Result
.
success
(
AliyunUtil
.
uploadPic
(
PlatformEnum
.
COURSE
,
picFile
,
BeanUtil
.
copyProperties
(
bossSys
.
getSys
(),
Aliyun
.
class
)));
}
return
Result
.
error
(
"请选择上传的图片"
);
...
...
@@ -169,6 +228,34 @@ public class ApiUploadBiz extends BaseBiz {
*/
public
Result
<
String
>
uploadDoc
(
MultipartFile
docFile
)
{
if
(
ObjectUtil
.
isNotNull
(
docFile
)
&&
!
docFile
.
isEmpty
())
{
// 获取系统配置信息
SysVO
sys
=
bossSys
.
getSys
();
if
(
ObjectUtil
.
isNull
(
sys
))
{
Result
.
error
(
"未配置系统配置表"
);
}
Long
fileNo
=
IdWorker
.
getId
();
// 1、上传到本地
if
(
sys
.
getFileType
().
equals
(
FileTypeEnum
.
LOCAL
.
getCode
()))
{
File
pic
=
new
File
(
SystemUtil
.
DOC_STORAGE_PATH
+
fileNo
.
toString
()
+
"."
+
StrUtil
.
getSuffix
(
docFile
.
getOriginalFilename
()));
try
{
// 判断文件目录是否存在,不存在就创建文件目录
if
(!
pic
.
getParentFile
().
exists
())
{
pic
.
getParentFile
().
mkdirs
();
// 创建父级文件路径
}
docFile
.
transferTo
(
pic
);
FileStorage
fileStorage
=
new
FileStorage
();
fileStorage
.
setFileName
(
docFile
.
getOriginalFilename
());
fileStorage
.
setFileNo
(
fileNo
);
fileStorage
.
setFileSize
(
docFile
.
getSize
());
fileStorage
.
setFileType
(
FileStorageTypeEnum
.
DOC
.
getCode
());
fileStorage
.
setFileUrl
(
pic
.
toString
());
fileStorageDao
.
save
(
fileStorage
);
return
Result
.
success
(
pic
.
toString
());
}
catch
(
Exception
e
)
{
logger
.
error
(
"上传到本地失败"
,
e
);
return
Result
.
error
(
"上传文件出错,请重新上传"
);
}
}
return
Result
.
success
(
AliyunUtil
.
uploadDoc
(
PlatformEnum
.
COURSE
,
docFile
,
BeanUtil
.
copyProperties
(
bossSys
.
getSys
(),
Aliyun
.
class
)));
}
return
Result
.
error
(
"请选择上传的文件"
);
...
...
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/dao/FileStorageDao.java
0 → 100644
浏览文件 @
79cf5a17
package
com.roncoo.education.course.service.dao
;
import
com.roncoo.education.course.service.dao.impl.mapper.entity.FileStorage
;
import
com.roncoo.education.course.service.dao.impl.mapper.entity.FileStorageExample
;
import
com.roncoo.education.util.base.Page
;
public
interface
FileStorageDao
{
int
save
(
FileStorage
record
);
int
deleteById
(
Long
id
);
int
updateById
(
FileStorage
record
);
FileStorage
getById
(
Long
id
);
Page
<
FileStorage
>
listForPage
(
int
pageCurrent
,
int
pageSize
,
FileStorageExample
example
);
}
\ No newline at end of file
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/dao/impl/FileStorageDaoImpl.java
0 → 100644
浏览文件 @
79cf5a17
package
com.roncoo.education.course.service.dao.impl
;
import
com.roncoo.education.course.service.dao.FileStorageDao
;
import
com.roncoo.education.course.service.dao.impl.mapper.FileStorageMapper
;
import
com.roncoo.education.course.service.dao.impl.mapper.entity.FileStorage
;
import
com.roncoo.education.course.service.dao.impl.mapper.entity.FileStorageExample
;
import
com.roncoo.education.util.base.Page
;
import
com.roncoo.education.util.base.PageUtil
;
import
com.roncoo.education.util.tools.IdWorker
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Repository
;
@Repository
public
class
FileStorageDaoImpl
implements
FileStorageDao
{
@Autowired
private
FileStorageMapper
fileStorageMapper
;
public
int
save
(
FileStorage
record
)
{
record
.
setId
(
IdWorker
.
getId
());
return
this
.
fileStorageMapper
.
insertSelective
(
record
);
}
public
int
deleteById
(
Long
id
)
{
return
this
.
fileStorageMapper
.
deleteByPrimaryKey
(
id
);
}
public
int
updateById
(
FileStorage
record
)
{
return
this
.
fileStorageMapper
.
updateByPrimaryKeySelective
(
record
);
}
public
FileStorage
getById
(
Long
id
)
{
return
this
.
fileStorageMapper
.
selectByPrimaryKey
(
id
);
}
public
Page
<
FileStorage
>
listForPage
(
int
pageCurrent
,
int
pageSize
,
FileStorageExample
example
)
{
int
count
=
this
.
fileStorageMapper
.
countByExample
(
example
);
pageSize
=
PageUtil
.
checkPageSize
(
pageSize
);
pageCurrent
=
PageUtil
.
checkPageCurrent
(
count
,
pageSize
,
pageCurrent
);
int
totalPage
=
PageUtil
.
countTotalPage
(
count
,
pageSize
);
example
.
setLimitStart
(
PageUtil
.
countOffset
(
pageCurrent
,
pageSize
));
example
.
setPageSize
(
pageSize
);
return
new
Page
<
FileStorage
>(
count
,
totalPage
,
pageCurrent
,
pageSize
,
this
.
fileStorageMapper
.
selectByExample
(
example
));
}
}
\ No newline at end of file
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/dao/impl/mapper/FileStorageMapper.java
0 → 100644
浏览文件 @
79cf5a17
package
com.roncoo.education.course.service.dao.impl.mapper
;
import
com.roncoo.education.course.service.dao.impl.mapper.entity.FileStorage
;
import
com.roncoo.education.course.service.dao.impl.mapper.entity.FileStorageExample
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
@Mapper
public
interface
FileStorageMapper
{
int
countByExample
(
FileStorageExample
example
);
int
deleteByExample
(
FileStorageExample
example
);
int
deleteByPrimaryKey
(
Long
id
);
int
insert
(
FileStorage
record
);
int
insertSelective
(
FileStorage
record
);
List
<
FileStorage
>
selectByExample
(
FileStorageExample
example
);
FileStorage
selectByPrimaryKey
(
Long
id
);
int
updateByExampleSelective
(
@Param
(
"record"
)
FileStorage
record
,
@Param
(
"example"
)
FileStorageExample
example
);
int
updateByExample
(
@Param
(
"record"
)
FileStorage
record
,
@Param
(
"example"
)
FileStorageExample
example
);
int
updateByPrimaryKeySelective
(
FileStorage
record
);
int
updateByPrimaryKey
(
FileStorage
record
);
}
\ No newline at end of file
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/dao/impl/mapper/entity/FileStorage.java
0 → 100644
浏览文件 @
79cf5a17
package
com.roncoo.education.course.service.dao.impl.mapper.entity
;
import
java.io.Serializable
;
import
java.util.Date
;
public
class
FileStorage
implements
Serializable
{
private
Long
id
;
private
Date
gmtCreate
;
private
Long
fileNo
;
private
String
fileName
;
private
String
fileUrl
;
private
Integer
fileType
;
private
Long
fileSize
;
private
static
final
long
serialVersionUID
=
1L
;
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Date
getGmtCreate
()
{
return
gmtCreate
;
}
public
void
setGmtCreate
(
Date
gmtCreate
)
{
this
.
gmtCreate
=
gmtCreate
;
}
public
Long
getFileNo
()
{
return
fileNo
;
}
public
void
setFileNo
(
Long
fileNo
)
{
this
.
fileNo
=
fileNo
;
}
public
String
getFileName
()
{
return
fileName
;
}
public
void
setFileName
(
String
fileName
)
{
this
.
fileName
=
fileName
==
null
?
null
:
fileName
.
trim
();
}
public
String
getFileUrl
()
{
return
fileUrl
;
}
public
void
setFileUrl
(
String
fileUrl
)
{
this
.
fileUrl
=
fileUrl
==
null
?
null
:
fileUrl
.
trim
();
}
public
Integer
getFileType
()
{
return
fileType
;
}
public
void
setFileType
(
Integer
fileType
)
{
this
.
fileType
=
fileType
;
}
public
Long
getFileSize
()
{
return
fileSize
;
}
public
void
setFileSize
(
Long
fileSize
)
{
this
.
fileSize
=
fileSize
;
}
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
getClass
().
getSimpleName
());
sb
.
append
(
" ["
);
sb
.
append
(
"Hash = "
).
append
(
hashCode
());
sb
.
append
(
", id="
).
append
(
id
);
sb
.
append
(
", gmtCreate="
).
append
(
gmtCreate
);
sb
.
append
(
", fileNo="
).
append
(
fileNo
);
sb
.
append
(
", fileName="
).
append
(
fileName
);
sb
.
append
(
", fileUrl="
).
append
(
fileUrl
);
sb
.
append
(
", fileType="
).
append
(
fileType
);
sb
.
append
(
", fileSize="
).
append
(
fileSize
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
}
}
\ No newline at end of file
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/dao/impl/mapper/entity/FileStorageExample.java
0 → 100644
浏览文件 @
79cf5a17
此差异已折叠。
点击以展开。
roncoo-education-course/roncoo-education-course-service/src/main/resources/mybatis/FileStorageMapper.xml
0 → 100644
浏览文件 @
79cf5a17
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.roncoo.education.course.service.dao.impl.mapper.FileStorageMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.roncoo.education.course.service.dao.impl.mapper.entity.FileStorage"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"gmt_create"
property=
"gmtCreate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"file_no"
property=
"fileNo"
jdbcType=
"BIGINT"
/>
<result
column=
"file_name"
property=
"fileName"
jdbcType=
"VARCHAR"
/>
<result
column=
"file_url"
property=
"fileUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"file_type"
property=
"fileType"
jdbcType=
"TINYINT"
/>
<result
column=
"file_size"
property=
"fileSize"
jdbcType=
"BIGINT"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where
>
<foreach
collection=
"oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
suffix=
")"
prefixOverrides=
"and"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose
>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
collection=
"criterion.value"
item=
"listItem"
open=
"("
close=
")"
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Update_By_Example_Where_Clause"
>
<where
>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
suffix=
")"
prefixOverrides=
"and"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose
>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
collection=
"criterion.value"
item=
"listItem"
open=
"("
close=
")"
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Base_Column_List"
>
id, gmt_create, file_no, file_name, file_url, file_type, file_size
</sql>
<select
id=
"selectByExample"
resultMap=
"BaseResultMap"
parameterType=
"com.roncoo.education.course.service.dao.impl.mapper.entity.FileStorageExample"
>
select
<if
test=
"distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
from file_storage
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
<if
test=
"limitStart >= 0"
>
limit ${limitStart} , ${pageSize}
</if>
</select>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
select
<include
refid=
"Base_Column_List"
/>
from file_storage
where id = #{id,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from file_storage
where id = #{id,jdbcType=BIGINT}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"com.roncoo.education.course.service.dao.impl.mapper.entity.FileStorageExample"
>
delete from file_storage
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"com.roncoo.education.course.service.dao.impl.mapper.entity.FileStorage"
>
insert into file_storage (id, gmt_create, file_no,
file_name, file_url, file_type,
file_size)
values (#{id,jdbcType=BIGINT}, #{gmtCreate,jdbcType=TIMESTAMP}, #{fileNo,jdbcType=BIGINT},
#{fileName,jdbcType=VARCHAR}, #{fileUrl,jdbcType=VARCHAR}, #{fileType,jdbcType=TINYINT},
#{fileSize,jdbcType=BIGINT})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.roncoo.education.course.service.dao.impl.mapper.entity.FileStorage"
>
insert into file_storage
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"gmtCreate != null"
>
gmt_create,
</if>
<if
test=
"fileNo != null"
>
file_no,
</if>
<if
test=
"fileName != null"
>
file_name,
</if>
<if
test=
"fileUrl != null"
>
file_url,
</if>
<if
test=
"fileType != null"
>
file_type,
</if>
<if
test=
"fileSize != null"
>
file_size,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=BIGINT},
</if>
<if
test=
"gmtCreate != null"
>
#{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if
test=
"fileNo != null"
>
#{fileNo,jdbcType=BIGINT},
</if>
<if
test=
"fileName != null"
>
#{fileName,jdbcType=VARCHAR},
</if>
<if
test=
"fileUrl != null"
>
#{fileUrl,jdbcType=VARCHAR},
</if>
<if
test=
"fileType != null"
>
#{fileType,jdbcType=TINYINT},
</if>
<if
test=
"fileSize != null"
>
#{fileSize,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.roncoo.education.course.service.dao.impl.mapper.entity.FileStorageExample"
resultType=
"java.lang.Integer"
>
select count(*) from file_storage
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
update file_storage
<set
>
<if
test=
"record.id != null"
>
id = #{record.id,jdbcType=BIGINT},
</if>
<if
test=
"record.gmtCreate != null"
>
gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.fileNo != null"
>
file_no = #{record.fileNo,jdbcType=BIGINT},
</if>
<if
test=
"record.fileName != null"
>
file_name = #{record.fileName,jdbcType=VARCHAR},
</if>
<if
test=
"record.fileUrl != null"
>
file_url = #{record.fileUrl,jdbcType=VARCHAR},
</if>
<if
test=
"record.fileType != null"
>
file_type = #{record.fileType,jdbcType=TINYINT},
</if>
<if
test=
"record.fileSize != null"
>
file_size = #{record.fileSize,jdbcType=BIGINT},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByExample"
parameterType=
"map"
>
update file_storage
set id = #{record.id,jdbcType=BIGINT},
gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP},
file_no = #{record.fileNo,jdbcType=BIGINT},
file_name = #{record.fileName,jdbcType=VARCHAR},
file_url = #{record.fileUrl,jdbcType=VARCHAR},
file_type = #{record.fileType,jdbcType=TINYINT},
file_size = #{record.fileSize,jdbcType=BIGINT}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.roncoo.education.course.service.dao.impl.mapper.entity.FileStorage"
>
update file_storage
<set
>
<if
test=
"gmtCreate != null"
>
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if
test=
"fileNo != null"
>
file_no = #{fileNo,jdbcType=BIGINT},
</if>
<if
test=
"fileName != null"
>
file_name = #{fileName,jdbcType=VARCHAR},
</if>
<if
test=
"fileUrl != null"
>
file_url = #{fileUrl,jdbcType=VARCHAR},
</if>
<if
test=
"fileType != null"
>
file_type = #{fileType,jdbcType=TINYINT},
</if>
<if
test=
"fileSize != null"
>
file_size = #{fileSize,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.roncoo.education.course.service.dao.impl.mapper.entity.FileStorage"
>
update file_storage
set gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
file_no = #{fileNo,jdbcType=BIGINT},
file_name = #{fileName,jdbcType=VARCHAR},
file_url = #{fileUrl,jdbcType=VARCHAR},
file_type = #{fileType,jdbcType=TINYINT},
file_size = #{fileSize,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
roncoo-education-util/src/main/java/com/roncoo/education/util/config/SystemUtil.java
浏览文件 @
79cf5a17
...
...
@@ -40,7 +40,7 @@ public final class SystemUtil {
public
static
final
String
RONCOO_PAY_NOTIFY
=
getProperty
(
"roncoo_pay_notify"
);
public
static
final
String
WEIXIN_PAY_NOTIFY
=
getProperty
(
"weixin_pay_notify"
);
public
static
final
String
ALI_PAY_NOTIFY
=
getProperty
(
"ali_pay_notify"
);
public
static
final
String
POLYV_GETCATAURL
=
getProperty
(
"polyv_getCataUrl"
);
public
static
final
String
POLYV_UPLOADVIDEO
=
getProperty
(
"polyv_uploadVideo"
);
public
static
final
String
POLYV_CHANGECATAURL
=
getProperty
(
"polyv_changeCataUrl"
);
...
...
@@ -51,8 +51,11 @@ public final class SystemUtil {
public
static
final
String
POLYV_GETTOKEN
=
getProperty
(
"polyv_getToken"
);
public
static
final
String
LECTURER_DEFAULT_PROPORTION
=
getProperty
(
"lecturer_default_proportion"
);
public
static
final
String
CONTENT_LENGTH
=
getProperty
(
"content_length"
);
public
static
final
String
TEST_COURSE
=
getProperty
(
"test_course"
);
public
static
final
String
DOC_STORAGE_PATH
=
getProperty
(
"doc_storage_path"
);
public
static
final
String
PIC_STORAGE_PATH
=
getProperty
(
"pic_storage_path"
);
}
roncoo-education-util/src/main/java/com/roncoo/education/util/enums/FileStorageTypeEnum.java
0 → 100644
浏览文件 @
79cf5a17
/**
* Copyright 2015-现在 广州市领课网络科技有限公司
*/
package
com.roncoo.education.util.enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
/**
* @author YZJ
*/
@Getter
@AllArgsConstructor
public
enum
FileStorageTypeEnum
{
DOC
(
1
,
"附件"
),
PICTURE
(
2
,
"图片"
),
VIDEO
(
3
,
"视频"
);
private
Integer
code
;
private
String
desc
;
}
roncoo-education-util/src/main/java/com/roncoo/education/util/enums/FileTypeEnum.java
浏览文件 @
79cf5a17
...
...
@@ -13,10 +13,10 @@ import lombok.Getter;
@AllArgsConstructor
public
enum
FileTypeEnum
{
ALIYUN
(
1
,
"阿里云"
),
QINIU
(
2
,
"七牛"
);
ALIYUN
(
1
,
"阿里云"
),
QINIU
(
2
,
"七牛"
)
,
LOCAL
(
3
,
"本地"
)
;
private
Integer
code
;
private
Integer
code
;
private
String
desc
;
private
String
desc
;
}
roncoo-education-util/src/main/java/com/roncoo/education/util/enums/VideoTypeEnum.java
浏览文件 @
79cf5a17
...
...
@@ -13,10 +13,10 @@ import lombok.Getter;
@AllArgsConstructor
public
enum
VideoTypeEnum
{
POLYV
(
1
,
"保利威视"
),
QINIU
(
2
,
"七牛"
);
POLYV
(
1
,
"保利威视"
),
QINIU
(
2
,
"七牛"
)
,
LOCAL
(
3
,
"本地"
)
;
private
Integer
code
;
private
Integer
code
;
private
String
desc
;
private
String
desc
;
}
roncoo-education-util/src/main/resources/system.properties
浏览文件 @
79cf5a17
...
...
@@ -24,4 +24,7 @@ lecturer_default_proportion=0.7000
content_length
=
5000
#测试课程id
test_course
=
1085453180200448002
\ No newline at end of file
test_course
=
1085453180200448002
doc_storage_path
=
D:/RonCoo/doc/
pic_storage_path
=
D:/RonCoo/pic/
\ No newline at end of file
roncoo-education-web-boss/src/main/resources/bootstrap.properties
浏览文件 @
79cf5a17
# info
info.eureka.host01
=
192.168.1.181
info.eureka.host02
=
192.168.1.181
info.eureka.host01
=
localhost
info.eureka.port01
=
5761
info.eureka.port02
=
5762
# profile
spring.profiles.active
=
dev
# eureka
eureka.client.serviceUrl.defaultZone
=
http://${info.eureka.host01}:${info.eureka.port01}/eureka/
,http://${info.eureka.host02}:${info.eureka.port02}/eureka/
eureka.client.serviceUrl.defaultZone
=
http://${info.eureka.host01}:${info.eureka.port01}/eureka/
# server
server.port
=
5880
...
...
roncoo-education-web-boss/src/main/resources/templates/system/sys/set.ftl
浏览文件 @
79cf5a17
...
...
@@ -16,6 +16,7 @@
<#else>
<input type="radio" name="videoType" value="1" data-toggle="icheck" checked="checked" data-label="保利威视" size="20">
<input type="radio" name="videoType" value="2" data-toggle="icheck" data-label="七牛" size="20">
<input type="radio" name="videoType" value="3" data-toggle="icheck" data-label="本地" size="20" checked="checked">
</#if>
</div>
<br />
...
...
@@ -49,6 +50,7 @@
<#else>
<input type="radio" name="fileType" value="1" data-toggle="icheck" checked="checked" data-label="阿里云" size="20">
<input type="radio" name="fileType" value="2" data-toggle="icheck" data-label="七牛" size="20">
<input type="radio" name="fileType" value="3" data-toggle="icheck" data-label="本地" size="20" checked="checked">
</#if>
</div>
<br />
...
...
@@ -59,6 +61,7 @@
<label class="control-label x120">ossBucket:</label>
<input type="text" name="aliyunOssBucket" value="<#if bean??>${bean.aliyunOssBucket!}</#if>" placeholder="accessKeySecret" size="20">
</div>
<br />
<div class="form-group">
<label class="control-label x150">smsCode:</label>
<input type="text" name="smsCode" value="<#if bean??>${bean.smsCode!}</#if>" placeholder="smsCode" size="20">
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录