|
@@ -0,0 +1,36 @@
|
|
|
+package com.sxtvs.open.api.news.controller;
|
|
|
+
|
|
|
+import com.sxtvs.open.api.news.entity.Area;
|
|
|
+import com.sxtvs.open.api.news.service.impl.AreaServiceImpl;
|
|
|
+import jakarta.annotation.Resource;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 前端控制器
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author syj
|
|
|
+ * @since 2023-02-27
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/news/area")
|
|
|
+public class AreaController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private AreaServiceImpl areaService;
|
|
|
+
|
|
|
+ @RequestMapping("province")
|
|
|
+ public List<Area> province(){
|
|
|
+ return areaService.lambdaQuery().eq(Area::getLevel, 1).list();
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping("city")
|
|
|
+ public List<Area> city(@RequestParam("pid") String pid){
|
|
|
+ return areaService.lambdaQuery().eq(Area::getPid, pid).list();
|
|
|
+ }
|
|
|
+}
|