diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerUserDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerUserDTO.java
new file mode 100644
index 0000000000..348dc373d2
--- /dev/null
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerUserDTO.java
@@ -0,0 +1,121 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 居民用户信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-16
+ */
+@Data
+public class CustomerUserDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 唯一标识
+ */
+ private String id;
+
+ /**
+ * 客户Id CUSTOMER.id
+ */
+ private String customerId;
+
+ /**
+ * 微信openId
+ */
+ private String wxOpenId;
+
+ /**
+ * 手机号
+ */
+ private String mobile;
+
+ /**
+ * 昵称
+ */
+ private String nickname;
+
+ /**
+ * 性别:0.未知 1.男性2女性
+ */
+ private Integer sex;
+
+ /**
+ * 头像
+ */
+ private String headImgUrl;
+
+ /**
+ * 国家
+ */
+ private String country;
+
+ /**
+ * 省份
+ */
+ private String province;
+
+ /**
+ * 城市
+ */
+ private String city;
+
+ /**
+ * 语言
+ */
+ private String language;
+
+ /**
+ * 删除标识:0.未删除 1.已删除
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-api/epmet-api-server/pom.xml b/epmet-user/epmet-user-server/pom.xml
similarity index 90%
rename from epmet-module/epmet-api/epmet-api-server/pom.xml
rename to epmet-user/epmet-user-server/pom.xml
index 1cbb7b6674..80043ebabe 100644
--- a/epmet-module/epmet-api/epmet-api-server/pom.xml
+++ b/epmet-user/epmet-user-server/pom.xml
@@ -5,32 +5,27 @@
com.epmet
- epmet-api
+ epmet-user
2.0.0
- epmet-api-server
+ epmet-user-server
jar
com.epmet
- epmet-oss-client
+ epmet-user-client
2.0.0
com.epmet
- epmet-api-client
- 2.0.0
-
-
- com.epmet
- epmet-commons-tools
+ epmet-commons-mybatis
2.0.0
com.epmet
- epmet-commons-mybatis
+ epmet-commons-dynamic-datasource
2.0.0
@@ -70,6 +65,7 @@
+
${project.basedir}/src/main/java
@@ -78,21 +74,20 @@
+
dev
-
true
-
8087
dev
-
+
epmet
elink@833066
@@ -113,13 +108,16 @@
test
+
8087
test
-
+
epmet
elink@833066
diff --git a/epmet-module/epmet-api/epmet-api-server/src/main/java/com/epmet/ApiApplication.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/UserApplication.java
similarity index 59%
rename from epmet-module/epmet-api/epmet-api-server/src/main/java/com/epmet/ApiApplication.java
rename to epmet-user/epmet-user-server/src/main/java/com/epmet/UserApplication.java
index d7c39bbe4e..7d54b4e248 100644
--- a/epmet-module/epmet-api/epmet-api-server/src/main/java/com/epmet/ApiApplication.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/UserApplication.java
@@ -10,22 +10,18 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
-import org.springframework.cloud.openfeign.EnableFeignClients;
/**
- * API模块
+ * 管理后台
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@SpringBootApplication
-@EnableDiscoveryClient
-@EnableFeignClients
-public class ApiApplication {
+public class UserApplication {
public static void main(String[] args) {
- SpringApplication.run(ApiApplication.class, args);
+ SpringApplication.run(UserApplication.class, args);
}
}
diff --git a/epmet-module/epmet-api/epmet-api-server/src/main/java/com/epmet/config/ModuleConfigImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/config/ModuleConfigImpl.java
similarity index 94%
rename from epmet-module/epmet-api/epmet-api-server/src/main/java/com/epmet/config/ModuleConfigImpl.java
rename to epmet-user/epmet-user-server/src/main/java/com/epmet/config/ModuleConfigImpl.java
index 0417544104..583ecbea38 100644
--- a/epmet-module/epmet-api/epmet-api-server/src/main/java/com/epmet/config/ModuleConfigImpl.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/config/ModuleConfigImpl.java
@@ -21,6 +21,6 @@ import org.springframework.stereotype.Service;
public class ModuleConfigImpl implements ModuleConfig {
@Override
public String getName() {
- return "api";
+ return "epmetuser";
}
}
diff --git a/epmet-module/epmet-api/epmet-api-server/src/main/java/com/epmet/config/SwaggerConfig.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/config/SwaggerConfig.java
similarity index 85%
rename from epmet-module/epmet-api/epmet-api-server/src/main/java/com/epmet/config/SwaggerConfig.java
rename to epmet-user/epmet-user-server/src/main/java/com/epmet/config/SwaggerConfig.java
index 6e70b9a800..e4ceef42ee 100644
--- a/epmet-module/epmet-api/epmet-api-server/src/main/java/com/epmet/config/SwaggerConfig.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/config/SwaggerConfig.java
@@ -12,7 +12,6 @@ import com.epmet.commons.tools.constant.Constant;
import io.swagger.annotations.ApiOperation;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
@@ -34,7 +33,7 @@ import static com.google.common.collect.Lists.newArrayList;
*/
@Configuration
@EnableSwagger2
-public class SwaggerConfig implements WebMvcConfigurer {
+public class SwaggerConfig {
@Bean
public Docket createRestApi() {
@@ -43,19 +42,20 @@ public class SwaggerConfig implements WebMvcConfigurer {
.select()
//加了ApiOperation注解的类,才生成接口文档
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
+ //包下的类,才生成接口文档
+ //.apis(RequestHandlerSelectors.basePackage("io.renren.controller"))
.paths(PathSelectors.any())
.build()
.directModelSubstitute(java.util.Date.class, String.class)
.securitySchemes(security());
-
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("人人开源")
- .description("API接口文档")
- .termsOfServiceUrl("https://www.renren.io")
- .version("1.1.0")
+ .description("系统模块开发文档")
+ .termsOfServiceUrl("https://www.renren.io/community")
+ .version("1.4.0")
.build();
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerUserController.java
new file mode 100644
index 0000000000..ae4187b65d
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerUserController.java
@@ -0,0 +1,94 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.controller;
+
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ExcelUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.AssertUtils;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
+import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.dto.CustomerUserDTO;
+import com.epmet.excel.CustomerUserExcel;
+import com.epmet.service.CustomerUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 居民用户信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-16
+ */
+@RestController
+@RequestMapping("customeruser")
+public class CustomerUserController {
+
+ @Autowired
+ private CustomerUserService customerUserService;
+
+ @GetMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = customerUserService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id){
+ CustomerUserDTO data = customerUserService.get(id);
+ return new Result().ok(data);
+ }
+
+ @PostMapping
+ public Result save(@RequestBody CustomerUserDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ customerUserService.save(dto);
+ return new Result();
+ }
+
+ @PutMapping
+ public Result update(@RequestBody CustomerUserDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ customerUserService.update(dto);
+ return new Result();
+ }
+
+ @DeleteMapping
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ customerUserService.delete(ids);
+ return new Result();
+ }
+
+ @GetMapping("export")
+ public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = customerUserService.list(params);
+ ExcelUtils.exportExcelToTarget(response, null, list, CustomerUserExcel.class);
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerUserDao.java
new file mode 100644
index 0000000000..e41ca338d6
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerUserDao.java
@@ -0,0 +1,33 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.entity.CustomerUserEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 居民用户信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-16
+ */
+@Mapper
+public interface CustomerUserDao extends BaseDao {
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerUserEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerUserEntity.java
new file mode 100644
index 0000000000..11a6e86b09
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerUserEntity.java
@@ -0,0 +1,91 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 居民用户信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-16
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("customer_user")
+public class CustomerUserEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户Id CUSTOMER.id
+ */
+ private String customerId;
+
+ /**
+ * 微信openId
+ */
+ private String wxOpenId;
+
+ /**
+ * 手机号
+ */
+ private String mobile;
+
+ /**
+ * 昵称
+ */
+ private String nickname;
+
+ /**
+ * 性别:0.未知 1.男性2女性
+ */
+ private Integer sex;
+
+ /**
+ * 头像
+ */
+ private String headImgUrl;
+
+ /**
+ * 国家
+ */
+ private String country;
+
+ /**
+ * 省份
+ */
+ private String province;
+
+ /**
+ * 城市
+ */
+ private String city;
+
+ /**
+ * 语言
+ */
+ private String language;
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/CustomerUserExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/CustomerUserExcel.java
new file mode 100644
index 0000000000..e1d2bc9aec
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/CustomerUserExcel.java
@@ -0,0 +1,86 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 居民用户信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-16
+ */
+@Data
+public class CustomerUserExcel {
+
+ @Excel(name = "唯一标识")
+ private String id;
+
+ @Excel(name = "客户Id CUSTOMER.id")
+ private String customerId;
+
+ @Excel(name = "微信openId")
+ private String wxOpenId;
+
+ @Excel(name = "手机号")
+ private String mobile;
+
+ @Excel(name = "昵称")
+ private String nickname;
+
+ @Excel(name = "性别:0.未知 1.男性2女性")
+ private Integer sex;
+
+ @Excel(name = "头像")
+ private String headImgUrl;
+
+ @Excel(name = "国家")
+ private String country;
+
+ @Excel(name = "省份")
+ private String province;
+
+ @Excel(name = "城市")
+ private String city;
+
+ @Excel(name = "语言")
+ private String language;
+
+ @Excel(name = "删除标识:0.未删除 1.已删除")
+ private String delFlag;
+
+ @Excel(name = "乐观锁")
+ private Integer revision;
+
+ @Excel(name = "创建人")
+ private String createdBy;
+
+ @Excel(name = "创建时间")
+ private Date createdTime;
+
+ @Excel(name = "更新人")
+ private String updatedBy;
+
+ @Excel(name = "更新时间")
+ private Date updatedTime;
+
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/CustomerUserRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/CustomerUserRedis.java
new file mode 100644
index 0000000000..f70ed57881
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/CustomerUserRedis.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.redis;
+
+import com.epmet.commons.tools.redis.RedisUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 居民用户信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-16
+ */
+@Component
+public class CustomerUserRedis {
+ @Autowired
+ private RedisUtils redisUtils;
+
+ public void delete(Object[] ids) {
+
+ }
+
+ public void set(){
+
+ }
+
+ public String get(String id){
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerUserService.java
new file mode 100644
index 0000000000..39ebe54c91
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerUserService.java
@@ -0,0 +1,95 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.service;
+
+import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.dto.CustomerUserDTO;
+import com.epmet.entity.CustomerUserEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 居民用户信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-16
+ */
+public interface CustomerUserService extends BaseService {
+
+ /**
+ * 默认分页
+ *
+ * @param params
+ * @return PageData
+ * @author generator
+ * @date 2020-03-16
+ */
+ PageData page(Map params);
+
+ /**
+ * 默认查询
+ *
+ * @param params
+ * @return java.util.List
+ * @author generator
+ * @date 2020-03-16
+ */
+ List list(Map params);
+
+ /**
+ * 单条查询
+ *
+ * @param id
+ * @return CustomerUserDTO
+ * @author generator
+ * @date 2020-03-16
+ */
+ CustomerUserDTO get(String id);
+
+ /**
+ * 默认保存
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2020-03-16
+ */
+ void save(CustomerUserDTO dto);
+
+ /**
+ * 默认更新
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2020-03-16
+ */
+ void update(CustomerUserDTO dto);
+
+ /**
+ * 批量删除
+ *
+ * @param ids
+ * @return void
+ * @author generator
+ * @date 2020-03-16
+ */
+ void delete(String[] ids);
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerUserServiceImpl.java
new file mode 100644
index 0000000000..59e3ccafaa
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerUserServiceImpl.java
@@ -0,0 +1,104 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.dao.CustomerUserDao;
+import com.epmet.dto.CustomerUserDTO;
+import com.epmet.entity.CustomerUserEntity;
+import com.epmet.redis.CustomerUserRedis;
+import com.epmet.service.CustomerUserService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 居民用户信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-16
+ */
+@Service
+public class CustomerUserServiceImpl extends BaseServiceImpl implements CustomerUserService {
+
+ @Autowired
+ private CustomerUserRedis customerUserRedis;
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, CustomerUserDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, CustomerUserDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params){
+ String id = (String)params.get(FieldConstant.ID_HUMP);
+
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
+
+ return wrapper;
+ }
+
+ @Override
+ public CustomerUserDTO get(String id) {
+ CustomerUserEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, CustomerUserDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(CustomerUserDTO dto) {
+ CustomerUserEntity entity = ConvertUtils.sourceToTarget(dto, CustomerUserEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(CustomerUserDTO dto) {
+ CustomerUserEntity entity = ConvertUtils.sourceToTarget(dto, CustomerUserEntity.class);
+ updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(String[] ids) {
+ // 逻辑删除(@TableLogic 注解)
+ baseDao.deleteBatchIds(Arrays.asList(ids));
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-api/epmet-api-server/src/main/resources/bootstrap.yml b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml
similarity index 74%
rename from epmet-module/epmet-api/epmet-api-server/src/main/resources/bootstrap.yml
rename to epmet-user/epmet-user-server/src/main/resources/bootstrap.yml
index 0ccc09e3b7..f7070de4b7 100644
--- a/epmet-module/epmet-api/epmet-api-server/src/main/resources/bootstrap.yml
+++ b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml
@@ -1,17 +1,19 @@
server:
port: @server.port@
servlet:
- context-path: /api
+ context-path: /epmetuser
spring:
+ main:
+ allow-bean-definition-overriding: true
application:
- name: epmet-api-server
+ name: epmet-user-server
#环境 dev|test|prod
profiles:
active: dev
messages:
encoding: UTF-8
- basename: i18n/messages,i18n/messages_common
+ basename: i18n/messages_common
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
@@ -28,6 +30,27 @@ spring:
url: @spring.datasource.druid.url@
username: @spring.datasource.druid.username@
password: @spring.datasource.druid.password@
+ initial-size: 10
+ max-active: 100
+ min-idle: 10
+ max-wait: 60000
+ pool-prepared-statements: true
+ max-pool-prepared-statement-per-connection-size: 20
+ time-between-eviction-runs-millis: 60000
+ min-evictable-idle-time-millis: 300000
+ #Oracle需要打开注释
+ #validation-query: SELECT 1 FROM DUAL
+ test-while-idle: true
+ test-on-borrow: false
+ test-on-return: false
+ filter:
+ stat:
+ log-slow-sql: true
+ slow-sql-millis: 1000
+ merge-sql: false
+ wall:
+ config:
+ multi-statement-allow: true
cloud:
nacos:
discovery:
diff --git a/epmet-module/epmet-api/epmet-api-server/src/main/resources/logback-spring.xml b/epmet-user/epmet-user-server/src/main/resources/logback-spring.xml
similarity index 97%
rename from epmet-module/epmet-api/epmet-api-server/src/main/resources/logback-spring.xml
rename to epmet-user/epmet-user-server/src/main/resources/logback-spring.xml
index 18a82fd8e0..c34321a409 100644
--- a/epmet-module/epmet-api/epmet-api-server/src/main/resources/logback-spring.xml
+++ b/epmet-user/epmet-user-server/src/main/resources/logback-spring.xml
@@ -2,7 +2,7 @@
-
+
-
-
+
+
@@ -146,7 +146,7 @@
-
+
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerUserDao.xml
new file mode 100644
index 0000000000..14a5b36bc6
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerUserDao.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/epmet-module/epmet-api/pom.xml b/epmet-user/pom.xml
similarity index 75%
rename from epmet-module/epmet-api/pom.xml
rename to epmet-user/pom.xml
index 58f74bf69f..9e06fd4e2f 100644
--- a/epmet-module/epmet-api/pom.xml
+++ b/epmet-user/pom.xml
@@ -5,17 +5,17 @@
com.epmet
- epmet-module
+ epmet-cloud
2.0.0
com.epmet
- epmet-api
+ epmet-user
pom
- epmet-api-client
- epmet-api-server
+ epmet-user-client
+ epmet-user-server
diff --git a/pom.xml b/pom.xml
index 5f1a213922..741f491b12 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,6 +26,7 @@
epmet-auth
epmet-admin
epmet-module
+ epmet-user