diff --git a/cloud-market-common/src/main/java/com/muyu/market/admain/Orders.java b/cloud-market-common/src/main/java/com/muyu/market/admain/Orders.java
index 3edc7b2..bd49cbf 100644
--- a/cloud-market-common/src/main/java/com/muyu/market/admain/Orders.java
+++ b/cloud-market-common/src/main/java/com/muyu/market/admain/Orders.java
@@ -9,8 +9,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.common.core.annotation.Excel;
import com.muyu.common.core.web.domain.BaseEntity;
-import com.muyu.market.admain.request.OrdersUpdResp;
-import com.muyu.market.admain.request.ProductUpdReq;
+import com.muyu.market.admain.response.OrdersUpdResp;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
diff --git a/cloud-market-common/src/main/java/com/muyu/market/admain/Product.java b/cloud-market-common/src/main/java/com/muyu/market/admain/Product.java
index eb3c212..03148cc 100644
--- a/cloud-market-common/src/main/java/com/muyu/market/admain/Product.java
+++ b/cloud-market-common/src/main/java/com/muyu/market/admain/Product.java
@@ -70,6 +70,16 @@ public class Product extends BaseEntity {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新时间",defaultValue = "2024-5-15 10:00:52",type = "Date")
private Date updateTime;
+ /**
+ *接口地址
+ */
+ @Excel(name = "接口地址")
+ private String apiAddr;
+ /**
+ *请求方式
+ */
+ @Excel(name = "请求方式")
+ private String apiWay;
@@ -91,6 +101,8 @@ public class Product extends BaseEntity {
.status(productSave.getStatus())
.createTime(productSave.getCreateTime())
.updateTime(productSave.getUpdateTime())
+ .apiAddr(productSave.getApiAddr())
+ .apiWay(productSave.getApiWay())
.build();
}
@@ -107,9 +119,12 @@ public class Product extends BaseEntity {
.status(productUpdReq.getStatus())
.createTime(productUpdReq.getCreateTime())
.updateTime(productUpdReq.getUpdateTime())
+ .apiAddr(productUpdReq.getApiAddr())
+ .apiWay(productUpdReq.getApiWay())
.build();
}
+//https://gitea.qinmian.online/cloud/cloud-ui.git
}
diff --git a/cloud-market-common/src/main/java/com/muyu/market/admain/SelectByPhone.java b/cloud-market-common/src/main/java/com/muyu/market/admain/SelectByPhone.java
new file mode 100644
index 0000000..bc774c0
--- /dev/null
+++ b/cloud-market-common/src/main/java/com/muyu/market/admain/SelectByPhone.java
@@ -0,0 +1,18 @@
+package com.muyu.market.admain;
+
+import lombok.Data;
+
+@Data
+public class SelectByPhone {
+ // 省份
+ private String province;
+ // 城市
+ private String city;
+ // 区号
+ private String areacode;
+ // 邮编
+ private String zip;
+ // 运营商
+ private String company;
+
+}
diff --git a/cloud-market-common/src/main/java/com/muyu/market/admain/SelectWeather.java b/cloud-market-common/src/main/java/com/muyu/market/admain/SelectWeather.java
new file mode 100644
index 0000000..a7feed1
--- /dev/null
+++ b/cloud-market-common/src/main/java/com/muyu/market/admain/SelectWeather.java
@@ -0,0 +1,37 @@
+package com.muyu.market.admain;
+
+import lombok.Data;
+
+@Data
+public class SelectWeather {
+
+ /**
+ * 城市
+ */
+ private String city;
+ /**
+ * 天气
+ */
+ private String info;
+ /**
+ * 温度
+ */
+ private String temperature;
+ /**
+ * 湿度
+ */
+ private String humidity;
+ /**
+ * 风向
+ */
+ private String direct;
+ /**
+ * 风力
+ */
+ private String power;
+ /**
+ * 空气质量
+ */
+ private String aqi;
+
+}
diff --git a/cloud-market-common/src/main/java/com/muyu/market/admain/request/OrdersSelectReq.java b/cloud-market-common/src/main/java/com/muyu/market/admain/request/OrdersSelectReq.java
index 3e16354..75ab6c2 100644
--- a/cloud-market-common/src/main/java/com/muyu/market/admain/request/OrdersSelectReq.java
+++ b/cloud-market-common/src/main/java/com/muyu/market/admain/request/OrdersSelectReq.java
@@ -1,11 +1,14 @@
package com.muyu.market.admain.request;
+import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
+import java.util.Date;
+
@Data
@Tag(name = "订单查询", description = "订单查询")
@AllArgsConstructor
@@ -23,5 +26,41 @@ public class OrdersSelectReq {
*/
@Schema(type = "Long",defaultValue = "用户ID",description = "用户ID")
private Long userId;
-
+ /**
+ * 商品ID
+ */
+ @Schema(type = "Long",defaultValue = "商品ID",description = "1")
+ private Long productId;
+ /**
+ * 订单号
+ */
+ @Schema(type = "String",defaultValue = "订单号",description = "订单号")
+ private String orderNo;
+ /**
+ * 订单状态
+ */
+ @Schema(type = "String",defaultValue = "订单状态",description = "订单状态")
+ private String orderStatus;
+ /**
+ * 订单总金额
+ */
+ @Schema(type = "BigDecimal",defaultValue = "25.3",description = "订单总金额")
+ private String totalAmount;
+ /**
+ * 订单创建时间
+ */
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @Schema(description = "订单创建时间",defaultValue = "2024-5-15 10:00:52",type = "Date")
+ private Date createTime;
+ /**
+ * 订单更新时间
+ */
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @Schema(description = "订单更新时间",defaultValue = "2024-5-15 10:00:52",type = "Date")
+ private Date updateTime;
+ /**
+ * 订单备注
+ */
+ @Schema(type = "String",defaultValue = "订单备注",description = "订单备注")
+ private String note;
}
diff --git a/cloud-market-common/src/main/java/com/muyu/market/admain/request/ProductListReq.java b/cloud-market-common/src/main/java/com/muyu/market/admain/request/ProductListReq.java
index ebfd20c..c416bad 100644
--- a/cloud-market-common/src/main/java/com/muyu/market/admain/request/ProductListReq.java
+++ b/cloud-market-common/src/main/java/com/muyu/market/admain/request/ProductListReq.java
@@ -1,6 +1,7 @@
package com.muyu.market.admain.request;
import com.fasterxml.jackson.annotation.JsonFormat;
+import com.muyu.common.core.annotation.Excel;
import com.muyu.market.admain.Product;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -60,6 +61,16 @@ public class ProductListReq {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新时间",defaultValue = "2024-5-15 10:00:52",type = "Date")
private Date updateTime;
+ /**
+ *接口地址
+ */
+ @Schema(type = "String",defaultValue = "接口地址",description = "接口地址")
+ private String apiAddr;
+ /**
+ *请求方式
+ */
+ @Schema(type = "String",defaultValue = "请求方式",description = "请求方式")
+ private String apiWay;
diff --git a/cloud-market-common/src/main/java/com/muyu/market/admain/request/ProductSaveReq.java b/cloud-market-common/src/main/java/com/muyu/market/admain/request/ProductSaveReq.java
index 6e6fe35..62cae07 100644
--- a/cloud-market-common/src/main/java/com/muyu/market/admain/request/ProductSaveReq.java
+++ b/cloud-market-common/src/main/java/com/muyu/market/admain/request/ProductSaveReq.java
@@ -55,6 +55,16 @@ public class ProductSaveReq {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新时间",defaultValue = "2024-5-15 10:00:52",type = "Date")
private Date updateTime;
+ /**
+ *接口地址
+ */
+ @Schema(type = "String",defaultValue = "接口地址",description = "接口地址")
+ private String apiAddr;
+ /**
+ *请求方式
+ */
+ @Schema(type = "String",defaultValue = "请求方式",description = "请求方式")
+ private String apiWay;
diff --git a/cloud-market-common/src/main/java/com/muyu/market/admain/request/ProductUpdReq.java b/cloud-market-common/src/main/java/com/muyu/market/admain/request/ProductUpdReq.java
index 92e74fc..2a7ea8b 100644
--- a/cloud-market-common/src/main/java/com/muyu/market/admain/request/ProductUpdReq.java
+++ b/cloud-market-common/src/main/java/com/muyu/market/admain/request/ProductUpdReq.java
@@ -60,6 +60,16 @@ public class ProductUpdReq {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新时间",defaultValue = "2024-5-15 10:00:52",type = "Date")
private Date updateTime;
+ /**
+ *接口地址
+ */
+ @Schema(type = "String",defaultValue = "接口地址",description = "接口地址")
+ private String apiAddr;
+ /**
+ *请求方式
+ */
+ @Schema(type = "String",defaultValue = "请求方式",description = "请求方式")
+ private String apiWay;
diff --git a/cloud-market-common/src/main/java/com/muyu/market/admain/request/OrdersUpdResp.java b/cloud-market-common/src/main/java/com/muyu/market/admain/response/OrdersUpdResp.java
similarity index 97%
rename from cloud-market-common/src/main/java/com/muyu/market/admain/request/OrdersUpdResp.java
rename to cloud-market-common/src/main/java/com/muyu/market/admain/response/OrdersUpdResp.java
index c2f774f..a88e293 100644
--- a/cloud-market-common/src/main/java/com/muyu/market/admain/request/OrdersUpdResp.java
+++ b/cloud-market-common/src/main/java/com/muyu/market/admain/response/OrdersUpdResp.java
@@ -1,4 +1,4 @@
-package com.muyu.market.admain.request;
+package com.muyu.market.admain.response;
import com.fasterxml.jackson.annotation.JsonFormat;
diff --git a/cloud-market-common/src/main/java/com/muyu/market/admain/response/ProductListResp.java b/cloud-market-common/src/main/java/com/muyu/market/admain/response/ProductListResp.java
index f4632bd..84dd47c 100644
--- a/cloud-market-common/src/main/java/com/muyu/market/admain/response/ProductListResp.java
+++ b/cloud-market-common/src/main/java/com/muyu/market/admain/response/ProductListResp.java
@@ -61,6 +61,17 @@ public class ProductListResp {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新时间",defaultValue = "2024-5-15 10:00:52",type = "Date")
private Date updateTime;
+ /**
+ *接口地址
+ */
+ @Schema(type = "String",defaultValue = "接口地址",description = "接口地址")
+ private String apiAddr;
+ /**
+ *请求方式
+ */
+ @Schema(type = "String",defaultValue = "请求方式",description = "请求方式")
+ private String apiWay;
+
private BigDecimal begin;
private BigDecimal end;
@@ -78,6 +89,8 @@ public class ProductListResp {
.status(productlist.getStatus())
.createTime(productlist.getCreateTime())
.updateTime(productlist.getUpdateTime())
+ .apiAddr(productlist.getApiAddr())
+ .apiWay(productlist.getApiWay())
.build();
}
diff --git a/cloud-market-common/src/main/java/com/muyu/market/admain/response/ProductSaveResp.java b/cloud-market-common/src/main/java/com/muyu/market/admain/response/ProductSaveResp.java
index 64eef8a..3331a8f 100644
--- a/cloud-market-common/src/main/java/com/muyu/market/admain/response/ProductSaveResp.java
+++ b/cloud-market-common/src/main/java/com/muyu/market/admain/response/ProductSaveResp.java
@@ -56,7 +56,16 @@ public class ProductSaveResp {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新时间",defaultValue = "2024-5-15 10:00:52",type = "Date")
private Date updateTime;
-
+ /**
+ *接口地址
+ */
+ @Schema(type = "String",defaultValue = "接口地址",description = "接口地址")
+ private String apiAddr;
+ /**
+ *请求方式
+ */
+ @Schema(type = "String",defaultValue = "请求方式",description = "请求方式")
+ private String apiWay;
diff --git a/cloud-market-server/pom.xml b/cloud-market-server/pom.xml
index 0237348..f0cecf5 100644
--- a/cloud-market-server/pom.xml
+++ b/cloud-market-server/pom.xml
@@ -103,6 +103,31 @@
cloud-common-nacos-api
+
+
+
+ commons-beanutils
+ commons-beanutils
+ 1.9.3
+
+
+ commons-lang
+ commons-lang
+ 2.6
+
+
+ commons-logging
+ commons-logging
+ 1.2
+
+
+
+ net.sf.json-lib
+ json-lib
+ 2.4
+ jdk13
+
+
diff --git a/cloud-market-server/src/main/java/com/muyu/market/server/controller/OrdersController.java b/cloud-market-server/src/main/java/com/muyu/market/server/controller/OrdersController.java
index 88791bf..686794f 100644
--- a/cloud-market-server/src/main/java/com/muyu/market/server/controller/OrdersController.java
+++ b/cloud-market-server/src/main/java/com/muyu/market/server/controller/OrdersController.java
@@ -1,19 +1,13 @@
package com.muyu.market.server.controller;
import com.muyu.common.core.domain.Result;
-import com.muyu.market.admain.Orders;
-import com.muyu.market.admain.Product;
import com.muyu.market.admain.request.OrdersSelectReq;
-import com.muyu.market.admain.request.OrdersUpdResp;
import com.muyu.market.admain.response.OrdersSelectResp;
import com.muyu.market.server.service.OrdersService;
import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.extern.log4j.Log4j2;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -29,31 +23,40 @@ public class OrdersController {
private OrdersService orderService;
+ @PostMapping("/orderSelect")
+ @Operation(summary = "查询订信息",description = "查询订信息")
+ public Result> orderSelect(@RequestBody OrdersSelectReq ordersSelectReq){
- /**
- * 点击下单 添加订单信息
- * @param product
- * @return
- */
- @PostMapping("/orders")
- @Operation(summary = "订单添加",description = "添加添加订单")
- public Result creatOrder(@RequestBody Product product){
+ List sellist = orderService.orderSelect(ordersSelectReq);
+ return Result.success(sellist);
- orderService.saveOrder(product);
- return Result.success();
}
- /**
- * 查询订信息
- * @param ordersSelectResp
- * @return
- */
- @RequestMapping(path = "/orderSelect",method = RequestMethod.POST)
- @Operation(summary = "查询订单",description = "根据接口查看订单信息")
- public Result> findByorderList(@RequestBody OrdersSelectResp ordersSelectResp){
- return Result.success(orderService.findByorderList(ordersSelectResp));
- }
+// /**
+// * 点击下单 添加订单信息
+// * @param product
+// * @return
+// */
+// @PostMapping("/orders")
+// @Operation(summary = "订单添加",description = "添加添加订单")
+// public Result creatOrder(@RequestBody Product product){
+//
+// orderService.saveOrder(product);
+// return Result.success();
+// }
+
+
+// /**
+// * 查询订信息
+// * @param ordersSelectResp
+// * @return
+// */
+// @RequestMapping(path = "/orderSelect",method = RequestMethod.POST)
+// @Operation(summary = "查询订单",description = "根据接口查看订单信息")
+// public Result> findByorderList(@RequestBody OrdersSelectResp ordersSelectResp){
+// return Result.success(orderService.findByorderList(ordersSelectResp));
+// }
// /**
@@ -69,36 +72,36 @@ public class OrdersController {
- /**
- * 根据ID删除订单
- * @param orderId
- * @return
- */
- @DeleteMapping
- @Operation(summary = "刪除订单",description = "根据订单Id 删除订单")
- public Result removeById(@RequestParam(value = "orderId") Long orderId){
- orderService.removeById(orderId);
- return Result.success(null,"操作成功");
- }
-
-
- /**
- * 修改订单
- * @param orderId
- * @param ordersUpdResp
- * @return
- */
- @PutMapping("/{orderId}")
- @Operation(summary = "订单的修改",description = "通过ID修改订单")
- public Result update(
- @Schema(title = "订单ID",type = "Long",description = "修改订单信息",defaultValue = "1")
- @PathVariable("orderId") Long orderId,
- @RequestBody @Validated OrdersUpdResp ordersUpdResp){
-
- orderService.updateById(Orders.UpdOrdersReq(ordersUpdResp,()->orderId));
- return Result.success(null,"操作成功");
-
- }
+// /**
+// * 根据ID删除订单
+// * @param orderId
+// * @return
+// */
+// @DeleteMapping
+// @Operation(summary = "刪除订单",description = "根据订单Id 删除订单")
+// public Result removeById(@RequestParam(value = "orderId") Long orderId){
+// orderService.removeById(orderId);
+// return Result.success(null,"操作成功");
+// }
+//
+//
+// /**
+// * 修改订单
+// * @param orderId
+// * @param ordersUpdResp
+// * @return
+// */
+// @PutMapping("/{orderId}")
+// @Operation(summary = "订单的修改",description = "通过ID修改订单")
+// public Result update(
+// @Schema(title = "订单ID",type = "Long",description = "修改订单信息",defaultValue = "1")
+// @PathVariable("orderId") Long orderId,
+// @RequestBody @Validated OrdersUpdResp ordersUpdResp){
+//
+// orderService.updateById(Orders.UpdOrdersReq(ordersUpdResp,()->orderId));
+// return Result.success(null,"操作成功");
+//
+// }
diff --git a/cloud-market-server/src/main/java/com/muyu/market/server/controller/PartyController.java b/cloud-market-server/src/main/java/com/muyu/market/server/controller/PartyController.java
new file mode 100644
index 0000000..9466357
--- /dev/null
+++ b/cloud-market-server/src/main/java/com/muyu/market/server/controller/PartyController.java
@@ -0,0 +1,33 @@
+package com.muyu.market.server.controller;
+
+import com.muyu.common.core.domain.Result;
+import com.muyu.market.admain.Product;
+import com.muyu.market.admain.SelectByPhone;
+import com.muyu.market.server.util.SelectPhoneUtil;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+
+@Slf4j
+@RestController
+@RequestMapping("/party")
+@Tag(name = "查询手机号",description = "订单查询")
+public class PartyController {
+
+
+ @PostMapping("/selparty")
+ @Operation(summary = "查询手机号",description = "查询手机号")
+ public SelectByPhone selparty(@RequestParam("phoneNumber") String phoneNumber){
+
+ return SelectPhoneUtil.queryMobileLocation(phoneNumber);
+
+ }
+
+
+
+ //测试
+ public static void main(String[] args) {
+ SelectPhoneUtil.queryMobileLocation("18790307917");
+ }
+}
diff --git a/cloud-market-server/src/main/java/com/muyu/market/server/controller/WeatherController.java b/cloud-market-server/src/main/java/com/muyu/market/server/controller/WeatherController.java
new file mode 100644
index 0000000..c53302f
--- /dev/null
+++ b/cloud-market-server/src/main/java/com/muyu/market/server/controller/WeatherController.java
@@ -0,0 +1,32 @@
+package com.muyu.market.server.controller;
+
+import com.muyu.market.admain.SelectWeather;
+import com.muyu.market.server.util.SelectWeatherUtil;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@Slf4j
+@RestController
+@RequestMapping("/weather")
+@Tag(name = "查询天气",description = "查询天气")
+public class WeatherController {
+
+
+
+ @PostMapping("/selweather")
+ @Operation(summary = "查询天气",description = "查询天气")
+ public SelectWeather selweather(@RequestParam("cityName") String cityName){
+
+ return SelectWeatherUtil.queryWeather(cityName);
+ }
+
+
+ public static void main(String[] args) {
+ SelectWeatherUtil.queryWeather("南京");
+ }
+}
diff --git a/cloud-market-server/src/main/java/com/muyu/market/server/mapper/OrdersMapper.java b/cloud-market-server/src/main/java/com/muyu/market/server/mapper/OrdersMapper.java
index e2cf386..a835b49 100644
--- a/cloud-market-server/src/main/java/com/muyu/market/server/mapper/OrdersMapper.java
+++ b/cloud-market-server/src/main/java/com/muyu/market/server/mapper/OrdersMapper.java
@@ -9,8 +9,10 @@ import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
-public interface OrdersMapper extends BaseMapper {
- List findByorderList(OrdersSelectResp ordersSelectResp);
+public interface OrdersMapper {
+
+ List orderSelect(OrdersSelectReq ordersSelectReq);
+// List findByorderList(OrdersSelectResp ordersSelectResp);
/**
* 查询所有
diff --git a/cloud-market-server/src/main/java/com/muyu/market/server/service/Impl/OrdersServiceImpl.java b/cloud-market-server/src/main/java/com/muyu/market/server/service/Impl/OrdersServiceImpl.java
index d594472..19957c7 100644
--- a/cloud-market-server/src/main/java/com/muyu/market/server/service/Impl/OrdersServiceImpl.java
+++ b/cloud-market-server/src/main/java/com/muyu/market/server/service/Impl/OrdersServiceImpl.java
@@ -15,60 +15,65 @@ import java.util.Date;
import java.util.List;
import java.util.UUID;
@Service
-public class OrdersServiceImpl extends ServiceImpl implements OrdersService {
+public class OrdersServiceImpl implements OrdersService {
@Autowired
private OrdersMapper orderMapper;
@Override
- public void saveOrder(Product product) {
-
- Orders order = new Orders();
- //获取用户ID
- Long userId = SecurityUtils.getUserId();
- order.setUserId(userId);
- //获取商品ID
- order.setProductId(product.getProductId());
-
- // 生成一个随机的UUID
- UUID uuid = UUID.randomUUID();
- // 将UUID转换为字符串
- String random = uuid.toString();
- //随机生成订单编号
- order.setOrderNo(random);
-
- //订单状态(0:未支付 1:已支付)(订单刚生成状态都为未支付)
- order.setOrderStatus("0");
- //订单总金额
- order.setTotalAmount(product.getProductPrice());
- //订单创建时间(为当前时间)
- order.setCreateTime(new Date());
- //订单更新时间(为当前时间)
- order.setUpdateTime(new Date());
-
- try {
- orderMapper.insert(order);
- } catch (Exception e) {
-
- }
-
-
-
+ public List orderSelect(OrdersSelectReq ordersSelectReq) {
+ return orderMapper.orderSelect(ordersSelectReq);
}
-
-
// @Override
-// public List findAll() {
-// return orderMapper.findAll();
+// public void saveOrder(Product product) {
+//
+// Orders order = new Orders();
+// //获取用户ID
+// Long userId = SecurityUtils.getUserId();
+// order.setUserId(userId);
+// //获取商品ID
+// order.setProductId(product.getProductId());
+//
+// // 生成一个随机的UUID
+// UUID uuid = UUID.randomUUID();
+// // 将UUID转换为字符串
+// String random = uuid.toString();
+// //随机生成订单编号
+// order.setOrderNo(random);
+//
+// //订单状态(0:未支付 1:已支付)(订单刚生成状态都为未支付)
+// order.setOrderStatus("0");
+// //订单总金额
+// order.setTotalAmount(product.getProductPrice());
+// //订单创建时间(为当前时间)
+// order.setCreateTime(new Date());
+// //订单更新时间(为当前时间)
+// order.setUpdateTime(new Date());
+//
+// try {
+// orderMapper.insert(order);
+// } catch (Exception e) {
+//
+// }
+//
+//
+//
// }
-
- @Override
- public List findByorderList(OrdersSelectResp ordersSelectResp) {
- return orderMapper.findByorderList(ordersSelectResp);
- }
-
+//
+//
+//
+//// @Override
+//// public List findAll() {
+//// return orderMapper.findAll();
+//// }
+//
+// @Override
+// public List findByorderList(OrdersSelectResp ordersSelectResp) {
+// return orderMapper.findByorderList(ordersSelectResp);
+// }
+//
diff --git a/cloud-market-server/src/main/java/com/muyu/market/server/service/Impl/ProductServiceImpl.java b/cloud-market-server/src/main/java/com/muyu/market/server/service/Impl/ProductServiceImpl.java
index c14f6db..c31926c 100644
--- a/cloud-market-server/src/main/java/com/muyu/market/server/service/Impl/ProductServiceImpl.java
+++ b/cloud-market-server/src/main/java/com/muyu/market/server/service/Impl/ProductServiceImpl.java
@@ -48,6 +48,7 @@ public class ProductServiceImpl extends ServiceImpl impl
Product::getProductPrice,productListResp.getEnd()
);
}
+
List productlist = this.list(lambdaQueryWrapperlist);
// return productlist.stream()
diff --git a/cloud-market-server/src/main/java/com/muyu/market/server/service/OrdersService.java b/cloud-market-server/src/main/java/com/muyu/market/server/service/OrdersService.java
index 1a097d7..f7e8a7f 100644
--- a/cloud-market-server/src/main/java/com/muyu/market/server/service/OrdersService.java
+++ b/cloud-market-server/src/main/java/com/muyu/market/server/service/OrdersService.java
@@ -2,6 +2,7 @@ package com.muyu.market.server.service;
import com.baomidou.mybatisplus.extension.service.IService;
+import com.muyu.common.core.domain.Result;
import com.muyu.market.admain.Orders;
import com.muyu.market.admain.Product;
import com.muyu.market.admain.request.OrdersSelectReq;
@@ -9,13 +10,15 @@ import com.muyu.market.admain.response.OrdersSelectResp;
import java.util.List;
-public interface OrdersService extends IService {
+public interface OrdersService {
+ List orderSelect(OrdersSelectReq ordersSelectReq);
- void saveOrder(Product product);
- List findByorderList(OrdersSelectResp ordersSelectResp);
-
-// List findAll();
+// void saveOrder(Product product);
+//
+// List findByorderList(OrdersSelectResp ordersSelectResp);
+//
+//// List findAll();
}
diff --git a/cloud-market-server/src/main/java/com/muyu/market/server/util/PayUtils.java b/cloud-market-server/src/main/java/com/muyu/market/server/util/PayUtils.java
index 69ce8c6..ab11e2e 100644
--- a/cloud-market-server/src/main/java/com/muyu/market/server/util/PayUtils.java
+++ b/cloud-market-server/src/main/java/com/muyu/market/server/util/PayUtils.java
@@ -7,7 +7,8 @@ import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.request.AlipayTradeWapPayRequest;
import com.alipay.api.response.AlipayTradeWapPayResponse;
-//测试 是能用的 好像 希望啥 写完啦 快了 我只要把公钥私钥换了就行了
+
+
public class PayUtils {
public static void main(String[] args) {
AlipayClient alipayClient = new DefaultAlipayClient(
@@ -19,55 +20,55 @@ public class PayUtils {
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvAodOIG6vaqMsl5DXjcRYPRro+C/SeTswVo5gqQdikK3qy118GWkVwL9gvEovq23EMCTmSV+KAFsHz8f0UxLEK9FZcfRuM5E7GfnP7sdY0ctjfmUhQ7fWVOTGLuH0h5DiQ+4voO/2Hi6SElvtLXAUBSqMKw6J0PsJ0uUY9CBZCQnZkFJWAAroUWw5ARUMy62KPZSAW2s8Qg4gacdhSk7SBACNGBFcJZHCS09xQJi5SxCHaTRLhhIckLBvuKEWhBsh+jU75BKYAC4ovoWhMAFnIWKwCmubhXqmYjuJ4egUQTQBbD1hasK99I1YzdXRH8OKwKD4Lufb42B9buZ/2hOywIDAQAB",
"RSA2");
AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest();
-//异步接收地址,仅支持http/https,公网可访问
+ //异步接收地址,仅支持http/https,公网可访问
request.setNotifyUrl("");
-//同步跳转地址,仅支持http/https
+ //同步跳转地址,仅支持http/https
request.setReturnUrl("");
-/******必传参数******/
+ /******必传参数******/
JSONObject bizContent = new JSONObject();
-//商户订单号,商家自定义,保持唯一性
+ //商户订单号,商家自定义,保持唯一性
bizContent.put("out_trade_no", "2088721039266985");
-//支付金额,最小值0.01元
+ //支付金额,最小值0.01元
bizContent.put("total_amount", 0.01);
-//订单标题,不可使用特殊符号
+ //订单标题,不可使用特殊符号
bizContent.put("subject", "测试商品");
-/******可选参数******/
-//手机网站支付默认传值QUICK_WAP_WAY
- bizContent.put("product_code", "QUICK_WAP_WAY");
-//bizContent.put("time_expire", "2022-08-01 22:00:00");
+ /******可选参数******/
+ //手机网站支付默认传值QUICK_WAP_WAY
+ bizContent.put("product_code", "QUICK_WAP_WAY");
+ //bizContent.put("time_expire", "2022-08-01 22:00:00");
-//// 商品明细信息,按需传入
-//JSONArray goodsDetail = new JSONArray();
-//JSONObject goods1 = new JSONObject();
-//goods1.put("goods_id", "goodsNo1");
-//goods1.put("goods_name", "子商品1");
-//goods1.put("quantity", 1);
-//goods1.put("price", 0.01);
-//goodsDetail.add(goods1);
-//bizContent.put("goods_detail", goodsDetail);
+ //// 商品明细信息,按需传入
+ //JSONArray goodsDetail = new JSONArray();
+ //JSONObject goods1 = new JSONObject();
+ //goods1.put("goods_id", "goodsNo1");
+ //goods1.put("goods_name", "子商品1");
+ //goods1.put("quantity", 1);
+ //goods1.put("price", 0.01);
+ //goodsDetail.add(goods1);
+ //bizContent.put("goods_detail", goodsDetail);
-//// 扩展信息,按需传入
-//JSONObject extendParams = new JSONObject();
-//extendParams.put("sys_service_provider_id", "2088511833207846");
-//bizContent.put("extend_params", extendParams);
+ //// 扩展信息,按需传入
+ //JSONObject extendParams = new JSONObject();
+ //extendParams.put("sys_service_provider_id", "2088511833207846");
+ //bizContent.put("extend_params", extendParams);
- request.setBizContent(bizContent.toString());
- AlipayTradeWapPayResponse response = null;
- try {
- response = alipayClient.pageExecute(request,"POST");
- } catch (AlipayApiException e) {
- throw new RuntimeException(e);
- }
-// 如果需要返回GET请求,请使用
-// AlipayTradeWapPayResponse response = alipayClient.pageExecute(request,"GET");
- String pageRedirectionData = response.getBody();
- System.out.println(pageRedirectionData);
+ request.setBizContent(bizContent.toString());
+ AlipayTradeWapPayResponse response = null;
+ try {
+ response = alipayClient.pageExecute(request,"POST");
+ } catch (AlipayApiException e) {
+ throw new RuntimeException(e);
+ }
+ // 如果需要返回GET请求,请使用
+ // AlipayTradeWapPayResponse response = alipayClient.pageExecute(request,"GET");
+ String pageRedirectionData = response.getBody();
+ System.out.println(pageRedirectionData);
- if(response.isSuccess()){
- System.out.println("调用成功");
- } else {
- System.out.println("调用失败");
+ if(response.isSuccess()){
+ System.out.println("调用成功");
+ } else {
+ System.out.println("调用失败");
+ }
}
}
-}
diff --git a/cloud-market-server/src/main/java/com/muyu/market/server/util/SelectPhoneUtil.java b/cloud-market-server/src/main/java/com/muyu/market/server/util/SelectPhoneUtil.java
new file mode 100644
index 0000000..d732f09
--- /dev/null
+++ b/cloud-market-server/src/main/java/com/muyu/market/server/util/SelectPhoneUtil.java
@@ -0,0 +1,147 @@
+package com.muyu.market.server.util;
+
+import com.muyu.market.admain.SelectByPhone;
+import net.sf.json.JSONObject;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.Map;
+
+@RestController
+public class SelectPhoneUtil {
+ // 手机归属地查询接口地址
+ public static String API_URL = "http://apis.juhe.cn/mobile/get";
+ // 接口请求Key
+ public static String API_KEY = "4cfc25ee624fc08ad83b61a3a0ab1bcb";
+
+
+ /**
+ * 根据手机号码/手机号码前7位查询号码归属地
+ * @param mobile
+ */
+ public static SelectByPhone queryMobileLocation(String mobile)
+ {
+ Map params = new HashMap<>();//组合参数
+ params.put("phone", mobile);
+ params.put("key", API_KEY);
+ String queryParams = urlencode(params);
+
+ String response = doGet(API_URL, queryParams);
+ SelectByPhone selectByPhone = new SelectByPhone();
+ try {
+ JSONObject jsonObject = JSONObject.fromObject(response);
+ int error_code = jsonObject.getInt("error_code");
+ if (error_code == 0) {
+ System.out.println("调用接口成功");
+
+ JSONObject result = jsonObject.getJSONObject("result");
+
+ System.out.printf("省份:%s%n", result.getString("province"));
+ System.out.printf("城市:%s%n", result.getString("city"));
+ System.out.printf("区号:%s%n", result.getString("areacode"));
+ System.out.printf("邮编:%s%n", result.getString("zip"));
+ System.out.printf("运营商:%s%n", result.getString("company"));
+
+ selectByPhone.setCompany(result.getString("company"));
+ selectByPhone.setCity(result.getString("city"));
+ selectByPhone.setZip(result.getString("zip"));
+ selectByPhone.setAreacode(result.getString("areacode"));
+ selectByPhone.setProvince(result.getString("province"));
+ } else {
+ System.out.println("调用接口失败:" + jsonObject.getString("reason"));
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return selectByPhone;
+ }
+
+ /**
+ * get方式的http请求
+ *
+ * @param httpUrl 请求地址
+ * @return 返回结果
+ */
+ public static String doGet(String httpUrl, String queryParams) {
+ HttpURLConnection connection = null;
+ InputStream inputStream = null;
+ BufferedReader bufferedReader = null;
+ String result = null;// 返回结果字符串
+ try {
+ // 创建远程url连接对象
+ URL url = new URL(new StringBuffer(httpUrl).append("?").append(queryParams).toString());
+ // 通过远程url连接对象打开一个连接,强转成httpURLConnection类
+ connection = (HttpURLConnection) url.openConnection();
+ // 设置连接方式:get
+ connection.setRequestMethod("GET");
+ // 设置连接主机服务器的超时时间:15000毫秒
+ connection.setConnectTimeout(5000);
+ // 设置读取远程返回的数据时间:60000毫秒
+ connection.setReadTimeout(6000);
+ // 发送请求
+ connection.connect();
+ // 通过connection连接,获取输入流
+ if (connection.getResponseCode() == 200) {
+ inputStream = connection.getInputStream();
+ // 封装输入流,并指定字符集
+ bufferedReader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
+ // 存放数据
+ StringBuilder sbf = new StringBuilder();
+ String temp;
+ while ((temp = bufferedReader.readLine()) != null) {
+ sbf.append(temp);
+ sbf.append(System.getProperty("line.separator"));
+ }
+ result = sbf.toString();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ // 关闭资源
+ if (null != bufferedReader) {
+ try {
+ bufferedReader.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ if (null != inputStream) {
+ try {
+ inputStream.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ if (connection != null) {
+ connection.disconnect();// 关闭远程连接
+ }
+ }
+ return result;
+ }
+
+ /**
+ * 将map型转为请求参数型
+ *
+ * @param data
+ * @return
+ */
+ public static String urlencode(Map data) {
+ StringBuilder sb = new StringBuilder();
+ for (Map.Entry i : data.entrySet()) {
+ try {
+ sb.append(i.getKey()).append("=").append(URLEncoder.encode(i.getValue() + "", "UTF-8")).append("&");
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ }
+ }
+ String result = sb.toString();
+ result = result.substring(0, result.lastIndexOf("&"));
+ return result;
+ }
+
+}
diff --git a/cloud-market-server/src/main/java/com/muyu/market/server/util/SelectWeatherUtil.java b/cloud-market-server/src/main/java/com/muyu/market/server/util/SelectWeatherUtil.java
new file mode 100644
index 0000000..5ed4b1e
--- /dev/null
+++ b/cloud-market-server/src/main/java/com/muyu/market/server/util/SelectWeatherUtil.java
@@ -0,0 +1,154 @@
+package com.muyu.market.server.util;
+import com.muyu.market.admain.SelectWeather;
+import net.sf.json.JSONObject;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.Map;
+@RestController
+public class SelectWeatherUtil {
+
+
+ // 天气情况查询接口地址
+ public static String API_URL = "http://apis.juhe.cn/simpleWeather/query";
+ // 接口请求Key
+ public static String API_KEY = "2e7b031d32a2eac211c099bf4918a4dd";
+
+
+ /**
+ * 根据城市名查询天气情况
+ *
+ * @param cityName
+ */
+ public static SelectWeather queryWeather(String cityName) {
+ Map params = new HashMap<>();//组合参数
+ params.put("city", cityName);
+ params.put("key", API_KEY);
+ String queryParams = urlencode(params);
+
+ String response = doGet(API_URL, queryParams);
+ SelectWeather selectWeather = new SelectWeather();
+
+ try {
+ JSONObject jsonObject = JSONObject.fromObject(response);
+ int error_code = jsonObject.getInt("error_code");
+ if (error_code == 0) {
+ System.out.println("调用接口成功");
+
+ JSONObject result = jsonObject.getJSONObject("result");
+ JSONObject realtime = result.getJSONObject("realtime");
+
+ System.out.printf("城市:%s%n", result.getString("city"));
+ System.out.printf("天气:%s%n", realtime.getString("info"));
+ System.out.printf("温度:%s%n", realtime.getString("temperature"));
+ System.out.printf("湿度:%s%n", realtime.getString("humidity"));
+ System.out.printf("风向:%s%n", realtime.getString("direct"));
+ System.out.printf("风力:%s%n", realtime.getString("power"));
+ System.out.printf("空气质量:%s%n", realtime.getString("aqi"));
+
+ selectWeather.setCity(result.getString("city"));
+ selectWeather.setInfo(realtime.getString("info"));
+ selectWeather.setTemperature(realtime.getString("temperature"));
+ selectWeather.setHumidity(realtime.getString("humidity"));
+ selectWeather.setDirect(realtime.getString("direct"));
+ selectWeather.setPower(realtime.getString("power"));
+ selectWeather.setAqi(realtime.getString("aqi"));
+
+ } else {
+ System.out.println("调用接口失败:" + jsonObject.getString("reason"));
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return selectWeather;
+ }
+
+ /**
+ * get方式的http请求
+ *
+ * @param httpUrl 请求地址
+ * @return 返回结果
+ */
+ public static String doGet(String httpUrl, String queryParams) {
+ HttpURLConnection connection = null;
+ InputStream inputStream = null;
+ BufferedReader bufferedReader = null;
+ String result = null;// 返回结果字符串
+ try {
+ // 创建远程url连接对象
+ URL url = new URL(new StringBuffer(httpUrl).append("?").append(queryParams).toString());
+ // 通过远程url连接对象打开一个连接,强转成httpURLConnection类
+ connection = (HttpURLConnection) url.openConnection();
+ // 设置连接方式:get
+ connection.setRequestMethod("GET");
+ // 设置连接主机服务器的超时时间:15000毫秒
+ connection.setConnectTimeout(5000);
+ // 设置读取远程返回的数据时间:60000毫秒
+ connection.setReadTimeout(6000);
+ // 发送请求
+ connection.connect();
+ // 通过connection连接,获取输入流
+ if (connection.getResponseCode() == 200) {
+ inputStream = connection.getInputStream();
+ // 封装输入流,并指定字符集
+ bufferedReader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
+ // 存放数据
+ StringBuilder sbf = new StringBuilder();
+ String temp;
+ while ((temp = bufferedReader.readLine()) != null) {
+ sbf.append(temp);
+ sbf.append(System.getProperty("line.separator"));
+ }
+ result = sbf.toString();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ // 关闭资源
+ if (null != bufferedReader) {
+ try {
+ bufferedReader.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ if (null != inputStream) {
+ try {
+ inputStream.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ if (connection != null) {
+ connection.disconnect();// 关闭远程连接
+ }
+ }
+ return result;
+ }
+
+ /**
+ * 将map型转为请求参数型
+ *
+ * @param data
+ * @return
+ */
+ public static String urlencode(Map data) {
+ StringBuilder sb = new StringBuilder();
+ for (Map.Entry i : data.entrySet()) {
+ try {
+ sb.append(i.getKey()).append("=").append(URLEncoder.encode(i.getValue() + "", "UTF-8")).append("&");
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ }
+ }
+ String result = sb.toString();
+ result = result.substring(0, result.lastIndexOf("&"));
+ return result;
+ }
+
+}
diff --git a/cloud-market-server/src/main/resources/Mapper/OrdersMapper.xml b/cloud-market-server/src/main/resources/Mapper/OrdersMapper.xml
index 1b9864a..fd7769f 100644
--- a/cloud-market-server/src/main/resources/Mapper/OrdersMapper.xml
+++ b/cloud-market-server/src/main/resources/Mapper/OrdersMapper.xml
@@ -17,21 +17,36 @@
-