xiangpei
6 天以前 0bcc66233bfe26a356c7ffa820f6a97a214a9b49
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
package cn.lili.modules.system.service;
 
import cn.lili.modules.system.entity.dos.Region;
import cn.lili.modules.system.entity.vo.RegionVO;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
 
import java.util.List;
import java.util.Map;
 
/**
 * 行政地区业务层
 *
 * @author Chopper
 * @since 2020/12/2 14:14
 */
@CacheConfig(cacheNames = "{regions}")
public interface RegionService extends IService<Region> {
 
 
    /**
     * 更新地区
     *
     * @param region 地区
     * @return
     */
    @CacheEvict(allEntries = true)
    boolean updateById(Region region);
    /**
     * 更新地区
     *
     * @param region 地区
     * @return
     */
    @CacheEvict(allEntries = true)
    boolean save(Region region);
 
 
    @CacheEvict(allEntries = true)
    boolean removeByIds(List<String> idList);
    /**
     * 同步行政数据
     *
     * @param url
     */
    @CacheEvict
    void synchronizationData(String url);
 
    /**
     * 获取地区列表
     *
     * @param id 地区ID
     * @return 地区列表
     */
    @Cacheable(key = "#id")
    List<Region> getItem(String id);
 
    /**
     * 根据最后一级名称获取改所有上级地区id
     *
     * @param lastName 最后一级名称
     * @return 全部地区id
     */
    String getItemByLastName(String lastName);
 
    /**
     * 获取地址
     *
     * @param cityCode 城市编码
     * @param townName 镇名称
     * @return
     */
    Map<String, Object> getRegion(String cityCode, String townName);
 
    /**
     * 获取所有的城市
     *
     * @return
     */
    @Cacheable(key = "'ALL_CITY'")
    List<RegionVO> getAllCity();
}