北斗定位
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ProvinceInfoServiceImpl.java 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. package com.telpo.dipperposition.service.impl;
  2. import com.telpo.dipperposition.entity.mongo.IpProvinceEntity;
  3. import com.telpo.dipperposition.entity.mongo.ProvinceInfoEntity;
  4. import com.telpo.dipperposition.mapper.IpProvinceMapper;
  5. import com.telpo.dipperposition.mapper.ProvinceInfoMapper;
  6. import com.telpo.dipperposition.service.IProvinceInfoService;
  7. import lombok.extern.slf4j.Slf4j;
  8. import org.apache.commons.lang3.ObjectUtils;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.stereotype.Service;
  11. import java.util.List;
  12. /**
  13. * @program: DataPushServer
  14. * @description: 推送记录服务接口实现类
  15. * @author: linwl
  16. * @create: 2020-07-20 11:09
  17. */
  18. @Slf4j
  19. @Service
  20. public class ProvinceInfoServiceImpl implements IProvinceInfoService {
  21. @Autowired
  22. private ProvinceInfoMapper provinceInfoMapper;
  23. @Override
  24. public boolean saveProvinceInfo(ProvinceInfoEntity entity) {
  25. return false;
  26. }
  27. @Override
  28. public boolean updateProvinceInfoEntity(ProvinceInfoEntity query, ProvinceInfoEntity update) {
  29. return false;
  30. }
  31. @Override
  32. public boolean romveById(String id) {
  33. provinceInfoMapper.deleteIpById(id);
  34. return false;
  35. }
  36. @Override
  37. public ProvinceInfoEntity getProvinceInfo(String provicne) {
  38. try {
  39. ProvinceInfoEntity query = new ProvinceInfoEntity();
  40. query.setProvince(provicne);
  41. List<ProvinceInfoEntity> records = provinceInfoMapper.queryIpList(query);
  42. if (ObjectUtils.isNotEmpty(records)) {
  43. return records.get(0);
  44. } else {
  45. return null;
  46. }
  47. } catch (Exception e) {
  48. log.error("获取省份异常:", e);
  49. return null;
  50. }
  51. }
  52. @Override
  53. public List<ProvinceInfoEntity> getProvinceInfoEntitys() {
  54. try {
  55. ProvinceInfoEntity query = new ProvinceInfoEntity();
  56. List<ProvinceInfoEntity> records = provinceInfoMapper.queryIpList(query);
  57. if (ObjectUtils.isNotEmpty(records)) {
  58. return records;
  59. } else {
  60. return null;
  61. }
  62. } catch (Exception e) {
  63. log.error("获取IP省份异常:", e);
  64. return null;
  65. }
  66. }
  67. }