mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-11 03:46:50 +08:00
'pageadd'
This commit is contained in:
103
modules/boe-module-course/pom.xml
Normal file
103
modules/boe-module-course/pom.xml
Normal file
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.xboe</groupId>
|
||||
<artifactId>module</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<!--<relativePath>../..</relativePath> -->
|
||||
</parent>
|
||||
<artifactId>xboe-module-course</artifactId>
|
||||
<name>xboe-module-course</name>
|
||||
<packaging>jar</packaging>
|
||||
<description>课程相关的处理</description>
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.xboe</groupId>
|
||||
<artifactId>xboe-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-text</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-beans</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-aop</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-jpa</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-aspects</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 以下几项和jdk有关 -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jdk8</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.module</groupId>
|
||||
<artifactId>jackson-module-parameter-names</artifactId>
|
||||
</dependency>
|
||||
<!-- log -->
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-to-slf4j</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.xboe.module.course.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 课程的全文检索索引
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class CourseFullText {
|
||||
|
||||
/**id,对于原系统是kid*/
|
||||
private String id;
|
||||
|
||||
/**es中的id*/
|
||||
private String esId;
|
||||
|
||||
/**名称*/
|
||||
private String name;
|
||||
|
||||
|
||||
/**来源,1表来源老系统,2表来源新系统*/
|
||||
private Integer source;
|
||||
|
||||
private String keywords;
|
||||
|
||||
private String summary;
|
||||
|
||||
/**10无目录录播课,20 有目录录播课,30:面授课;40学习项目*/
|
||||
private Integer type;
|
||||
/**多个时用到*/
|
||||
private String types;
|
||||
|
||||
/**原系统的企业id,对应sass模式的字段*/
|
||||
private String companyId;
|
||||
|
||||
/**封面图片*/
|
||||
private String coverImg;
|
||||
|
||||
/**课程的评分*/
|
||||
private Float score;
|
||||
|
||||
/**学习人数*/
|
||||
private Integer studies;
|
||||
|
||||
/** 格式化学习人数 **/
|
||||
private Integer studiesFormat;
|
||||
|
||||
private String teacher;
|
||||
|
||||
private String teacherCode;
|
||||
|
||||
/**发布时间*/
|
||||
private Long publishTime;
|
||||
|
||||
/**课程的时长,秒*/
|
||||
private Integer duration;
|
||||
|
||||
/**是否置顶*/
|
||||
private Integer isTop;
|
||||
|
||||
/**置顶时间*/
|
||||
private Long topTime;
|
||||
|
||||
/**系统的一级*/
|
||||
private String sysType1;
|
||||
|
||||
/**系统的二级*/
|
||||
private String sysType2;
|
||||
|
||||
/**系统的三级*/
|
||||
private String sysType3;
|
||||
|
||||
/**课程的标签*/
|
||||
private String tags;
|
||||
|
||||
/**
|
||||
* 是否有受众
|
||||
*/
|
||||
private Integer isSetAudience;
|
||||
|
||||
/**受众,受众的id,多个使用逗号分隔*/
|
||||
//private String audience;
|
||||
|
||||
private String[] audiences;
|
||||
|
||||
/**资源归属*/
|
||||
private String resOwner;
|
||||
|
||||
/**新系统无此字段*/
|
||||
private Integer startTime;
|
||||
|
||||
/**新系统无此字段*/
|
||||
private Integer endTime;
|
||||
|
||||
/**创建*/
|
||||
private Long createdAt;
|
||||
|
||||
/***/
|
||||
private String domainIds;
|
||||
|
||||
/**用于查询*/
|
||||
private Integer maxDuration;
|
||||
|
||||
/**用于查询排序处理,1表最新,2表最热,不做存储*/
|
||||
private Integer orderType;
|
||||
|
||||
/**设备 1:PC端可见;2:移动端可见;3:多端可见*/
|
||||
private Integer device;
|
||||
|
||||
/**
|
||||
* 是否公开课,0表非公开课,1表公开课
|
||||
*/
|
||||
private Integer openCourse;
|
||||
|
||||
/**
|
||||
* 是否公开0表非公开报名,1表公开报名-字段需新增,按管理端需求增加
|
||||
*/
|
||||
private Integer openEnroll;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.xboe.module.course.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 课程学习的传输类
|
||||
*/
|
||||
@Data
|
||||
public class CourseStudyDto {
|
||||
|
||||
/**id,系统中标识的学习记录id,本地就是studyId*/
|
||||
private String id;
|
||||
|
||||
/**es中的id*/
|
||||
private String esId;
|
||||
|
||||
/**用户账号的id*/
|
||||
private String accountId;
|
||||
|
||||
/**课程的id*/
|
||||
private String courseId;
|
||||
|
||||
/**课程类型,10无目录录播课,20 有目录录播课,30:面授课;40学习项目*/
|
||||
private Integer courseType;
|
||||
|
||||
/**课程的名称*/
|
||||
private String courseName;
|
||||
|
||||
/**课程的图片*/
|
||||
private String courseImage;
|
||||
|
||||
/**课程来源,1表老系统,2表学员端,3表管理端*/
|
||||
private Integer source;
|
||||
|
||||
/**报名时间,时间秒*/
|
||||
private Long startTime;
|
||||
|
||||
/**状态,1表未开始,2表进行中,9表已完成*/
|
||||
private Integer status;
|
||||
|
||||
/**学习进度0-100的值*/
|
||||
private Integer progress;
|
||||
|
||||
/**
|
||||
* 10-报名未审核 20-报名被拒绝 30-报名审核通过-字段新,应管理端需求增加
|
||||
*/
|
||||
private Integer applyStatus;
|
||||
|
||||
/**
|
||||
* 应管理端需求,增加上课时间
|
||||
*/
|
||||
private Long attendCourseTime;
|
||||
|
||||
/**
|
||||
* 应管理端需求,增加面授地点
|
||||
*/
|
||||
private String courseAddress;
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.xboe.module.course.service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import com.xboe.common.PageList;
|
||||
import com.xboe.module.course.dto.CourseFullText;
|
||||
|
||||
/**
|
||||
* 课程的全文检索
|
||||
*/
|
||||
public interface ICourseFullTextSearch {
|
||||
|
||||
/**
|
||||
* 默认索引名称
|
||||
*/
|
||||
public static final String DEFAULT_INDEX_NAME="new_resource_list";
|
||||
|
||||
/**
|
||||
* 发布课程
|
||||
* @param indexName
|
||||
* @param cf
|
||||
* @return
|
||||
*/
|
||||
String publish(String indexName,CourseFullText cf) throws Exception;
|
||||
|
||||
/**
|
||||
* 更新或重新发布
|
||||
* @param indexName
|
||||
* @param cf
|
||||
* @param fullTextId
|
||||
*/
|
||||
String republish(String indexName, CourseFullText cf, String fullTextId) throws Exception;
|
||||
|
||||
/**
|
||||
* 检查文档是否存在
|
||||
* @param indexName
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
boolean checkHas(String indexName,String id);
|
||||
|
||||
|
||||
boolean reCreateIndex(String indexName) throws Exception;
|
||||
|
||||
/**
|
||||
* 更新一个字段
|
||||
* @param indexName
|
||||
* @param field
|
||||
* @param value
|
||||
* @param fullTextId
|
||||
*/
|
||||
void updateField(String indexName, String field,Object value, String fullTextId) throws Exception;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 移除全文检索
|
||||
* @param indexName
|
||||
* @param id
|
||||
*/
|
||||
void removeByDocId(String indexName,String id) throws Exception;
|
||||
|
||||
|
||||
boolean deleteById(String indexName, String id) throws IOException;
|
||||
|
||||
// /**
|
||||
// * 重新发布到全文检索
|
||||
// * @param indexName
|
||||
// * @param item
|
||||
// * @param fullTextItemId
|
||||
// */
|
||||
// void republish(String indexName,CourseFullText item,String fullTextItemId);
|
||||
|
||||
/**
|
||||
* 不分页的全文检索
|
||||
* @param indexName
|
||||
* @param num
|
||||
* @param keyword
|
||||
* @return
|
||||
*/
|
||||
List<CourseFullText> search(String indexName,int num,CourseFullText paras) throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
** 分页搜索
|
||||
* @param indexName
|
||||
* @param startRow
|
||||
* @param pageSize
|
||||
* @param keyword
|
||||
* @return
|
||||
*/
|
||||
PageList<CourseFullText> search(String indexName,int startRow,int pageSize,CourseFullText paras) throws Exception;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.xboe.module.course.service;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.xboe.common.PageList;
|
||||
import com.xboe.module.course.dto.CourseStudyDto;
|
||||
|
||||
/**
|
||||
*
|
||||
* 课程学习查询
|
||||
* @author seastar
|
||||
*
|
||||
*/
|
||||
public interface ICourseStudySearch {
|
||||
|
||||
/**
|
||||
* 索引名称,固定的值
|
||||
*/
|
||||
public static final String IndexName="new_study_resource";
|
||||
|
||||
/**
|
||||
* 创建索引
|
||||
* @param indexName
|
||||
*/
|
||||
void createIndex() throws Exception;
|
||||
|
||||
/**
|
||||
* 删除索引
|
||||
* @param indexName
|
||||
*/
|
||||
void deleteIndex();
|
||||
|
||||
/**
|
||||
* 发布学习课程,如果存在就更新,不存在就添加
|
||||
* @param dto
|
||||
* @param docId
|
||||
*/
|
||||
String publishOrUpdate(CourseStudyDto dto,String docId) throws IOException;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param startRow
|
||||
* @param pageSize
|
||||
* @param dto
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
PageList<CourseStudyDto> search(int startRow, int pageSize, CourseStudyDto dto) throws Exception;
|
||||
|
||||
/**
|
||||
* 更新字段
|
||||
* @param field
|
||||
* @param value
|
||||
* @param docId
|
||||
* @throws Exception
|
||||
*/
|
||||
void updateFieldByDocId(String field,Object value, String docId) throws Exception;
|
||||
|
||||
/**
|
||||
* 更新状态和进度
|
||||
* @param docId
|
||||
* @param status
|
||||
* @param process
|
||||
* @throws Exception
|
||||
*/
|
||||
void updateStatusAndProcessByDocId(String docId,int status,int process) throws Exception;
|
||||
|
||||
/**
|
||||
* 移除课程
|
||||
* @param id
|
||||
* @throws Exception
|
||||
*/
|
||||
void removeByDocId(String id) throws Exception;
|
||||
|
||||
/**
|
||||
* 根据学习id删除
|
||||
* @param id
|
||||
* @throws Exception
|
||||
*/
|
||||
void removeByStudyId(String id);
|
||||
}
|
||||
Reference in New Issue
Block a user