mitao
2025-02-24 879ce4e66b36daf44f79b17eb02d3578148e4545
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
package com.panzhihua.applets.api;
 
import javax.annotation.Resource;
 
import com.panzhihua.common.controller.BaseController;
import org.springframework.web.bind.annotation.*;
 
import com.panzhihua.common.model.dtos.community.switchs.SearchCommunityDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.switchs.CommunitySwitchAllAppletsVO;
import com.panzhihua.common.model.vos.community.switchs.StreetAllAppletsVO;
import com.panzhihua.common.service.community.CommunityService;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
 
@Slf4j
@RestController
@RequestMapping("/switch/")
@Api(tags = {"切换社区模块"})
public class CommunitySwitchApi extends BaseController {
 
    @Resource
    private CommunityService communityService;
 
    @ApiOperation(value = "查询所有社区", response = StreetAllAppletsVO.class)
    @GetMapping("/list/noToken")
    public R list() {
        return communityService.communitySwitchList(this.getAppId());
    }
 
    @ApiOperation(value = "根据名字搜索社区", response = CommunitySwitchAllAppletsVO.class)
    @GetMapping("/search/noToken")
    public R search(@RequestParam(value = "name") String name) {
        return communityService.communitySwitchSearchList(name,this.getAppId());
    }
 
    @ApiOperation(value = "根据距离搜索社区", response = CommunitySwitchAllAppletsVO.class)
    @PostMapping("/distance/noToken")
    public R searchDistance(@RequestBody SearchCommunityDTO communityDTO) {
        return communityService.communitySwitchSearchDistanceList(communityDTO);
    }
 
}