huanghongfa
2021-08-10 63cdfcdab5b90e25dc468967c5e4ac0315965f02
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.panzhihua.service_community.api;
 
import com.panzhihua.common.model.dtos.community.switchs.SearchCommunityDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.service_community.service.ComActService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
 
 
@Slf4j
@RestController
@RequestMapping("/switch/")
public class CommunitySwitchApi {
 
    @Resource
    private ComActService comActService;
 
    /**
     * 查询社区所有列表
     * @return  社区列表
     */
    @GetMapping("/community/all/list")
    public R getCommunityAllList() {
        return comActService.getCommunityAllList();
    }
 
    /**
     * 根据名字查询所有社区列表
     * @param name  社区名字
     * @return  社区列表
     */
    @GetMapping("/community/search/list")
    public R communitySwitchSearchList(@RequestParam(value = "name") String name) {
        return comActService.communitySwitchSearchList(name);
    }
 
    /**
     * 根据经纬度以及距离搜索附近社区列表
     * @param communityDTO  请求参数
     * @return  社区列表
     */
    @PostMapping("/community/search/distance/list")
    public R communitySwitchSearchDistanceList(@RequestBody SearchCommunityDTO communityDTO) {
        return comActService.communitySwitchSearchDistanceList(communityDTO);
    }
}