

- "1.0" encoding="UTF-8"?>
"http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
4.0.0 -
-
com.atguigu.springcloud -
cloud2024 -
1.0-SNAPSHOT -
pom -
-
-
- <module>cloud-provider-payment8001module>
- <module>cloud-consumer-order80module>
- <module>cloud-api-commonsmodule>
- <module>cloud-eureka-server7001module>
- <module>cloud-eureka-server7002module>
- <module>cloud-provider-payment8002module>
-
-
-
-
-
-
UTF-8 -
1.8 -
1.8 -
4.12 -
1.2.17 -
1.18.30 -
8.0.18 -
1.1.16 -
1.3.0 -
-
-
-
-
-
-
org.springframework.boot -
spring-boot-dependencies -
2.2.2.RELEASE -
pom -
import -
-
-
-
org.springframework.cloud -
spring-cloud-dependencies -
Hoxton.SR1 -
pom -
import -
-
-
-
com.alibaba.cloud -
spring-cloud-alibaba-dependencies -
2.2.0.RELEASE -
pom -
import -
-
-
-
mysql -
mysql-connector-java -
${mysql.version} -
-
-
-
com.alibaba -
druid-spring-boot-starter -
${druid.verison} -
-
-
-
org.mybatis.spring.boot -
mybatis-spring-boot-starter -
${mybatis.spring.boot.verison} -
-
-
-
org.projectlombok -
lombok -
${lombok.version} -
-
-
-
junit -
junit -
${junit.version} -
-
-
-
log4j -
log4j -
${log4j.version} -
-
-
-
-
-
-
-
org.apache.maven.plugins -
maven-compiler-plugin -
3.6.2 -
-
8 -
8 -
-
-
-
-
-
- package com.atguigu.springcloud.entities;
-
- import lombok.AllArgsConstructor;
- import lombok.Data;
- import lombok.NoArgsConstructor;
-
- @Data
- @NoArgsConstructor
- @AllArgsConstructor
- public class CommonResult
{ - private Integer code;
- private String message;
- private T data;
-
- public CommonResult(Integer code,String message){
- this(code,message,null);
- }
- }
- package com.atguigu.springcloud.entities;
-
- import lombok.AllArgsConstructor;
- import lombok.Data;
- import lombok.NoArgsConstructor;
-
- import java.io.Serializable;
-
- @Data
- @NoArgsConstructor
- @AllArgsConstructor
- public class Payment implements Serializable {
- private Long id;
- private String serial;
- }
- "1.0" encoding="UTF-8"?>
- <project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>cloud2024artifactId>
- <groupId>com.atguigu.springcloudgroupId>
- <version>1.0-SNAPSHOTversion>
- parent>
- <modelVersion>4.0.0modelVersion>
-
- <artifactId>cloud-api-commonsartifactId>
-
- <properties>
- <maven.compiler.source>8maven.compiler.source>
- <maven.compiler.target>8maven.compiler.target>
- properties>
- <dependencies>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-webartifactId>
- dependency>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-actuatorartifactId>
- dependency>
- <dependency>
- <groupId>org.projectlombokgroupId>
- <artifactId>lombokartifactId>
- <optional>trueoptional>
- dependency>
- <dependency>
- <groupId>cn.hutoolgroupId>
- <artifactId>hutool-allartifactId>
- <version>5.7.19version>
- dependency>
-
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-devtoolsartifactId>
- <scope>runtimescope>
- <optional>trueoptional>
- dependency>
- dependencies>
-
- project>
- package com.atguigu.springcloud;
-
- import org.springframework.boot.SpringApplication;
- import org.springframework.boot.autoconfigure.SpringBootApplication;
- import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
-
- /**
- * @Author: ASUS
- * @Date: 2024/2/27 20:40
- */
- @SpringBootApplication
- @EnableEurekaClient
- public class OrderMain80 {
- public static void main(String[] args) {
- SpringApplication.run(OrderMain80.class,args);
- }
- }
- package com.atguigu.springcloud.controller;
-
- import com.atguigu.springcloud.entities.CommonResult;
- import com.atguigu.springcloud.entities.Payment;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.beans.factory.annotation.Value;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RestController;
- import org.springframework.web.client.RestTemplate;
-
- import javax.annotation.Resource;
-
- /**
- * @Author: ASUS
- * @Date: 2024/2/27 20:43
- */
- @RestController
- @Slf4j
- 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("/consumer/payment/create")
- public CommonResult
create(Payment payment) { - return restTemplate.postForObject(PAYMENT_URL + "/payment/create", payment, CommonResult.class);
- }
-
- @GetMapping("/consumer/payment/get/{id}")
- public CommonResult
getPayment(@PathVariable("id") Long id) { - return restTemplate.getForObject(PAYMENT_URL + "/payment/get/" + id, CommonResult.class);
- }
- }
- server:
- port: 80
- spring:
- application:
- name: cloud-order-service
- eureka:
- client:
- register-with-eureka: true
- fetch-registry: true
- service-url:
- # defaultZone: http://localhost:7001/eureka
- defaultZone: http://eureka7001.com:7001/eureka,http://eureka7002.com:7002/eureka
- "1.0" encoding="UTF-8"?>
- <project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>cloud2024artifactId>
- <groupId>com.atguigu.springcloudgroupId>
- <version>1.0-SNAPSHOTversion>
- parent>
- <modelVersion>4.0.0modelVersion>
-
- <artifactId>cloud-consumer-order80artifactId>
-
- <properties>
- <maven.compiler.source>8maven.compiler.source>
- <maven.compiler.target>8maven.compiler.target>
- properties>
- <dependencies>
- <dependency>
- <groupId>org.springframework.cloudgroupId>
- <artifactId>spring-cloud-starter-netflix-eureka-clientartifactId>
- <version>2.2.10.RELEASEversion>
- dependency>
- <dependency>
- <groupId>com.atguigu.springcloudgroupId>
- <artifactId>cloud-api-commonsartifactId>
- <version>1.0-SNAPSHOTversion>
- dependency>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-webartifactId>
- dependency>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-actuatorartifactId>
- dependency>
- <dependency>
- <groupId>org.projectlombokgroupId>
- <artifactId>lombokartifactId>
- <optional>trueoptional>
- dependency>
-
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-devtoolsartifactId>
- <scope>runtimescope>
- <optional>trueoptional>
- dependency>
- dependencies>
-
- project>
- server:
- port: 7001
-
- eureka:
- instance:
- hostname: eureka7001.com
- client:
- register-with-eureka: false
- fetch-registry: false
- service-url:
- defaultZone: http://eureka7002.com:7002/eureka/
- "1.0" encoding="UTF-8"?>
- <project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>cloud2024artifactId>
- <groupId>com.atguigu.springcloudgroupId>
- <version>1.0-SNAPSHOTversion>
- parent>
- <modelVersion>4.0.0modelVersion>
-
- <artifactId>cloud-eureka-server7001artifactId>
-
- <properties>
- <maven.compiler.source>8maven.compiler.source>
- <maven.compiler.target>8maven.compiler.target>
- properties>
- <dependencies>
- <dependency>
- <groupId>org.springframework.cloudgroupId>
- <artifactId>spring-cloud-starter-netflix-eureka-serverartifactId>
- <version>2.2.10.RELEASEversion>
- dependency>
-
- <dependency>
- <groupId>com.atguigu.springcloudgroupId>
- <artifactId>cloud-api-commonsartifactId>
- <version>1.0-SNAPSHOTversion>
- dependency>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-webartifactId>
- dependency>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-actuatorartifactId>
- dependency>
- <dependency>
- <groupId>org.projectlombokgroupId>
- <artifactId>lombokartifactId>
- <optional>trueoptional>
- dependency>
-
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-devtoolsartifactId>
- <scope>runtimescope>
- <optional>trueoptional>
- dependency>
- dependencies>
-
- project>
- server:
- port: 7002
-
- eureka:
- instance:
- hostname: eureka7002.com
- client:
- register-with-eureka: false
- fetch-registry: false
- service-url:
- defaultZone: http://eureka7001.com:7001/eureka/
- "1.0" encoding="UTF-8"?>
- <project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>cloud2024artifactId>
- <groupId>com.atguigu.springcloudgroupId>
- <version>1.0-SNAPSHOTversion>
- parent>
- <modelVersion>4.0.0modelVersion>
-
- <artifactId>cloud-eureka-server7002artifactId>
-
- <properties>
- <maven.compiler.source>8maven.compiler.source>
- <maven.compiler.target>8maven.compiler.target>
- properties>
- <dependencies>
- <dependency>
- <groupId>org.springframework.cloudgroupId>
- <artifactId>spring-cloud-starter-netflix-eureka-serverartifactId>
- <version>2.2.10.RELEASEversion>
- dependency>
-
- <dependency>
- <groupId>com.atguigu.springcloudgroupId>
- <artifactId>cloud-api-commonsartifactId>
- <version>1.0-SNAPSHOTversion>
- dependency>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-webartifactId>
- dependency>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-actuatorartifactId>
- dependency>
- <dependency>
- <groupId>org.projectlombokgroupId>
- <artifactId>lombokartifactId>
- <optional>trueoptional>
- dependency>
-
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-devtoolsartifactId>
- <scope>runtimescope>
- <optional>trueoptional>
- dependency>
- dependencies>
-
-
- project>
- package com.atguigu.springcloud;
-
- import org.springframework.boot.SpringApplication;
- import org.springframework.boot.autoconfigure.SpringBootApplication;
- import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
- import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
-
-
- @SpringBootApplication
- @EnableEurekaClient
- @EnableDiscoveryClient
- public class PayMain8001 {
- public static void main(String[] args) {
- SpringApplication.run(PayMain8001.class, args);
- }
- }
- package com.atguigu.springcloud.controller;
-
- import com.atguigu.springcloud.entities.CommonResult;
- import com.atguigu.springcloud.entities.Payment;
- import com.atguigu.springcloud.service.PaymentService;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.beans.factory.annotation.Value;
- import org.springframework.cloud.client.ServiceInstance;
- import org.springframework.cloud.client.discovery.DiscoveryClient;
- import org.springframework.web.bind.annotation.*;
-
- import javax.annotation.Resource;
- import java.util.List;
-
- @RestController
- @Slf4j
- public class PaymentController {
- @Resource
- private PaymentService paymentService;
-
- @Value("${server.port}")
- private String serverPort;
-
- @Resource
- private DiscoveryClient discoveryClient;
-
- @PostMapping(value = "/payment/create")
- public CommonResult create(@RequestBody Payment payment) {
- int result = paymentService.create(payment);
- log.info("******插入结果:" + result);
- if (result > 0) {
- return new CommonResult(200, "插入数据库成功,serverPort:" + serverPort, result);
- } else {
- return new CommonResult(444, "插入数据库失败", null);
- }
- }
-
- @GetMapping(value = "/payment/get/{id}")
- public CommonResult
getPaymentById(@PathVariable("id") Long id) { - Payment payment = paymentService.getPaymentById(id);
- log.info("******查询结果:" + payment);
- if (payment != null) {
- return new CommonResult(200, "查询成功,serverPort:" + serverPort, payment);
- } else {
- return new CommonResult(444, "没有对应纪录,查询失败,查询的id:" + id, null);
- }
- }
-
- @GetMapping(value = "/payment/discovery")
- public Object discovery() {
- List
services = discoveryClient.getServices(); - for (String element : services) {
- log.info("******element:"+element);
- }
- List
instances = discoveryClient.getInstances("CLOUD-PAYMENT-SERVICE"); - for (ServiceInstance instance : instances) {
- log.info(instance.getInstanceId()+"\t"+instance.getHost()+"\t"+instance.getPort()+"\t"+instance.getUri());
- }
- return this.discoveryClient;
- }
- }
- package com.atguigu.springcloud.dao;
-
- import com.atguigu.springcloud.entities.Payment;
- import org.apache.ibatis.annotations.Mapper;
- import org.apache.ibatis.annotations.Param;
-
- @Mapper
- public interface PaymentDao {
- public int create(Payment payment);
-
- public Payment getPaymentById(@Param("id") Long id);
- }
- package com.atguigu.springcloud.service;
-
- import com.atguigu.springcloud.entities.Payment;
- import org.apache.ibatis.annotations.Param;
-
- public interface PaymentService {
- public int create(Payment payment);
-
- public Payment getPaymentById(@Param("id") Long id);
- }
- package com.atguigu.springcloud.service.impl;
-
- import com.atguigu.springcloud.dao.PaymentDao;
- import com.atguigu.springcloud.entities.Payment;
- import com.atguigu.springcloud.service.PaymentService;
- import org.apache.ibatis.annotations.Param;
- import org.springframework.stereotype.Service;
-
- import javax.annotation.Resource;
-
- @Service
- public class PaymentServiceImpl implements PaymentService {
- @Resource
- private PaymentDao paymentDao;
-
- public int create(Payment payment) {
- return paymentDao.create(payment);
- }
-
- public Payment getPaymentById(Long id) {
- return paymentDao.getPaymentById(id);
- }
- }
- server:
- port: 8001
-
- spring:
- application:
- name: cloud-payment-service
- datasource:
- type: com.alibaba.druid.pool.DruidDataSource
- driver-class-name: com.mysql.cj.jdbc.Driver
- url: jdbc:mysql://localhost:3306/db2019?serverTimezone=UTC&allowMultiQueries=true
- username: root
- password: 123456
-
- mybatis:
- mapper-locations: classpath:mapper/*.xml
- type-aliases-package: com.atguigu.springcloud.entities
-
- eureka:
- client:
- register-with-eureka: true
- fetch-registry: true
- service-url:
- # defaultZone: http://localhost:7001/eureka
- defaultZone: http://eureka7001.com:7001/eureka,http://eureka7002.com:7002/eureka
- instance:
- instance-id: payment8001
- prefer-ip-address: true
- "1.0" encoding="UTF-8"?>
- mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.atguigu.springcloud.dao.PaymentDao">
-
- <insert id="create" useGeneratedKeys="true" parameterType="Payment" keyProperty="id">
- insert into payment(serial) values(#{serial});
- insert>
-
- <resultMap id="BaseResultMap" type="com.atguigu.springcloud.entities.Payment">
- <id column="id" property="id" jdbcType="BIGINT"/>
- <id column="serial" property="serial" jdbcType="VARCHAR"/>
- resultMap>
- <select id="getPaymentById" parameterType="Long" resultMap="BaseResultMap">
- select * from payment where id = #{id};
- select>
- mapper>
- "1.0" encoding="UTF-8"?>
- <project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>cloud2024artifactId>
- <groupId>com.atguigu.springcloudgroupId>
- <version>1.0-SNAPSHOTversion>
- parent>
- <modelVersion>4.0.0modelVersion>
-
- <artifactId>cloud-provider-payment8001artifactId>
-
- <properties>
- <maven.compiler.source>8maven.compiler.source>
- <maven.compiler.target>8maven.compiler.target>
- properties>
- <dependencies>
- <dependency>
- <groupId>org.springframework.cloudgroupId>
- <artifactId>spring-cloud-starter-netflix-eureka-clientartifactId>
- <version>2.2.10.RELEASEversion>
- dependency>
-
- <dependency>
- <groupId>com.atguigu.springcloudgroupId>
- <artifactId>cloud-api-commonsartifactId>
- <version>1.0-SNAPSHOTversion>
- dependency>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-webartifactId>
- dependency>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-actuatorartifactId>
- dependency>
- <dependency>
- <groupId>org.mybatis.spring.bootgroupId>
- <artifactId>mybatis-spring-boot-starterartifactId>
- dependency>
- <dependency>
- <groupId>com.alibabagroupId>
- <artifactId>druid-spring-boot-starterartifactId>
-
- dependency>
-
- <dependency>
- <groupId>mysqlgroupId>
- <artifactId>mysql-connector-javaartifactId>
- dependency>
-
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-jdbcartifactId>
- dependency>
-
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-devtoolsartifactId>
- <scope>runtimescope>
- <optional>trueoptional>
- dependency>
- <dependency>
- <groupId>org.projectlombokgroupId>
- <artifactId>lombokartifactId>
- <optional>trueoptional>
- dependency>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-testartifactId>
- <scope>testscope>
- dependency>
- dependencies>
-
- project>
- package com.atguigu.springcloud;
-
- import org.springframework.boot.SpringApplication;
- import org.springframework.boot.autoconfigure.SpringBootApplication;
- import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
-
-
- @SpringBootApplication
- @EnableEurekaClient
- public class PayMain8002 {
- public static void main(String[] args) {
- SpringApplication.run(PayMain8002.class, args);
- }
- }
- package com.atguigu.springcloud.controller;
-
- import com.atguigu.springcloud.entities.CommonResult;
- import com.atguigu.springcloud.entities.Payment;
- import com.atguigu.springcloud.service.PaymentService;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.beans.factory.annotation.Value;
- import org.springframework.web.bind.annotation.*;
-
- import javax.annotation.Resource;
-
- @RestController
- @Slf4j
- public class PaymentController {
- @Resource
- private PaymentService paymentService;
-
- @Value("${server.port}")
- private String serverPort;
-
- @PostMapping(value = "/payment/create")
- public CommonResult create(@RequestBody Payment payment) {
- int result = paymentService.create(payment);
- log.info("******插入结果:" + result);
- if (result > 0) {
- return new CommonResult(200, "插入数据库成功,serverPort:"+serverPort, result);
- } else {
- return new CommonResult(444, "插入数据库失败", null);
- }
- }
-
- @GetMapping(value = "/payment/get/{id}")
- public CommonResult
getPaymentById(@PathVariable("id") Long id) { - Payment payment = paymentService.getPaymentById(id);
- log.info("******查询结果:" + payment);
- if (payment != null) {
- return new CommonResult(200, "查询成功,serverPort:"+serverPort, payment);
- } else {
- return new CommonResult(444, "没有对应纪录,查询失败,查询的id:"+id, null);
- }
- }
- }
- package com.atguigu.springcloud.dao;
-
- import com.atguigu.springcloud.entities.Payment;
- import org.apache.ibatis.annotations.Mapper;
- import org.apache.ibatis.annotations.Param;
-
- @Mapper
- public interface PaymentDao {
- public int create(Payment payment);
-
- public Payment getPaymentById(@Param("id") Long id);
- }
- package com.atguigu.springcloud.service;
-
- import com.atguigu.springcloud.entities.Payment;
- import org.apache.ibatis.annotations.Param;
-
- public interface PaymentService {
- public int create(Payment payment);
-
- public Payment getPaymentById(@Param("id") Long id);
- }
- package com.atguigu.springcloud.service.impl;
-
- import com.atguigu.springcloud.dao.PaymentDao;
- import com.atguigu.springcloud.entities.Payment;
- import com.atguigu.springcloud.service.PaymentService;
- import org.apache.ibatis.annotations.Param;
- import org.springframework.stereotype.Service;
-
- import javax.annotation.Resource;
-
- @Service
- public class PaymentServiceImpl implements PaymentService {
- @Resource
- private PaymentDao paymentDao;
-
- public int create(Payment payment) {
- return paymentDao.create(payment);
- }
-
- public Payment getPaymentById(Long id) {
- return paymentDao.getPaymentById(id);
- }
- }
- server:
- port: 8002
-
- spring:
- application:
- name: cloud-payment-service
- datasource:
- type: com.alibaba.druid.pool.DruidDataSource
- driver-class-name: com.mysql.cj.jdbc.Driver
- url: jdbc:mysql://localhost:3306/db2019?serverTimezone=UTC&allowMultiQueries=true
- username: root
- password: 123456
-
- mybatis:
- mapper-locations: classpath:mapper/*.xml
- type-aliases-package: com.atguigu.springcloud.entities
-
- eureka:
- client:
- register-with-eureka: true
- fetch-registry: true
- service-url:
- # defaultZone: http://localhost:7001/eureka
- defaultZone: http://eureka7001.com:7001/eureka,http://eureka7002.com:7002/eureka
- instance:
- instance-id: payment8002
- prefer-ip-address: true
- "1.0" encoding="UTF-8"?>
- mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.atguigu.springcloud.dao.PaymentDao">
-
- <insert id="create" useGeneratedKeys="true" parameterType="Payment" keyProperty="id">
- insert into payment(serial) values(#{serial});
- insert>
-
- <resultMap id="BaseResultMap" type="com.atguigu.springcloud.entities.Payment">
- <id column="id" property="id" jdbcType="BIGINT"/>
- <id column="serial" property="serial" jdbcType="VARCHAR"/>
- resultMap>
- <select id="getPaymentById" parameterType="Long" resultMap="BaseResultMap">
- select * from payment where id = #{id};
- select>
- mapper>
- "1.0" encoding="UTF-8"?>
- <project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>cloud2024artifactId>
- <groupId>com.atguigu.springcloudgroupId>
- <version>1.0-SNAPSHOTversion>
- parent>
- <modelVersion>4.0.0modelVersion>
-
- <artifactId>cloud-provider-payment8002artifactId>
-
- <properties>
- <maven.compiler.source>8maven.compiler.source>
- <maven.compiler.target>8maven.compiler.target>
- properties>
- <dependencies>
- <dependency>
- <groupId>org.springframework.cloudgroupId>
- <artifactId>spring-cloud-starter-netflix-eureka-clientartifactId>
- <version>2.2.10.RELEASEversion>
- dependency>
-
- <dependency>
- <groupId>com.atguigu.springcloudgroupId>
- <artifactId>cloud-api-commonsartifactId>
- <version>1.0-SNAPSHOTversion>
- dependency>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-webartifactId>
- dependency>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-actuatorartifactId>
- dependency>
- <dependency>
- <groupId>org.mybatis.spring.bootgroupId>
- <artifactId>mybatis-spring-boot-starterartifactId>
- dependency>
- <dependency>
- <groupId>com.alibabagroupId>
- <artifactId>druid-spring-boot-starterartifactId>
-
- dependency>
-
- <dependency>
- <groupId>mysqlgroupId>
- <artifactId>mysql-connector-javaartifactId>
- dependency>
-
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-jdbcartifactId>
- dependency>
-
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-devtoolsartifactId>
- <scope>runtimescope>
- <optional>trueoptional>
- dependency>
- <dependency>
- <groupId>org.projectlombokgroupId>
- <artifactId>lombokartifactId>
- <optional>trueoptional>
- dependency>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-testartifactId>
- <scope>testscope>
- dependency>
- dependencies>
- project>