Requirement Analysis of 2.1 Learning Page for Acquiring Video Play Address
Users enter the online learning page and click on the course plan to play the corresponding teaching video of the course plan.
The business process is as follows:
Business process description:
1. The user enters the online learning page, and the page requests the search service to obtain the course information (including the course plan information) and display it on the page.
2. Online learning requests learning service to get video playback address.
3. Learning service verifies whether the current user has permission to learn, and prompts the user if there is no permission to learn.
4. The learning service is checked and the search service is requested to obtain the course media information.
5. Search service requests Elastic Search to obtain course media information.
Why do you ask Elastic Search for information about course media?
For performance reasons, course information is queried publicly from search service.
When will the course media information be stored in Elastic Search?
Course media information is stored in Elastic Search when the course is released, because the course information will not be modified after the course is released.
2.2 Course Release Storage Media Information
2.2.1 Demand Analysis
Course media information is stored in the Elastic Search index database when the course is released, because the course information will not be modified after the course is released, the specific business process is as follows.
The business process is as follows:
1. Publish the course and write the data to the course media information sheet.
1) Delete data from teachplan Media Pub according to course id
2) Query teachplan Media data according to course id
3) Insert the queried teachplan Media data into teachplan Media Pub
2. Logstash scans the course media information table regularly and writes the course media information into the index database.
2.2.2 Data Model
Create a course plan media release form in xc_course database:
[mw_shl_code=applescript,true]CREATE TABLE `teachplan_media_pub` ( `teachplan_id` varchar(32) NOT NULL COMMENT 'Course plan id', `media_id` varchar(32) NOT NULL COMMENT 'Media documents id', `media_fileoriginalname` varchar(128) NOT NULL COMMENT 'Original Name of Media Document', `media_url` varchar(256) NOT NULL COMMENT 'Media Document Access Address', `courseid` varchar(32) NOT NULL COMMENT 'curriculum Id', `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'logstash Use', PRIMARY KEY (`teachplan_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8[/mw_shl_code]
The data model classes are as follows:
[mw_shl_code=applescript,true]@Data @ToString @Entity @Table(name="teachplan_media_pub") @GenericGenerator(name = "jpa‐assigned", strategy = "assigned") public class TeachplanMediaPub implements Serializable { private static final long serialVersionUID = ‐916357110051689485L; @Id @GeneratedValue(generator = "jpa‐assigned") @Column(name="teachplan_id") private String teachplanId; @Column(name="media_id") private String mediaId; @Column(name="media_fileoriginalname") private String mediaFileOriginalName; @Column(name="media_url") private String mediaUrl; @Column(name="courseid")[/mw_shl_code] [mw_shl_code=applescript,true]private String courseId; @Column(name="timestamp") private Date timestamp;//Timestamp} [/mw_shl_code]