+
+
+
+
+
\ No newline at end of file
diff --git a/elmclient/src/views/CouponSelect.vue b/elmclient/src/views/CouponSelect.vue
new file mode 100644
index 0000000..22d014e
--- /dev/null
+++ b/elmclient/src/views/CouponSelect.vue
@@ -0,0 +1,271 @@
+
+
+
+
+
+
消费券选择
+
+
+
+
+
+
+
满{{item.limitNum}}减{{item.minusNum}}优惠券
+
有效日期:{{item.outDate}}
+
+
+
+
+
+
不使用消费券
+
-
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/elmclient/src/views/Index.vue b/elmclient/src/views/Index.vue
index d0e60c6..81c52f3 100644
--- a/elmclient/src/views/Index.vue
+++ b/elmclient/src/views/Index.vue
@@ -17,7 +17,8 @@
\ No newline at end of file
diff --git a/elmclient/src/views/Payment.vue b/elmclient/src/views/Payment.vue
index 7b00e01..75cb726 100644
--- a/elmclient/src/views/Payment.vue
+++ b/elmclient/src/views/Payment.vue
@@ -1,254 +1,284 @@
-
-
-
-
-
在线支付
-
-
-
订单信息:
-
-
- {{orders.business.businessName}}
-
-
-
¥{{orders.orderTotal}}
-
-
-
-
-
{{item.food.foodName}} x {{item.quantity}}
-
¥{{item.food.foodPrice*item.quantity}}
-
-
-
配送费
-
¥{{orders.business.deliveryPrice}}
-
-
-
积分
-
-¥{{reduction}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 支付成功!
-
-
-
-
+
+
+
+
+
在线支付
+
+
+
订单信息:
+
+
+ {{orders.business.businessName}}
+
+
+
¥{{orders.orderTotal}}
+
+
+
+
+
{{item.food.foodName}} x {{item.quantity}}
+
¥{{item.food.foodPrice*item.quantity}}
+
+
+
配送费
+
¥{{orders.business.deliveryPrice}}
+
+
+
消费券减免
+
-¥{{reduction}}
+
+
+
+
获得积分
+
{{orders.orderTotal*10}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 支付成功!
+
+
+
+
\ No newline at end of file
diff --git a/elmclient/src/views/Point.vue b/elmclient/src/views/Point.vue
deleted file mode 100644
index 1d97870..0000000
--- a/elmclient/src/views/Point.vue
+++ /dev/null
@@ -1,191 +0,0 @@
-
-
-
-
-
积分明细
-
-
-
可用积分({{ sum }})
-
每批积分将在获得后180天过期
-
-
-
-
-
积分
-
获得时间
-
过期时间
-
-
-
-
-
{{ item.pointNum }}
-
{{ item.pointDate }}
-
{{ item.outDate }}
-
-
-
-
-
过期积分
-
-
-
-
-
积分
-
获得时间
-
过期时间
-
-
-
-
-
{{ item.pointNum }}
-
{{ item.pointDate }}
-
{{ item.outDate }}
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/elmclient/src/views/PointStore.vue b/elmclient/src/views/PointStore.vue
new file mode 100644
index 0000000..0e9dfab
--- /dev/null
+++ b/elmclient/src/views/PointStore.vue
@@ -0,0 +1,308 @@
+
+
+
+
+
+
+
积分商城
+
+
+
+
剩余积分
+
{{sum}}
+
+
+
+
+
满50减40购物券
+
+
结算时如果总额满50元,可以优惠40元。
+
+
+
+
+
立即购买(1000)
+
+
+
+
+
+
+
+
满20减15购物券
+
+
结算时如果总额满20元,可以优惠15元。
+
+
+
+
+
立即购买(800)
+
+
+
+
+
+
+
+
满10减8购物券
+
+
结算时如果总额10元,可以优惠8元。
+
+
+
+
+
立即购买(600)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/elmclient/src/views/PointsDetails.vue b/elmclient/src/views/PointsDetails.vue
index e843b0c..3e17271 100644
--- a/elmclient/src/views/PointsDetails.vue
+++ b/elmclient/src/views/PointsDetails.vue
@@ -1,284 +1,289 @@
-
-
-
-
-
积分记录
-
+
+
+
+
+
积分记录
+
-
-
-
-
{{ sum }}
-
-
-
积分有效期180天,记得使用哟
-
-
+
+
+
+
{{ sum }}
+
+
+
积分有效期180天,记得使用哟
+
+
-
-
-
可用积分
-
已过期积分
-
-
-
-
-
-
-
获取时间
-
-
-
剩余数量
-
-
-
过期时间
-
-
-
-
-
-
-
{{item.pointDate}}
-
-
-
{{ item.pointNum }}
-
-
-
{{ item.outDate }}
-
-
-
-
-
-
-
-
-
获取时间
-
-
-
过期数量
-
-
-
过期时间
-
-
-
-
-
-
-
{{item.pointDate}}
-
-
-
{{ item.pointNum }}
-
-
-
{{ item.outDate }}
-
-
-
-
-
-
-
+
+
+
可用积分
+
已过期积分
+
+
+
+
+
+
+
获取时间
+
+
+
剩余数量
+
+
+
过期时间
+
+
+
+
+
+
+
{{item.pointDate}}
+
+
+
{{ item.pointNum }}
+
+
+
{{ item.outDate }}
+
+
+
+
+
+
+
+
+
获取时间
+
+
+
过期数量
+
+
+
过期时间
+
+
+
+
+
+
+
{{item.pointDate}}
+
+
+
{{ item.pointNum }}
+
+
+
{{ item.outDate }}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/elmclient/src/views/SearchResults.vue b/elmclient/src/views/SearchResults.vue
index fa613fe..e1f32c8 100644
--- a/elmclient/src/views/SearchResults.vue
+++ b/elmclient/src/views/SearchResults.vue
@@ -14,7 +14,7 @@
-
+
diff --git a/point.sql b/point.sql
new file mode 100644
index 0000000..797adf4
--- /dev/null
+++ b/point.sql
@@ -0,0 +1,7 @@
+CREATE TABLE point (
+ pointId INT AUTO_INCREMENT PRIMARY KEY,
+ userId VARCHAR(20),
+ pointDate VARCHAR(50),
+ pointNum INT,
+ outDate VARCHAR(50)
+);
\ No newline at end of file
diff --git a/springcloud_elm/.idea/compiler.xml b/springcloud_elm/.idea/compiler.xml
index 54b6c28..e7e0cbf 100644
--- a/springcloud_elm/.idea/compiler.xml
+++ b/springcloud_elm/.idea/compiler.xml
@@ -6,6 +6,7 @@
+
@@ -19,6 +20,7 @@
+
diff --git a/springcloud_elm/.idea/encodings.xml b/springcloud_elm/.idea/encodings.xml
index a983912..95f9a58 100644
--- a/springcloud_elm/.idea/encodings.xml
+++ b/springcloud_elm/.idea/encodings.xml
@@ -13,6 +13,8 @@
+
+
@@ -29,6 +31,8 @@
+
+
diff --git a/springcloud_elm/.idea/misc.xml b/springcloud_elm/.idea/misc.xml
index b9120de..d54e9ba 100644
--- a/springcloud_elm/.idea/misc.xml
+++ b/springcloud_elm/.idea/misc.xml
@@ -12,9 +12,4 @@
-
-
-
\ No newline at end of file
diff --git a/springcloud_elm/.idea/runConfigurations/business_server_10300.xml b/springcloud_elm/.idea/runConfigurations/business_server_10300.xml
new file mode 100644
index 0000000..42e11a0
--- /dev/null
+++ b/springcloud_elm/.idea/runConfigurations/business_server_10300.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/.idea/runConfigurations/business_server_10301.xml b/springcloud_elm/.idea/runConfigurations/business_server_10301.xml
new file mode 100644
index 0000000..d4decbd
--- /dev/null
+++ b/springcloud_elm/.idea/runConfigurations/business_server_10301.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/.idea/runConfigurations/cart_server_10400.xml b/springcloud_elm/.idea/runConfigurations/cart_server_10400.xml
new file mode 100644
index 0000000..7771bcf
--- /dev/null
+++ b/springcloud_elm/.idea/runConfigurations/cart_server_10400.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/.idea/runConfigurations/cart_server_10401.xml b/springcloud_elm/.idea/runConfigurations/cart_server_10401.xml
new file mode 100644
index 0000000..ed2ad9c
--- /dev/null
+++ b/springcloud_elm/.idea/runConfigurations/cart_server_10401.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/.idea/runConfigurations/config_server_15000.xml b/springcloud_elm/.idea/runConfigurations/config_server_15000.xml
new file mode 100644
index 0000000..eb170c4
--- /dev/null
+++ b/springcloud_elm/.idea/runConfigurations/config_server_15000.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/.idea/runConfigurations/config_server_15001.xml b/springcloud_elm/.idea/runConfigurations/config_server_15001.xml
new file mode 100644
index 0000000..bdbaf92
--- /dev/null
+++ b/springcloud_elm/.idea/runConfigurations/config_server_15001.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/.idea/runConfigurations/coupon_server_10950.xml b/springcloud_elm/.idea/runConfigurations/coupon_server_10950.xml
new file mode 100644
index 0000000..76fd36c
--- /dev/null
+++ b/springcloud_elm/.idea/runConfigurations/coupon_server_10950.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/.idea/runConfigurations/deliveryaddress_server_10500.xml b/springcloud_elm/.idea/runConfigurations/deliveryaddress_server_10500.xml
new file mode 100644
index 0000000..f9ce849
--- /dev/null
+++ b/springcloud_elm/.idea/runConfigurations/deliveryaddress_server_10500.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/.idea/runConfigurations/eureka_server_13000.xml b/springcloud_elm/.idea/runConfigurations/eureka_server_13000.xml
new file mode 100644
index 0000000..4c3f588
--- /dev/null
+++ b/springcloud_elm/.idea/runConfigurations/eureka_server_13000.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/.idea/runConfigurations/eureka_server_13001.xml b/springcloud_elm/.idea/runConfigurations/eureka_server_13001.xml
new file mode 100644
index 0000000..cfb342f
--- /dev/null
+++ b/springcloud_elm/.idea/runConfigurations/eureka_server_13001.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/.idea/runConfigurations/food_server_10200.xml b/springcloud_elm/.idea/runConfigurations/food_server_10200.xml
new file mode 100644
index 0000000..2203500
--- /dev/null
+++ b/springcloud_elm/.idea/runConfigurations/food_server_10200.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/.idea/runConfigurations/food_server_10201.xml b/springcloud_elm/.idea/runConfigurations/food_server_10201.xml
new file mode 100644
index 0000000..35e2ffe
--- /dev/null
+++ b/springcloud_elm/.idea/runConfigurations/food_server_10201.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/.idea/runConfigurations/gateway_server_14000.xml b/springcloud_elm/.idea/runConfigurations/gateway_server_14000.xml
new file mode 100644
index 0000000..b2e58b9
--- /dev/null
+++ b/springcloud_elm/.idea/runConfigurations/gateway_server_14000.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/.idea/runConfigurations/orders_server_10600.xml b/springcloud_elm/.idea/runConfigurations/orders_server_10600.xml
new file mode 100644
index 0000000..e0be16e
--- /dev/null
+++ b/springcloud_elm/.idea/runConfigurations/orders_server_10600.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/.idea/runConfigurations/orders_server_10601.xml b/springcloud_elm/.idea/runConfigurations/orders_server_10601.xml
new file mode 100644
index 0000000..467a4cd
--- /dev/null
+++ b/springcloud_elm/.idea/runConfigurations/orders_server_10601.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/.idea/runConfigurations/point_server_10900.xml b/springcloud_elm/.idea/runConfigurations/point_server_10900.xml
new file mode 100644
index 0000000..89a725d
--- /dev/null
+++ b/springcloud_elm/.idea/runConfigurations/point_server_10900.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/.idea/runConfigurations/search_server_11600.xml b/springcloud_elm/.idea/runConfigurations/search_server_11600.xml
new file mode 100644
index 0000000..1897af7
--- /dev/null
+++ b/springcloud_elm/.idea/runConfigurations/search_server_11600.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/.idea/runConfigurations/user_server_10100.xml b/springcloud_elm/.idea/runConfigurations/user_server_10100.xml
new file mode 100644
index 0000000..04ce329
--- /dev/null
+++ b/springcloud_elm/.idea/runConfigurations/user_server_10100.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/.idea/sqldialects.xml b/springcloud_elm/.idea/sqldialects.xml
new file mode 100644
index 0000000..c724144
--- /dev/null
+++ b/springcloud_elm/.idea/sqldialects.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/coupon_server_10950/pom.xml b/springcloud_elm/coupon_server_10950/pom.xml
new file mode 100644
index 0000000..c53ac5e
--- /dev/null
+++ b/springcloud_elm/coupon_server_10950/pom.xml
@@ -0,0 +1,65 @@
+
+ 4.0.0
+
+ com.neusoft
+ springcloud_elm
+ 1.0-SNAPSHOT
+
+ coupon_server_10950
+
+
+ 8
+ 8
+
+
+
+
+ org.springframework.cloud
+ spring-cloud-bus
+
+
+ org.springframework.cloud
+ spring-cloud-stream-binder-rabbit
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+
+
+ org.springframework.cloud
+ spring-cloud-starter-config
+
+
+ org.springframework.cloud
+ spring-cloud-starter-netflix-eureka-client
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.mybatis.spring.boot
+ mybatis-spring-boot-starter
+ 2.0.1
+
+
+ mysql
+ mysql-connector-java
+ 8.0.20
+ runtime
+
+
+
+ org.springframework.boot
+ spring-boot-devtools
+ runtime
+ true
+
+
+ com.neusoft
+ business_server_10300
+ 1.0-SNAPSHOT
+
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/coupon_server_10950/src/main/java/com/neusoft/MyApplication.java b/springcloud_elm/coupon_server_10950/src/main/java/com/neusoft/MyApplication.java
new file mode 100644
index 0000000..fff9695
--- /dev/null
+++ b/springcloud_elm/coupon_server_10950/src/main/java/com/neusoft/MyApplication.java
@@ -0,0 +1,11 @@
+package com.neusoft;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class MyApplication {
+ public static void main(String[] args){
+ SpringApplication.run(MyApplication.class,args);
+ }
+}
diff --git a/springcloud_elm/coupon_server_10950/src/main/java/com/neusoft/controller/CouponController.java b/springcloud_elm/coupon_server_10950/src/main/java/com/neusoft/controller/CouponController.java
new file mode 100644
index 0000000..a91e4f9
--- /dev/null
+++ b/springcloud_elm/coupon_server_10950/src/main/java/com/neusoft/controller/CouponController.java
@@ -0,0 +1,52 @@
+package com.neusoft.controller;
+
+import java.text.ParseException;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.neusoft.po.CommonResult;
+import com.neusoft.po.Coupon;
+import com.neusoft.service.CouponService;
+import com.neusoft.service.impl.CouponServiceImpl;
+
+@RestController
+@RequestMapping("/CouponController")
+public class CouponController {
+
+ @Autowired
+ public CouponServiceImpl couponService;
+
+ @PostMapping("/saveCoupon/{userId}/{limitNum}/{minusNum}")
+ public CommonResult listOutofDatePoint(@PathVariable("userId") String userId,@PathVariable("limitNum") int limitNum,@PathVariable("minusNum") int minusNum) throws Exception {
+
+ Coupon coupon =new Coupon();
+ coupon.setUserId(userId);
+ coupon.setLimitNum(limitNum);
+ coupon.setMinusNum(minusNum);
+ return new CommonResult<>(200,"success",couponService.saveCoupon(coupon));
+ }
+
+ @GetMapping("/getCouponByUserId/{userId}")
+ public CommonResult> getCouponByUserId(@PathVariable String userId) throws ParseException
+ {
+ return new CommonResult<>(200,"success",couponService.ListAvailableCoupon(userId));
+ }
+
+ @DeleteMapping("/deleteCouponByCouponId/{couponId}")
+ public CommonResult deleteCouponByCouponId(@PathVariable("couponId") int couponId)
+ {
+ Coupon coupon =new Coupon();
+ coupon.setCouponId(couponId);
+ return new CommonResult<>(200,"success",couponService.deleteCouponByCouponId(coupon));
+ }
+
+}
diff --git a/springcloud_elm/coupon_server_10950/src/main/java/com/neusoft/mapper/CouponMapper.java b/springcloud_elm/coupon_server_10950/src/main/java/com/neusoft/mapper/CouponMapper.java
new file mode 100644
index 0000000..c741990
--- /dev/null
+++ b/springcloud_elm/coupon_server_10950/src/main/java/com/neusoft/mapper/CouponMapper.java
@@ -0,0 +1,31 @@
+package com.neusoft.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Options;
+import org.apache.ibatis.annotations.Select;
+
+import com.neusoft.po.Coupon;
+
+@Mapper
+public interface CouponMapper {
+
+ @Select("select * from coupon where couponId=#{couponId}")
+ public Coupon getCouponByCouponId(Coupon coupon);
+
+ @Select("select * from coupon where userId=#{userId}")
+ public List listCouponByUserId(Coupon coupon);
+
+
+ @Insert("insert into coupon values(#{couponId},#{userId},#{limitNum},#{minusNum},#{couponDate},#{outDate})")
+ @Options(useGeneratedKeys=true,keyProperty="couponId",keyColumn="couponId")
+ public int saveCoupon(Coupon coupon);
+
+ @Delete("delete from coupon where couponId=#{couponId}")
+ public int deleteCouponByCouponId(Coupon coupon);
+
+
+}
diff --git a/springcloud_elm/coupon_server_10950/src/main/java/com/neusoft/po/Coupon.java b/springcloud_elm/coupon_server_10950/src/main/java/com/neusoft/po/Coupon.java
new file mode 100644
index 0000000..ca2cf2d
--- /dev/null
+++ b/springcloud_elm/coupon_server_10950/src/main/java/com/neusoft/po/Coupon.java
@@ -0,0 +1,83 @@
+package com.neusoft.po;
+
+public class Coupon {
+
+ public int couponId;
+ public String userId;
+ public int limitNum;
+ public int minusNum;
+ public String couponDate;
+ public String outDate;
+
+ public Coupon()
+ {
+
+ }
+ public Coupon(int couponId,String userId,int limitNum,int minusNum,String couponDate,String outDate)
+ {
+ this.couponId=couponId;
+ this.userId=userId;
+ this.limitNum=limitNum;
+ this.minusNum=minusNum;
+ this.couponDate=couponDate;
+ this.outDate=outDate;
+ }
+
+
+ public int getCouponId()
+ {
+ return this.couponId;
+ }
+ public void setCouponId(int couponId)
+ {
+ this.couponId=couponId;
+ }
+
+ public String getUserId()
+ {
+ return this.userId;
+ }
+ public void setUserId(String userId)
+ {
+ this.userId=userId;
+ }
+
+ public int getLimitNum()
+ {
+ return this.limitNum;
+ }
+ public void setLimitNum(int limitNum)
+ {
+ this.limitNum=limitNum;
+ }
+
+ public int getMinusNum()
+ {
+ return this.minusNum;
+ }
+ public void setMinusNum(int minusNum)
+ {
+ this.minusNum=minusNum;
+ }
+
+ public String getCouponDate()
+ {
+ return this.couponDate;
+ }
+ public void setCouponDate(String couponDate)
+ {
+ this.couponDate=couponDate;
+ }
+
+ public String getOutDate()
+
+ {
+ return this.outDate;
+ }
+
+ public void setOutDate(String outDate)
+ {
+ this.outDate=outDate;
+ }
+
+}
diff --git a/springcloud_elm/coupon_server_10950/src/main/java/com/neusoft/service/CouponService.java b/springcloud_elm/coupon_server_10950/src/main/java/com/neusoft/service/CouponService.java
new file mode 100644
index 0000000..6d502f1
--- /dev/null
+++ b/springcloud_elm/coupon_server_10950/src/main/java/com/neusoft/service/CouponService.java
@@ -0,0 +1,20 @@
+package com.neusoft.service;
+
+import java.text.ParseException;
+import java.util.List;
+
+import org.springframework.stereotype.Service;
+
+import com.neusoft.po.Coupon;
+
+
+public interface CouponService {
+
+ public List ListAvailableCoupon(String userId) throws ParseException;
+
+ public List ListOutCoupon(int userId) throws ParseException;
+
+ public int saveCoupon(Coupon coupon);
+
+ public int deleteCouponByCouponId(Coupon coupon);
+}
diff --git a/springcloud_elm/coupon_server_10950/src/main/java/com/neusoft/service/impl/CouponServiceImpl.java b/springcloud_elm/coupon_server_10950/src/main/java/com/neusoft/service/impl/CouponServiceImpl.java
new file mode 100644
index 0000000..914bfd9
--- /dev/null
+++ b/springcloud_elm/coupon_server_10950/src/main/java/com/neusoft/service/impl/CouponServiceImpl.java
@@ -0,0 +1,61 @@
+package com.neusoft.service.impl;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.neusoft.mapper.CouponMapper;
+import com.neusoft.po.Coupon;
+import com.neusoft.service.CouponService;
+
+
+@Service
+public class CouponServiceImpl implements CouponService {
+
+ @Autowired
+ public CouponMapper couponMapper;
+
+public List ListAvailableCoupon(String userId) throws ParseException
+{
+
+ Coupon coupon=new Coupon();
+ coupon.setUserId(userId);
+ List couponList =couponMapper.listCouponByUserId(coupon);
+
+ return couponList;
+}
+
+ public List ListOutCoupon(int userId) throws ParseException
+ {
+ return null;
+ }
+
+ public int saveCoupon(Coupon coupon)
+ {
+
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ String formattedDate = sdf.format(new Date());
+ Date currentDate=new Date();
+ coupon.setCouponDate(formattedDate);
+ Calendar calendar = Calendar.getInstance();
+ calendar.setTime(currentDate);
+ calendar.add(Calendar.DAY_OF_MONTH, 3);
+ Date threeDaysLater = calendar.getTime();
+ String outDate=sdf.format(threeDaysLater);
+ coupon.setOutDate(outDate);
+ couponMapper.saveCoupon(coupon);
+ return 1;
+ }
+ public int deleteCouponByCouponId(Coupon coupon)
+ {
+
+ couponMapper.deleteCouponByCouponId(coupon);
+ return 1;
+ }
+
+}
diff --git a/springcloud_elm/coupon_server_10950/src/main/resources/bootstrap.yml b/springcloud_elm/coupon_server_10950/src/main/resources/bootstrap.yml
new file mode 100644
index 0000000..1bb8aa7
--- /dev/null
+++ b/springcloud_elm/coupon_server_10950/src/main/resources/bootstrap.yml
@@ -0,0 +1,19 @@
+spring:
+ cloud:
+ config:
+ name: coupon_server_10950
+ profile: dev
+ label: master
+ discovery:
+ enabled: true
+ service-id: config-server
+
+eureka:
+ client:
+ service-url:
+ defaultZone: http://eurekaServer13000:13000/eureka/,http://eurekaServer13001:13001/eureka/
+ instance:
+ prefer-ip-address: true #使用ip地址向eureka server进行注册
+ instance-id: ${spring.cloud.client.ip-address}:${server.port} #设置eureka控制台中显示的注册信息
+ lease-renewal-interval-in-seconds: 5
+ lease-expiration-duration-in-seconds: 15
\ No newline at end of file
diff --git a/springcloud_elm/coupon_server_10950/target/classes/bootstrap.yml b/springcloud_elm/coupon_server_10950/target/classes/bootstrap.yml
new file mode 100644
index 0000000..1bb8aa7
--- /dev/null
+++ b/springcloud_elm/coupon_server_10950/target/classes/bootstrap.yml
@@ -0,0 +1,19 @@
+spring:
+ cloud:
+ config:
+ name: coupon_server_10950
+ profile: dev
+ label: master
+ discovery:
+ enabled: true
+ service-id: config-server
+
+eureka:
+ client:
+ service-url:
+ defaultZone: http://eurekaServer13000:13000/eureka/,http://eurekaServer13001:13001/eureka/
+ instance:
+ prefer-ip-address: true #使用ip地址向eureka server进行注册
+ instance-id: ${spring.cloud.client.ip-address}:${server.port} #设置eureka控制台中显示的注册信息
+ lease-renewal-interval-in-seconds: 5
+ lease-expiration-duration-in-seconds: 15
\ No newline at end of file
diff --git a/springcloud_elm/gateway_server_14000/src/main/resources/application.yml b/springcloud_elm/gateway_server_14000/src/main/resources/application.yml
index a408f74..0b72282 100644
--- a/springcloud_elm/gateway_server_14000/src/main/resources/application.yml
+++ b/springcloud_elm/gateway_server_14000/src/main/resources/application.yml
@@ -12,10 +12,10 @@ spring:
allowedOrigins: "*"
allowedHeaders: "*"
allowedMethods:
- - GET
- - POST
- - PUT
- - DELETE
+ - GET
+ - POST
+ - PUT
+ - DELETE
default-filters:
- name: Hystrix
args:
@@ -45,7 +45,7 @@ spring:
- id: deliveryaddressServer
uri: lb://deliveryaddress-server
predicates:
- - Path=/DeliveryaddressController/*/**
+ - Path=/DeliveryAddressController/*/**
- id: ordersServer
uri: lb://orders-server
@@ -57,6 +57,16 @@ spring:
predicates:
- Path=/SearchController/*/**
+ - id: pointServer
+ uri: lb://point-server
+ predicates:
+ - Path=/PointController/*/**
+
+ - id: couponServer
+ uri: lb://coupon-server
+ predicates:
+ - Path=/CouponController/*/**
+
eureka:
client:
service-url:
diff --git a/springcloud_elm/gateway_server_14000/target/classes/application.yml b/springcloud_elm/gateway_server_14000/target/classes/application.yml
index a408f74..0b72282 100644
--- a/springcloud_elm/gateway_server_14000/target/classes/application.yml
+++ b/springcloud_elm/gateway_server_14000/target/classes/application.yml
@@ -12,10 +12,10 @@ spring:
allowedOrigins: "*"
allowedHeaders: "*"
allowedMethods:
- - GET
- - POST
- - PUT
- - DELETE
+ - GET
+ - POST
+ - PUT
+ - DELETE
default-filters:
- name: Hystrix
args:
@@ -45,7 +45,7 @@ spring:
- id: deliveryaddressServer
uri: lb://deliveryaddress-server
predicates:
- - Path=/DeliveryaddressController/*/**
+ - Path=/DeliveryAddressController/*/**
- id: ordersServer
uri: lb://orders-server
@@ -57,6 +57,16 @@ spring:
predicates:
- Path=/SearchController/*/**
+ - id: pointServer
+ uri: lb://point-server
+ predicates:
+ - Path=/PointController/*/**
+
+ - id: couponServer
+ uri: lb://coupon-server
+ predicates:
+ - Path=/CouponController/*/**
+
eureka:
client:
service-url:
diff --git a/springcloud_elm/orders_server_10600/src/main/java/com/neusoft/controller/OrdersController.java b/springcloud_elm/orders_server_10600/src/main/java/com/neusoft/controller/OrdersController.java
index bd7e68f..8563cae 100644
--- a/springcloud_elm/orders_server_10600/src/main/java/com/neusoft/controller/OrdersController.java
+++ b/springcloud_elm/orders_server_10600/src/main/java/com/neusoft/controller/OrdersController.java
@@ -44,6 +44,12 @@ public class OrdersController {
return new CommonResult<>(200,"success",list);
}
+ @PutMapping("/Orders/{orderId}")
+ public CommonResultpayOrdersById(@PathVariable("orderId") Integer orderId)throws Exception
+ {
+ int result=ordersService.payOrdersById(orderId, null, null, null);
+ return new CommonResult<>(200,"success",result);
+ }
// @PutMapping("/Orders")
// public int payOrdersById(OrderState orderState, @RequestHeader("Authorization") String token) throws Exception {
// return ordersService.payOrdersById(orderState.getOrderId(), orderState.getUserId(), orderState.getOrderTotal(), orderState.getReduction(),token);
diff --git a/springcloud_elm/point_server_10900/pom.xml b/springcloud_elm/point_server_10900/pom.xml
new file mode 100644
index 0000000..f67c8f8
--- /dev/null
+++ b/springcloud_elm/point_server_10900/pom.xml
@@ -0,0 +1,64 @@
+
+ 4.0.0
+
+ com.neusoft
+ springcloud_elm
+ 1.0-SNAPSHOT
+
+ point_server_10900
+
+
+ 8
+ 8
+
+
+
+
+ org.springframework.cloud
+ spring-cloud-bus
+
+
+ org.springframework.cloud
+ spring-cloud-stream-binder-rabbit
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+
+
+ org.springframework.cloud
+ spring-cloud-starter-config
+
+
+ org.springframework.cloud
+ spring-cloud-starter-netflix-eureka-client
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.mybatis.spring.boot
+ mybatis-spring-boot-starter
+ 2.0.1
+
+
+ mysql
+ mysql-connector-java
+ 8.0.20
+ runtime
+
+
+
+ org.springframework.boot
+ spring-boot-devtools
+ runtime
+ true
+
+
+ com.neusoft
+ business_server_10300
+ 1.0-SNAPSHOT
+
+
+
\ No newline at end of file
diff --git a/springcloud_elm/point_server_10900/src/main/java/com/neusoft/MyApplication.java b/springcloud_elm/point_server_10900/src/main/java/com/neusoft/MyApplication.java
new file mode 100644
index 0000000..fff9695
--- /dev/null
+++ b/springcloud_elm/point_server_10900/src/main/java/com/neusoft/MyApplication.java
@@ -0,0 +1,11 @@
+package com.neusoft;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class MyApplication {
+ public static void main(String[] args){
+ SpringApplication.run(MyApplication.class,args);
+ }
+}
diff --git a/springcloud_elm/point_server_10900/src/main/java/com/neusoft/controller/PointController.java b/springcloud_elm/point_server_10900/src/main/java/com/neusoft/controller/PointController.java
new file mode 100644
index 0000000..2ae32b8
--- /dev/null
+++ b/springcloud_elm/point_server_10900/src/main/java/com/neusoft/controller/PointController.java
@@ -0,0 +1,48 @@
+package com.neusoft.controller;
+
+import com.neusoft.po.CommonResult;
+import com.neusoft.po.Point;
+import com.neusoft.service.PointService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/PointController")
+public class PointController {
+ @Autowired
+ private PointService pointService;
+
+ @GetMapping("/OutofDatePoints")
+ public CommonResult> listOutofDatePoint(@RequestParam("userId") String userId, @RequestHeader("Authorization") String token) throws Exception {
+ return new CommonResult<>(200,"success",pointService.listOutofDatePoint(userId,token));
+ }
+
+ @GetMapping("/AvailablePoints")
+ public CommonResult> listAvailablePoint(@RequestParam("userId") String userId, @RequestHeader("Authorization") String token) throws Exception {
+ return new CommonResult<>(200,"success",pointService.listAvailablePoint(userId,token));
+// return null;
+ }
+
+ @PostMapping("/addPointByPointId/{userId}/{date}/{pointNum}")
+ public CommonResult addPointByPointId(@PathVariable("userId") String userId,@PathVariable("date") String date,@PathVariable("pointNum") Integer pointNum)
+ {
+ System.out.println("addPointById/"+userId+"/"+date+"/"+pointNum);
+ return new CommonResult(200,"success",pointService.addPointByPointId(userId, date, pointNum));
+ }
+
+ @PostMapping("/updatePointNumById/{pointId}/{PointNum}")
+ public CommonResult updatePointNumById(@PathVariable String pointId,@PathVariable int PointNum)
+ {
+ System.out.println("pointId="+pointId+"pointNum="+PointNum);
+ return new CommonResult(200,"success",pointService.updatePointByPointId(pointId, PointNum));
+ }
+
+ @DeleteMapping("/deletePointByPointId/{pointId}")
+ public CommonResult deletePointByPointId(@PathVariable("pointId") String pointId)
+ {
+ return new CommonResult(200,"success",pointService.deletePointByPointId(pointId));
+ }
+
+}
diff --git a/springcloud_elm/point_server_10900/src/main/java/com/neusoft/mapper/PointMapper.java b/springcloud_elm/point_server_10900/src/main/java/com/neusoft/mapper/PointMapper.java
new file mode 100644
index 0000000..cbe35db
--- /dev/null
+++ b/springcloud_elm/point_server_10900/src/main/java/com/neusoft/mapper/PointMapper.java
@@ -0,0 +1,31 @@
+package com.neusoft.mapper;
+
+
+import com.neusoft.po.Point;
+
+import feign.Param;
+
+import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Options;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+import java.util.List;
+
+@Mapper
+public interface PointMapper {
+ @Select("select * from point where userId=#{userId}")
+ public List listPointsByUserId(String userId);
+
+ @Update("update point set pointNum=#{pointNum} where pointId=#{pointId}")
+ public void setPointByPointId(Point point);
+
+ @Delete("delete from point where pointId=#{pointId}")
+ public void deletePointByPointId(String pointId);
+
+ @Select("insert into point(userId,pointDate,pointNum,outDate) values(#{userId},#{pointDate},#{pointNum},#{outDate})")
+ @Options(useGeneratedKeys=true,keyProperty="pointId",keyColumn="pointId")
+ public void addPointByPointId(Point point);
+
+}
diff --git a/springcloud_elm/point_server_10900/src/main/java/com/neusoft/mapper/UserMapper.java b/springcloud_elm/point_server_10900/src/main/java/com/neusoft/mapper/UserMapper.java
new file mode 100644
index 0000000..ea585ed
--- /dev/null
+++ b/springcloud_elm/point_server_10900/src/main/java/com/neusoft/mapper/UserMapper.java
@@ -0,0 +1,18 @@
+package com.neusoft.mapper;
+
+import com.neusoft.po.User;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+@Mapper
+public interface UserMapper {
+ @Select("select * from user where userId=#{userId} and password=#{password}")
+ public User getUserByIdByPass(User user);
+
+ @Select("select count(*) from user where userId=#{userId}")
+ public int getUserById(String userId);
+
+ @Insert("insert into user values(#{userId},#{password},#{userName},#{userSex},null,1)")
+ public int saveUser(User user);
+}
\ No newline at end of file
diff --git a/springcloud_elm/point_server_10900/src/main/java/com/neusoft/po/CommonResult.java b/springcloud_elm/point_server_10900/src/main/java/com/neusoft/po/CommonResult.java
new file mode 100644
index 0000000..84f1b51
--- /dev/null
+++ b/springcloud_elm/point_server_10900/src/main/java/com/neusoft/po/CommonResult.java
@@ -0,0 +1,41 @@
+package com.neusoft.po;
+
+import java.io.Serializable;
+
+public class CommonResult implements Serializable {
+ private Integer code;
+ private String message;
+ private T result;
+
+ public CommonResult() {}
+
+ public CommonResult(Integer code, String message, T result) {
+ this.code = code;
+ this.message = message;
+ this.result = result;
+ }
+
+ public Integer getCode() {
+ return code;
+ }
+
+ public void setCode(Integer code) {
+ this.code = code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public T getResult() {
+ return result;
+ }
+
+ public void setResult(T result) {
+ this.result = result;
+ }
+}
diff --git a/springcloud_elm/point_server_10900/src/main/java/com/neusoft/po/Point.java b/springcloud_elm/point_server_10900/src/main/java/com/neusoft/po/Point.java
new file mode 100644
index 0000000..cc693b4
--- /dev/null
+++ b/springcloud_elm/point_server_10900/src/main/java/com/neusoft/po/Point.java
@@ -0,0 +1,63 @@
+package com.neusoft.po;
+
+public class Point {
+
+ private String pointId;
+ private String userId;
+ private String pointDate;
+ private Integer pointNum;
+ private String outDate;
+ public Point()
+ {
+
+ }
+
+ public Point(String pointId,String userId,String pointDate,Integer pointNum,String outDate)
+ {
+ this.pointId=pointId;
+ this.userId=userId;
+ this.pointDate=pointDate;
+ this.pointNum=pointNum;
+ this.outDate=outDate;
+ }
+
+ public String getPointId()
+ {
+ return this.pointId;
+ }
+ public String getUserId()
+ {
+ return this.userId;
+ }
+ public String getPointDate()
+ {
+ return this.pointDate;
+ }
+ public Integer getPointNum()
+ {
+ return this.pointNum;
+ }
+
+ public void setPointId(String pointId)
+ {
+ this.pointId=pointId;
+ }
+ public void setUserId(String userId)
+ {
+ this.userId=userId;
+ }
+ public void setPointDate(String pointDate)
+ {
+ this.pointDate=pointDate;
+ }
+ public void setPointNum(Integer pointNum)
+ {
+ this.pointNum=pointNum;
+ }
+ public String getOutDate() {
+ return outDate;
+ }
+ public void setOutDate(String outDate) {
+ this.outDate = outDate;
+ }
+}
diff --git a/springcloud_elm/point_server_10900/src/main/java/com/neusoft/po/User.java b/springcloud_elm/point_server_10900/src/main/java/com/neusoft/po/User.java
new file mode 100644
index 0000000..711644a
--- /dev/null
+++ b/springcloud_elm/point_server_10900/src/main/java/com/neusoft/po/User.java
@@ -0,0 +1,59 @@
+package com.neusoft.po;
+
+public class User {
+
+ private String userId;
+ private String password;
+ private String userName;
+ private Integer userSex;
+ private String userImg;
+ private Integer delTag;
+
+ public String getUserId() {
+ return userId;
+ }
+
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ public Integer getUserSex() {
+ return userSex;
+ }
+
+ public void setUserSex(Integer userSex) {
+ this.userSex = userSex;
+ }
+
+ public String getUserImg() {
+ return userImg;
+ }
+
+ public void setUserImg(String userImg) {
+ this.userImg = userImg;
+ }
+
+ public Integer getDelTag() {
+ return delTag;
+ }
+
+ public void setDelTag(Integer delTag) {
+ this.delTag = delTag;
+ }
+}
\ No newline at end of file
diff --git a/springcloud_elm/point_server_10900/src/main/java/com/neusoft/service/PointService.java b/springcloud_elm/point_server_10900/src/main/java/com/neusoft/service/PointService.java
new file mode 100644
index 0000000..c071988
--- /dev/null
+++ b/springcloud_elm/point_server_10900/src/main/java/com/neusoft/service/PointService.java
@@ -0,0 +1,21 @@
+package com.neusoft.service;
+
+import java.text.ParseException;
+import java.util.List;
+
+import com.neusoft.po.Point;
+
+public interface PointService {
+ public List listOutofDatePoint(String userId, String token) throws ParseException;
+
+ public List listAvailablePoint(String userId, String token) throws ParseException;
+
+
+ public int addPointByPointId(String userId,String date,Integer pointNum);
+
+ public int updatePointByPointId(String pointId,int PointNum);
+
+ public int deletePointByPointId(String pointId);
+
+
+}
diff --git a/springcloud_elm/point_server_10900/src/main/java/com/neusoft/service/impl/PointServiceImpl.java b/springcloud_elm/point_server_10900/src/main/java/com/neusoft/service/impl/PointServiceImpl.java
new file mode 100644
index 0000000..acef530
--- /dev/null
+++ b/springcloud_elm/point_server_10900/src/main/java/com/neusoft/service/impl/PointServiceImpl.java
@@ -0,0 +1,109 @@
+package com.neusoft.service.impl;
+
+import com.neusoft.mapper.PointMapper;
+import com.neusoft.mapper.UserMapper;
+import com.neusoft.po.Point;
+import com.neusoft.po.User;
+import com.neusoft.service.PointService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+@Service
+public class PointServiceImpl implements PointService {
+ @Autowired
+ private PointMapper pointMapper;
+
+ @Autowired
+ private UserMapper userMapper0;
+
+ @Override
+ public List listOutofDatePoint(String userId, String token) throws ParseException {
+ User user = new User();
+ user.setUserId(userId);
+ user.setPassword(token);
+ if (userMapper0.getUserByIdByPass(user) == null) return null;
+
+ List list = new ArrayList<>();
+
+ try {
+ list = pointMapper.listPointsByUserId(userId);
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ for (Point i : list) {
+ i.setOutDate(sdf.format(new Date(sdf.parse(i.getPointDate()).getTime() + 15552000000L)));
+ sdf.parse(i.getPointDate());
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ List res = new ArrayList();
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ Date now = new Date();
+ for (Point i : list) {
+ if (sdf.parse(i.getOutDate()).before(now)) {
+ res.add(i);
+ }
+ }
+ return res;
+ }
+
+ @Override
+ public List listAvailablePoint(String userId, String token) throws ParseException {
+ User user = new User();
+ user.setUserId(userId);
+ user.setPassword(token);
+
+ if(userMapper0.getUserByIdByPass(user) == null) return null;
+
+ List list = new ArrayList<>();
+
+ try {
+ list = pointMapper.listPointsByUserId(userId);
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ for (Point i : list) {
+ i.setOutDate(sdf.format(new Date(sdf.parse(i.getPointDate()).getTime() + 15552000000L)));
+ sdf.parse(i.getPointDate());
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ List res = new ArrayList();
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ Date now = new Date();
+ for (Point i : list) {
+ if (!sdf.parse(i.getOutDate()).before(now)) {
+ res.add(i);
+ }
+ }
+ return res;
+ }
+
+ //积分系统新增方法
+ @Override
+ public int addPointByPointId(String userId,String date,Integer pointNum)
+ {
+ Point point=new Point(null,userId,date,pointNum,null);
+ pointMapper.addPointByPointId(point);
+ return 1;
+ }
+
+ @Override
+ public int updatePointByPointId(String PointId,int pointNum)
+ {
+ Point point =new Point(PointId,null,null,pointNum,null);
+ pointMapper.setPointByPointId(point);
+ return 1;
+ }
+
+ public int deletePointByPointId(String pointId)
+ {
+
+ pointMapper.deletePointByPointId(pointId);
+ return 1;
+ }
+}
diff --git a/springcloud_elm/point_server_10900/src/main/resources/bootstrap.yml b/springcloud_elm/point_server_10900/src/main/resources/bootstrap.yml
new file mode 100644
index 0000000..78e7b82
--- /dev/null
+++ b/springcloud_elm/point_server_10900/src/main/resources/bootstrap.yml
@@ -0,0 +1,19 @@
+spring:
+ cloud:
+ config:
+ name: point_server_10900
+ profile: dev
+ label: master
+ discovery:
+ enabled: true
+ service-id: config-server
+
+eureka:
+ client:
+ service-url:
+ defaultZone: http://eurekaServer13000:13000/eureka/,http://eurekaServer13001:13001/eureka/
+ instance:
+ prefer-ip-address: true #使用ip地址向eureka server进行注册
+ instance-id: ${spring.cloud.client.ip-address}:${server.port} #设置eureka控制台中显示的注册信息
+ lease-renewal-interval-in-seconds: 5
+ lease-expiration-duration-in-seconds: 15
\ No newline at end of file
diff --git a/springcloud_elm/point_server_10900/target/classes/bootstrap.yml b/springcloud_elm/point_server_10900/target/classes/bootstrap.yml
new file mode 100644
index 0000000..78e7b82
--- /dev/null
+++ b/springcloud_elm/point_server_10900/target/classes/bootstrap.yml
@@ -0,0 +1,19 @@
+spring:
+ cloud:
+ config:
+ name: point_server_10900
+ profile: dev
+ label: master
+ discovery:
+ enabled: true
+ service-id: config-server
+
+eureka:
+ client:
+ service-url:
+ defaultZone: http://eurekaServer13000:13000/eureka/,http://eurekaServer13001:13001/eureka/
+ instance:
+ prefer-ip-address: true #使用ip地址向eureka server进行注册
+ instance-id: ${spring.cloud.client.ip-address}:${server.port} #设置eureka控制台中显示的注册信息
+ lease-renewal-interval-in-seconds: 5
+ lease-expiration-duration-in-seconds: 15
\ No newline at end of file
diff --git a/springcloud_elm/pom.xml b/springcloud_elm/pom.xml
index 54652e8..87def86 100644
--- a/springcloud_elm/pom.xml
+++ b/springcloud_elm/pom.xml
@@ -23,7 +23,9 @@
orders_server_10601config_server_15000config_server_15001
- search_server_116000
+ search_server_11600
+ point_server_10900
+ coupon_server_10950pom
diff --git a/springcloud_elm/search_server_11600/src/main/java/com/neusoft/MyApplication.java b/springcloud_elm/search_server_11600/src/main/java/com/neusoft/MyApplication.java
index 556aefa..fff9695 100644
--- a/springcloud_elm/search_server_11600/src/main/java/com/neusoft/MyApplication.java
+++ b/springcloud_elm/search_server_11600/src/main/java/com/neusoft/MyApplication.java
@@ -1,7 +1,5 @@
package com.neusoft;
-import org.ansj.domain.Result;
-import org.ansj.splitWord.analysis.ToAnalysis;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/springcloud_elm/search_server_11600/src/main/java/com/neusoft/service/impl/SearchServiceImpl.java b/springcloud_elm/search_server_11600/src/main/java/com/neusoft/service/impl/SearchServiceImpl.java
index 9a6fd64..76d51bd 100644
--- a/springcloud_elm/search_server_11600/src/main/java/com/neusoft/service/impl/SearchServiceImpl.java
+++ b/springcloud_elm/search_server_11600/src/main/java/com/neusoft/service/impl/SearchServiceImpl.java
@@ -26,7 +26,9 @@ public class SearchServiceImpl implements SearchService {
Result res = ToAnalysis.parse(query);
List keywords=new ArrayList<>();
for(Term term:res){
- keywords.add(term.getName());
+ if(!term.getName().matches("^\\s+$")){
+ keywords.add(term.getName());
+ }
}
return foodMapper.listFoodByKeyWord(keywords);
}