Commit 07cef8ea authored by luzhuang's avatar luzhuang

bfile

parent dcf4e070
......@@ -104,43 +104,21 @@ public class BFileController extends PaginationController<BFile> {
@ApiOperation(value="上传文件", notes="上传文件")
@ApiImplicitParams({@ApiImplicitParam(name = "chapterId", value = "章节ID", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "lessonId", value = "课程ID", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "type", value = "'0'为视频,'1'为附件,'2'为ppt,'3'为pdf", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "type", value = "0视频 1音频 2ppt 3pdf 4附件", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "lessonId", value = "章节所在课程名", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "file", value = "视频文件", required = true, dataType = "MultipartFile")})
@PostMapping(value = "/uploadVideo")
public Result uploadVideo(BFile bFile, HttpServletRequest request) {
List<MultipartFile> list = ((MultipartHttpServletRequest)request).getFiles("file");
String videoUrl = bFileService.uploadVideoToServer(list, bFile);
return Result.builder(new PersistModel(1),
"上传成功",
MessageConstant.MESSAGE_ALERT_ERROR,
videoUrl);
}
// @ApiOperation(value="上传license", notes="上传license证书文件")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "file", value = "license文件", required = true, dataType = "MultipartFile")})
// @PostMapping(value = "/uploadLicenseWithoutAuth")
// public Result uploadLicense(HttpServletRequest request) {
// List<MultipartFile> list = ((MultipartHttpServletRequest)request).getFiles("file");
// try {
// if(list.size()>0){
// bFileService.uploadLicense(list.get(0));
// }else{
// throw new ServiceException(ResultServiceEnums.UPLOAD_ERROR);
// }
//
// } catch (IOException e) {
// e.printStackTrace();
// throw new ServiceException(ResultServiceEnums.UPLOAD_ERROR);
// }
// return Result.builder(new PersistModel(1),
// "license上传成功",
// MessageConstant.MESSAGE_ALERT_ERROR,
// "");
// }
/**
* 下载文件
* @param chapterId
......
package org.rcisoft.business.bfile.dao;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.*;
import org.rcisoft.business.bchapter.entity.BChapter;
import org.rcisoft.business.bcourse.entity.BCourse;
import org.rcisoft.business.bfile.entity.BFile;
import org.rcisoft.core.base.BaseMapper;
import org.springframework.stereotype.Repository;
......@@ -15,6 +15,16 @@ import java.util.Map;
*/
@Repository
public interface BFileRepository extends BaseMapper<BFile> {
@Update("UPDATE b_chapter set course_time = #{time} where business_id =#{id}")
int updateVideoTimeInChapter(@Param("time") String time,@Param("id") String id);
@Update("UPDATE b_lesson set course_time = #{time} where business_id =#{id}")
int updateVideoTimeInLesson(@Param("time") String time,@Param("id") String id);
@Select("SELECT business_id FROM b_chapter WHERE" +
"pid = ( SELECT business_id FROM b_chapter WHERE lesson_id = #{lessonId} AND chapter_level = '1' AND del_flag != 1 AND flag = 1 ORDER BY sort LIMIT 1 ) " +
"ORDER BY sort LIMIT 1")
String getFirstChapter(@Param("lessonId") String lessonId);
/**
* 根据条件查找
......
......@@ -43,7 +43,9 @@ public class SysUserController extends PaginationController<SysUser> {
private Global global;
@ApiOperation(value = "分页查询用户", notes = "分页查询用户")
@ApiImplicitParam(name = "agencyCode", value = "教学单位Code", required = false, dataType = "varchar")
@ApiImplicitParams({ @ApiImplicitParam(name = "name", value = "用户名(模糊查询条件)", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "flag", value = "用户启用状态 0未启用 1启用", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "roleName", value = "用户角色", required = false, dataType = "varchar")})
@GetMapping(value = "/queryUsers")
public GridModel queryUsers(CurUser curUser, @Valid SysUser sysUser, BindingResult br) {
userServiceImpl.queryUsersByPagination(getPaginationUtility(), sysUser);
......
......@@ -23,6 +23,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
"left join s_role as sr on ru.role_id = sr.business_id " +
"where su.del_flag = 0"+
"<if test=\"name!=null and name != ''\"> and su.name like CONCAT('%',#{name},'%') </if>" +
"<if test=\"roleName!=null and roleName != ''\"> and sr.role_name = #{roleName}</if>" +
"<if test=\"flag!=null and flag != ''\"> and su.flag = #{flag}</if></script>")
@ResultMap(value = "BaseResultMap")
List<SysUser> queryUsers(SysUser sysUser);
......
......@@ -54,6 +54,10 @@ spring:
charset: UTF-8
suffix: .ftl
template-loader-path: classpath:/templates/
servlet:
multipart:
max-file-size: 10MB
max-request-size: 100MB
global:
default_location:
......
......@@ -12,6 +12,7 @@
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="video_name" jdbcType="VARCHAR" property="videoName"/>
<result column="video_url" jdbcType="VARCHAR" property="videoUrl"/>
<result column="audio_url" jdbcType="VARCHAR" property="audioUrl"/>
<result column="file_url" jdbcType="VARCHAR" property="fileUrl"/>
<result column="ppt_url" jdbcType="VARCHAR" property="pptUrl"/>
<result column="pdf_url" jdbcType="VARCHAR" property="pdfUrl"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment