Spring+Dubbo+MyBatis+Linner分布式Web开发环境搭建

        Spring+Dubbo+MyBatis+Linner分布式Web开发环境搭建

     

        本文承接我之前的博客《Spring+Maven+Dubbo+MyBatis+Linner+Handlebars—Web开发环境搭建》,以下我在对相关的Maven配置和详细的Spring配置文件进行简单介绍。

       整个开发框架大体结构如下:

        

      1) 核心业务逻辑工程用于处理系统自身的核心业务逻辑;

      2) 桥梁工程用于关联页面工程和后台处理逻辑;

      3) 公共业务逻辑对公共的业务逻辑进行处理;

      4) Maven父工程用于对整个开发环境进行配置,包括jar包的定义与管理,系统基本环境的配置(例:数据库连接的管理);

      5) 客户端接口工程用于发布服务给桥梁工程或可信任的第三方调用;

      6) 客户端接口实现工程用于具体实现服务接口;

      7) 任务调度工程用于处理相关任务调度;

      8) 总的框架工程用于对前面的后台工程进行统一的管理。

    以下我将对各个工程进行逐一介绍:

1.核心业务逻辑mkhl-biz:

     mkhl-biz工程的具体结构如下图:
    

   1)biz工程的pom文件:

<?xml version="1.0"?>
<project
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<artifactId>mkhl-parent</artifactId>
		<groupId>com.ouc.mkhl.supplier</groupId>
		<version>1.0</version>
		<relativePath>../mkhl-parent/pom.xml</relativePath>
	</parent>
	<artifactId>mkhl-biz</artifactId>
	<name>mkhl-biz</name>
	<url>http://maven.apache.org</url>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>
	<dependencies>
		<!-- oop开放平台核心业务(此jar包须具有相关开发权限) -->
		<dependency>
			<groupId>com.ouc</groupId>
			<artifactId>oop-core</artifactId>
		</dependency>
		<dependency>
			<groupId>weblogic</groupId>
			<artifactId>wlfullclient</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>dubbo</artifactId>
		</dependency>
		
		<!-- 
		<dependency> 
		    <groupId>redis.clients</groupId> 
		    <artifactId>jedis</artifactId> 
		</dependency> 
		-->
		
		<dependency>
			<groupId>com.ouc.mkhl.supplier</groupId>
			<artifactId>mkhl-service-client</artifactId>
			<exclusions>
				<exclusion>
					<groupId>ch.qos.logback</groupId>
					<artifactId>logback-classic</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>com.ouc.mkhl.supplier</groupId>
			<artifactId>mkhl-common</artifactId>
		</dependency>
		<dependency>
			<groupId>org.mybatis</groupId>
			<artifactId>mybatis-spring</artifactId>
		</dependency>
		<dependency>
			<groupId>org.mybatis</groupId>
			<artifactId>mybatis</artifactId>
		</dependency>
		<dependency>
			<groupId>org.mybatis.generator</groupId>
			<artifactId>mybatis-generator-core</artifactId>
		</dependency>
		<dependency>
			<groupId>com.github.sgroschupf</groupId>
			<artifactId>zkclient</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.zookeeper</groupId>
			<artifactId>zookeeper</artifactId>
		</dependency>

		<dependency>
			<groupId>javax.jms</groupId>
			<artifactId>jms-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-jms</artifactId>
		</dependency>
		<dependency>
			<groupId>com.oracle</groupId>
			<artifactId>ojdbc14</artifactId>
		</dependency>

		<!-- mysql连接 -->
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<!-- <version>5.1.34</version> -->
		</dependency>
		<dependency>
			<groupId>commons-pool</groupId>
			<artifactId>commons-pool</artifactId>
			<!-- <version>1.6</version> -->
		</dependency>
		<dependency>
			<groupId>commons-dbcp</groupId>
			<artifactId>commons-dbcp</artifactId>
			<!-- <version>1.4</version> -->
		</dependency>

		<dependency>
			<groupId>org.aspectj</groupId>
			<artifactId>aspectjweaver</artifactId>
		</dependency>
		<dependency>
			<groupId>cglib</groupId>
			<artifactId>cglib</artifactId>
		</dependency>
		<dependency>
			<groupId>aopalliance</groupId>
			<artifactId>aopalliance</artifactId>
		</dependency>
		<!-- XStream -->
		<dependency>
			<groupId>com.thoughtworks.xstream</groupId>
			<artifactId>xstream</artifactId>
		</dependency>
		<dependency>
			<groupId>xpp3</groupId>
			<artifactId>xpp3_min</artifactId>
		</dependency>

		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-ooxml</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-beanutils</groupId>
			<artifactId>commons-beanutils</artifactId>
		</dependency>
		<dependency>
			<groupId>org.quartz-scheduler</groupId>
			<artifactId>quartz</artifactId>
		</dependency>
		<dependency>
			<groupId>org.terracotta.quartz</groupId>
			<artifactId>quartz-terracotta</artifactId>
		</dependency>
		<dependency>
			<groupId>org.freemarker</groupId>
			<artifactId>freemarker</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context-support</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-jdbc</artifactId>
		</dependency>
		<dependency>
			<groupId>net.sf.ehcache</groupId>
			<artifactId>ehcache</artifactId>
			<type>pom</type>
		</dependency>
		<dependency>
			<groupId>com.haier.openplatform.hfs</groupId>
			<artifactId>hfs-service-client</artifactId>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
		</dependency>
		<dependency>
			<groupId>com.ouc.openplatform</groupId>
			<artifactId>monitor-service-client</artifactId>
		</dependency>
		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>druid</artifactId>
		</dependency>
		<dependency>
			<groupId>com.dangdang</groupId>
			<artifactId>config-toolkit-easyzk</artifactId>
		</dependency>
		<dependency>
			<groupId>mx4j</groupId>
			<artifactId>mx4j</artifactId>
		</dependency>
		<dependency>
			<groupId>mx4j</groupId>
			<artifactId>mx4j-tools</artifactId>
		</dependency>
		<dependency>
			<groupId>com.ouc</groupId>
			<artifactId>openapi-auth</artifactId>
		</dependency>
		<dependency>
			<groupId>com.ouc</groupId>
			<artifactId>openapi-service-client</artifactId>
		</dependency>
	</dependencies>
</project>
    注:当中与ouc相关的包不对外开发。

   2)以安全模块为例,对单一模块的编写进行简单介绍。

   单一模块结构如下图:
   
     (1)advice实例:OperationLogAdvice
package com.ouc.mkhl.supplier.security.advice;

import java.util.Date;

import org.aspectj.lang.ProceedingJoinPoint;

import com.ouc.openplatform.log.advice.DefaultOperationLogAdvice;
import com.ouc.openplatform.log.config.LogConfiguration;
import com.ouc.openplatform.log.domain.OperationLog;
import com.ouc.openplatform.security.LoginContext;
import com.ouc.openplatform.security.LoginContextHolder;
import com.ouc.openplatform.util.OOPConstant;
import com.ouc.mkhl.supplier.security.service.OperationLogService;

/**
 * @author Tom
 */
public class OperationLogAdvice extends DefaultOperationLogAdvice {
	private OperationLogService operationLogService;
	@Override
	protected void saveLog(OperationLog operationLog) {
		operationLogService.save(operationLog);
	}
	public void setOperationLogService(OperationLogService operationLogService) {
		this.operationLogService = operationLogService;
	}
	
	protected OperationLog createOperationLog(ProceedingJoinPoint thisJoinPoint,LogConfiguration logConfiguration){
		LoginContext loginContext = LoginContextHolder.get();
		if(loginContext == null){
			loginContext = new LoginContext();
			loginContext.setUserId(-999L);
			loginContext.setUserName("-SYSTEM-");
		}
		OperationLog operationLog = new OperationLog();
		operationLog.setAppName(HOPConstant.getAppName());
		operationLog.setGmtCreate(new Date());
		operationLog.setGmtModified(new Date());
		operationLog.setUserId(loginContext.getUserId());
		operationLog.setUserName(loginContext.getUserName());
		operationLog.setOperationType(logConfiguration.getType());
		operationLog.setModule(logConfiguration.getModule());
		operationLog.setDescription(executeTemplate(getMessage(logConfiguration.getMessageMap()),thisJoinPoint));
		return operationLog;
	}
}
    (2)dao实例:SupplyUserDAO
package com.ouc.mkhl.supplier.security.dao;

import java.util.List;

import com.ouc.mkhl.supplier.security.model.SupplyUser;

public interface SupplyUserDAO {
    
    public int deleteByPrimaryKey(String supplycode);

    public int insert(SupplyUser record);

    public int insertSelective(SupplyUser record);

    public SupplyUser selectByPrimaryKey(String supplycode);

    public int updateByPrimaryKeySelective(SupplyUser record);

    public int updateByPrimaryKey(SupplyUser record);
    
    public List<SupplyUser> selectAllSupplyUser();
    
    public SupplyUser selectByVCode(String supplycode);
    
}
     (3)domain实例:OrderNum
package com.ouc.mkhl.supplier.security.domain;

public class OrderNum {

    private String itemName; // 项目名

    private int myOrderNum; // 我的订单

    private int proOrderNum; // 订单生产

    private int tstOrderNum; // 订单检测

    private int subOrderNum; // 订单交付

    private String percentage; // 完成率

    public String getItemName() {
	return itemName;
    }

    public void setItemName(String itemName) {
	this.itemName = itemName == null ? null : itemName.trim();
    }

    public int getMyOrderNum() {
	return myOrderNum;
    }

    public void setMyOrderNum(int myOrderNum) {
	this.myOrderNum = myOrderNum;
    }

    public int getProOrderNum() {
	return proOrderNum;
    }

    public void setProOrderNum(int proOrderNum) {
	this.proOrderNum = proOrderNum;
    }

    public int getTstOrderNum() {
	return tstOrderNum;
    }

    public void setTstOrderNum(int tstOrderNum) {
	this.tstOrderNum = tstOrderNum;
    }

    public int getSubOrderNum() {
	return subOrderNum;
    }

    public void setSubOrderNum(int subOrderNum) {
	this.subOrderNum = subOrderNum;
    }

    public String getPercentage() {
	return percentage;
    }

    public void setPercentage(String percentage) {
	this.percentage = percentage == null ? null : percentage.trim();
    }
}
    (4)model实例:SupplyUser
package com.ouc.mkhl.supplier.security.model;

import java.io.Serializable;

public class SupplyUser implements Serializable{

    private static final long serialVersionUID = -123120032141L;
    
    private String supplycode;

    private String supplypass;

    private String supplyname;

    public String getSupplycode() {
        return supplycode;
    }

    public void setSupplycode(String supplycode) {
        this.supplycode = supplycode == null ? null : supplycode.trim();
    }

    public String getSupplypass() {
        return supplypass;
    }

    public void setSupplypass(String supplypass) {
        this.supplypass = supplypass == null ? null : supplypass.trim();
    }

    public String getSupplyname() {
        return supplyname;
    }

    public void setSupplyname(String supplyname) {
        this.supplyname = supplyname == null ? null : supplyname.trim();
    }
}
    (5)内部Service接口实例:SupplyUserService
package com.ouc.mkhl.supplier.security.service;

import java.util.List;

import com.ouc.mkhl.supplier.security.model.SupplyUser;

public interface SupplyUserService {
    
    public int saveSupplyUser(SupplyUser supplyUser);
    
    public List<SupplyUser> getAllSupplyUser();
    
    public SupplyUser getSupplyUserByVCode(String supplycode);
    
}
   (6) 内部Service接口实现实例:SupplyUserServiceImpl
package com.ouc.mkhl.supplier.security.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.ouc.mkhl.supplier.security.dao.SupplyUserDAO;
import com.ouc.mkhl.supplier.security.model.SupplyUser;
import com.ouc.mkhl.supplier.security.service.SupplyUserService;

@Service
public class SupplyUserServiceImpl implements SupplyUserService {

    private SupplyUserDAO supplyUserDAO;

    public SupplyUserDAO getSupplyUserDAO() {
	return supplyUserDAO;
    }

    public void setSupplyUserDAO(SupplyUserDAO supplyUserDAO) {
	this.supplyUserDAO = supplyUserDAO;
    }

    @Override
    public int saveSupplyUser(SupplyUser supplyUser) {
	int a = supplyUserDAO.insert(supplyUser);
	return a;
    }

    @Override
    public List<SupplyUser> getAllSupplyUser() {
	System.out.println("进入了biz层impl的getAllSupplyUser");
	List<SupplyUser> supplyUserList = null;
	try {
	    supplyUserList = supplyUserDAO.selectAllSupplyUser();
	} catch (Exception e) {
	    e.printStackTrace();
	}
	return supplyUserList;
    }

    @Override
    public SupplyUser getSupplyUserByVCode(String supplycode) {
	SupplyUser supplyUser = null;
	try {
	    supplyUser = supplyUserDAO.selectByVCode(supplycode);
	} catch (Exception e) {
	    e.printStackTrace();
	}
	return supplyUser;
    }
}

    3)MyBatis配置:

      (1)sqlMapConfig.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
  PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
  "http://mybatis.org/dtd/mybatis-3-config.dtd">

<configuration>
	<settings>
		<setting name="cacheEnabled" value="true" />
		<setting name="lazyLoadingEnabled" value="true" />
		<setting name="multipleResultSetsEnabled" value="true" />
		<setting name="useColumnLabel" value="true" />
		<setting name="useGeneratedKeys" value="false" />
		<setting name="autoMappingBehavior" value="PARTIAL" />
		<setting name="defaultExecutorType" value="SIMPLE" /><!-- SIMPLE REUSE BATCH -->
		<!-- <setting name="defaultExecutorType" value="BATCH" /> -->
		<setting name="defaultStatementTimeout" value="25000" />
		<setting name="safeRowBoundsEnabled" value="false" />
		<setting name="mapUnderscoreToCamelCase" value="false" />
		<setting name="localCacheScope" value="SESSION" />
		<!-- <setting name="jdbcTypeForNull" value="OTHER" /> -->
		<setting name="jdbcTypeForNull" value="NULL" />
		<setting name="lazyLoadTriggerMethods" value="equals,clone,hashCode,toString" />
	</settings>
	<typeAliases>
	    <!-- =========================================================== -->
	    <!-- security模块 -->
	    <!-- =========================================================== -->
	    <typeAlias alias="supplyUser" type="com.ouc.mkhl.supplier.security.model.SupplyUser"/>
	</typeAliases>
	
	<typeHandlers>
	  <typeHandler handler="com.ouc.openplatform.dao.mybatis.SerializableTypeHandler"/>
	</typeHandlers>
</configuration>
    (2)mappers/security/SupplyUserMapper.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.ouc.mkhl.supplier.security.dao.SupplyUserDAO" >
  <resultMap id="SupplyUserMap" type="supplyUser" >
    <id column="SupplyCode" property="supplycode" jdbcType="VARCHAR" />
    <result column="SupplyPass" property="supplypass" jdbcType="VARCHAR" />
    <result column="SupplyName" property="supplyname" jdbcType="VARCHAR" />
  </resultMap>
  
  <sql id="Base_Column_List" >
    SupplyCode, SupplyPass, SupplyName
  </sql>
 
  <select id="selectAllSupplyUser" resultMap="SupplyUserMap">
    select * from supplyuser
  </select>
 
  <select id="selectByVCode" resultType="supplyUser" parameterType="java.lang.String" >
    select * from supplyuser
    where SupplyCode = #{supplycode,jdbcType=VARCHAR}
  </select>
  
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from supplyuser
    where SupplyCode = #{supplycode,jdbcType=VARCHAR}
  </delete>
  
  <insert id="insert" parameterType="supplyUser" >
    insert into supplyuser (SupplyCode, SupplyPass, SupplyName
      )
    values (#{supplycode,jdbcType=VARCHAR}, #{supplypass,jdbcType=VARCHAR}, #{supplyname,jdbcType=VARCHAR}
      )
  </insert>
  
  <insert id="insertSelective" parameterType="supplyUser" >
    insert into supplyuser
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="supplycode != null" >
        SupplyCode,
      </if>
      <if test="supplypass != null" >
        SupplyPass,
      </if>
      <if test="supplyname != null" >
        SupplyName,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="supplycode != null" >
        #{supplycode,jdbcType=VARCHAR},
      </if>
      <if test="supplypass != null" >
        #{supplypass,jdbcType=VARCHAR},
      </if>
      <if test="supplyname != null" >
        #{supplyname,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  
  <update id="updateByPrimaryKeySelective" parameterType="supplyUser" >
    update supplyuser
    <set >
      <if test="supplypass != null" >
        SupplyPass = #{supplypass,jdbcType=VARCHAR},
      </if>
      <if test="supplyname != null" >
        SupplyName = #{supplyname,jdbcType=VARCHAR},
      </if>
    </set>
    where SupplyCode = #{supplycode,jdbcType=VARCHAR}
  </update>
  
  <update id="updateByPrimaryKey" parameterType="supplyUser" >
    update supplyuser
    set SupplyPass = #{supplypass,jdbcType=VARCHAR},
      SupplyName = #{supplyname,jdbcType=VARCHAR}
    where SupplyCode = #{supplycode,jdbcType=VARCHAR}
  </update>
</mapper>

    4)Spring相关配置:

   (1)spring/spring-common.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jee="http://www.springframework.org/schema/jee"
	xmlns:lang="http://www.springframework.org/schema/lang" xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="
     http://www.springframework.org/schema/beans 
     http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
     http://www.springframework.org/schema/tx
     http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
     http://www.springframework.org/schema/aop 
     http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
     http://www.springframework.org/schema/jee 
     http://www.springframework.org/schema/jee/spring-jee-3.1.xsd
     http://www.springframew
  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
下面是Spring Cloud Alibaba + Spring Boot + Dubbo + Nacos + Mybatis Plus + MySQL 项目搭建步骤: 1. 创建一个Spring Boot项目,并添加以下依赖: ```xml <!--Spring Boot依赖--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!--Dubbo依赖--> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-dubbo</artifactId> <version>2.2.1.RELEASE</version> </dependency> <!--Nacos依赖--> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> <version>2.2.1.RELEASE</version> </dependency> <!--Mybatis Plus依赖--> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.4.3</version> </dependency> <!--MySQL依赖--> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.23</version> </dependency> ``` 2. 配置application.yml文件,添加以下内容: ```yaml spring: application: name: service-provider # 服务名称 datasource: url: jdbc:mysql://localhost:3306/db_example # 数据库URL username: root # 数据库用户名 password: root # 数据库密码 driver-class-name: com.mysql.cj.jdbc.Driver # 数据库驱动 mybatis-plus: mapper-locations: classpath:mapper/*.xml # Mybatis Plus的mapper文件路径 dubbo: application: name: dubbo-service-provider # Dubbo应用名称 registry: address: nacos://localhost:8848 # Nacos注册中心地址 protocol: name: dubbo # Dubbo协议名称 port: 20880 # Dubbo协议端口号 ``` 3. 创建一个数据模型类,例如: ```java @Data public class User { private Long id; private String username; private String password; private String email; } ``` 4. 创建一个Mapper类,例如: ```java @Mapper public interface UserMapper extends BaseMapper<User> { } ``` 5. 创建一个Service类,例如: ```java @Service public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService { } ``` 6. 创建一个Controller类,例如: ```java @RestController @RequestMapping("/user") public class UserController { @Autowired private UserService userService; @GetMapping("/{id}") public User getUser(@PathVariable Long id) { return userService.getById(id); } } ``` 7. 在Nacos控制台中添加服务提供者的配置信息。 8. 启动服务提供者,并在Nacos控制台中查看服务是否注册成功。 9. 创建一个服务消费者项目,并添加以下依赖: ```xml <!--Spring Boot依赖--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!--Dubbo依赖--> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-dubbo</artifactId> <version>2.2.1.RELEASE</version> </dependency> <!--Nacos依赖--> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> <version>2.2.1.RELEASE</version> </dependency> ``` 10. 配置application.yml文件,添加以下内容: ```yaml spring: application: name: service-consumer # 服务名称 dubbo: application: name: dubbo-service-consumer # Dubbo应用名称 registry: address: nacos://localhost:8848 # Nacos注册中心地址 ``` 11. 创建一个Service类,例如: ```java @Service public class UserServiceImpl implements UserService { @Reference private UserService userService; @Override public User getUser(Long id) { return userService.getById(id); } } ``` 12. 创建一个Controller类,例如: ```java @RestController @RequestMapping("/user") public class UserController { @Autowired private UserService userService; @GetMapping("/{id}") public User getUser(@PathVariable Long id) { return userService.getUser(id); } } ``` 13. 启动服务消费者,访问http://localhost:8080/user/{id},查看服务是否调用成功。 以上就是Spring Cloud Alibaba + Spring Boot + Dubbo + Nacos + Mybatis Plus + MySQL项目搭建步骤。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值