该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Learn Online

Project function to be developed

  • 基础Api开发
  • OOS三方接口接入
  • SpringCloud Ali全家桶接入 + 熔断 + 事务TTL

System basic configuration environment

  1. Modify the local host to match the local domain name

    CD C:\Windows\System32\drivers\etc
    127.0.0.1 www.51xuecheng.cn 51xuecheng.cn ucenter.51xuecheng.cn teacher.51xuecheng.cn file.51xuecheng.cn
    
  2. Open Nginx configuration

    1. Modify the upstream of your own Nginx
    2. Match static resource path
    3. Execute nginx
http {
	server_names_hash_bucket_size 64;
    include       mime.types;
    default_type  application/octet-stream;
	
    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;
	client_max_body_size 20m;
    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;
	
 #文件服务
  upstream fileserver{
    server 1.117.60.49:9000 weight=10;
  } 
   #后台网关
  upstream gatewayserver{
    server 127.0.0.1:63010 weight=10;
  } 
   #前端开发服务
  upstream uidevserver{
    server 127.0.0.1:8601 weight=10;
  } 

		#主页面代理
      server {
        listen       80;
        server_name  www.51xuecheng.cn localhost;
        #rewrite ^(.*) https://$server_name$1 permanent;
        #charset koi8-r;
        ssi on;
		
        ssi_silent_errors on;
        #access_log  logs/host.access.log  main;

        location / {
            alias   P:/AllStackStudy/xuecheng/xc-ui-pc-static-portal/;
            index  index.html index.htm;
        }

		#api nginx分发
        location /api/ {
                proxy_pass http://gatewayserver/;
        } 
        #openapi
        location /open/content/ {
                proxy_pass http://gatewayserver/content/open/;
        } 
        location /open/media/ {
                proxy_pass http://gatewayserver/media/open/;
        } 
        location /course/ {  
                proxy_pass http://fileserver/mediafiles/course/;
        } 
        #静态资源
        location /static/img/ {
                alias  P:/AllStackStudy/xuecheng/xc-ui-pc-static-portal/img/;
        } 
        location /static/css/ {  
                alias   P:/AllStackStudy/xuecheng/xc-ui-pc-static-portal/css/;
        } 
        location /static/js/ {  
                alias   P:/AllStackStudy/xuecheng/xc-ui-pc-static-portal/js/;
        } 
        location /static/plugins/ {  
                alias   P:/AllStackStudy/xuecheng/xc-ui-pc-static-portal/plugins/;
                add_header Access-Control-Allow-Origin http://ucenter.51xuecheng.cn;  
                add_header Access-Control-Allow-Credentials true;  
                add_header Access-Control-Allow-Methods GET;
        } 
        location /plugins/ {  
                alias   P:/AllStackStudy/xuecheng/xc-ui-pc-static-portal/plugins/;
        } 

        location /course/preview/learning.html {
                alias P:/AllStackStudy/xuecheng/xc-ui-pc-static-portal/course/learning.html;
        } 
        location /course/search.html {  
                root   P:/AllStackStudy/xuecheng/xc-ui-pc-static-portal;
        } 
        location /course/learning.html {  
                root   P:/AllStackStudy/xuecheng/xc-ui-pc-static-portal;
        } 
       
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
	
	#教师模块
	server {
        listen       80;
        server_name  teacher.51xuecheng.cn;
        #charset koi8-r;
        ssi on;
        ssi_silent_errors on;
        #access_log  logs/host.access.log  main;
        #location / {
         #   alias   D:/itcast2022/xc_edu3.0/code_1/dist/;
         #   index  index.html index.htm;
        #}
        location / {
            proxy_pass   http://uidevserver;
        }

        location /api/ {
                proxy_pass http://gatewayserver/;
        } 
   }
	#用户中心
	server {
        listen       80;
        server_name  ucenter.51xuecheng.cn;
        #charset koi8-r;
        ssi on;
        ssi_silent_errors on;
        #access_log  logs/host.access.log  main;
        location / {
            alias   D:/itcast2022/xc_edu3.0/code_1/xc-ui-pc-static-portal/ucenter/;
            index  index.html index.htm;
        }
        location /include {
            proxy_pass   http://127.0.0.1;
        }
        location /img/ {
            proxy_pass   http://127.0.0.1/static/img/;
        }
        location /api/ {
                proxy_pass http://gatewayserver/;
        } 
   }
   #文件上传
   server {
        listen       80;
        server_name  file.51xuecheng.cn;
        #charset koi8-r;
        ssi on;
        ssi_silent_errors on;
        #access_log  logs/host.access.log  main;
        location /video {
            proxy_pass   http://fileserver;
        }

        location /mediafiles {
            proxy_pass   http://fileserver;
        }
   }
}
  • Elastic 数据在 EsDataTest.java进行预加载

Docker-compose

TODO
  • 由于本项目没有提供人工审核接口 如果点击审核之后需要把数据库的 course_base中的audit_status 与 course_publish_pre 中的status中202003修改为202004
  • 上述操作即为人工审核通过

Extended writing

  • In the message publishing function module, two methods are provided to solve the problem of storing in the cache!
  • Locate Package Name===> MessageProcessAbstract | PublishConsumer
    • Use RabbitMQ message queue for asynchronous consumption and deposit of courses (this method does not need to pay too much attention to idempotence issues FIFO consumption) + artificial ACK mechanism
    • Use design pattern + strategy and distributed task scheduling (and use delay, discarding strategy) to solve the idempotence problem caused by storing in the cache (this method uses multithreading + task scheduling)

空文件

简介

微服务 服务治理 分布式文件管理系统 消息队列 OSS alibaba Cloud seate分布式事务 支付宝沙箱支付 展开 收起
JavaScript 等 6 种语言
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化