国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

這篇具有很好參考價值的文章主要介紹了【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。


一、cloud組件

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

二、環(huán)境搭建

2.1 創(chuàng)建父工程

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

2.2 支付模塊構(gòu)建

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

2.3 消費者模塊構(gòu)建

2.3.1 引入RestTemplate

@Configuration
public class ApplicationContextConfig {
    // 配置bean 不然后面沒法依賴注入,就像以前ssm整合時配置依賴注入一樣,
    // 需要在配置文件配置之后,代碼中才可以依賴注入
    // 當(dāng)前文件就是spring的配置文件
    @Bean
//    @LoadBalanced //讓這個RestTemplate在請求時擁有客戶端負載均衡的能力  //將此注解注釋掉,使用自己的輪詢算法不使用默認的
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}

2.3.2 遠程調(diào)用支付模塊

@RestController
public class OrderController {

    public static final String PAYMENT_URL = "http://localhost:8001";

    public static final String PAYMENT_URL = "http://CLOUD-PAYMENT-SERVICE";

    @Resource
    private RestTemplate restTemplate;

    @GetMapping("/testRPC/{id}")
    public CommonResult<Payment> getPayment(@PathVariable("id") String id) {
        return restTemplate.getForObject(PAYMENT_URL + "/test/" + id, CommonResult.class);
    }
    
}

三、Eureka

3.1 基礎(chǔ)知識

前面我們沒有服務(wù)注冊中心,也可以服務(wù)間調(diào)用,為什么還要服務(wù)注冊?

當(dāng)服務(wù)很多時,單靠代碼手動管理是很麻煩的,需要一個公共組件,統(tǒng)一管理多服務(wù),包括服務(wù)是否正常運行,等

Eureka用于**服務(wù)注冊,目前官網(wǎng)已經(jīng)停止更新**

3.2 單機版Eureka安裝

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

創(chuàng)建項目cloud-eureka-server-7001

引入依賴

<dependencies>
    <!-- 服務(wù)注冊中心的服務(wù)端 eureka-server -->
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
    </dependency>
    
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
    </dependency>

</dependencies>

yml配置文件

server:
  port: 7001

# 單機版
eureka:
  instance:
    hostname: localhost  #eureka服務(wù)端的實例名字
  client:
    register-with-eureka: false    #表示不向注冊中心注冊自己
    fetch-registry: false   #表示自己就是注冊中心,職責(zé)是維護服務(wù)實例,并不需要去檢索服務(wù)
    service-url:
      #設(shè)置與eureka server交互的地址查詢服務(wù)和注冊服務(wù)都需要依賴這個地址
      defaultZone: http://${eureka.instance.hostname}:${server.port}

啟動類

/**
 * @author WSKH
 * @date 2020/12/19 14:12
 * @description 注冊中心
 */
@SpringBootApplication
@EnableEurekaServer // 啟動Eureka服務(wù)
public class CloudEurekaServer7001Application {
    public static void main(String[] args) {
        SpringApplication.run(CloudEurekaServer7001Application.class, args);
        System.out.println("啟動成功!");
    }
}

3.3 服務(wù)注冊

引入依賴

<!-- 服務(wù)注冊中心的客戶端端 eureka-client -->
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>

yaml配置

server:
  port: 8001

spring:
  application:
    name: cloud-payment-service
    
eureka:
  client:
    register-with-eureka: true #是否向注冊中心注冊自己
    fetchRegistry: true #是否從注冊中心抓取已有的注冊信息 默認true,集群必須設(shè)置為true
    service-url:
      #      設(shè)置與eureka server交互的地址查詢服務(wù)和注冊服務(wù)都需要依賴這個地址
            defaultZone: http://localhost:7001 #單機版
  instance:
    instance-id: payment8001
    prefer-ip-address: true  #訪問路徑可以顯示IP地址
#    Eureka客戶端向服務(wù)端發(fā)送心跳的時間間隔,單位為秒(默認是30秒)
#    lease-renewal-interval-in-seconds: 1
#    Eureka服務(wù)端在收到最后一次心跳后等待時間上限,單位為秒(默認是90秒),超時將剔除服務(wù)
#    lease-expiration-duration-in-seconds: 2

啟動類

@SpringBootApplication
@EnableEurekaClient // 指定成為Eureka客戶端
@EnableDiscoveryClient // 開啟服務(wù)發(fā)現(xiàn)
@Slf4j
public class CloudProviderPayment8001Application {
    public static void main(String[] args) {
        SpringApplication.run(CloudProviderPayment8001Application.class, args);
        log.info("cloud-provider-payment-8001 啟動成功!");
    }
}

3.4 Eureka集群

單機版注冊中心會出現(xiàn)單點故障,故一般都采用集群

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

兩臺或以上的Rureka互相注冊,相互守望,對外暴露端口

3.4.1 Eureka端配置

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

7001的yaml配置

server:
  port: 7001
  
#集群版
eureka:
  instance:
    hostname: eureka7001    #eureka服務(wù)端的實例名字(實際好像不起作用,DS Replicas是直接截取URL中冒號前面的部分,當(dāng)作隊友名,如http://localhost:7001,那就截取localhost當(dāng)作隊友名)
  client:
    register-with-eureka: false    #表示不向注冊中心注冊自己
    fetch-registry: false   #表示自己就是注冊中心,職責(zé)是維護服務(wù)實例,并不需要去檢索服務(wù)
    service-url:
      #設(shè)置與eureka server交互的地址查詢服務(wù)和注冊服務(wù)都需要依賴這個地址
#      defaultZone: http://eureka7001.com:7001
      defaultZone: http://localhost:7002  #這個是集群版開啟 互相注冊
#  server:
##    關(guān)閉自我保護機制,保證不可用服務(wù)被及時踢除
#    enable-self-preservation: false
#    eviction-interval-timer-in-ms: 2000

7002的yaml配置

server:
  port: 7002

#集群版
eureka:
  instance:
    hostname: eureka7002    #eureka服務(wù)端的實例名字(實際好像不起作用,DS Replicas是直接截取URL中冒號前面的部分,當(dāng)作隊友名,如http://localhost:7001,那就截取localhost當(dāng)作隊友名)
  client:
    register-with-eureka: false    #表識不向注冊中心注冊自己
    fetch-registry: false   #表示自己就是注冊中心,職責(zé)是維護服務(wù)實例,并不需要去檢索服務(wù)
    service-url:
      #設(shè)置與eureka server交互的地址查詢服務(wù)和注冊服務(wù)都需要依賴這個地址
      defaultZone: http://localhost:7001

3.4.2 微服務(wù)端配置

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

server:
  port: 80

spring:
  application:
    name: cloud-order-service

eureka:
  client:
    register-with-eureka: true #是否向注冊中心注冊自己
    fetchRegistry: true #是否從注冊中心抓取已有的注冊信息 默認true,集群必須設(shè)置為true
    service-url:
      #設(shè)置與eureka server交互的地址查詢服務(wù)和注冊服務(wù)都需要依賴這個地址
      defaultZone: http://localhost:7001,http://localhost:7002  #集群版

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

server:
  port: 8001

spring:
  application:
    name: cloud-payment-service

eureka:
  client:
    register-with-eureka: true #是否向注冊中心注冊自己
    fetchRegistry: true #是否從注冊中心抓取已有的注冊信息 默認true,集群必須設(shè)置為true
    service-url:
      #      設(shè)置與eureka server交互的地址查詢服務(wù)和注冊服務(wù)都需要依賴這個地址
      defaultZone: http://localhost:7001,http://localhost:7002  #集群版
  instance:
    instance-id: payment8001
    prefer-ip-address: true  #訪問路徑可以顯示IP地址
#    Eureka客戶端向服務(wù)端發(fā)送心跳的時間間隔,單位為秒(默認是30秒)
#    lease-renewal-interval-in-seconds: 1
#    Eureka服務(wù)端在收到最后一次心跳后等待時間上限,單位為秒(默認是90秒),超時將剔除服務(wù)
#    lease-expiration-duration-in-seconds: 2

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

3.4.3 restTemplate負載均衡

加入@LoadBalanced注解即可開啟負載均衡

@Configuration
public class ApplicationContextConfig {

    // 配置bean 不然后面沒法依賴注入,就像以前ssm整合時配置依賴注入一樣,
    // 需要在配置文件配置之后,代碼中才可以依賴注入
    // 當(dāng)前文件就是spring的配置文件
    @Bean
    @LoadBalanced //讓這個RestTemplate在請求時擁有客戶端負載均衡的能力  //將此注解注釋掉,使用自己的輪詢算法不使用默認的
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}

測試

@RestController
public class OrderController {

    // http://服務(wù)名大寫
    public static final String PAYMENT_URL = "http://CLOUD-PAYMENT-SERVICE";

    @Resource
    private RestTemplate restTemplate;

    @GetMapping("/testLoadBalancedRpc/{id}")
    public CommonResult<Payment> testLoadBalancedRpc(@PathVariable("id") String id) {
        return restTemplate.getForObject(PAYMENT_URL + "/test/"+id, CommonResult.class);
    }

}

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

最后發(fā)送請求 http://127.0.0.1:80/testLoadBalancedRpc/id=123 進行測試

發(fā)現(xiàn)會自動均衡地訪問8001和8002

3.4.4 主機名修改和ip地址顯示

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

3.5 服務(wù)發(fā)現(xiàn)Discovery

開啟服務(wù)發(fā)現(xiàn)

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

使用DiscoveryClient完成服務(wù)發(fā)現(xiàn)

// 注入DiscoveryClient對象
@Resource
DiscoveryClient discoveryClient;

@GetMapping("/testDiscoveryClient")
public void testDiscoveryClient(){
    // 從注冊中心獲取所有服務(wù)的名稱
    List<String> services = discoveryClient.getServices();
    services.forEach(System.out::println);
    // 根據(jù)服務(wù)名稱找到其下的所有實例
    List<ServiceInstance> instances = discoveryClient.getInstances("CLOUD-PAYMENT-SERVICE");
    // 遍歷輸出實例信息
    instances.forEach(instance -> {
        System.out.println(instance.getServiceId() + "\t" + instance.getHost() + "\t" + instance.getPort() + "\t" + instance.getUri());
    });
}

測試 http://127.0.0.1:8001/testDiscoveryClient

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

3.6 Rureka自我保護機制

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

3.7 禁止Eureka自我保護

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

#集群版
eureka:
  instance:
    hostname: eureka7001    #eureka服務(wù)端的實例名字
  client:
    register-with-eureka: false    #表示不向注冊中心注冊自己
    fetch-registry: false   #表示自己就是注冊中心,職責(zé)是維護服務(wù)實例,并不需要去檢索服務(wù)
    service-url:
      #設(shè)置與eureka server交互的地址查詢服務(wù)和注冊服務(wù)都需要依賴這個地址
#      defaultZone: http://eureka7001.com:7001/eureka/
      defaultZone: http://localhost:7002  #這個是集群版開啟 互相注冊
#  server:
##    關(guān)閉自我保護機制,保證不可用服務(wù)被及時踢除
#    enable-self-preservation: false
#    eviction-interval-timer-in-ms: 2000

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

四、Zookeeper

五、Consul

5.1 簡介

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

5.2 安裝

中文官網(wǎng): https://www.spring.cloud.cc/spring-cloud-consul.html

英文官網(wǎng):https://www.consul.io

需要下載一個安裝包

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

查看版本

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

啟動是一個命令行界面,需要輸入consul agent -dev啟動

http://localhost:8500

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

5.3 搭建項目

引入依賴

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-consul-discovery</artifactId>
</dependency>

yaml配置

server:
  port: 8006

spring:
  application:
    name: consul-provider-payment
  cloud:
    consul:
      host: localhost
      port: 8500
      discovery:
        service-name: ${spring.application.name}

啟動類

@SpringBootApplication
@EnableDiscoveryClient //該注解用于向使用consul或者zookeeper作為注冊中心時注冊服務(wù)
public class CloudProviderconsulPayment8006Application {

    public static void main(String[] args) {
        SpringApplication.run(CloudProviderconsulPayment8006Application.class, args);
        System.out.println("啟動成功");
    }

}

啟動App,查看服務(wù)注冊情況

六、三個注冊中心的異同點

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

七、Ribbon

7.1 入門介紹

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

7.2 使用Ribbon

默認我們使用eureka的新版本時,它默認集成了ribbon:

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

這個starter中集成了reibbon了

我們也可以手動引入ribbon

7.3 RestTemplate類

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

RestTemplate:
        xxxForObject()方法,返回的是響應(yīng)體中的數(shù)據(jù)
        xxxForEntity()方法.返回的是entity對象,這個對象不僅僅包含響應(yīng)體數(shù)據(jù),還包含響應(yīng)體信息(狀態(tài)碼等)

7.4 Ribbon常用負載均衡算法

IRule接口,Riboon使用該接口,根據(jù)特定算法從所有服務(wù)中,選擇一個服務(wù),

Rule接口有7個實現(xiàn)類,每個實現(xiàn)類代表一個負載均衡算法

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

7.5 Ribbon負載均衡規(guī)則替換

[外鏈圖片轉(zhuǎn)存失敗,源站可能有防盜鏈機制,建議將圖片保存下來直接上傳(img-jqERrsdi-1686926847827)(…/…/AppData/Roaming/Typora/typora-user-images/image-20220423202944560.png)]

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

配置類

@Configuration
public class MySelfRule {
    @Bean
    public IRule myRule() {
        // 此處將ribbon默認使用的輪詢策略改為隨機策略
        return new RandomRule();
    }
}

啟動類

@SpringBootApplication
@EnableEurekaClient
@EnableDiscoveryClient
// 啟動CLOUD-PAYMENT-SERVICE服務(wù)時去加載自定義的ribbon配置
@RibbonClient(name = "CLOUD-PAYMENT-SERVICE", configuration = MySelfRule.class)
@Slf4j
public class CloudConsumerOrder80Application {

    public static void main(String[] args) {
        SpringApplication.run(CloudConsumerOrder80Application.class, args);
        log.info("cloud-consumer-order-80 啟動成功!");
    }

}

7.6 輪詢算法原理

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

7.7 源碼分析

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

7.8 手寫輪詢算法

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

public interface MyLoadBalancer {

    /**
     * 收集服務(wù)器總共有多少臺能夠提供服務(wù)的機器,并放到list里面
     *
     * @param serviceInstances
     * @return ServiceInstance
     * @author WSKH
     * @date 2020/12/23 9:24
     */
    ServiceInstance instances(List<ServiceInstance> serviceInstances);
}
@Component
public class MyLB implements MyLoadBalancer {
    // 原子類
    private final AtomicInteger atomicInteger = new AtomicInteger(0);

    /**
     * @author WSKH
     * @date 2020/12/23 10:07
     * @description 判斷時第幾次訪問
     */
    public final int getAndIncrement() {
        int current;
        String a = "current";
        int next = 0;
        do {
            current = atomicInteger.get();
            // 防止越界
            next = current >= Integer.MAX_VALUE ? 0 : current + 1;
        } while (!atomicInteger.compareAndSet(current, next));
        System.out.println("*****第幾次訪問,次數(shù)next: " + next);
        return next;
    }

    /**
     * 負載均衡算法:rest接口第幾次請求數(shù) % 服務(wù)器集群總數(shù)量 = 實際調(diào)用服務(wù)器位置下標(biāo), 每次服務(wù)重啟動后rest接口計數(shù)從1開始。1
     *
     * @param serviceInstances
     * @return ServiceInstance
     * @author WSKH
     * @date 2020/12/23 9:51
     */
    @Override
    public ServiceInstance instances(List<ServiceInstance> serviceInstances) {
        int index = getAndIncrement() % serviceInstances.size();

        return serviceInstances.get(index);
    }

}
// 注入自定義的負載均衡規(guī)則
@Resource
private MyLoadBalancer myLoadBalancer;

@Resource
private DiscoveryClient discoveryClient;
/**
 * @author WSKH
 * @date 2020/12/23 10:27
 * @description 測試自定義的負載均衡規(guī)則
 */
@GetMapping(value = "/payment/lb")
public String getPaymentLB() {
    List<ServiceInstance> instances = discoveryClient.getInstances("CLOUD-PAYMENT-SERVICE");

    if (instances == null || instances.isEmpty()) {
        return null;
    }

    // 調(diào)用自定義的負載均衡策略
    ServiceInstance serviceInstance = myLoadBalancer.instances(instances);
    URI uri = serviceInstance.getUri();
    return restTemplate.getForObject(uri + "/payment/lb", String.class);

}

八、OpenFeign

8.1 什么是OpenFeign

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記

8.2 OpenFeign服務(wù)調(diào)用

未完待續(xù)...文章來源地址http://www.zghlxwxcb.cn/news/detail-497807.html

到了這里,關(guān)于【后端開發(fā)】尚硅谷 SpringCloud 學(xué)習(xí)筆記的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • Flask框架小程序后端分離開發(fā)學(xué)習(xí)筆記《1》網(wǎng)絡(luò)知識

    Flask框架小程序后端分離開發(fā)學(xué)習(xí)筆記《1》網(wǎng)絡(luò)知識

    Flask是使用python的后端,由于小程序需要后端開發(fā),遂學(xué)習(xí)一下后端開發(fā)。 協(xié)議:http,https (https是加密的http) 主機:g.cn zhihu.com之類的網(wǎng)址 端口:HTTP協(xié)議默認是80,因此一般不用填寫 路徑下面的「/question/31838184」是路徑 http://www.zhihu.com/question/31838184 http://www.zhihu.com:80/ 電腦通

    2024年01月17日
    瀏覽(50)
  • RabbitMQ學(xué)習(xí)筆記(尚硅谷)

    RabbitMQ學(xué)習(xí)筆記(尚硅谷)

    2.1 流量消峰 2.2 應(yīng)用解耦 2.3 異步處理 大量數(shù)據(jù):Kafaka;高并發(fā):RocketMQ; 中小型數(shù)據(jù)量少:RabbitMQ 5.1 概念 快遞站 5.2 四大概念 生產(chǎn)者,消費者,交換機,隊列 交換機可以對應(yīng)多個隊列 5.3 六大模式 簡單模式 工作模式 發(fā)布/訂閱模式 路由模式 主題模式 發(fā)布確定模式 5.4 Rab

    2024年02月11日
    瀏覽(23)
  • 尚硅谷ES學(xué)習(xí)筆記一

    尚硅谷ES學(xué)習(xí)筆記一

    01-開篇 結(jié)構(gòu)化數(shù)據(jù):二維表數(shù)據(jù) 非結(jié)構(gòu)化數(shù)據(jù):不能用二維表結(jié)構(gòu)表示的數(shù)據(jù):視頻、圖片,放到nosql中 半結(jié)構(gòu)化數(shù)據(jù):將結(jié)構(gòu)和內(nèi)容混在一起,沒有明顯的區(qū)分。json、xml 02-技術(shù)選型 Elasticsearch 是什么 The Elastic Stack, 包括 Elasticsearch、 Kibana、 Beats 和 Logstash(也稱為 ELK Sta

    2024年02月04日
    瀏覽(21)
  • 尚硅谷JavaScript高級學(xué)習(xí)筆記

    尚硅谷JavaScript高級學(xué)習(xí)筆記

    JavaScript中函數(shù)是對象。我們后續(xù)描述構(gòu)造函數(shù)的內(nèi)存模型時,會將構(gòu)造函數(shù)稱為 構(gòu)造函數(shù)對象。 typeof 運算符來查看值的類型,它返回的是類型的字符串值 == 會做數(shù)據(jù)轉(zhuǎn)換 輸出: 每個函數(shù)都有一個prototype屬性,它默認指向一個0bject空對象(即稱為:原型對象) 給原型對象添加

    2024年03月11日
    瀏覽(22)
  • [尚硅谷22版shiro]學(xué)習(xí)筆記

    [尚硅谷22版shiro]學(xué)習(xí)筆記

    Apache Shiro 是一個功能強大且易于使用的 Java 安全(權(quán)限)框架。Shiro 可以完成:認證、授權(quán)、加密、會話管理、與 Web 集成、緩存 等。借助 Shiro 您可以快速輕松地保護任何應(yīng)用程序——從最小的移動應(yīng)用程序到最大的 Web 和企業(yè)應(yīng)用程序。 自 2003 年以來,框架格局發(fā)生了相當(dāng)大

    2023年04月08日
    瀏覽(23)
  • Elasticsearch7學(xué)習(xí)筆記(尚硅谷)

    Elasticsearch7學(xué)習(xí)筆記(尚硅谷)

    Elasticsearch是一個 實時的分布式搜索和分析引擎 。它可以幫助你用前所未有的速度去處理大規(guī)模數(shù)據(jù)。它可以用于 全文搜索,結(jié)構(gòu)化搜索以及分析 ,當(dāng)然你也可以將這三者進行組合。 Elasticsearch是一個建 立在全文搜索引擎 Apache Lucene? 基礎(chǔ) 上的搜索引擎,可以說Lucene是當(dāng)今

    2024年01月23日
    瀏覽(28)
  • SpringMVC《學(xué)習(xí)筆記(21版尚硅谷)》

    SpringMVC《學(xué)習(xí)筆記(21版尚硅谷)》

    1、什么是MVC MVC是一種軟件架構(gòu)的思想,將軟件按照模型、視圖、控制器來劃分 M:Model,模型層,指工程中的JavaBean,作用是處理數(shù)據(jù) JavaBean分為兩類: 一類稱為實體類Bean:專門存儲業(yè)務(wù)數(shù)據(jù)的,如 Student、User 等 一類稱為業(yè)務(wù)處理 Bean:指 Service 或 Dao 對象,專門用于處理業(yè)

    2024年02月08日
    瀏覽(17)
  • 尚硅谷webpack課程學(xué)習(xí)筆記

    尚硅谷webpack課程學(xué)習(xí)筆記

    為什么需要使用打包工具? 開發(fā)時使用的框架、es6 語法 、less 等瀏覽器無法識別。 需要經(jīng)過編譯成瀏覽器能識別的css、js才可以運行。 打包工具可以幫我們編譯,還可以做代碼壓縮、兼容處理、性能優(yōu)化。 常見的打包工具有什么? vite、webpack、glup、grunt webapck最基本的使用

    2024年02月07日
    瀏覽(22)
  • 【系統(tǒng)開發(fā)】尚硅谷 - 谷粒商城項目筆記(七):消息隊列

    【系統(tǒng)開發(fā)】尚硅谷 - 谷粒商城項目筆記(七):消息隊列

    Docker中安裝 下載鏡像: docker pull rabbitmq:management 創(chuàng)建實例并啟動: 4369 – erlang發(fā)現(xiàn)口 5672 --client端通信口 15672 – 管理界面ui端口 25672 – server間內(nèi)部通信口 在web瀏覽器中輸入地址:http://服務(wù)器ip:15672/ 輸入默認賬號: guest : guest overview :概覽 connections :無論生產(chǎn)者還是消費者

    2024年02月12日
    瀏覽(26)
  • Flask框架小程序后端分離開發(fā)學(xué)習(xí)筆記《2》構(gòu)建基礎(chǔ)的HTTP服務(wù)器

    Flask框架小程序后端分離開發(fā)學(xué)習(xí)筆記《2》構(gòu)建基礎(chǔ)的HTTP服務(wù)器

    Flask是使用python的后端,由于小程序需要后端開發(fā),遂學(xué)習(xí)一下后端開發(fā)。本節(jié)提供一個構(gòu)建簡單的本地服務(wù)器的代碼,仔細看注釋,學(xué)習(xí)每一步的流程,理解服務(wù)器接收請求,回復(fù)響應(yīng)的基本原理。 代碼效果,運行之后,在瀏覽器輸入:localhost:2000 總結(jié) 1.導(dǎo)入socket庫:這個庫

    2024年01月18日
    瀏覽(26)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包