commit
db75f56498
40 changed files with 788 additions and 0 deletions
@ -0,0 +1,2 @@ |
|||||
|
# Default ignored files |
||||
|
/workspace.xml |
||||
@ -0,0 +1,18 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project version="4"> |
||||
|
<component name="CompilerConfiguration"> |
||||
|
<annotationProcessing> |
||||
|
<profile name="Maven default annotation processors profile" enabled="true"> |
||||
|
<sourceOutputDir name="target/generated-sources/annotations" /> |
||||
|
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> |
||||
|
<outputRelativeToContentRoot value="true" /> |
||||
|
<module name="payment-eureka-app" /> |
||||
|
<module name="payment-common-app" /> |
||||
|
<module name="payment-base-app" /> |
||||
|
</profile> |
||||
|
</annotationProcessing> |
||||
|
<bytecodeTargetLevel> |
||||
|
<module name="rbseurekaserverapp" target="1.8" /> |
||||
|
</bytecodeTargetLevel> |
||||
|
</component> |
||||
|
</project> |
||||
@ -0,0 +1,10 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project version="4"> |
||||
|
<component name="Encoding"> |
||||
|
<file url="file://$PROJECT_DIR$" charset="UTF-8" /> |
||||
|
<file url="file://$PROJECT_DIR$/payment-base-app" charset="UTF-8" /> |
||||
|
<file url="file://$PROJECT_DIR$/payment-common-app" charset="UTF-8" /> |
||||
|
<file url="file://$PROJECT_DIR$/payment-eureka-app" charset="UTF-8" /> |
||||
|
<file url="file://$PROJECT_DIR$/payment-eureka-server-app" charset="UTF-8" /> |
||||
|
</component> |
||||
|
</project> |
||||
@ -0,0 +1,14 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project version="4"> |
||||
|
<component name="ExternalStorageConfigurationManager" enabled="true" /> |
||||
|
<component name="MavenProjectsManager"> |
||||
|
<option name="originalFiles"> |
||||
|
<list> |
||||
|
<option value="$PROJECT_DIR$/pom.xml" /> |
||||
|
</list> |
||||
|
</option> |
||||
|
</component> |
||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> |
||||
|
<output url="file://$PROJECT_DIR$/out" /> |
||||
|
</component> |
||||
|
</project> |
||||
@ -0,0 +1,124 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project version="4"> |
||||
|
<component name="Palette2"> |
||||
|
<group name="Swing"> |
||||
|
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" /> |
||||
|
</item> |
||||
|
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" /> |
||||
|
</item> |
||||
|
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" /> |
||||
|
</item> |
||||
|
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true"> |
||||
|
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" /> |
||||
|
</item> |
||||
|
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" /> |
||||
|
<initial-values> |
||||
|
<property name="text" value="Button" /> |
||||
|
</initial-values> |
||||
|
</item> |
||||
|
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> |
||||
|
<initial-values> |
||||
|
<property name="text" value="RadioButton" /> |
||||
|
</initial-values> |
||||
|
</item> |
||||
|
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> |
||||
|
<initial-values> |
||||
|
<property name="text" value="CheckBox" /> |
||||
|
</initial-values> |
||||
|
</item> |
||||
|
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" /> |
||||
|
<initial-values> |
||||
|
<property name="text" value="Label" /> |
||||
|
</initial-values> |
||||
|
</item> |
||||
|
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
||||
|
<preferred-size width="150" height="-1" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
||||
|
<preferred-size width="150" height="-1" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
||||
|
<preferred-size width="150" height="-1" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||
|
<preferred-size width="150" height="50" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||
|
<preferred-size width="150" height="50" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||
|
<preferred-size width="150" height="50" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" /> |
||||
|
</item> |
||||
|
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||
|
<preferred-size width="150" height="50" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3"> |
||||
|
<preferred-size width="150" height="50" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||
|
<preferred-size width="150" height="50" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> |
||||
|
<preferred-size width="200" height="200" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> |
||||
|
<preferred-size width="200" height="200" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> |
||||
|
</item> |
||||
|
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> |
||||
|
</item> |
||||
|
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" /> |
||||
|
</item> |
||||
|
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" /> |
||||
|
</item> |
||||
|
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1"> |
||||
|
<preferred-size width="-1" height="20" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" /> |
||||
|
</item> |
||||
|
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" /> |
||||
|
</item> |
||||
|
</group> |
||||
|
</component> |
||||
|
</project> |
||||
@ -0,0 +1,72 @@ |
|||||
|
<?xml version="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>rbsservice</artifactId> |
||||
|
<groupId>com.rbs.springcloud</groupId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>payment-base-app</artifactId> |
||||
|
|
||||
|
<dependencies> |
||||
|
<!-- 引入实体的包--> |
||||
|
<dependency> |
||||
|
<groupId>com.rbs.springcloud</groupId> |
||||
|
<artifactId>payment-common-app</artifactId> |
||||
|
<version>${project.version}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- eureka client --> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.cloud</groupId> |
||||
|
<artifactId>spring-cloud-starter-netflix-eureka-client</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.mybatis.spring.boot</groupId> |
||||
|
<artifactId>mybatis-spring-boot-starter</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba</groupId> |
||||
|
<artifactId>druid-spring-boot-starter</artifactId> |
||||
|
<version>1.1.10</version> |
||||
|
</dependency> |
||||
|
<!--mysql-connector-java--> |
||||
|
<dependency> |
||||
|
<groupId>mysql</groupId> |
||||
|
<artifactId>mysql-connector-java</artifactId> |
||||
|
</dependency> |
||||
|
<!--jdbc--> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-jdbc</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-devtools</artifactId> |
||||
|
<scope>runtime</scope> |
||||
|
<optional>true</optional> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.projectlombok</groupId> |
||||
|
<artifactId>lombok</artifactId> |
||||
|
<optional>true</optional> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-test</artifactId> |
||||
|
<scope>test</scope> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
</project> |
||||
@ -0,0 +1,14 @@ |
|||||
|
package com.base.springclould; |
||||
|
|
||||
|
import org.springframework.boot.SpringApplication; |
||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
|
import org.springframework.cloud.netflix.eureka.EnableEurekaClient; |
||||
|
|
||||
|
@SpringBootApplication |
||||
|
@EnableEurekaClient |
||||
|
public class PaymentBaseApplication { |
||||
|
|
||||
|
public static void main(String[] args) { |
||||
|
SpringApplication.run(PaymentBaseApplication.class, args); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.base.springclould.controller; |
||||
|
|
||||
|
import com.base.springclould.service.MerchantService; |
||||
|
import com.rbs.springcloud.pojo.base.CommonResult; |
||||
|
import com.rbs.springcloud.pojo.constant.ErrorConstant; |
||||
|
import com.rbs.springcloud.pojo.merchant.*; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
@RestController |
||||
|
@Slf4j |
||||
|
public class MerchantController { |
||||
|
|
||||
|
@Autowired |
||||
|
private MerchantService merchantService; |
||||
|
|
||||
|
@PostMapping("/merchant/add") |
||||
|
public CommonResult create(@RequestBody Merchant merchant) { |
||||
|
// TODO 业务逻辑
|
||||
|
|
||||
|
return new CommonResult(ErrorConstant.NULL_OBJ.getCode(), ErrorConstant.NULL_OBJ.getMessage(), null); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
package com.base.springclould.dao; |
||||
|
|
||||
|
import com.rbs.springcloud.pojo.merchant.Merchant; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
|
||||
|
@Mapper |
||||
|
@Resource |
||||
|
public interface MerchantDao { |
||||
|
|
||||
|
int insert(Merchant merchant); |
||||
|
} |
||||
@ -0,0 +1,8 @@ |
|||||
|
package com.base.springclould.service; |
||||
|
|
||||
|
import com.rbs.springcloud.pojo.merchant.Merchant; |
||||
|
|
||||
|
public interface MerchantService { |
||||
|
|
||||
|
void merchantAdd(Merchant merchant); |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
package com.base.springclould.service.imp; |
||||
|
|
||||
|
import com.base.springclould.service.MerchantService; |
||||
|
import com.rbs.springcloud.pojo.merchant.Merchant; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
@Service |
||||
|
public class MerchantServiceImp implements MerchantService { |
||||
|
|
||||
|
@Override |
||||
|
public void merchantAdd(Merchant merchant) { |
||||
|
// TODO 添加商户逻辑
|
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,32 @@ |
|||||
|
server: |
||||
|
port: 8001 #服务端口 |
||||
|
#eureka配置 |
||||
|
#eureka配置 |
||||
|
eureka: |
||||
|
client: |
||||
|
#表示是否将自己注册进eureka 默认为true |
||||
|
register-with-eureka: true |
||||
|
#是否从EurekaServer中抓取已有的注册信息,默认为true,单点无所谓,集群必须设置true才能和ribbon使用负载均衡 |
||||
|
fetch-registry: true |
||||
|
service-url: |
||||
|
#集群配置 |
||||
|
defaultZone: http://eureka7002.com:7002/eureka |
||||
|
instance: |
||||
|
#服务名称修改 |
||||
|
instance-id: PAYMENT-BASE |
||||
|
#访问路径可以显示ip地址 |
||||
|
prefer-ip-address: true |
||||
|
#spring相关配置 |
||||
|
spring: |
||||
|
application: |
||||
|
name: mcroservice-payment #服务名 |
||||
|
datasource: |
||||
|
type: com.alibaba.druid.pool.DruidDataSource #当前数据源操作类型 |
||||
|
driver-class-name: org.gjt.mm.mysql.Driver #数据库驱动包 |
||||
|
url: jdbc:mysql://106.14.81.251:3306/rbs_erp_test?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false |
||||
|
username: root |
||||
|
password: hnrr%%360 |
||||
|
#mybatis:配置 |
||||
|
mybatis: |
||||
|
mapperLocations: classpath:dao/*.xml |
||||
|
type-aliases-package: com.rbs.springcloud.pojo |
||||
@ -0,0 +1,52 @@ |
|||||
|
<!DOCTYPE mapper |
||||
|
PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dqueryByidtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
|
||||
|
<mapper namespace="com.rbs.springcloud.pojo.merchant.Merchant"> |
||||
|
<resultMap id="BaseResultMap" type="com.rbs.springcloud.pojo.merchant.Merchant"> |
||||
|
<id column="merchantId" property="merchant_id" jdbcType="varchar"/> |
||||
|
<id column="merchantName" property="merchant_name" jdbcType="varchar"/> |
||||
|
<id column="cityStoreName" property="city_store_name" jdbcType="varchar"/> |
||||
|
<id column="storeBrandName" property="store_brand_name" jdbcType="varchar"/> |
||||
|
<id column="timeStamp" property="time_stamp" jdbcType="varchar"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<insert id="insert" parameterType="com.rbs.springcloud.pojo.merchant.Merchant" useGeneratedKeys="true" |
||||
|
keyProperty="merchantId"> |
||||
|
insert into merchant |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="merchantId != null"> |
||||
|
merchant_id, |
||||
|
</if> |
||||
|
<if test="merchantName != null"> |
||||
|
merchant_name, |
||||
|
</if> |
||||
|
<if test="cityStoreName != null"> |
||||
|
city_store_name, |
||||
|
</if> |
||||
|
<if test="storeBrandName != null"> |
||||
|
store_brand_name, |
||||
|
</if> |
||||
|
<if test="timeStamp != null"> |
||||
|
time_stamp, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="merchantId != null and merchantId != ''"> |
||||
|
#{merchantId,jdbcType=varchar}, |
||||
|
</if> |
||||
|
<if test="merchantName != null and merchantName != ''"> |
||||
|
#{merchantName,jdbcType=varchar}, |
||||
|
</if> |
||||
|
<if test="cityStoreName != null and cityStoreName != ''"> |
||||
|
#{cityStoreName,jdbcType=varchar}, |
||||
|
</if> |
||||
|
<if test="storeBrandName != null and storeBrandName != ''"> |
||||
|
#{storeBrandName,jdbcType=varchar}, |
||||
|
</if> |
||||
|
<if test="timeStamp != null and timeStamp != ''"> |
||||
|
#{timeStamp,jdbcType=varchar}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
</mapper> |
||||
@ -0,0 +1,32 @@ |
|||||
|
server: |
||||
|
port: 8001 #服务端口 |
||||
|
#eureka配置 |
||||
|
#eureka配置 |
||||
|
eureka: |
||||
|
client: |
||||
|
#表示是否将自己注册进eureka 默认为true |
||||
|
register-with-eureka: true |
||||
|
#是否从EurekaServer中抓取已有的注册信息,默认为true,单点无所谓,集群必须设置true才能和ribbon使用负载均衡 |
||||
|
fetch-registry: true |
||||
|
service-url: |
||||
|
#集群配置 |
||||
|
defaultZone: http://eureka7001.com:7001/eureka,http://eureka7002.com:7002/eureka |
||||
|
instance: |
||||
|
#服务名称修改 |
||||
|
instance-id: PAYMENT-BASE |
||||
|
#访问路径可以显示ip地址 |
||||
|
prefer-ip-address: true |
||||
|
#spring相关配置 |
||||
|
spring: |
||||
|
application: |
||||
|
name: mcroservice-payment #服务名 |
||||
|
datasource: |
||||
|
type: com.alibaba.druid.pool.DruidDataSource #当前数据源操作类型 |
||||
|
driver-class-name: org.gjt.mm.mysql.Driver #数据库驱动包 |
||||
|
url: jdbc:mysql://106.14.81.251:3306/rbs_erp_test?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false |
||||
|
username: root |
||||
|
password: hnrr%%360 |
||||
|
#mybatis:配置 |
||||
|
mybatis: |
||||
|
mapperLocations: classpath:dao/*.xml |
||||
|
type-aliases-package: com.rbs.springcloud.pojo |
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,52 @@ |
|||||
|
<!DOCTYPE mapper |
||||
|
PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dqueryByidtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
|
||||
|
<mapper namespace="com.rbs.springcloud.pojo.merchant.Merchant"> |
||||
|
<resultMap id="BaseResultMap" type="com.rbs.springcloud.pojo.merchant.Merchant"> |
||||
|
<id column="merchantId" property="merchant_id" jdbcType="varchar"/> |
||||
|
<id column="merchantName" property="merchant_name" jdbcType="varchar"/> |
||||
|
<id column="cityStoreName" property="city_store_name" jdbcType="varchar"/> |
||||
|
<id column="storeBrandName" property="store_brand_name" jdbcType="varchar"/> |
||||
|
<id column="timeStamp" property="time_stamp" jdbcType="varchar"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<insert id="insert" parameterType="com.rbs.springcloud.pojo.merchant.Merchant" useGeneratedKeys="true" |
||||
|
keyProperty="merchantId"> |
||||
|
insert into merchant |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="merchantId != null"> |
||||
|
merchant_id, |
||||
|
</if> |
||||
|
<if test="merchantName != null"> |
||||
|
merchant_name, |
||||
|
</if> |
||||
|
<if test="cityStoreName != null"> |
||||
|
city_store_name, |
||||
|
</if> |
||||
|
<if test="storeBrandName != null"> |
||||
|
store_brand_name, |
||||
|
</if> |
||||
|
<if test="timeStamp != null"> |
||||
|
time_stamp, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="merchantId != null and merchantId != ''"> |
||||
|
#{merchantId,jdbcType=varchar}, |
||||
|
</if> |
||||
|
<if test="merchantName != null and merchantName != ''"> |
||||
|
#{merchantName,jdbcType=varchar}, |
||||
|
</if> |
||||
|
<if test="cityStoreName != null and cityStoreName != ''"> |
||||
|
#{cityStoreName,jdbcType=varchar}, |
||||
|
</if> |
||||
|
<if test="storeBrandName != null and storeBrandName != ''"> |
||||
|
#{storeBrandName,jdbcType=varchar}, |
||||
|
</if> |
||||
|
<if test="timeStamp != null and timeStamp != ''"> |
||||
|
#{timeStamp,jdbcType=varchar}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
</mapper> |
||||
@ -0,0 +1,2 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<module type="JAVA_MODULE" version="4" /> |
||||
@ -0,0 +1,35 @@ |
|||||
|
<?xml version="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>rbsservice</artifactId> |
||||
|
<groupId>com.rbs.springcloud</groupId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>payment-common-app</artifactId> |
||||
|
|
||||
|
<dependencies> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-devtools</artifactId> |
||||
|
<scope>runtime</scope> |
||||
|
<optional>true</optional> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.projectlombok</groupId> |
||||
|
<artifactId>lombok</artifactId> |
||||
|
<optional>true</optional> |
||||
|
</dependency> |
||||
|
<!-- 工具包--> |
||||
|
<dependency> |
||||
|
<groupId>cn.hutool</groupId> |
||||
|
<artifactId>hutool-all</artifactId> |
||||
|
<version>5.1.0</version> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
</project> |
||||
|
|
||||
|
|
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.rbs.springcloud.pojo.base; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import lombok.experimental.Accessors; |
||||
|
|
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
@AllArgsConstructor |
||||
|
@Accessors(chain = true) |
||||
|
public class CommonResult<T> { |
||||
|
|
||||
|
//返回状态码
|
||||
|
private String code; |
||||
|
|
||||
|
//返回状态信息
|
||||
|
private String message; |
||||
|
|
||||
|
//返回的数据
|
||||
|
private T data; |
||||
|
|
||||
|
public CommonResult(String code, String message) { |
||||
|
this(code,message,null); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,38 @@ |
|||||
|
package com.rbs.springcloud.pojo.constant; |
||||
|
|
||||
|
public enum ErrorConstant { |
||||
|
|
||||
|
NULL_OBJ("RBS00001","参数异常"); |
||||
|
|
||||
|
private String code; |
||||
|
private String message; |
||||
|
|
||||
|
private ErrorConstant(String code, String message) { |
||||
|
this.setCode(code); |
||||
|
this.setMessage(message); |
||||
|
} |
||||
|
|
||||
|
public String getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
public void setCode(String code) { |
||||
|
this.code = code; |
||||
|
} |
||||
|
|
||||
|
public String getMessage() { |
||||
|
return message; |
||||
|
} |
||||
|
|
||||
|
public void setMessage(String message) { |
||||
|
this.message = message; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
return "ErrorConstant{" + |
||||
|
"code='" + code + '\'' + |
||||
|
", message='" + message + '\'' + |
||||
|
'}'; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
package com.rbs.springcloud.pojo.merchant; |
||||
|
|
||||
|
import com.rbs.springcloud.pojo.base.CommonResult; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class Merchant extends CommonResult { |
||||
|
|
||||
|
// 商户编号
|
||||
|
private String merchantId; |
||||
|
|
||||
|
// 商户名称
|
||||
|
private String merchantName; |
||||
|
|
||||
|
// 城市分店名
|
||||
|
private String cityStoreName; |
||||
|
|
||||
|
// 门店品牌名
|
||||
|
private String storeBrandName; |
||||
|
|
||||
|
// 时间戳
|
||||
|
private String timeStamp; |
||||
|
} |
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,5 @@ |
|||||
|
#Generated by Maven |
||||
|
#Wed Feb 23 09:55:53 CST 2022 |
||||
|
version=1.0-SNAPSHOT |
||||
|
groupId=com.rbs.springcloud |
||||
|
artifactId=payment-common-app |
||||
@ -0,0 +1,2 @@ |
|||||
|
com\rbs\springcloud\pojo\merchant\Merchant.class |
||||
|
com\rbs\springcloud\pojo\base\CommonResult.class |
||||
@ -0,0 +1,2 @@ |
|||||
|
F:\RongRun\rbsservice\payment-common-app\src\main\java\com\rbs\springcloud\pojo\merchant\Merchant.java |
||||
|
F:\RongRun\rbsservice\payment-common-app\src\main\java\com\rbs\springcloud\pojo\base\CommonResult.java |
||||
Binary file not shown.
@ -0,0 +1,41 @@ |
|||||
|
<?xml version="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>rbsservice</artifactId> |
||||
|
<groupId>com.rbs.springcloud</groupId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>payment-eureka-app</artifactId> |
||||
|
|
||||
|
<dependencies> |
||||
|
<!-- eureka client --> |
||||
|
<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.projectlombok</groupId> |
||||
|
<artifactId>lombok</artifactId> |
||||
|
<optional>true</optional> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-test</artifactId> |
||||
|
<scope>test</scope> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
|
||||
|
</project> |
||||
@ -0,0 +1,14 @@ |
|||||
|
package com.eureka.server.springclould; |
||||
|
|
||||
|
import org.springframework.boot.SpringApplication; |
||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
|
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; |
||||
|
|
||||
|
@SpringBootApplication |
||||
|
@EnableEurekaServer |
||||
|
public class EurekaServerApplication { |
||||
|
|
||||
|
public static void main(String[] args) { |
||||
|
SpringApplication.run(EurekaServerApplication.class, args); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
server: |
||||
|
port: 7002 |
||||
|
eureka: |
||||
|
instance: |
||||
|
hostname: eureka7002.com #eureka服务端的实例名称 |
||||
|
client: |
||||
|
register-with-eureka: false #false表示不向注册中心注册自己。 |
||||
|
fetch-registry: false #false表示自己端就是注册中心,我的职责就是维护服务实例,并不需要去检索服务 |
||||
|
service-url: |
||||
|
#设置与eureka server交互的地址和注册服务都需要依赖这个地址 |
||||
|
defaultZone: http://eureka7002.com:7002/eureka/ #集群就是指向其他的eureka |
||||
@ -0,0 +1,11 @@ |
|||||
|
server: |
||||
|
port: 7002 |
||||
|
eureka: |
||||
|
instance: |
||||
|
hostname: eureka7002.com #eureka服务端的实例名称 |
||||
|
client: |
||||
|
register-with-eureka: false #false表示不向注册中心注册自己。 |
||||
|
fetch-registry: false #false表示自己端就是注册中心,我的职责就是维护服务实例,并不需要去检索服务 |
||||
|
service-url: |
||||
|
#设置与eureka server交互的地址和注册服务都需要依赖这个地址 |
||||
|
defaultZone: http://eureka7002.com:7002/eureka/ #集群就是指向其他的eureka |
||||
Binary file not shown.
@ -0,0 +1,93 @@ |
|||||
|
<?xml version="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"> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<groupId>com.rbs.springcloud</groupId> |
||||
|
<artifactId>rbsservice</artifactId> |
||||
|
|
||||
|
<!-- 首先修改打包方式 --> |
||||
|
<packaging>pom</packaging> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
<modules> |
||||
|
<module>payment-common-app</module> |
||||
|
<module>payment-base-app</module> |
||||
|
<module>rbs-eureka-server-app</module> |
||||
|
<module>payment-eureka-app</module> |
||||
|
</modules> |
||||
|
|
||||
|
<properties> |
||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||
|
<maven.compiler.source>1.8</maven.compiler.source> |
||||
|
<maven.compiler.target>1.8</maven.compiler.target> |
||||
|
<mysql.version>5.1.47</mysql.version> |
||||
|
<druid.version>1.1.10</druid.version> |
||||
|
<junit.version>4.1.2</junit.version> |
||||
|
<lombok.version>1.16.10</lombok.version> |
||||
|
<log4j.vsrsion>1.2.17</log4j.vsrsion> |
||||
|
</properties> |
||||
|
|
||||
|
<!-- 因为是总项目 所以用dependencyManagement来管理 因为其他的子项目就不会来管理版本了了 可以直接引用 --> |
||||
|
<dependencyManagement> |
||||
|
<dependencies> |
||||
|
<!-- springcloud的依赖--> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.cloud</groupId> |
||||
|
<artifactId>spring-cloud-dependencies</artifactId> |
||||
|
<version>Greenwich.SR1</version> |
||||
|
<type>pom</type> |
||||
|
<scope>import</scope> |
||||
|
</dependency> |
||||
|
<!-- springboot的依赖--> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-dependencies</artifactId> |
||||
|
<version>2.1.4.RELEASE</version> |
||||
|
<type>pom</type> |
||||
|
<scope>import</scope> |
||||
|
</dependency> |
||||
|
<!-- 数据库--> |
||||
|
<dependency> |
||||
|
<groupId>mysql</groupId> |
||||
|
<artifactId>mysql-connector-java</artifactId> |
||||
|
<version>${mysql.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba</groupId> |
||||
|
<artifactId>druid</artifactId> |
||||
|
<version>${druid.version}</version> |
||||
|
</dependency> |
||||
|
<!-- springboot启动器--> |
||||
|
<dependency> |
||||
|
<groupId>org.mybatis.spring.boot</groupId> |
||||
|
<artifactId>mybatis-spring-boot-starter</artifactId> |
||||
|
<version>1.3.2</version> |
||||
|
</dependency> |
||||
|
<!--单元测试 --> |
||||
|
<dependency> |
||||
|
<groupId>junit</groupId> |
||||
|
<artifactId>junit</artifactId> |
||||
|
<version>4.12</version> |
||||
|
</dependency> |
||||
|
<!-- lombok--> |
||||
|
<dependency> |
||||
|
<groupId>org.projectlombok</groupId> |
||||
|
<artifactId>lombok</artifactId> |
||||
|
<version>1.18.8</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- log4j--> |
||||
|
<dependency> |
||||
|
<groupId>log4j</groupId> |
||||
|
<artifactId>log4j</artifactId> |
||||
|
<version>${log4j.vsrsion}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>ch.qos.logback</groupId> |
||||
|
<artifactId>logback-core</artifactId> |
||||
|
<version>1.2.3</version> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
</dependencyManagement> |
||||
|
</project> |
||||
@ -0,0 +1,2 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<module type="JAVA_MODULE" version="4" /> |
||||
Loading…
Reference in new issue