Browse Source

修改到docker外运行环境

tags/v1.0.0^2
林万龙 3 years ago
parent
commit
90c96317a5
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      src/main/java/com/telpo/dipperposition/service/impl/IPProvinceServiceImpl.java

+ 12
- 0
src/main/java/com/telpo/dipperposition/service/impl/IPProvinceServiceImpl.java View File

@@ -26,6 +26,9 @@ public class IPProvinceServiceImpl implements IPProvinceService {


@Override @Override
public boolean saveIPProvince(IPProvinceEntity entity) { public boolean saveIPProvince(IPProvinceEntity entity) {
if (iPProvinceMapper == null) {
iPProvinceMapper = new IPProvinceMapper();
}
iPProvinceMapper.save(entity); iPProvinceMapper.save(entity);
return true; return true;
} }
@@ -33,12 +36,18 @@ public class IPProvinceServiceImpl implements IPProvinceService {
@Override @Override
public boolean updateIPProvince( public boolean updateIPProvince(
IPProvinceEntity query, IPProvinceEntity update) { IPProvinceEntity query, IPProvinceEntity update) {
if (iPProvinceMapper == null) {
iPProvinceMapper = new IPProvinceMapper();
}
iPProvinceMapper.updateFirst(query, update); iPProvinceMapper.updateFirst(query, update);
return true; return true;
} }


@Override @Override
public boolean romveById(String id) { public boolean romveById(String id) {
if (iPProvinceMapper == null) {
iPProvinceMapper = new IPProvinceMapper();
}
iPProvinceMapper.deleteById(id); iPProvinceMapper.deleteById(id);
return false; return false;
} }
@@ -48,6 +57,9 @@ public class IPProvinceServiceImpl implements IPProvinceService {
try { try {
IPProvinceEntity query = new IPProvinceEntity(); IPProvinceEntity query = new IPProvinceEntity();
query.setIp(ipAddress); query.setIp(ipAddress);
if (iPProvinceMapper == null) {
iPProvinceMapper = new IPProvinceMapper();
}
List<IPProvinceEntity> pushRecords = iPProvinceMapper.queryList(query); List<IPProvinceEntity> pushRecords = iPProvinceMapper.queryList(query);
if (ObjectUtils.isNotEmpty(pushRecords)) { if (ObjectUtils.isNotEmpty(pushRecords)) {
return pushRecords.get(0); return pushRecords.get(0);


Loading…
Cancel
Save