|
@@ -0,0 +1,57 @@
|
|
|
|
+package com.gis.service.impl;
|
|
|
|
+
|
|
|
|
+import com.gis.common.exception.BaseRuntimeException;
|
|
|
|
+import com.gis.common.util.Result;
|
|
|
|
+import com.gis.domain.po.ClientEntity;
|
|
|
|
+import com.gis.mapper.ClientMapper;
|
|
|
|
+import com.gis.mapper.IBaseMapper;
|
|
|
|
+import com.gis.service.ClientService;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * Created by owen on 2020/3/11 0011 16:16
|
|
|
|
+ */
|
|
|
|
+@Slf4j
|
|
|
|
+@Service
|
|
|
|
+public class ClientServiceImpl extends IBaseServiceImpl<ClientEntity, Long> implements ClientService {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private ClientMapper entityMapper;
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public IBaseMapper<ClientEntity, Long> getBaseMapper() {
|
|
|
|
+ return this.entityMapper;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Result saveCode(String code) {
|
|
|
|
+
|
|
|
|
+ BaseRuntimeException.isBlank(code, null, "场景码不能为空");
|
|
|
|
+ ClientEntity entity = this.findByCode(code);
|
|
|
|
+ BaseRuntimeException.isTrue(entity!=null, null, "此场景已存在");
|
|
|
|
+
|
|
|
|
+ entity = new ClientEntity();
|
|
|
|
+ entity.setCode(code);
|
|
|
|
+ this.save(entity);
|
|
|
|
+ return Result.success(entity);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public ClientEntity findByCode(String code) {
|
|
|
|
+ return entityMapper.findByCode(code);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Result remove(String sceneCode) {
|
|
|
|
+ log.warn("sss :{}", sceneCode);
|
|
|
|
+ entityMapper.remove(sceneCode);
|
|
|
|
+ return Result.success();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+}
|