From a617006079e833b174f3223dee1e0266aa3ac2d8 Mon Sep 17 00:00:00 2001
From: “mitao” <“2763622819@qq.com”>
Date: 星期二, 03 二月 2026 21:23:38 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
xp-service/xp-operation/src/main/java/com/xiaopeng/operation/controller/XpRegionController.java | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 53 insertions(+), 6 deletions(-)
diff --git a/xp-service/xp-operation/src/main/java/com/xiaopeng/operation/controller/XpRegionController.java b/xp-service/xp-operation/src/main/java/com/xiaopeng/operation/controller/XpRegionController.java
index 61bdb52..a422f56 100644
--- a/xp-service/xp-operation/src/main/java/com/xiaopeng/operation/controller/XpRegionController.java
+++ b/xp-service/xp-operation/src/main/java/com/xiaopeng/operation/controller/XpRegionController.java
@@ -1,20 +1,67 @@
package com.xiaopeng.operation.controller;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.xiaopeng.common.core.domain.R;
+import com.xiaopeng.api.model.operation.XpRegion;
+import com.xiaopeng.operation.service.XpRegionService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
-import org.springframework.stereotype.Controller;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.List;
/**
* <p>
- * 省市区三级联动 前端控制器
+ * 省市管理 前端控制器
* </p>
*
- * @author mitao
- * @since 2026-02-03
*/
-@Controller
-@RequestMapping("/xp-region")
+@Api(tags = "省市管理")
+@RestController
+@RequestMapping("/base/v1/mini-program")
public class XpRegionController {
+ private final XpRegionService regionService;
+
+
+ @Autowired
+ public XpRegionController(XpRegionService regionService) {
+ this.regionService = regionService;
+ }
+
+
+
+ /**
+ * 查询省市管理
+ */
+ @ApiOperation(value = "查询省市管理",tags = {"小程序-省市管理"},response = XpRegion.class)
+ @GetMapping(value = "/open/t-region/getRegion")
+ public R<List<List<XpRegion>>> geXpRegion() {
+ return R.ok(regionService.getXpRegion());
+ }
+
+
+ /*
+ * 查询市
+ */
+ @ApiOperation(value = "查询市",tags = {"小程序-查询市"},response = XpRegion.class)
+ @PostMapping(value = "/open/t-region/getProvince")
+ public R<List<XpRegion>> getProvince() {
+ List<XpRegion> list = regionService.list(Wrappers.lambdaQuery(XpRegion.class).ne(XpRegion::getParentId, 0).orderByAsc(XpRegion::getInitial));
+ return R.ok(list);
+ }
+
}
+
--
Gitblit v1.7.1