锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲精品无码一区二区,亚洲日韩中文字幕无码一区,久久精品国产亚洲AV大全http://www.tkk7.com/zzsuje/zh-cnFri, 09 May 2025 13:38:40 GMTFri, 09 May 2025 13:38:40 GMT60springAlibaba瀹炶返(12)----緗戝叧閰嶇疆http://www.tkk7.com/zzsuje/archive/2022/05/10/450741.htmlzzsujezzsujeTue, 10 May 2022 07:15:00 GMThttp://www.tkk7.com/zzsuje/archive/2022/05/10/450741.htmlhttp://www.tkk7.com/zzsuje/comments/450741.htmlhttp://www.tkk7.com/zzsuje/archive/2022/05/10/450741.html#Feedback0http://www.tkk7.com/zzsuje/comments/commentRss/450741.htmlhttp://www.tkk7.com/zzsuje/services/trackbacks/450741.html緗戝叧
鍙戦佽姹傞渶瑕佺煡閬撳晢鍝佹湇鍔$殑鍦板潃錛屽鏋滃晢鍝佹湇鍔″櫒鏈?00鏈嶅姟鍣紝1鍙鋒帀綰垮悗錛?/div>
榪樺緱鏀癸紝鎵浠ラ渶瑕佺綉鍏沖姩鎬佸湴綆$悊錛屼粬鑳戒粠娉ㄥ唽涓績涓疄鏃跺湴鎰熺煡鏌愪釜鏈嶅姟涓?/div>
綰胯繕鏄笅綰褲?/div>
璇鋒眰涔熻鍔犱笂璇㈤棶鏉冮檺錛岀湅鐢ㄦ埛鏈夋病鏈夋潈闄愯闂繖涓姹傦紝涔熼渶瑕佺綉鍏熾?/div>
鎵浠ユ垜浠嬌鐢╯pring cloud鐨刧ateway緇勪歡鍋氱綉鍏沖姛鑳姐?/div>
緗戝叧鏄姹傛祻瑙堢殑鍏ュ彛錛屽父鐢ㄥ姛鑳藉寘鎷礬鐢?span style="background-color: yellow;">杞彂錛?span style="background-color: yellow;">鏉冮檺鏍¢獙錛?span style="background-color: yellow;">闄愭祦鎺у埗絳夈俿pringcloud gateway鍙栦唬浜唞uul緗戝叧銆?/div>
涓夊ぇ鏍稿績姒傚康錛?/div>
Route: The basic building block of the gateway. It is defined by an ID, a 
destination URI, a collection of predicates鏂█, and a collection of filters. 
A route is matched if the aggregate predicate is true.
鍙戜竴涓姹傜粰緗戝叧錛岀綉鍏寵灝嗚姹傝礬鐢卞埌鎸囧畾鐨勬湇鍔°?br />璺敱鏈塱d錛?/span>
鐩殑鍦皍ri錛?/span>
鏂█鐨勯泦鍚堬紝
鍖歸厤浜嗘柇璦灝辮兘鍒拌揪鎸囧畾浣嶇疆錛?/div>
Predicate鏂█:
This is a Java 8 Function Predicate. The input type is a Spring 
Framework ServerWebExchange. This lets you match on anything from the 
HTTP request, such as headers or parameters.灝辨槸java閲岀殑鏂█鍑芥暟錛屽尮閰嶈姹傞噷鐨勪換浣曚俊鎭紝鍖呮嫭璇鋒眰澶寸瓑
Filter:
These are instances of Spring Framework GatewayFilter that have been 
constructed with a specific factory. Here, you can modify requests and
responses before or after sending the downstream request.
榪囨護(hù)鍣ㄨ姹傚拰鍝嶅簲閮藉彲浠ヨ淇敼銆?/div>
瀹㈡埛绔彂璇鋒眰緇欐湇鍔$銆備腑闂存湁緗戝叧銆傚厛浜ょ粰鏄犲皠鍣紝濡傛灉鑳藉鐞嗗氨浜ょ粰handler
澶勭悊錛岀劧鍚庝氦緇欎竴緋誨垪filer錛岀劧鍚庣粰鎸囧畾鐨勬湇鍔★紝鍐嶈繑鍥炲洖鏉ョ粰瀹㈡埛绔?/div>
12.1 鍒涘緩妯″潡gulimall-gateway
<dependency>
            <groupId>com.zyn.glmall</groupId>
            <artifactId>glmall-common</artifactId>
            <version>0.0.1-SNAPSHOT</version>
</dependency>
1 鍦╬om.xml寮曞叆
鐗堟湰鐜闇淇濇寔涓鑷?/div>
<spring-boot.version>2.1.8.RELEASE</spring-boot.version>
<spring-cloud.version>Greenwich.SR3</spring-cloud.version>
2 寮鍚敞鍐屾湇鍔″彂鐜癅EnableDiscoveryClient
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@EnableDiscoveryClient
public class GulimallGatewayApplication {
    public static void main(String[] args) {
        SpringApplication.run(GulimallGatewayApplication.class, args);
    }
}
3 閰嶇疆nacos娉ㄥ唽涓績鍦板潃applicaion.properties
spring.application.name=glmall-gateway
spring.cloud.nacos.discovery.server-addr=192.168.11.1:8848
server.port=88
4 bootstrap.properties 濉啓閰嶇疆涓績鍦板潃
spring.application.name=glmall-coupon
spring.cloud.nacos.config.server-addr=192.168.11.1:8848
spring.cloud.nacos.config.namespace=a791fa0e-cef8-47ee-8f07-5ac5a63ea061
5 nacos閲屽垱寤哄懡鍚嶇┖闂磄ateway錛岀劧鍚庡湪鍛藉悕絀洪棿閲屽垱寤烘枃浠秅lmall-gateway.yml
spring:
    application:
        name: glmall-gateway
6 鍦ㄩ」鐩噷鍒涘緩application.yml
spring:
  cloud:
    gateway:
      routes:
        - id: baidu_route
          uri: http://www.baidu.com
          predicates:
            - Query=url,baidu

        - id: test_route
          uri: http://www.qq.com
          predicates:
            - Query=url,qq
嫻嬭瘯 localhost:8080?url=baidu # 璺沖埌鐧懼害欏甸潰
嫻嬭瘯 localhost:8080?url=baidu # 璺沖埌qq欏甸潰


zzsuje 2022-05-10 15:15 鍙戣〃璇勮
]]>springAlibaba瀹炶返(11)----Nacos閰嶇疆涓績閰嶇疆http://www.tkk7.com/zzsuje/archive/2022/05/09/450740.htmlzzsujezzsujeMon, 09 May 2022 06:55:00 GMThttp://www.tkk7.com/zzsuje/archive/2022/05/09/450740.htmlhttp://www.tkk7.com/zzsuje/comments/450740.htmlhttp://www.tkk7.com/zzsuje/archive/2022/05/09/450740.html#Feedback0http://www.tkk7.com/zzsuje/comments/commentRss/450740.htmlhttp://www.tkk7.com/zzsuje/services/trackbacks/450740.html闃呰鍏ㄦ枃

zzsuje 2022-05-09 14:55 鍙戣〃璇勮
]]>
springAlibaba瀹炶返(10)----OpenFegin閰嶇疆http://www.tkk7.com/zzsuje/archive/2022/05/06/450738.htmlzzsujezzsujeFri, 06 May 2022 06:45:00 GMThttp://www.tkk7.com/zzsuje/archive/2022/05/06/450738.htmlhttp://www.tkk7.com/zzsuje/comments/450738.htmlhttp://www.tkk7.com/zzsuje/archive/2022/05/06/450738.html#Feedback0http://www.tkk7.com/zzsuje/comments/commentRss/450738.htmlhttp://www.tkk7.com/zzsuje/services/trackbacks/450738.html10.0 Feign涓庢敞鍐屼腑蹇?br />
澹版槑寮忚繙紼嬭皟鐢?/strong>
feign鏄竴涓0鏄庡紡鐨凥TTP瀹㈡埛绔紝浠栫殑鐩殑灝辨槸璁╄繙紼嬭皟鐢ㄦ洿鍔犵畝鍗曘?/strong>
緇欒繙紼嬫湇鍔″彂鐨勬槸HTTP璇鋒眰銆?br />
浼?xì)鍛樻湇鍔″Q坢ember錛夎皟浼樻儬鍒革紙coupon錛夋湇鍔?br />浼?xì)鍛樻湇鍔¢氳繃openFeign鍏堝幓娉ㄥ唽涓績鎵句紭鎯犲埜鏈嶅姟
10.1 寮曞叆 openfeign 渚濊禆
浼?xì)鍛樻湇鍔℃儗櫐仒q滅▼璋冪敤浼樻儬鍒告湇鍔★紝鍙渶瑕佺粰浼?xì)鍛樻湇鍔¢噷寮曞叆openfeign渚濊禆錛屼粬灝辨湁浜嗚繙紼嬭皟鐢ㄥ叾浠栨湇鍔$殑鑳藉姏銆?/div>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>

10.2 鍦╟oupon鏈嶅姟(琚皟鐢ㄦ湇鍔?涓慨鏀瑰涓嬬殑鍐呭
@RequestMapping("coupon/coupon")
public class CouponController {
    @Autowired
    private CouponService couponService;
    @RequestMapping("/member/list")
    public R membercoupons(){    //鍏ㄧ郴緇熺殑鎵鏈夎繑鍥為兘榪斿洖R
        
// 搴旇鍘繪暟鎹簱鏌ョ敤鎴峰浜庣殑浼樻儬鍒革紝浣嗚繖涓垜浠畝鍖栦簡錛屼笉鍘繪暟鎹簱鏌ヤ簡錛屾瀯閫犱簡涓涓紭鎯犲埜緇欎粬榪斿洖
        CouponEntity couponEntity = new CouponEntity();
        couponEntity.setCouponName("婊?00鍑?0");//浼樻儬鍒哥殑鍚嶅瓧
        return R.ok().put("coupons",Arrays.asList(couponEntity));
    }
10.3 榪欐牱鎴戜滑鍑嗗濂戒簡浼樻儬鍒哥殑璋冪敤鍐呭
鍦╩ember鐨勯厤緗被涓婂姞娉ㄨВ@EnableFeignClients(basePackages="com.yxj.gulimall.member.feign")錛?/div>
鍛婅瘔spring榪欓噷闈㈡槸涓涓繙紼嬭皟鐢ㄥ鎴風(fēng)錛宮ember瑕佽皟鐢ㄧ殑鎺ュ彛
package com.yxj.gulimall.member;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@MapperScan("com.yxj.gulimall.member.dao")
@EnableDiscoveryClient
@EnableFeignClients(basePackages="com.yxj.gulimall.member.feign")
public class GulimallMemberApplication {
    public static void main(String[] args) {
        SpringApplication.run(GulimallMemberApplication.class, args);
    }
}

10.4
 閭d箞瑕佽皟鐢ㄤ粈涔堜笢瑗垮憿錛熷氨鏄垜
浠垰鎵嶅啓鐨勪紭鎯犲埜鐨勫姛鑳斤紝
澶嶅埗鍑芥暟閮ㄥ垎錛屽湪member鐨刢om.yxj.gulimall.member.feign鍖呬笅鏂板緩綾伙細(xì)
package com.yxj.gulimall.member.feign;
import com.yxj.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
@FeignClient("gulimall-coupon") //鍛婅瘔spring cloud榪欎釜鎺ュ彛鏄竴涓繙紼嬪鎴風(fēng)錛岃璋冪敤coupon鏈嶅姟錛屽啀鍘昏皟鐢╟oupon鏈嶅姟/coupon/coupon/member/list瀵瑰簲鐨勬柟娉?/span>
public interface CouponFeignService {
    @RequestMapping("/coupon/coupon/member/list") 
    public R membercoupons();//寰楀埌涓涓猂瀵硅薄
}
10.5 鐒跺悗鎴戜滑鍦╩ember鐨勬帶鍒跺眰鍐欎竴涓祴璇曡姹?/strong>
@RestController
@RequestMapping("member/member")
public class MemberController {
    @Autowired
    private MemberService memberService;
    @Autowired
    CouponFeignService couponFeignService;
    @RequestMapping("/coupons")
    public R test(){
        MemberEntity memberEntity = new MemberEntity();
        memberEntity.setNickname("寮犱笁");
        R membercoupons = couponFeignService.membercoupons(); //鍋囪寮犱笁鍘繪暟鎹簱鏌ヤ簡鍚庤繑鍥炰簡寮犱笁鐨勪紭鎯犲埜淇℃伅
        
// 鎵撳嵃浼?xì)鍛樺拰浼樻儬鍒镐俊鎭?/span>
        return R.ok().put("member",memberEntity).put("coupons",membercoupons.get("coupons"));
    }
 
10.6 閲嶆柊鍚姩鏈嶅姟
http://localhost:8000/member/member/coupons
{"msg":"success","code":0,"coupons":[{"id":null,"couponType":null,"couponImg":null,"couponName":"婊?00鍑?0","num":null,"amount":null,"perLimit":null,"minPoint":null,"startTime":null,"endTime":null,"useType":null,"note":null,"publishCount":null,"useCount":null,"receiveCount":null,"enableStartTime":null,"enableEndTime":null,"code":null,"memberLevel":null,"publish":null}],"member":{"id":null,"levelId":null,"username":null,"password":null,"nickname":"寮犱笁","mobile":null,"email":null,"header":null,"gender":null,"birth":null,"city":null,"job":null,"sign":null,"sourceType":null,"integration":null,"growth":null,"status":null,"createTime":null}}

10.7 涓婇潰鍐呭寰堥噸瑕侊紝鎴戜滑鍋滅暀5鍒嗛挓浣撲細(xì)涓涓?br />coupon閲岀殑R.ok()鏄粈涔?# coupon閲岀殑鎺у埗灞傚氨鏄痭ew浜嗕釜couponEntity鐒跺悗鏀懼埌hashmap錛圧錛夐噷鑰屽凡銆?/div>
public class R extends HashMap<String, Object> {
    public static R ok() {
        return new R();
    }
    public R put(String key, Object value) {
        super.put(key, value);
        return this;
    }
}


zzsuje 2022-05-06 14:45 鍙戣〃璇勮
]]>springAlibaba瀹炶返(8)----Nacos瀹夎(Linux)http://www.tkk7.com/zzsuje/archive/2022/05/06/450736.htmlzzsujezzsujeFri, 06 May 2022 01:10:00 GMThttp://www.tkk7.com/zzsuje/archive/2022/05/06/450736.htmlhttp://www.tkk7.com/zzsuje/comments/450736.htmlhttp://www.tkk7.com/zzsuje/archive/2022/05/06/450736.html#Feedback0http://www.tkk7.com/zzsuje/comments/commentRss/450736.htmlhttp://www.tkk7.com/zzsuje/services/trackbacks/450736.html闃呰鍏ㄦ枃

zzsuje 2022-05-06 09:10 鍙戣〃璇勮
]]>
springAlibaba瀹炶返(7)---閫嗗悜宸ョ▼鎼緩http://www.tkk7.com/zzsuje/archive/2022/05/05/450734.htmlzzsujezzsujeThu, 05 May 2022 06:10:00 GMThttp://www.tkk7.com/zzsuje/archive/2022/05/05/450734.htmlhttp://www.tkk7.com/zzsuje/comments/450734.htmlhttp://www.tkk7.com/zzsuje/archive/2022/05/05/450734.html#Feedback0http://www.tkk7.com/zzsuje/comments/commentRss/450734.htmlhttp://www.tkk7.com/zzsuje/services/trackbacks/450734.html閫嗗悜宸ョ▼鎼緩
7.1 product
git clone https://gitee.com/renrenio/renren-generator.git
涓嬭澆鍒版闈㈠悗錛屽悓鏍鋒妸閲岄潰鐨?git鏂囦歡鍒犻櫎錛岀劧鍚庣Щ鍔ㄥ埌鎴戜滑IDEA欏圭洰鐩綍涓紝鍚屾牱閰嶇疆濂絧om.xml(root)
鍦╟ommon欏圭洰涓鍔爉odule
<modules>
<module>gulimall-coupon</module>
<module>gulimall-member</module>
<module>gulimall-order</module>
<module>gulimall-product</module>
<module>gulimall-ware</module>
<module>renren-fast</module>
<module>renren-generator</module>
</modules>
淇敼renren-generator鐨刟pplication.yml
url: jdbc:mysql://192.168.1.103:3306/gulimall-pms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: root
password: root
淇敼generator.properties
mainPath=com.yxj # 涓葷洰褰?/div>
package=com.yxj.gulimall # 鍖呭悕
moduleName=product   # 妯″潡鍚?/div>
author=yxj  # 浣滆?/div>
email=xxx@qq.com  # email
tablePrefix=pms_   # 鎴戜滑鐨刾ms鏁版嵁搴撲腑鐨勮〃鐨勫墠緙閮芥湁pms錛?/div>
濡傛灉鍐欎簡琛ㄥ墠緙錛屾瘡涓寮犺〃瀵逛簬鐨刯avaBean灝變笉浼?xì)娣诲姞鍓嵕~浜?/div>
榪愯RenrenApplication銆傚鏋滃惎鍔ㄤ笉鎴愬姛錛屼慨鏀筧pplication涓槸port涓?0銆傝闂甴ttp://localhost:80
鐒跺悗鐐瑰嚮鍏ㄩ儴錛岀偣鍑葷敓鎴愪唬鐮併備笅杞戒簡鍘嬬緝鍖?/div>
瑙e帇鍘嬬緝鍖咃紝鎶妋ain鏀懼埌gulimall-product鐨勫悓綰х洰褰曚笅銆?/div>
鍦╟ommon欏圭洰鐨刾om.xml錛堟垜浠妸姣忎釜寰湇鍔¢噷鍏叡鐨勭被鍜屼緷璧栨斁鍒癱ommon閲屻傦級涓坊鍔?/div>
<!-- mybatisPLUS-->
<dependency>
    <groupId>com.baomidou</groupId>
    <artifactId>mybatis-plus-boot-starter</artifactId>
    <version>3.3.2</version>
</dependency>
<!--綆鍖栧疄浣撶被錛岀敤@Data浠f浛getset鏂規(guī)硶-->
<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.18.8</version>
</dependency>
<!-- httpcomponent鍖卙ttps://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore -->
<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpcore</artifactId>
    <version>4.4.13</version>
</dependency>
<dependency>
    <groupId>commons-lang</groupId>
    <artifactId>commons-lang</artifactId>
    <version>2.6</version>
</dependency>
鐒跺悗鍦╬roduct欏圭洰涓殑pom.xml涓姞鍏ヤ笅闈㈠唴瀹?/div>
<dependency>
    <groupId>com.atguigu.gulimall</groupId>
    <artifactId>gulimall-common</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</dependency>
澶嶅埗
renren-fast----utils鍖呬笅鐨凲uery鍜孭ageUtils銆丷銆丆onstant澶嶅埗鍒癱ommon欏圭洰鐨刯ava/com.yxj.common.utils涓?/div>
鎶夽RequiresPermissions榪欎簺娉ㄨВ鎺夛紝鍥犱負(fù)鏄痵hiro鐨?/div>
澶嶅埗renren-fast涓殑xss鍖呯矘璐村埌common鐨刯ava/com.yxj.common鐩綍涓嬨?/div>
榪樺鍒朵簡exception鏂囦歡澶癸紝瀵瑰簲鐨勪綅緗叧緋昏嚜宸辮瀵熶竴涓嬪氨琛?/div>
娉ㄩ噴鎺塸roduct欏圭洰涓嬬被涓殑//import org.apache.shiro.authz.annotation.RequiresPermissions;錛屼粬鏄痵hiro鐨勪笢瑗?/div>
娉ㄩ噴renren-generator\src\main\resources\template/Controller涓墍鏈夌殑
# @RequiresPermissions銆?/div>
# import org.apache.shiro.authz.annotation.RequiresPermissions;
鎬諱箣浠涔堟姤閿欏氨鍘籸enren-fast閲岄潰鎵俱?/div>
嫻嬭瘯
嫻嬭瘯涓庢暣鍚堝晢鍝佹湇鍔¢噷鐨刴ybatisplus
鍦╟ommon鐨刾om.xml涓鍏?/div>
<!-- 鏁版嵁搴撻┍鍔?https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.17</version>
</dependency>
<!--tomcat閲屼竴鑸兘甯?->
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>2.5</version>
    <scope>provided</scope>  # Tomcat鏈夊甫錛屾墍浠rovided
</dependency>
鍒犳帀common閲寈ss/xssfiler鍜孹ssHttpServletRequestWrapper
鍦╬roduct欏圭洰鐨剅esources鐩綍涓嬫柊寤篴pplication.yml
spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://192.168.1.103:3306/gulimall_pms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
    username: root
    password: root
# MapperScan
# sql鏄犲皠鏂囦歡浣嶇疆
mybatis-plus:
  mapper-locations: classpath:/mapper/**/*.xml
  global-config:
    db-config:
      id-type: auto
鐒跺悗鍦ㄤ富鍚姩綾諱笂鍔犱笂娉ㄨВ@MapperScan()
@MapperScan("com.yxj.gulimall.product.dao")
@SpringBootApplication
public class gulimallProductApplication {
    public static void main(String[] args) {
        SpringApplication.run(gulimallProductApplication.class, args);
    }
}
鐒跺悗鍘繪祴璇曪紝鍏堥氳繃涓嬮潰鏂規(guī)硶緇欐暟鎹簱娣誨姞鍐呭
@SpringBootTest
class gulimallProductApplicationTests {
    @Autowired
    BrandService brandService;
    @Test
    void contextLoads() {
        BrandEntity brandEntity = new BrandEntity();
        brandEntity.setDescript("hello");
        brandEntity.setName("鍗庝負(fù)");
        brandService.save(brandEntity);
        System.out.println("淇濆瓨鎴愬姛");
    }
}
3.12.2 coupon
閲嶆柊鎵撳紑generator閫嗗悜宸ョ▼錛屼慨鏀筭enerator.properties
# 涓葷洰褰?nbsp;
mainPath=com.yxj
package=com.yxj.gulimall
moduleName=coupon
autho=yxj
email=xxx@qq.com
tablePrefix=sms_
淇敼yml鏁版嵁搴撲俊鎭?/div>
spring:
  datasource:
    username: root
    password: root
    url: jdbc:mysql://192.168.1.103:3306/gulimall_sms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
mybatis-plus:
  mapper-locations: classpath:/mapper/**/*.xml
  global-config:
    db-config:
      id-type: auto
      logic-delete-value: 1
      logic-not-delete-value: 0
server:
  port: 7000
鍚姩鐢熸垚RenrenApplication.java錛岃繍琛屽悗鍘繪祻瑙堝櫒80绔彛鏌ョ湅錛屽悓鏍瘋浠栦竴
欏靛叏鏄劇ず鍚庨夋嫨鍏ㄩ儴鍚庣敓鎴愩傜敓鎴愬悗瑙e帇澶嶅埗鍒癱oupon欏圭洰瀵瑰簲鐩綍涓嬨?/div>
璁ヽoupon涔熶緷璧栦簬common錛屼慨鏀筽om.xml
<dependency>
    <groupId>com.atguigu.gulimall</groupId>
    <artifactId>gulimall-common</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</dependency>
resources涓媠rc鍖呭厛鍒犻櫎
娣誨姞application.yml
spring:
  datasource:
    username: root
    password: root
    url: jdbc:mysql://192.168.1.103:3306/gulimall_sms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
    driver-class-name: com.mysql.cj.jdbc.Driver
mybatis-plus:
  mapper-locations: classpath:/mapper/**/*.xml
  global-config:
    db-config:
      id-type: auto
      logic-delete-value: 1
      logic-not-delete-value: 0
榪愯gulimallCouponApplication.java
http://localhost:8080/coupon/coupon/list
{"msg":"success","code":0,"page":{"totalCount":0,"pageSize":10,"totalPage":0,"currPage":1,"list":[]}}
3.12.3 member
閲嶆柊浣跨敤浠g爜鐢熸垚鍣ㄧ敓鎴恥ms
妯′豢涓婇潰淇敼涓嬮潰涓や釜閰嶇疆
浠g爜鐢熸垚鍣ㄩ噷錛?/div>
url: jdbc:mysql://192.168.1.103:3306/gulimall_sms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
mainPath=com.yxj 
package=com.yxj.gulimall
moduleName=member
author=yxj
email=xxx@qq.com
tablePrefix=ums_
閲嶅惎RenrenApplication.java錛岀劧鍚庡悓鏍峰幓嫻忚鍣ㄨ幏鍙栧帇緙╁寘瑙e帇鍒板搴攎ember欏圭洰鐩綍
member涔熷鍏ヤ緷璧?/div>
<dependency>
    <groupId>com.atguigu.gulimall</groupId>
    <artifactId>gulimall-common</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</dependency>
鍚屾牱鏂板緩application.yml
spring:
  datasource:
    username: root
    password: root
    url: jdbc:mysql://192.168.1.103:3306/gulimall-ums?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
    driver-class-name: com.mysql.cj.jdbc.Driver
mybatis-plus:
  mapper-locations: classpath:/mapper/**/*.xml
  global-config:
    db-config:
      id-type: auto
      logic-delete-value: 1
      logic-not-delete-value: 0
server:
  port: 8000
order绔彛鏄?000錛宲roduct鏄?0000錛寃are鏄?1000銆?/div>
浠ュ悗姣斿order緋葷粺瑕佸鍒跺浠斤紝浠栫殑绔彛璁$畻9001銆?002銆傘傘?/div>
閲嶅惎web鍚庯紝http://localhost:8000/member/growthchangehistory/list
嫻嬭瘯鎴愬姛錛歿"msg":"success","code":0,"page":{"totalCount":0,"pageSize":10,"totalPage":0,"currPage":1,"list":[]}}
3.12.4 order
淇敼浠g爜鐢熸垚鍣?/div>
jdbc:mysql://192.168.1.103:3306/gulimall_oms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
#浠g爜鐢熸垚鍣紝閰嶇疆淇℃伅
mainPath=com.yxj
package=com.yxj.gulimall
moduleName=order
author=yxj
email=xxx@qq.com
tablePrefix=oms_
榪愯RenrenApplication.java閲嶆柊鐢熸垚鍚庡幓涓嬭澆瑙e帇鏀劇疆銆?/div>
application.yml
spring:
  datasource:
    username: root
    password: root
    url: jdbc:mysql://192.168.1.103:3306/gulimall_oms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
    driver-class-name: com.mysql.cj.jdbc.Driver
mybatis-plus:
  mapper-locations: classpath:/mapper/**/*.xml
  global-config:
    db-config:
      id-type: auto
      logic-delete-value: 1
      logic-not-delete-value: 0
      
server:
  port: 9000
鍦╬om.xml娣誨姞
<dependency>
    <groupId>com.atguigu.gulimall</groupId>
    <artifactId>gulimall-common</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</dependency>
鍚姩gulimallOrderApplication.java
http://localhost:9000/order/order/list
{"msg":"success","code":0,"page":{"totalCount":0,"pageSize":10,"totalPage":0,"currPage":1,"list":[]}}
3.12.5 ware
淇敼浠g爜鐢熸垚鍣?/div>
jdbc:mysql://192.168.1.103:3306/gulimall_wms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
#浠g爜鐢熸垚鍣紝閰嶇疆淇℃伅
mainPath=com.yxj
package=com.yxj.gulimall
moduleName=ware
author=yxj
email=xxx@qq.com
tablePrefix=wms_
榪愯RenrenApplication.java閲嶆柊鐢熸垚鍚庡幓涓嬭澆瑙e帇鏀劇疆銆?/div>
application.yml
spring:
  datasource:
    username: root
    password: root
    url: jdbc:mysql://192.168.1.103:3306/gulimall_wms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
    driver-class-name: com.mysql.cj.jdbc.Driver
mybatis-plus:
  mapper-locations: classpath:/mapper/**/*.xml
  global-config:
    db-config:
      id-type: auto
      logic-delete-value: 1
      logic-not-delete-value: 0
      
server:
  port: 11000
鍦╬om.xml娣誨姞
<dependency>
    <groupId>com.atguigu.gulimall</groupId>
    <artifactId>gulimall-common</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</dependency>
鍚姩gulimallWareApplication.java
http://localhost:11000/ware/wareinfo/list
{"msg":"success","code":0,"page":{"totalCount":0,"pageSize":10,"totalPage":0,"currPage":1,"list":[]}}


zzsuje 2022-05-05 14:10 鍙戣〃璇勮
]]>springAlibaba瀹炶返(6)----renren欏圭洰鑴氭墜鏋?/title><link>http://www.tkk7.com/zzsuje/archive/2022/04/26/450730.html</link><dc:creator>zzsuje</dc:creator><author>zzsuje</author><pubDate>Tue, 26 Apr 2022 08:49:00 GMT</pubDate><guid>http://www.tkk7.com/zzsuje/archive/2022/04/26/450730.html</guid><wfw:comment>http://www.tkk7.com/zzsuje/comments/450730.html</wfw:comment><comments>http://www.tkk7.com/zzsuje/archive/2022/04/26/450730.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/zzsuje/comments/commentRss/450730.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/zzsuje/services/trackbacks/450730.html</trackback:ping><description><![CDATA[<strong style="font-family: "Comic Sans MS"; font-size: 12pt;">6.1 git clone 浜轟漢欏圭洰</strong><br style="font-size: 12pt;" /><br /> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->鍦ㄧ爜浜戜笂鎼滅儲(chǔ)浜轟漢寮婧愶紝鎴戜滑浣跨敤renren-fast錛宺enren-fast-vue欏圭洰銆?br /> git clone https://gitee.com/renrenio/renren-fast.git<br /> <br /> git clone https://gitee.com/renrenio/renren-fast-vue.git<br /> <br /> 涓嬭澆鍒頒簡妗岄潰錛屾垜浠妸renren-fast縐誨姩鍒版垜浠殑欏圭洰鏂囦歡澶癸紙鍒犳帀.git鏂囦歡錛夛紝鑰宺enren-fast-vue鏄敤VSCode鎵撳紑鐨勶紙鍚庨潰鍐嶅紕錛?/div> <blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><strong><div style="text-align: right;"></div></strong></blockquote><h3><span style="font-size: 12pt; font-family: "Comic Sans MS";">6.2淇敼閰嶇疆鏂囦歡 鍚姩欏圭洰</span><span style="font-size: 12pt; font-family: "Comic Sans MS";"><br /></span>    <span style="font-weight: normal; font-family: Arial;">鐒跺悗淇敼欏圭洰閲宺enren-fast涓殑application.yml</span><span style="font-family: Arial;">錛?br /></span>    <span style="font-family: Arial;"><span style="font-weight: normal; font-family: Arial;">淇敼application-dev.yml涓殑鏁板簱搴撶殑 </span></span><br />    <span style="font-family: Arial;"><span style="font-weight: normal; font-family: Arial;">url: jdbc:mysql://192.168.1.103:3306/gulimall_admin?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai </span><br /></span>    <span style="font-family: Arial;"><span style="font-weight: normal; font-family: Arial;">username: root password: root </span><br /></span>    <span style="font-family: Arial;"><span style="font-weight: normal; font-family: Arial;">鐒跺悗鎵цjava涓嬬殑RenrenApplication </span><br /></span>    <span style="font-family: Arial;"><span style="font-weight: normal; font-family: Arial;">嫻忚鍣ㄨ緭鍏ttp://localhost:8080/renren-fast/ </span><br /></span>    <span style="font-family: Arial;"><span style="font-weight: normal; font-family: Arial;">寰楀埌{“msg”:“invalid token”,“code”:401}灝變唬琛ㄦ棤璇?/span><br /><br /></span><span style="font-family: "Comic Sans MS"; font-size: 12pt;">6.3</span><span style="font-family: "Comic Sans MS";">鐢╒SCode鎵撳紑renren-fast-vue</span><br /><span style="font-weight: normal;">    6.3.1 瀹夎node錛?br />            鐗堟湰涓簐10.16.3<br /></span>            <span style="font-weight: normal;">璁劇疆node闀滃儚浠撳簱<br /></span>            <span style="font-weight: normal;">npm config set registry http://registry.npm.taobao.org/  # 璁劇疆node浠撳簱銆傛彁楂樹笅杞介熷害</span></h3><div>     6.3.2  <span style="background-color: #ffffff; color: #4d4d4d; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; font-variant-ligatures: no-common-ligatures;">鍦ㄧ粓绔腑杈撳叆鍛戒護(hù)錛?/span><code style="font-variant-ligatures: no-common-ligatures; box-sizing: border-box; outline: 0px; font-family: "Source Code Pro", "DejaVu Sans Mono", "Ubuntu Mono", "Anonymous Pro", "Droid Sans Mono", Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 22px; color: #c7254e; background-color: #f9f2f4; border-radius: 2px; padding: 2px 4px; overflow-wrap: break-word;">npm install</code><span style="background-color: #ffffff; color: #4d4d4d; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; font-variant-ligatures: no-common-ligatures;">錛屽畨瑁呴」鐩墍闇渚濊禆銆?/span></div><div>     6.3.3  <span style="background-color: #ffffff; color: #4d4d4d; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; font-variant-ligatures: no-common-ligatures;">瀹夎瀹屾垚鍚庯紝杈撳叆鍛戒護(hù)錛?/span><code style="font-variant-ligatures: no-common-ligatures; box-sizing: border-box; outline: 0px; font-family: "Source Code Pro", "DejaVu Sans Mono", "Ubuntu Mono", "Anonymous Pro", "Droid Sans Mono", Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 22px; color: #c7254e; background-color: #f9f2f4; border-radius: 2px; padding: 2px 4px; overflow-wrap: break-word;">npm run dev</code><span style="background-color: #ffffff; color: #4d4d4d; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; font-variant-ligatures: no-common-ligatures;">錛岃繍琛岄」鐩?/span></div><div></div><div>              嫻忚鍣ㄨ緭鍏ocalhost:8001 灝卞彲浠ョ湅鍒板唴瀹逛簡錛岀櫥褰曡處鍙穉dmin 瀵嗙爜admin</div><div></div><img src ="http://www.tkk7.com/zzsuje/aggbug/450730.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/zzsuje/" target="_blank">zzsuje</a> 2022-04-26 16:49 <a href="http://www.tkk7.com/zzsuje/archive/2022/04/26/450730.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>springAlibaba瀹炶返(5)----SQL璇彞http://www.tkk7.com/zzsuje/archive/2022/04/26/450729.htmlzzsujezzsujeTue, 26 Apr 2022 07:39:00 GMThttp://www.tkk7.com/zzsuje/archive/2022/04/26/450729.htmlhttp://www.tkk7.com/zzsuje/comments/450729.htmlhttp://www.tkk7.com/zzsuje/archive/2022/04/26/450729.html#Feedback0http://www.tkk7.com/zzsuje/comments/commentRss/450729.htmlhttp://www.tkk7.com/zzsuje/services/trackbacks/450729.htmlgulimall-oms.sqldrop table if exists oms_order;drop table if&nbs...  闃呰鍏ㄦ枃

zzsuje 2022-04-26 15:39 鍙戣〃璇勮
]]>
springAlibaba瀹炶返(4)----欏圭洰鏂板緩 http://www.tkk7.com/zzsuje/archive/2022/04/26/450728.htmlzzsujezzsujeTue, 26 Apr 2022 03:17:00 GMThttp://www.tkk7.com/zzsuje/archive/2022/04/26/450728.htmlhttp://www.tkk7.com/zzsuje/comments/450728.htmlhttp://www.tkk7.com/zzsuje/archive/2022/04/26/450728.html#Feedback0http://www.tkk7.com/zzsuje/comments/commentRss/450728.htmlhttp://www.tkk7.com/zzsuje/services/trackbacks/450728.html闃呰鍏ㄦ枃

zzsuje 2022-04-26 11:17 鍙戣〃璇勮
]]>
springAlibaba瀹炶返(3)----Git閰嶇疆http://www.tkk7.com/zzsuje/archive/2022/04/25/450727.htmlzzsujezzsujeMon, 25 Apr 2022 09:22:00 GMThttp://www.tkk7.com/zzsuje/archive/2022/04/25/450727.htmlhttp://www.tkk7.com/zzsuje/comments/450727.htmlhttp://www.tkk7.com/zzsuje/archive/2022/04/25/450727.html#Feedback0http://www.tkk7.com/zzsuje/comments/commentRss/450727.htmlhttp://www.tkk7.com/zzsuje/services/trackbacks/450727.html闃呰鍏ㄦ枃

zzsuje 2022-04-25 17:22 鍙戣〃璇勮
]]>
springAlibaba瀹炶返(2)----Docker瀹夎http://www.tkk7.com/zzsuje/archive/2022/04/24/450726.htmlzzsujezzsujeSun, 24 Apr 2022 07:45:00 GMThttp://www.tkk7.com/zzsuje/archive/2022/04/24/450726.htmlhttp://www.tkk7.com/zzsuje/comments/450726.htmlhttp://www.tkk7.com/zzsuje/archive/2022/04/24/450726.html#Feedback0http://www.tkk7.com/zzsuje/comments/commentRss/450726.htmlhttp://www.tkk7.com/zzsuje/services/trackbacks/450726.html

2.1瀹夎Docker

2.1.1docker 鍗歌澆

 $sudo yum remove docker \                  
 docker-client \               
 docker-client-latest \                 
 docker-common \                  
 docker-latest \                
 docker-latest-logrotate \                 
 docker-logrotate \                
 docker-engine

 2.1.2 瀹夎yum宸ュ叿鍖?/span>
     sudo yum install -y yum-utils

 2.1.3 鍛婅瘔Linux,Docker鍘誨摢閲岃幏鍙栭暅鍍忓畨瑁?/strong>

sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo

 
2.1.4瀹夎Docker

 sudo yum install docker-ce docker-ce-cli containerd.io

 

2.1.5瀹夎瀹屾垚鍚?鏌ョ湅鏄惁鎴愬姛

docker -v  鏌ョ湅docker鐗堟湰

 

docker images   鏌ョ湅docker 宸叉湁闀滃儚 錛堟湭鍚姩錛?/p>

 

 2.1.6 鍚姩docker

  sudo systemctl start docker

 

2.1.7璁劇疆docker 寮鏈哄惎鍔?/strong>

 

 2.1.8 浣跨敤闃塊噷浜戠殑闀滃儚鍔犻熷櫒   鍦ㄩ樋閲屼簯鐨勬帶鍒跺彴涓?鎵句駭鍝佸拰鏈嶅姟 ---瀹瑰櫒闀滃儚鏈嶅姟---闀滃儚鍔犻熷櫒

 

 https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors

sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://d6gqzuc3.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker


2.2 鍦―ocker涓畨瑁卪ysql  

2.2.1瀹夎mysql
https://hub.docker.com/_/mysql?tab=tags&page=1&ordering=last_updated

docker pull mysql:5.7

2.2.2 瀹夎鎴愬姛鍚?鏌ョ湅闀滃儚

docker images

2.2.3璁劇疆绔彛鏄犲皠

sudo docker run -3306:3306 --name mysql \
-/mydata/mysql/log:/var/log/mysql \
-/mydata/mysql/data:/var/lib/mysql \
-/mydata/mysql/conf:/etc/mysql \
-e MYSQL_ROOT_PASSWORD=root \
-d mysql:5.7

2.2.4 docker ps 鏌ョ湅宸插惎鐢ㄧ殑瀹瑰櫒

 2.2.5 淇敼閰嶆棩蹇楁枃浠?/span>

 [client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
init_connect
='SET collation_connection = utf8_unicode_ci'
init_connect
='SET NAMES utf8'
character
-set-server=utf8
collation
-server=utf8_unicode_ci
skip
-character-set-client-handshake
skip
-name-resolve

2.2.6淇濆瓨鍚?閲嶅惎 璁劇疆 鍚姩docker鏃?鍗寵繍琛宮ysql

docker update mysql --restart=always

 
2.3Docker 瀹夎Redis

2.3.1瀹夎Redis

docker pull redis
2.3.2 閰嶇疆Redis鏈嶅姟
# 鍒涘緩閰嶇疆飩備歡瀛樺偍璺緞
mkdir -/mydata/redis/conf
# 鍒涘緩閰嶇疆飩備歡
touch /mydata/redis/conf/redis.conf
# 濉啓閰嶇疆淇℃伅銆愭暟鎹寔涔呭寲AOF銆?/div>
echo "appendonly yes" >> /mydata/redis/conf/redis.conf

鍚姩redis闀滃儚
docker run -p 6379:6379 --name redis \
-v /mydata/redis/data:/data \
-v /mydata/redis/conf/redis.conf:/etc/redis/redis.conf \
-d redis redis-server /etc/redis/redis.conf

鍛戒護(hù)璇存槑錛?/strong>
-10001:6379 :  灝嗗鍣ㄧ殑6379绔彛鏄犲皠鍒頒富鏈虹殑10001绔彛
--name redis :     瀹瑰櫒鍚嶅瓧
-/data/redis/redis.conf:/etc/redis/redis.conf : 灝嗕富鏈轟腑閰嶇疆鏂囦歡鎸傝澆鍒板鍣ㄤ腑
-/data/redis/data:/data : 灝嗕富鏈轟腑data鎸傝澆鍒板鍣ㄧ殑/data
redis
-server --appendonly yes : 鍦ㄥ鍣ㄦ墽琛宺edis-server鍚姩鍛戒護(hù)錛屽茍鎵撳紑redis鎸佷箙鍖栭厤緗?/strong>
redis
-server /etc/redis/redis.conf : 瀹瑰櫒涓互閰嶇疆鏂囦歡鏂瑰紡鍚姩redis
2.3.3嫻嬭瘯r(shí)edis
# 榪涒紛redis瀹瑰櫒錛屽茍涓旀墽餼弐edis-cli鐨勫懡浠?/div>
docker exec -it redis redis-cli
2.3.4璁劇疆redis瀹瑰櫒鍦―ocker鍚姩鐨勬椂鍊欏惎鍔?/strong>
docker update redis --restart=always


 



zzsuje 2022-04-24 15:45 鍙戣〃璇勮
]]> 主站蜘蛛池模板: 亚洲a无码综合a国产av中文| 67194成是人免费无码| 在线亚洲97se亚洲综合在线| 国产精品亚洲色图| 午夜老司机免费视频| 国产亚洲国产bv网站在线| 91香蕉国产线在线观看免费| 国产精品亚洲一区二区三区在线| 羞羞视频在线观看免费| 免费一级大黄特色大片| 亚洲国产成人久久精品软件| 成年18网站免费视频网站| 亚洲精品第一国产综合野| 国产精品入口麻豆免费观看| 亚洲综合无码一区二区三区| 无码A级毛片免费视频内谢| 亚洲热线99精品视频| 国产在线观a免费观看| 亚洲无av在线中文字幕| 中文字幕无线码免费人妻| 亚洲中文字幕不卡无码| 久久国产福利免费| 亚洲综合图色40p| 91在线视频免费观看| 亚洲精品无码专区在线在线播放| 丝袜捆绑调教视频免费区| 亚洲夜夜欢A∨一区二区三区| 亚洲高清免费视频| 亚洲国产婷婷六月丁香| 中文字幕av免费专区| 亚洲精品无码专区在线在线播放| a级成人毛片免费视频高清| 亚洲国产精品无码专区| 日韩免费在线视频| 色拍自拍亚洲综合图区| 亚洲黄色免费网址| 亚洲av午夜精品无码专区| AV免费网址在线观看| 99亚洲男女激情在线观看| 亚洲国产精品自在拍在线播放| 国产精品黄页免费高清在线观看|