101captain
2022-07-20 c40f8e3d2e08e108780091776437242528bf61d6
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
package com.panzhihua.service_community.api;
 
import java.util.List;
 
import javax.annotation.Resource;
 
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import com.panzhihua.common.model.dtos.community.PageComStreetDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComStreetVO;
import com.panzhihua.service_community.service.ComStreetService;
 
import lombok.extern.slf4j.Slf4j;
 
/**
 * @Author: llming
 * @Description:
 */
@Slf4j
@RestController
@RequestMapping("/")
public class StreetApi {
    @Resource
    private ComStreetService comStreetService;
 
    /**
     * 新增街道
     * 
     * @param comStreetVO
     *            新增信息
     * @return 新增结果
     */
    @PostMapping("addstreet")
    @Transactional(rollbackFor = Exception.class)
    public R<ComStreetVO> addStreet(@RequestBody ComStreetVO comStreetVO) {
        return comStreetService.addStreet(comStreetVO);
    }
 
    /**
     * 分页查询街道
     * 
     * @param pageComStreetDTO
     *            查询条件
     * @return 新增结果
     */
    @PostMapping("pagestreet")
    public R putStreet(@RequestBody PageComStreetDTO pageComStreetDTO) {
        R r = comStreetService.pageStreet(pageComStreetDTO);
        return R.ok(r);
    }
 
    /**
     * 查询街道
     * 
     * @param comStreetVO
     *            查询条件
     * @return 新增结果
     */
    @PostMapping("liststreet")
    public R putStreet(@RequestBody ComStreetVO comStreetVO) {
        R r = comStreetService.listStreet(comStreetVO);
        return R.ok(r);
    }
 
    /**
     * 街道
     * 
     * @param Ids
     *            动态id
     * @return 删除结果
     */
    @PostMapping("deletestreet")
    @Transactional(rollbackFor = Exception.class)
    public R delectStreat(@RequestBody List<Long> Ids) {
        R r = comStreetService.delectStreat(Ids);
        return r;
    }
 
    /**
     * 街道详情
     * @param id
     * @return
     */
    @GetMapping("detailStreet")
    public R detailStreet(@RequestParam("id") Long id) {
        return comStreetService.detailStreet(id);
    }
 
}