diff --git a/eladmin-common/src/main/java/me/zhengjie/annotation/NoRepeatSubmit.java b/eladmin-common/src/main/java/me/zhengjie/annotation/NoRepeatSubmit.java new file mode 100644 index 0000000..b2d4a72 --- /dev/null +++ b/eladmin-common/src/main/java/me/zhengjie/annotation/NoRepeatSubmit.java @@ -0,0 +1,17 @@ +package me.zhengjie.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * @author Enzo + * @功能描述 防止重复提交标记注解 + * @date : 2022/6/6 + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface NoRepeatSubmit { + +} diff --git a/eladmin-common/src/main/java/me/zhengjie/aspect/NoRepeatSubmitAspect.java b/eladmin-common/src/main/java/me/zhengjie/aspect/NoRepeatSubmitAspect.java new file mode 100644 index 0000000..b8cce96 --- /dev/null +++ b/eladmin-common/src/main/java/me/zhengjie/aspect/NoRepeatSubmitAspect.java @@ -0,0 +1,59 @@ +package me.zhengjie.aspect; + +import javax.servlet.http.HttpServletRequest; + +import lombok.extern.slf4j.Slf4j; +import me.zhengjie.annotation.NoRepeatSubmit; +import me.zhengjie.exception.BadRequestException; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import java.util.concurrent.TimeUnit; + +/** + * @author Enzo + * @desc aop解析注解 + * @date 2018-08-26 + */ +@Slf4j +@Aspect +@Component +public class NoRepeatSubmitAspect { + + private final RedisTemplate redisTemplate; + + public NoRepeatSubmitAspect(RedisTemplate redisTemplate) { + this.redisTemplate = redisTemplate; + } + + @Around("@annotation(nrs)") + public Object around(ProceedingJoinPoint pjp, NoRepeatSubmit nrs) { + ValueOperations opsForValue = redisTemplate.opsForValue(); + try { + ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + String sessionId = RequestContextHolder.getRequestAttributes().getSessionId(); + HttpServletRequest request = attributes.getRequest(); + String key = sessionId + "-" + request.getServletPath(); + // 如果缓存中有这个url视为重复提交 + if (opsForValue.get(key) == null) { + Object o = pjp.proceed(); + opsForValue.set(key, 0, 2, TimeUnit.SECONDS); + return o; + } else { + log.error("重复提交"); + throw new BadRequestException("重复提交!"); + } + } catch (BadRequestException e) { + throw new BadRequestException(e.getMessage()); + } catch (Throwable e) { + log.error("验证重复提交时出现未知异常!"); + throw new BadRequestException("验证重复提交时出现未知异常!"); + } + } +} diff --git a/eladmin-common/src/main/java/me/zhengjie/config/UrlCache.java b/eladmin-common/src/main/java/me/zhengjie/config/UrlCache.java new file mode 100644 index 0000000..a148649 --- /dev/null +++ b/eladmin-common/src/main/java/me/zhengjie/config/UrlCache.java @@ -0,0 +1,23 @@ +package me.zhengjie.config; + +import com.google.common.cache.CacheBuilder; + +import com.google.common.cache.Cache; + +import java.util.concurrent.TimeUnit; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + + +/** + * @功能描述 内存缓存 + * @author + * @date 2018-08-26 + */ +@Configuration +public class UrlCache { + @Bean + public Cache getCache() { + return CacheBuilder.newBuilder().expireAfterWrite(2L, TimeUnit.SECONDS).build(); + } +} diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/MobileUtil.java b/eladmin-common/src/main/java/me/zhengjie/utils/MobileUtil.java new file mode 100644 index 0000000..d945e1d --- /dev/null +++ b/eladmin-common/src/main/java/me/zhengjie/utils/MobileUtil.java @@ -0,0 +1,112 @@ +package me.zhengjie.utils; + +import org.apache.commons.lang3.StringUtils; + +import java.util.regex.Pattern; + +/** + * @author Enzo + * @date : 2022/4/18 + */ +public class MobileUtil { + + /** + * 中国电信号码格式验证 手机段: 133,149,153,173,177,180,181,189,199,1349,1410,1700,1701,1702 + **/ + private static final String CHINA_TELECOM_PATTERN = "(?:^(?:\\+86)?1(?:33|49|53|7[37]|8[019]|99)\\d{8}$)|(?:^(?:\\+86)?1349\\d{7}$)|(?:^(?:\\+86)?1410\\d{7}$)|(?:^(?:\\+86)?170[0-2]\\d{7}$)"; + + /** + * 中国联通号码格式验证 手机段:130,131,132,145,146,155,156,166,171,175,176,185,186,1704,1707,1708,1709 + **/ + private static final String CHINA_UNICOM_PATTERN = "(?:^(?:\\+86)?1(?:3[0-2]|4[56]|5[56]|66|7[156]|8[56])\\d{8}$)|(?:^(?:\\+86)?170[47-9]\\d{7}$)"; + + /** + * 中国移动号码格式验证 + * 手机段:134,135,136,137,138,139,147,148,150,151,152,157,158,159,178,182,183,184,187,188,198,1440,1703,1705,1706 + **/ + private static final String CHINA_MOBILE_PATTERN = "(?:^(?:\\+86)?1(?:3[4-9]|4[78]|5[0-27-9]|78|8[2-478]|98)\\d{8}$)|(?:^(?:\\+86)?1440\\d{7}$)|(?:^(?:\\+86)?170[356]\\d{7}$)"; + + /** + * 中国大陆手机号码校验 + * + * @param phone + * + * @return + */ + public static boolean checkPhone(String phone) { + if (StringUtils.isNotBlank(phone)) { + if (checkChinaMobile(phone) || checkChinaUnicom(phone) || checkChinaTelecom(phone)) { + return true; + } + } + return false; + } + + /** + * 中国移动手机号码校验 + * + * @param phone + * + * @return + */ + public static boolean checkChinaMobile(String phone) { + if (StringUtils.isNotBlank(phone)) { + Pattern regexp = Pattern.compile(CHINA_MOBILE_PATTERN); + if (regexp.matcher(phone).matches()) { + return true; + } + } + return false; + } + + /** + * 中国联通手机号码校验 + * + * @param phone + * + * @return + */ + public static boolean checkChinaUnicom(String phone) { + if (StringUtils.isNotBlank(phone)) { + Pattern regexp = Pattern.compile(CHINA_UNICOM_PATTERN); + if (regexp.matcher(phone).matches()) { + return true; + } + } + return false; + } + + /** + * 中国电信手机号码校验 + * + * @param phone + * + * @return + */ + public static boolean checkChinaTelecom(String phone) { + if (StringUtils.isNotBlank(phone)) { + Pattern regexp = Pattern.compile(CHINA_TELECOM_PATTERN); + if (regexp.matcher(phone).matches()) { + return true; + } + } + return false; + } + + /** + * 隐藏手机号中间四位 + * + * @param phone + * + * @return java.lang.String + */ + public static String hideMiddleMobile(String phone) { + if (StringUtils.isNotBlank(phone)) { + phone = phone.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2"); + } + return phone; + } + + + +} diff --git a/eladmin-logging/target/generated-sources/annotations/me/zhengjie/service/mapstruct/LogErrorMapperImpl.java b/eladmin-logging/target/generated-sources/annotations/me/zhengjie/service/mapstruct/LogErrorMapperImpl.java index 6bfd5b3..9443971 100644 --- a/eladmin-logging/target/generated-sources/annotations/me/zhengjie/service/mapstruct/LogErrorMapperImpl.java +++ b/eladmin-logging/target/generated-sources/annotations/me/zhengjie/service/mapstruct/LogErrorMapperImpl.java @@ -9,8 +9,8 @@ import org.springframework.stereotype.Component; @Generated( value = "org.mapstruct.ap.MappingProcessor", - date = "2021-08-09T13:53:23+0800", - comments = "version: 1.3.1.Final, compiler: javac, environment: Java 1.8.0_261 (Oracle Corporation)" + date = "2022-06-06T14:36:08+0800", + comments = "version: 1.3.1.Final, compiler: javac, environment: Java 1.8.0_251 (Oracle Corporation)" ) @Component public class LogErrorMapperImpl implements LogErrorMapper { diff --git a/eladmin-logging/target/generated-sources/annotations/me/zhengjie/service/mapstruct/LogSmallMapperImpl.java b/eladmin-logging/target/generated-sources/annotations/me/zhengjie/service/mapstruct/LogSmallMapperImpl.java index 7943c7f..ff7444c 100644 --- a/eladmin-logging/target/generated-sources/annotations/me/zhengjie/service/mapstruct/LogSmallMapperImpl.java +++ b/eladmin-logging/target/generated-sources/annotations/me/zhengjie/service/mapstruct/LogSmallMapperImpl.java @@ -9,8 +9,8 @@ import org.springframework.stereotype.Component; @Generated( value = "org.mapstruct.ap.MappingProcessor", - date = "2021-08-09T13:53:23+0800", - comments = "version: 1.3.1.Final, compiler: javac, environment: Java 1.8.0_261 (Oracle Corporation)" + date = "2022-06-06T14:36:08+0800", + comments = "version: 1.3.1.Final, compiler: javac, environment: Java 1.8.0_251 (Oracle Corporation)" ) @Component public class LogSmallMapperImpl implements LogSmallMapper { diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/dmp/rest/DMPController.java b/eladmin-system/src/main/java/me/zhengjie/modules/dmp/rest/DMPController.java deleted file mode 100644 index 559c097..0000000 --- a/eladmin-system/src/main/java/me/zhengjie/modules/dmp/rest/DMPController.java +++ /dev/null @@ -1,18 +0,0 @@ -package me.zhengjie.modules.dmp.rest; - -import io.swagger.annotations.Api; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author Enzo - * @date : 2022/3/1 - */ -@RestController -@RequiredArgsConstructor -@Api(tags = "数据解析与图表展示") -@RequestMapping("/api/dmp") -public class DMPController { - -} diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/gold/rest/GoldPriceController.java b/eladmin-system/src/main/java/me/zhengjie/modules/gold/rest/GoldPriceController.java index 388f136..03e1a72 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/gold/rest/GoldPriceController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/gold/rest/GoldPriceController.java @@ -9,6 +9,7 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONObject; import com.google.common.collect.Lists; +import com.google.common.collect.Maps; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @@ -52,7 +53,8 @@ public class GoldPriceController { && ObjectUtil.isNull(requestDTO.getEndDate())) { DateTime date = DateUtil.date(); requestDTO.setStartDate(DateUtil.beginOfDay - (DateUtil.offsetDay(date, -DefaultConstant.SEVEN_NUMBER))); + (DateUtil.offsetMonth(DateUtil.beginOfDay(date), + -DefaultConstant.ONE_NUMBER))); requestDTO.setEndDate(DateUtil.beginOfDay(date)); } if (requestDTO.getStartDate().after(requestDTO.getEndDate())) { @@ -68,15 +70,16 @@ public class GoldPriceController { long betweenDays = DateUtil.between(requestDTO.getStartDate(), requestDTO.getEndDate(), DateUnit.DAY); DateTime dateTime = DateUtil.beginOfDay(DateUtil.date()); for (String code : requestDTO.getGoldCodeList()) { + Date endDate = requestDTO.getEndDate(); + Date startDate = requestDTO.getStartDate(); String goldCode = GoldCodeEnums.findCode(code); // 发送请求 JSONObject jsonObject = ResponseUtil.goldRequest (betweenDays, goldCode, requestDTO.getStartDate(), requestDTO.getEndDate()); // 解析数据 List dtoArrayList = getAnalyzingGoldResponse(jsonObject); - List todayGoldList = Lists.newArrayList(dtoArrayList); - Iterator iterator = todayGoldList.iterator(); - TodayGoldResponseDTO todayGoldResponseDTO; + Map dtoMap = Maps.newHashMap + (Maps.uniqueIndex(dtoArrayList, AnalyzingGoldResponseDTO::getTime)); // 查看周几 int dayOfWeek = DateUtil.thisDayOfWeek(); if (dayOfWeek == DefaultConstant.SEVEN_NUMBER || dayOfWeek == DefaultConstant.ONE_NUMBER) { @@ -84,19 +87,28 @@ public class GoldPriceController { (dateTime, -(dayOfWeek == DefaultConstant.SEVEN_NUMBER ? DefaultConstant.ONE_NUMBER : DefaultConstant.TWO_NUMBER)); } - while (iterator.hasNext()) { - AnalyzingGoldResponseDTO next = iterator.next(); - long betweenDay = DateUtil.betweenDay(dateTime, next.getTime(), Boolean.TRUE); - // 查询当天金价 - if (betweenDay == DefaultConstant.ZERO_NUMBER) { - todayGoldResponseDTO = new TodayGoldResponseDTO(); - BeanUtil.copyProperties(next, todayGoldResponseDTO); - todayGoldResponseDTO.setGoldCode(code); - goldResponseDTOList.add(todayGoldResponseDTO); - break; + while (startDate.before(endDate) || startDate.equals(endDate)) { + if (dtoMap.containsKey(startDate)) { + long betweenDay = DateUtil.betweenDay(dateTime, startDate, Boolean.TRUE); + // 查询当天金价 + if (betweenDay == DefaultConstant.ZERO_NUMBER) { + TodayGoldResponseDTO todayGoldResponseDTO = new TodayGoldResponseDTO(); + BeanUtil.copyProperties(dtoMap.get(startDate), todayGoldResponseDTO); + todayGoldResponseDTO.setGoldCode(code); + goldResponseDTOList.add(todayGoldResponseDTO); + } + startDate = DateUtil.offsetDay(startDate, DefaultConstant.ONE_NUMBER); + continue; } + AnalyzingGoldResponseDTO empty = new AnalyzingGoldResponseDTO(); + empty.setTime(startDate); + dtoMap.put(startDate, empty); + startDate = DateUtil.offsetDay(startDate, DefaultConstant.ONE_NUMBER); } - historyMap.put(code, dtoArrayList); + // list排序 + List goldListDTOList = Lists.newArrayList(dtoMap.values()); + goldListDTOList.sort(Comparator.comparing(AnalyzingGoldResponseDTO::getTime, Date::compareTo)); + historyMap.put(code, goldListDTOList); } // map排序 Stream>> st = @@ -109,6 +121,8 @@ public class GoldPriceController { } + + @Log("查询当天金价") @ApiOperation("查询当天金价") @GetMapping("/dayPrice") @@ -135,14 +149,14 @@ public class GoldPriceController { private List getAnalyzingGoldResponse(JSONObject jsonObject) { - // 解析数据 - List dtoList = - Convert.toList(AnalyzingGoldResponseDTO.class, - jsonObject.get("data")); - // 时间去除 - return dtoList.stream() - .collect(Collectors.collectingAndThen(Collectors.toCollection( - () -> new TreeSet<>(Comparator.comparing(AnalyzingGoldResponseDTO::getTime))), ArrayList::new)); + // 解析数据 + List dtoList = + Convert.toList(AnalyzingGoldResponseDTO.class, + jsonObject.get("data")); + // 时间去除 + return dtoList.stream() + .collect(Collectors.collectingAndThen(Collectors.toCollection( + () -> new TreeSet<>(Comparator.comparing(AnalyzingGoldResponseDTO::getTime))), ArrayList::new)); } } diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/loan/domain/LoanUser.java b/eladmin-system/src/main/java/me/zhengjie/modules/loan/domain/LoanUser.java new file mode 100644 index 0000000..da93365 --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/loan/domain/LoanUser.java @@ -0,0 +1,55 @@ +package me.zhengjie.modules.loan.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Getter; +import lombok.Setter; +import me.zhengjie.base.BaseEntity; + +import javax.persistence.*; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @author Enzo + * @date : 2022/6/6 + */ +@Getter +@Setter +@Entity +@Table(name = "tb_loan_user") +public class LoanUser extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 631332413031546831L; + + @Id + @Column(name = "id") + @NotNull(groups = {BaseEntity.Update.class}) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(name = "username") + @ApiModelProperty(value = "用户名称") + private String username; + + @Column(name = "phone") + @ApiModelProperty(value = "手机号码") + private String phone; + + @Column(name = "address") + @ApiModelProperty(value = "地址") + private String address; + + @Column(name = "borrowing_type") + @ApiModelProperty(value = "借款类别 1:信用卡 2:网贷 3:信用卡+网贷") + private Integer borrowingType; + + @Column(name = "quota_type") + @ApiModelProperty(value = "额度类型 1:5-10万 2:10-20万 3:20-30万 4:30-50万 5:50万以上") + private Integer quotaType; + + + + + +} diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/loan/dto/LoanUserDTO.java b/eladmin-system/src/main/java/me/zhengjie/modules/loan/dto/LoanUserDTO.java new file mode 100644 index 0000000..7000873 --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/loan/dto/LoanUserDTO.java @@ -0,0 +1,34 @@ +package me.zhengjie.modules.loan.dto; + +import javax.validation.constraints.NotNull; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @author Enzo + * @date : 2022/6/6 + */ +@Data +public class LoanUserDTO { + + @NotBlank + @ApiModelProperty(value = "用户名称") + private String username; + + @NotBlank + @ApiModelProperty(value = "手机号码") + private String phone; + + @ApiModelProperty(value = "地址") + private String address; + + @NotNull + @ApiModelProperty(value = "借款类别 1:信用卡 2:网贷 3:信用卡+网贷") + private Integer borrowingType; + + @NotNull + @ApiModelProperty(value = "额度类型 1:5-10万 2:10-20万 3:20-30万 4:30-50万 5:50万以上") + private Integer quotaType; +} diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/loan/mapstruct/LoanUserMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/loan/mapstruct/LoanUserMapper.java new file mode 100644 index 0000000..492f7cc --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/loan/mapstruct/LoanUserMapper.java @@ -0,0 +1,32 @@ +/* +* Copyright 2019-2020 Zheng Jie +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +package me.zhengjie.modules.loan.mapstruct; + +import me.zhengjie.base.BaseMapper; +import me.zhengjie.modules.loan.domain.LoanUser; +import me.zhengjie.modules.loan.dto.LoanUserDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @website https://el-admin.vip +* @author x +* @date 2021-08-05 +**/ +@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface LoanUserMapper extends BaseMapper { + +} diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/loan/repository/LoanUserRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/loan/repository/LoanUserRepository.java new file mode 100644 index 0000000..dd04545 --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/loan/repository/LoanUserRepository.java @@ -0,0 +1,35 @@ +/* +* Copyright 2019-2020 Zheng Jie +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +package me.zhengjie.modules.loan.repository; + +import me.zhengjie.modules.loan.domain.LoanUser; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @website https://el-admin.vip +* @author x +* @date 2021-08-05 +**/ +public interface LoanUserRepository extends JpaRepository, JpaSpecificationExecutor { + + /** + * 号码查找提交用户 + * @param phone + * @return + */ + LoanUser findByPhone(String phone); +} diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/loan/rest/LoanUserController.java b/eladmin-system/src/main/java/me/zhengjie/modules/loan/rest/LoanUserController.java new file mode 100644 index 0000000..0b41e15 --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/loan/rest/LoanUserController.java @@ -0,0 +1,43 @@ +package me.zhengjie.modules.loan.rest; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import me.zhengjie.annotation.NoRepeatSubmit; +import me.zhengjie.common.http.CommonResponse; +import me.zhengjie.common.http.ResponseCode; +import me.zhengjie.modules.loan.dto.LoanUserDTO; +import me.zhengjie.modules.loan.service.LoanUserService; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author Enzo + * @date : 2022/6/6 + */ +@Slf4j +@RestController +@Api("用户额度信息收集") +@RequestMapping("/api/loanUser") +@RequiredArgsConstructor +public class LoanUserController { + private final LoanUserService loanUserService; + + + @NoRepeatSubmit + @PostMapping("/submit") + @ApiOperation("提交用户信息") + public ResponseEntity submit(@RequestBody @Validated LoanUserDTO loanUserDTO) { + + Boolean flag = loanUserService.userSubmit(loanUserDTO); + return flag != null && flag ? + new ResponseEntity<>(CommonResponse.createBySuccess(ResponseCode.SUCCESS), HttpStatus.OK) + : new ResponseEntity<>(CommonResponse.createByError(ResponseCode.ERROR), HttpStatus.INTERNAL_SERVER_ERROR); + } +} diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/loan/service/LoanUserService.java b/eladmin-system/src/main/java/me/zhengjie/modules/loan/service/LoanUserService.java new file mode 100644 index 0000000..2159c9c --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/loan/service/LoanUserService.java @@ -0,0 +1,16 @@ +package me.zhengjie.modules.loan.service; + +import me.zhengjie.modules.loan.dto.LoanUserDTO; + +/** + * @author Enzo + * @date : 2022/6/6 + */ +public interface LoanUserService { + /** + * 用户提交表单信息 + * @param loanUserDTO + * @return + */ + Boolean userSubmit(LoanUserDTO loanUserDTO); +} diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/loan/service/impl/LoanUserServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/loan/service/impl/LoanUserServiceImpl.java new file mode 100644 index 0000000..afb3180 --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/loan/service/impl/LoanUserServiceImpl.java @@ -0,0 +1,41 @@ +package me.zhengjie.modules.loan.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.ObjectUtil; +import lombok.RequiredArgsConstructor; +import me.zhengjie.exception.BadRequestException; +import me.zhengjie.modules.loan.domain.LoanUser; +import me.zhengjie.modules.loan.dto.LoanUserDTO; +import me.zhengjie.modules.loan.repository.LoanUserRepository; +import me.zhengjie.modules.loan.service.LoanUserService; +import me.zhengjie.utils.MobileUtil; +import org.springframework.stereotype.Service; + +/** + * @author Enzo + * @date : 2022/6/6 + */ +@Service +@RequiredArgsConstructor +public class LoanUserServiceImpl implements LoanUserService { + + private final LoanUserRepository loanUserRepository; + + @Override + public Boolean userSubmit(LoanUserDTO loanUserDTO) { + if (ObjectUtil.isNotNull(loanUserDTO)) { + if (!MobileUtil.checkPhone(loanUserDTO.getPhone())) { + throw new BadRequestException("号码验证失败!"); + } + LoanUser byPhone = loanUserRepository.findByPhone(loanUserDTO.getPhone()); + if (byPhone != null) { + throw new BadRequestException("该号码已提交信息!"); + } + LoanUser loanUser = new LoanUser(); + BeanUtil.copyProperties(loanUserDTO, loanUser); + LoanUser saveLoanUser = loanUserRepository.save(loanUser); + return ObjectUtil.isNotNull(saveLoanUser.getId()); + } + return Boolean.FALSE; + } +} diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/config/SecurityConfig.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/config/SecurityConfig.java index 8494a7d..54ff01e 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/security/config/SecurityConfig.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/config/SecurityConfig.java @@ -124,6 +124,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { // 爬取数据请求 用户小程序过审 By Enzo .antMatchers("/api/consult/**").permitAll() .antMatchers("/api/gold/**").permitAll() + .antMatchers("/api/loanUser/**").permitAll() // 放行OPTIONS请求 .antMatchers(HttpMethod.OPTIONS, "/**").permitAll() // 自定义匿名访问所有url放行:允许匿名和带Token访问,细腻化到每个 Request 类型 diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/domain/SmsConfiguration.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/domain/SmsConfiguration.java similarity index 97% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/domain/SmsConfiguration.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/domain/SmsConfiguration.java index 79db6bb..61baf6f 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/domain/SmsConfiguration.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/domain/SmsConfiguration.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.domain; +package me.zhengjie.modules.system.domain.sms.domain; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/domain/TbBlacklist.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/domain/TbBlacklist.java similarity index 97% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/domain/TbBlacklist.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/domain/TbBlacklist.java index 0486a2d..e1fa104 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/domain/TbBlacklist.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/domain/TbBlacklist.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.domain; +package me.zhengjie.modules.system.domain.sms.domain; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/domain/TbSendSms.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/domain/TbSendSms.java similarity index 97% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/domain/TbSendSms.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/domain/TbSendSms.java index 86a863b..5a94610 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/domain/TbSendSms.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/domain/TbSendSms.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.domain; +package me.zhengjie.modules.system.domain.sms.domain; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/domain/TbTemplate.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/domain/TbTemplate.java similarity index 96% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/domain/TbTemplate.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/domain/TbTemplate.java index 08b2968..65b117a 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/domain/TbTemplate.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/domain/TbTemplate.java @@ -13,14 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.domain; +package me.zhengjie.modules.system.domain.sms.domain; import lombok.Data; import cn.hutool.core.bean.BeanUtil; import io.swagger.annotations.ApiModelProperty; import cn.hutool.core.bean.copier.CopyOptions; import javax.persistence.*; -import javax.validation.constraints.*; import java.sql.Timestamp; import java.io.Serializable; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/dto/ShortLinkUrlDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/dto/ShortLinkUrlDto.java similarity index 92% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/dto/ShortLinkUrlDto.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/dto/ShortLinkUrlDto.java index f02ec5d..93fde72 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/dto/ShortLinkUrlDto.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/dto/ShortLinkUrlDto.java @@ -1,4 +1,4 @@ -package me.zhengjie.modules.sms.dto; +package me.zhengjie.modules.system.domain.sms.dto; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/repository/SmsConfigurationRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/repository/SmsConfigurationRepository.java similarity index 89% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/repository/SmsConfigurationRepository.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/repository/SmsConfigurationRepository.java index e56f976..f1e0a51 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/repository/SmsConfigurationRepository.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/repository/SmsConfigurationRepository.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.repository; +package me.zhengjie.modules.system.domain.sms.repository; -import me.zhengjie.modules.sms.domain.SmsConfiguration; +import me.zhengjie.modules.system.domain.sms.domain.SmsConfiguration; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/repository/TbBlacklistRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/repository/TbBlacklistRepository.java similarity index 88% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/repository/TbBlacklistRepository.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/repository/TbBlacklistRepository.java index c9e2129..8a8133f 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/repository/TbBlacklistRepository.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/repository/TbBlacklistRepository.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.repository; +package me.zhengjie.modules.system.domain.sms.repository; -import me.zhengjie.modules.sms.domain.TbBlacklist; +import me.zhengjie.modules.system.domain.sms.domain.TbBlacklist; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.stereotype.Repository; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/repository/TbSendSmsRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/repository/TbSendSmsRepository.java similarity index 91% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/repository/TbSendSmsRepository.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/repository/TbSendSmsRepository.java index ff4cd17..cddf990 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/repository/TbSendSmsRepository.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/repository/TbSendSmsRepository.java @@ -13,17 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.repository; +package me.zhengjie.modules.system.domain.sms.repository; -import me.zhengjie.modules.sms.domain.TbSendSms; +import me.zhengjie.modules.system.domain.sms.domain.TbSendSms; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; -import javax.transaction.Transactional; - /** * @website https://el-admin.vip * @author Enzo diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/repository/TbTemplateRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/repository/TbTemplateRepository.java similarity index 90% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/repository/TbTemplateRepository.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/repository/TbTemplateRepository.java index eee4257..175c4fe 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/repository/TbTemplateRepository.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/repository/TbTemplateRepository.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.repository; +package me.zhengjie.modules.system.domain.sms.repository; -import me.zhengjie.modules.sms.domain.TbTemplate; +import me.zhengjie.modules.system.domain.sms.domain.TbTemplate; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.stereotype.Repository; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/rest/ConsultController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/rest/ConsultController.java similarity index 98% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/rest/ConsultController.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/rest/ConsultController.java index 2556116..c3f786f 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/rest/ConsultController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/rest/ConsultController.java @@ -1,4 +1,4 @@ -package me.zhengjie.modules.sms.rest; +package me.zhengjie.modules.system.domain.sms.rest; import io.swagger.annotations.Api; import lombok.RequiredArgsConstructor; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/rest/SmsConfigurationController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/rest/SmsConfigurationController.java similarity index 91% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/rest/SmsConfigurationController.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/rest/SmsConfigurationController.java index f6ba02a..ed881be 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/rest/SmsConfigurationController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/rest/SmsConfigurationController.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.rest; +package me.zhengjie.modules.system.domain.sms.rest; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -21,11 +21,11 @@ import lombok.RequiredArgsConstructor; import me.zhengjie.annotation.Log; import me.zhengjie.common.http.CommonResponse; import me.zhengjie.common.http.ResponseCode; -import me.zhengjie.modules.sms.domain.SmsConfiguration; -import me.zhengjie.modules.sms.service.SmsConfigurationService; -import me.zhengjie.modules.sms.service.dto.SmsConfigurationDto; -import me.zhengjie.modules.sms.service.dto.SmsConfigurationQueryCriteria; -import me.zhengjie.modules.sms.vo.UploadAndSendMessageVo; +import me.zhengjie.modules.system.domain.sms.domain.SmsConfiguration; +import me.zhengjie.modules.system.domain.sms.service.SmsConfigurationService; +import me.zhengjie.modules.system.domain.sms.service.dto.SmsConfigurationDto; +import me.zhengjie.modules.system.domain.sms.service.dto.SmsConfigurationQueryCriteria; +import me.zhengjie.modules.system.domain.sms.vo.UploadAndSendMessageVo; import me.zhengjie.utils.SecurityUtils; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/rest/TbBlacklistController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/rest/TbBlacklistController.java similarity index 91% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/rest/TbBlacklistController.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/rest/TbBlacklistController.java index 1b5ad21..ba30610 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/rest/TbBlacklistController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/rest/TbBlacklistController.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.rest; +package me.zhengjie.modules.system.domain.sms.rest; import me.zhengjie.annotation.Log; -import me.zhengjie.modules.sms.domain.TbBlacklist; -import me.zhengjie.modules.sms.service.TbBlacklistService; -import me.zhengjie.modules.sms.service.dto.TbBlacklistQueryCriteria; +import me.zhengjie.modules.system.domain.sms.domain.TbBlacklist; +import me.zhengjie.modules.system.domain.sms.service.TbBlacklistService; +import me.zhengjie.modules.system.domain.sms.service.dto.TbBlacklistQueryCriteria; import org.springframework.data.domain.Pageable; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/rest/TbSendSmsController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/rest/TbSendSmsController.java similarity index 92% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/rest/TbSendSmsController.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/rest/TbSendSmsController.java index 916829d..50a11c9 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/rest/TbSendSmsController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/rest/TbSendSmsController.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.rest; +package me.zhengjie.modules.system.domain.sms.rest; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -23,11 +23,11 @@ import me.zhengjie.annotation.Log; import me.zhengjie.common.http.ResponseCode; import me.zhengjie.exception.BadRequestException; import me.zhengjie.modules.constant.DefaultConstant; -import me.zhengjie.modules.sms.domain.TbSendSms; -import me.zhengjie.modules.sms.service.TbSendSmsService; -import me.zhengjie.modules.sms.service.dto.TbSendSmsQueryCriteria; -import me.zhengjie.modules.sms.vo.LinkCallBack; -import me.zhengjie.modules.sms.vo.SendVo; +import me.zhengjie.modules.system.domain.sms.domain.TbSendSms; +import me.zhengjie.modules.system.domain.sms.service.TbSendSmsService; +import me.zhengjie.modules.system.domain.sms.service.dto.TbSendSmsQueryCriteria; +import me.zhengjie.modules.system.domain.sms.vo.LinkCallBack; +import me.zhengjie.modules.system.domain.sms.vo.SendVo; import org.apache.commons.collections4.CollectionUtils; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/rest/TbTemplateController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/rest/TbTemplateController.java similarity index 93% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/rest/TbTemplateController.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/rest/TbTemplateController.java index e1d0ddd..cdb27c3 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/rest/TbTemplateController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/rest/TbTemplateController.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.rest; +package me.zhengjie.modules.system.domain.sms.rest; import lombok.extern.slf4j.Slf4j; import me.zhengjie.annotation.AnonymousAccess; @@ -21,11 +21,10 @@ import me.zhengjie.annotation.Log; import me.zhengjie.common.http.CommonResponse; import me.zhengjie.common.http.ResponseCode; -import me.zhengjie.modules.sms.domain.TbTemplate; -import me.zhengjie.modules.sms.service.TbTemplateService; -import me.zhengjie.modules.sms.service.dto.TbTemplateQueryCriteria; -import me.zhengjie.modules.sms.vo.SendNewVo; -import me.zhengjie.modules.sms.vo.SendVo; +import me.zhengjie.modules.system.domain.sms.domain.TbTemplate; +import me.zhengjie.modules.system.domain.sms.service.TbTemplateService; +import me.zhengjie.modules.system.domain.sms.service.dto.TbTemplateQueryCriteria; +import me.zhengjie.modules.system.domain.sms.vo.SendNewVo; import org.springframework.data.domain.Pageable; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; @@ -36,8 +35,6 @@ import org.springframework.web.bind.annotation.*; import io.swagger.annotations.*; import java.io.IOException; import java.sql.Timestamp; -import java.time.LocalDate; -import java.util.Date; import javax.servlet.http.HttpServletResponse; /** diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/SmsConfigurationService.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/SmsConfigurationService.java similarity index 87% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/SmsConfigurationService.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/SmsConfigurationService.java index 1dfaa58..d1a41bb 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/SmsConfigurationService.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/SmsConfigurationService.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service; +package me.zhengjie.modules.system.domain.sms.service; -import me.zhengjie.modules.sms.domain.SmsConfiguration; -import me.zhengjie.modules.sms.service.dto.SmsConfigurationDto; -import me.zhengjie.modules.sms.service.dto.SmsConfigurationQueryCriteria; -import me.zhengjie.modules.sms.vo.UploadAndSendMessageVo; +import me.zhengjie.modules.system.domain.sms.domain.SmsConfiguration; +import me.zhengjie.modules.system.domain.sms.service.dto.SmsConfigurationDto; +import me.zhengjie.modules.system.domain.sms.service.dto.SmsConfigurationQueryCriteria; +import me.zhengjie.modules.system.domain.sms.vo.UploadAndSendMessageVo; import org.springframework.data.domain.Pageable; import org.springframework.web.multipart.MultipartFile; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/TbBlacklistService.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/TbBlacklistService.java similarity index 87% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/TbBlacklistService.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/TbBlacklistService.java index 962b184..2d3fe04 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/TbBlacklistService.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/TbBlacklistService.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service; +package me.zhengjie.modules.system.domain.sms.service; -import me.zhengjie.modules.sms.domain.TbBlacklist; -import me.zhengjie.modules.sms.service.dto.TbBlacklistDto; -import me.zhengjie.modules.sms.service.dto.TbBlacklistQueryCriteria; +import me.zhengjie.modules.system.domain.sms.domain.TbBlacklist; +import me.zhengjie.modules.system.domain.sms.service.dto.TbBlacklistDto; +import me.zhengjie.modules.system.domain.sms.service.dto.TbBlacklistQueryCriteria; import org.springframework.data.domain.Pageable; import java.util.Map; import java.util.List; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/TbSendSmsService.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/TbSendSmsService.java similarity index 87% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/TbSendSmsService.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/TbSendSmsService.java index c758f04..40e58f5 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/TbSendSmsService.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/TbSendSmsService.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service; +package me.zhengjie.modules.system.domain.sms.service; -import me.zhengjie.modules.sms.domain.TbSendSms; -import me.zhengjie.modules.sms.service.dto.TbSendSmsDto; -import me.zhengjie.modules.sms.service.dto.TbSendSmsQueryCriteria; -import me.zhengjie.modules.sms.vo.SendVo; +import me.zhengjie.modules.system.domain.sms.domain.TbSendSms; +import me.zhengjie.modules.system.domain.sms.service.dto.TbSendSmsDto; +import me.zhengjie.modules.system.domain.sms.service.dto.TbSendSmsQueryCriteria; +import me.zhengjie.modules.system.domain.sms.vo.SendVo; import org.springframework.data.domain.Pageable; import java.util.Map; import java.util.List; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/TbTemplateService.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/TbTemplateService.java similarity index 87% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/TbTemplateService.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/TbTemplateService.java index 49dcdf1..5fe8017 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/TbTemplateService.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/TbTemplateService.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service; +package me.zhengjie.modules.system.domain.sms.service; -import me.zhengjie.modules.sms.domain.TbTemplate; -import me.zhengjie.modules.sms.service.dto.TbTemplateDto; -import me.zhengjie.modules.sms.service.dto.TbTemplateQueryCriteria; +import me.zhengjie.modules.system.domain.sms.domain.TbTemplate; +import me.zhengjie.modules.system.domain.sms.service.dto.TbTemplateDto; +import me.zhengjie.modules.system.domain.sms.service.dto.TbTemplateQueryCriteria; import org.springframework.data.domain.Pageable; import java.util.Map; import java.util.List; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/SmsConfigurationDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/SmsConfigurationDto.java similarity index 96% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/SmsConfigurationDto.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/SmsConfigurationDto.java index 1867417..acffed4 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/SmsConfigurationDto.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/SmsConfigurationDto.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service.dto; +package me.zhengjie.modules.system.domain.sms.service.dto; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/SmsConfigurationQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/SmsConfigurationQueryCriteria.java similarity index 92% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/SmsConfigurationQueryCriteria.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/SmsConfigurationQueryCriteria.java index a03f753..20df76d 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/SmsConfigurationQueryCriteria.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/SmsConfigurationQueryCriteria.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service.dto; +package me.zhengjie.modules.system.domain.sms.service.dto; import lombok.Data; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/TbBlacklistDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/TbBlacklistDto.java similarity index 95% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/TbBlacklistDto.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/TbBlacklistDto.java index e2a5026..7345b39 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/TbBlacklistDto.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/TbBlacklistDto.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service.dto; +package me.zhengjie.modules.system.domain.sms.service.dto; import lombok.Data; import java.sql.Timestamp; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/TbBlacklistQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/TbBlacklistQueryCriteria.java similarity index 93% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/TbBlacklistQueryCriteria.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/TbBlacklistQueryCriteria.java index cdd92a1..5cc00c4 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/TbBlacklistQueryCriteria.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/TbBlacklistQueryCriteria.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service.dto; +package me.zhengjie.modules.system.domain.sms.service.dto; import lombok.Data; import java.util.List; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/TbSendSmsDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/TbSendSmsDto.java similarity index 96% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/TbSendSmsDto.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/TbSendSmsDto.java index e6c37c2..e0ddbbd 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/TbSendSmsDto.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/TbSendSmsDto.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service.dto; +package me.zhengjie.modules.system.domain.sms.service.dto; import lombok.Data; import java.sql.Timestamp; @@ -62,4 +62,4 @@ public class TbSendSmsDto implements Serializable { /** 链接是否回调 */ private Integer isLinkCallback; -} \ No newline at end of file +} diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/TbSendSmsQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/TbSendSmsQueryCriteria.java similarity index 92% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/TbSendSmsQueryCriteria.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/TbSendSmsQueryCriteria.java index 44f8098..459392a 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/TbSendSmsQueryCriteria.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/TbSendSmsQueryCriteria.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service.dto; +package me.zhengjie.modules.system.domain.sms.service.dto; import lombok.Data; import java.util.List; @@ -26,4 +26,4 @@ import me.zhengjie.annotation.Query; **/ @Data public class TbSendSmsQueryCriteria{ -} \ No newline at end of file +} diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/TbTemplateDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/TbTemplateDto.java similarity index 95% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/TbTemplateDto.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/TbTemplateDto.java index b1989c8..b8120a4 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/TbTemplateDto.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/TbTemplateDto.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service.dto; +package me.zhengjie.modules.system.domain.sms.service.dto; import lombok.Data; import java.sql.Timestamp; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/TbTemplateQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/TbTemplateQueryCriteria.java similarity index 93% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/TbTemplateQueryCriteria.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/TbTemplateQueryCriteria.java index 4132a8c..b76549c 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/dto/TbTemplateQueryCriteria.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/dto/TbTemplateQueryCriteria.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service.dto; +package me.zhengjie.modules.system.domain.sms.service.dto; import lombok.Data; import java.util.List; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/impl/SmsConfigurationServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/impl/SmsConfigurationServiceImpl.java similarity index 93% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/impl/SmsConfigurationServiceImpl.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/impl/SmsConfigurationServiceImpl.java index feb7408..8b88799 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/impl/SmsConfigurationServiceImpl.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/impl/SmsConfigurationServiceImpl.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service.impl; +package me.zhengjie.modules.system.domain.sms.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.lang.Snowflake; @@ -26,13 +26,13 @@ import me.zhengjie.common.http.ResponseCode; import me.zhengjie.exception.BadRequestException; import me.zhengjie.modules.constant.DefaultConstant; import me.zhengjie.modules.constant.FileConstant; -import me.zhengjie.modules.sms.domain.SmsConfiguration; -import me.zhengjie.modules.sms.repository.SmsConfigurationRepository; -import me.zhengjie.modules.sms.service.SmsConfigurationService; -import me.zhengjie.modules.sms.service.dto.SmsConfigurationDto; -import me.zhengjie.modules.sms.service.dto.SmsConfigurationQueryCriteria; -import me.zhengjie.modules.sms.service.mapstruct.SmsConfigurationMapper; -import me.zhengjie.modules.sms.vo.UploadAndSendMessageVo; +import me.zhengjie.modules.system.domain.sms.domain.SmsConfiguration; +import me.zhengjie.modules.system.domain.sms.repository.SmsConfigurationRepository; +import me.zhengjie.modules.system.domain.sms.service.SmsConfigurationService; +import me.zhengjie.modules.system.domain.sms.service.dto.SmsConfigurationDto; +import me.zhengjie.modules.system.domain.sms.service.dto.SmsConfigurationQueryCriteria; +import me.zhengjie.modules.system.domain.sms.service.mapstruct.SmsConfigurationMapper; +import me.zhengjie.modules.system.domain.sms.vo.UploadAndSendMessageVo; import me.zhengjie.modules.uploadnew.service.TbUploadFileNewService; import me.zhengjie.modules.uploadnew.service.dto.TbUploadFileNewDto; import me.zhengjie.modules.uploadnew.task.SendMessageTask; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/impl/TbBlacklistServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/impl/TbBlacklistServiceImpl.java similarity index 89% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/impl/TbBlacklistServiceImpl.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/impl/TbBlacklistServiceImpl.java index 9e416ba..c0ee7ab 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/impl/TbBlacklistServiceImpl.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/impl/TbBlacklistServiceImpl.java @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service.impl; +package me.zhengjie.modules.system.domain.sms.service.impl; -import me.zhengjie.modules.sms.domain.TbBlacklist; -import me.zhengjie.modules.sms.repository.TbBlacklistRepository; -import me.zhengjie.modules.sms.service.TbBlacklistService; +import me.zhengjie.modules.system.domain.sms.domain.TbBlacklist; +import me.zhengjie.modules.system.domain.sms.repository.TbBlacklistRepository; +import me.zhengjie.modules.system.domain.sms.service.TbBlacklistService; -import me.zhengjie.modules.sms.service.dto.TbBlacklistDto; -import me.zhengjie.modules.sms.service.dto.TbBlacklistQueryCriteria; -import me.zhengjie.modules.sms.service.mapstruct.TbBlacklistMapper; +import me.zhengjie.modules.system.domain.sms.service.dto.TbBlacklistDto; +import me.zhengjie.modules.system.domain.sms.service.dto.TbBlacklistQueryCriteria; +import me.zhengjie.modules.system.domain.sms.service.mapstruct.TbBlacklistMapper; import me.zhengjie.utils.ValidationUtil; import me.zhengjie.utils.FileUtil; import lombok.RequiredArgsConstructor; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/impl/TbSendSmsServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/impl/TbSendSmsServiceImpl.java similarity index 92% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/impl/TbSendSmsServiceImpl.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/impl/TbSendSmsServiceImpl.java index f6b7778..cf70006 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/impl/TbSendSmsServiceImpl.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/impl/TbSendSmsServiceImpl.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service.impl; +package me.zhengjie.modules.system.domain.sms.service.impl; import cn.hutool.cache.impl.LRUCache; import cn.hutool.core.date.DateUnit; @@ -31,17 +31,17 @@ import lombok.extern.slf4j.Slf4j; import me.zhengjie.constant.SmsConstant; import me.zhengjie.exception.BadRequestException; import me.zhengjie.modules.constant.DefaultConstant; -import me.zhengjie.modules.sms.domain.TbSendSms; -import me.zhengjie.modules.sms.domain.TbTemplate; -import me.zhengjie.modules.sms.dto.ShortLinkUrlDto; -import me.zhengjie.modules.sms.repository.TbSendSmsRepository; -import me.zhengjie.modules.sms.repository.TbTemplateRepository; -import me.zhengjie.modules.sms.service.TbSendSmsService; -import me.zhengjie.modules.sms.service.dto.TbSendSmsDto; -import me.zhengjie.modules.sms.service.dto.TbSendSmsQueryCriteria; -import me.zhengjie.modules.sms.service.mapstruct.TbSendSmsMapper; -import me.zhengjie.modules.sms.util.SmsUtil; -import me.zhengjie.modules.sms.vo.SendVo; +import me.zhengjie.modules.system.domain.sms.domain.TbSendSms; +import me.zhengjie.modules.system.domain.sms.domain.TbTemplate; +import me.zhengjie.modules.system.domain.sms.dto.ShortLinkUrlDto; +import me.zhengjie.modules.system.domain.sms.repository.TbSendSmsRepository; +import me.zhengjie.modules.system.domain.sms.repository.TbTemplateRepository; +import me.zhengjie.modules.system.domain.sms.service.TbSendSmsService; +import me.zhengjie.modules.system.domain.sms.service.dto.TbSendSmsDto; +import me.zhengjie.modules.system.domain.sms.service.dto.TbSendSmsQueryCriteria; +import me.zhengjie.modules.system.domain.sms.service.mapstruct.TbSendSmsMapper; +import me.zhengjie.modules.system.domain.sms.util.SmsUtil; +import me.zhengjie.modules.system.domain.sms.vo.SendVo; import me.zhengjie.modules.upload.task.model.SendSmsJsonContent; import me.zhengjie.utils.FileUtil; import me.zhengjie.utils.PageUtil; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/impl/TbTemplateServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/impl/TbTemplateServiceImpl.java similarity index 88% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/impl/TbTemplateServiceImpl.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/impl/TbTemplateServiceImpl.java index aaf1e2b..7a38c03 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/impl/TbTemplateServiceImpl.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/impl/TbTemplateServiceImpl.java @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service.impl; +package me.zhengjie.modules.system.domain.sms.service.impl; -import me.zhengjie.modules.sms.domain.TbTemplate; -import me.zhengjie.modules.sms.repository.TbTemplateRepository; -import me.zhengjie.modules.sms.service.TbTemplateService; -import me.zhengjie.modules.sms.service.dto.TbTemplateDto; -import me.zhengjie.modules.sms.service.dto.TbTemplateQueryCriteria; -import me.zhengjie.modules.sms.service.mapstruct.TbTemplateMapper; +import me.zhengjie.modules.system.domain.sms.domain.TbTemplate; +import me.zhengjie.modules.system.domain.sms.repository.TbTemplateRepository; +import me.zhengjie.modules.system.domain.sms.service.TbTemplateService; +import me.zhengjie.modules.system.domain.sms.service.dto.TbTemplateDto; +import me.zhengjie.modules.system.domain.sms.service.dto.TbTemplateQueryCriteria; +import me.zhengjie.modules.system.domain.sms.service.mapstruct.TbTemplateMapper; import me.zhengjie.utils.ValidationUtil; import me.zhengjie.utils.FileUtil; import lombok.RequiredArgsConstructor; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/mapstruct/SmsConfigurationMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/mapstruct/SmsConfigurationMapper.java similarity index 81% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/mapstruct/SmsConfigurationMapper.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/mapstruct/SmsConfigurationMapper.java index ba67b6b..e46c0d7 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/mapstruct/SmsConfigurationMapper.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/mapstruct/SmsConfigurationMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service.mapstruct; +package me.zhengjie.modules.system.domain.sms.service.mapstruct; import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.sms.domain.SmsConfiguration; -import me.zhengjie.modules.sms.service.dto.SmsConfigurationDto; +import me.zhengjie.modules.system.domain.sms.domain.SmsConfiguration; +import me.zhengjie.modules.system.domain.sms.service.dto.SmsConfigurationDto; import org.mapstruct.Mapper; import org.mapstruct.ReportingPolicy; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/mapstruct/TbBlacklistMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/mapstruct/TbBlacklistMapper.java similarity index 82% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/mapstruct/TbBlacklistMapper.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/mapstruct/TbBlacklistMapper.java index 8fd0c44..5bbcfda 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/mapstruct/TbBlacklistMapper.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/mapstruct/TbBlacklistMapper.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service.mapstruct; +package me.zhengjie.modules.system.domain.sms.service.mapstruct; import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.sms.domain.TbBlacklist; -import me.zhengjie.modules.sms.service.dto.TbBlacklistDto; +import me.zhengjie.modules.system.domain.sms.domain.TbBlacklist; +import me.zhengjie.modules.system.domain.sms.service.dto.TbBlacklistDto; import org.mapstruct.Mapper; import org.mapstruct.ReportingPolicy; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/mapstruct/TbSendSmsMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/mapstruct/TbSendSmsMapper.java similarity index 82% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/mapstruct/TbSendSmsMapper.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/mapstruct/TbSendSmsMapper.java index 16f9ef0..ab8afae 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/mapstruct/TbSendSmsMapper.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/mapstruct/TbSendSmsMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service.mapstruct; +package me.zhengjie.modules.system.domain.sms.service.mapstruct; import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.sms.domain.TbSendSms; -import me.zhengjie.modules.sms.service.dto.TbSendSmsDto; +import me.zhengjie.modules.system.domain.sms.domain.TbSendSms; +import me.zhengjie.modules.system.domain.sms.service.dto.TbSendSmsDto; import org.mapstruct.Mapper; import org.mapstruct.ReportingPolicy; @@ -29,4 +29,4 @@ import org.mapstruct.ReportingPolicy; @Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) public interface TbSendSmsMapper extends BaseMapper { -} \ No newline at end of file +} diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/mapstruct/TbTemplateMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/mapstruct/TbTemplateMapper.java similarity index 82% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/service/mapstruct/TbTemplateMapper.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/mapstruct/TbTemplateMapper.java index 4bfdd74..7cb1898 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/service/mapstruct/TbTemplateMapper.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/service/mapstruct/TbTemplateMapper.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.sms.service.mapstruct; +package me.zhengjie.modules.system.domain.sms.service.mapstruct; import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.sms.domain.TbTemplate; -import me.zhengjie.modules.sms.service.dto.TbTemplateDto; +import me.zhengjie.modules.system.domain.sms.domain.TbTemplate; +import me.zhengjie.modules.system.domain.sms.service.dto.TbTemplateDto; import org.mapstruct.Mapper; import org.mapstruct.ReportingPolicy; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/util/SmsUtil.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/util/SmsUtil.java similarity index 99% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/util/SmsUtil.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/util/SmsUtil.java index e2569a9..71e4036 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/util/SmsUtil.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/util/SmsUtil.java @@ -1,4 +1,4 @@ -package me.zhengjie.modules.sms.util; +package me.zhengjie.modules.system.domain.sms.util; import cn.hutool.http.HttpUtil; import cn.hutool.json.JSONUtil; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/vo/LinkCallBack.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/vo/LinkCallBack.java similarity index 81% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/vo/LinkCallBack.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/vo/LinkCallBack.java index 8b63734..b547bfe 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/vo/LinkCallBack.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/vo/LinkCallBack.java @@ -1,4 +1,4 @@ -package me.zhengjie.modules.sms.vo; +package me.zhengjie.modules.system.domain.sms.vo; import javax.validation.constraints.NotNull; import lombok.Data; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/vo/SendNewVo.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/vo/SendNewVo.java similarity index 88% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/vo/SendNewVo.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/vo/SendNewVo.java index fef266b..510d80a 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/vo/SendNewVo.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/vo/SendNewVo.java @@ -1,4 +1,4 @@ -package me.zhengjie.modules.sms.vo; +package me.zhengjie.modules.system.domain.sms.vo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/vo/SendVo.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/vo/SendVo.java similarity index 94% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/vo/SendVo.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/vo/SendVo.java index ebc92c3..9897761 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/vo/SendVo.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/vo/SendVo.java @@ -1,4 +1,4 @@ -package me.zhengjie.modules.sms.vo; +package me.zhengjie.modules.system.domain.sms.vo; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/vo/UploadAndSendMessageVo.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/vo/UploadAndSendMessageVo.java similarity index 93% rename from eladmin-system/src/main/java/me/zhengjie/modules/sms/vo/UploadAndSendMessageVo.java rename to eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/vo/UploadAndSendMessageVo.java index 6d9bfad..a8476bd 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/vo/UploadAndSendMessageVo.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/sms/vo/UploadAndSendMessageVo.java @@ -1,4 +1,4 @@ -package me.zhengjie.modules.sms.vo; +package me.zhengjie.modules.system.domain.sms.vo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/task/SaveToFileNewTask.java b/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/task/SaveToFileNewTask.java index 7fa33d9..7289fb1 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/task/SaveToFileNewTask.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/task/SaveToFileNewTask.java @@ -12,10 +12,12 @@ import cn.hutool.http.HttpResponse; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.google.common.collect.Lists; +import com.google.common.collect.Sets; import com.jcraft.jsch.Session; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import me.zhengjie.exception.BadRequestException; +import me.zhengjie.modules.constant.DefaultConstant; import me.zhengjie.modules.constant.FileConstant; import me.zhengjie.modules.upload.task.model.ResponseEncryptJsonContent; import me.zhengjie.modules.upload.task.model.SendEncryptJsonContent; @@ -38,11 +40,13 @@ import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import java.time.LocalDateTime; import java.time.ZoneOffset; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -115,7 +119,7 @@ public class SaveToFileNewTask { * @param tbUploadFileNewDto 需要传输用到的Bean */ private void runTask(TbUploadFileNewDto tbUploadFileNewDto) { - boolean finalTag = false; + int finalTag; // 获取需求的地址 String tempFilesPath = tbUploadFileNewDto.getLocalSavePath(); @@ -125,16 +129,16 @@ public class SaveToFileNewTask { // 更新状态为成功,更新解析成功的条数 TbUploadFileNew tbUploadFileNew = new TbUploadFileNew(); - if (finalTag) { + if (finalTag > DefaultConstant.ZERO_NUMBER) { BeanUtils.copyProperties(tbUploadFileNewDto, tbUploadFileNew); - tbUploadFileNew.setFileTransSuccessCount(tbUploadFileNewDto.getFileCount()); + tbUploadFileNew.setFileTransSuccessCount((long) finalTag); tbUploadFileNew.setUploadTag(SUCCESS_TAG); tbUploadFileNewService.update(tbUploadFileNew); } else { // 失败进行容错 BeanUtils.copyProperties(tbUploadFileNewDto, tbUploadFileNew); tbUploadFileNew.setUploadTag(FAIL_TAG); - tbUploadFileNew.setFileTransSuccessCount(tbUploadFileNewDto.getFileCount()); + tbUploadFileNew.setFileTransSuccessCount((long) finalTag); tbUploadFileNewService.update(tbUploadFileNew); } } @@ -145,19 +149,24 @@ public class SaveToFileNewTask { * @param filePath 进行操作的每一个文件的路径 */ @SneakyThrows - private boolean handleEachFileContent(String filePath, TbUploadFileNewDto tbUploadFileNewDto) { + private int handleEachFileContent(String filePath, TbUploadFileNewDto tbUploadFileNewDto) { + + List phoneList = Lists.newArrayList(); + //根据文件类型进行解析 List listT = tbUploadFileNewDto.getFileFormat().contains(FileConstant.TXT_FILE_SUB_NAME) ? TxtUtils.txtParseListVyUrl(filePath) : ToolExcelUtils.excelParseListByUrl(filePath); - Map> preEncryptNumMap = listT.stream() + Map> preEncryptNumMap = listT.stream().filter + (phone -> phone.trim().getBytes(StandardCharsets.UTF_8).length == DefaultConstant.ELEVEN_NUMBER) .collect(Collectors.groupingBy(String::length)); if (CollectionUtil.isNotEmpty(preEncryptNumMap)) { // 分批调用接口进行加密 List list = preEncryptNumMap.get(PRE_SEND_NUM_LENGTH); - if (CollectionUtil.isNotEmpty(list)) { - batchSendToEncrypt(filePath, list); + phoneList = Lists.newArrayList(Sets.newHashSet(list)); + if (CollectionUtil.isNotEmpty(phoneList)) { + batchSendToEncrypt(filePath, phoneList); } } // modify by q 把剩下不需要加密的内容也写到文件中 @@ -168,7 +177,7 @@ public class SaveToFileNewTask { // 加入一个全局控制开关 if (!booleanTag) { - return Boolean.FALSE; + return DefaultConstant.ZERO_NUMBER; } // 把临时存储的文件进行删除 @@ -181,9 +190,9 @@ public class SaveToFileNewTask { boolean sendUpdatePostReqTag = sendUpdatePostReq(filePath + TEMP_FILE_END_STR, tbUploadFileNewDto); // fixme 这里要修改之前的平台给一个更新接口,然后这边可以用rpc调用,也可以用http,也可以考虑直接消息中间件进行解耦 if (delFileTag && sendUpdatePostReqTag) { - return Boolean.TRUE; + return phoneList.size(); } - return Boolean.FALSE; + return DefaultConstant.ZERO_NUMBER; } private void batchSendToEncrypt(String filePath, List fileAllLinesList) { diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/task/SendMessageTask.java b/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/task/SendMessageTask.java index 6922edf..fd7376d 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/task/SendMessageTask.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/task/SendMessageTask.java @@ -8,18 +8,16 @@ import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import me.zhengjie.constant.SmsConstant; -import me.zhengjie.exception.BadRequestException; import me.zhengjie.modules.constant.DefaultConstant; import me.zhengjie.modules.constant.FileConstant; -import me.zhengjie.modules.sms.domain.TbSendSms; -import me.zhengjie.modules.sms.dto.ShortLinkUrlDto; -import me.zhengjie.modules.sms.service.TbSendSmsService; -import me.zhengjie.modules.sms.service.dto.SmsConfigurationDto; -import me.zhengjie.modules.sms.util.SmsUtil; +import me.zhengjie.modules.system.domain.sms.domain.TbSendSms; +import me.zhengjie.modules.system.domain.sms.dto.ShortLinkUrlDto; +import me.zhengjie.modules.system.domain.sms.service.TbSendSmsService; +import me.zhengjie.modules.system.domain.sms.service.dto.SmsConfigurationDto; +import me.zhengjie.modules.system.domain.sms.util.SmsUtil; import me.zhengjie.modules.uploadnew.domain.TbUploadFileNew; import me.zhengjie.modules.uploadnew.service.TbUploadFileNewService; import me.zhengjie.modules.uploadnew.service.dto.TbUploadFileNewDto; -import me.zhengjie.modules.uploadnew.util.ExcelUtils; import me.zhengjie.modules.uploadnew.util.ToolExcelUtils; import me.zhengjie.modules.uploadnew.util.TxtUtils; import me.zhengjie.utils.ConvertUtil; @@ -31,7 +29,6 @@ import org.springframework.beans.BeanUtils; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; -import java.io.IOException; import java.nio.charset.StandardCharsets; import java.sql.Timestamp; import java.time.Instant; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/util/ExcelUtils.java b/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/util/ExcelUtils.java index 2f53916..6b8d25a 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/util/ExcelUtils.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/util/ExcelUtils.java @@ -59,7 +59,7 @@ public class ExcelUtils { * @return * @throws IOException */ - public List excelParseListByUrl(String url) throws IOException { + public static List excelParseListByUrl(String url) throws IOException { List list = new ArrayList<>(); InputStream inputStream = new FileInputStream(url) ; Workbook workbook = new XSSFWorkbook(inputStream); diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/util/TxtUtils.java b/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/util/TxtUtils.java index f6aaa6e..fd64a84 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/util/TxtUtils.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/util/TxtUtils.java @@ -1,12 +1,19 @@ package me.zhengjie.modules.uploadnew.util; +import cn.hutool.core.util.StrUtil; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; import lombok.extern.slf4j.Slf4j; +import me.zhengjie.modules.constant.DefaultConstant; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.*; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; + @Slf4j public class TxtUtils { private static final Logger LOGGER = LoggerFactory.getLogger(TxtUtils.class); @@ -43,6 +50,7 @@ public class TxtUtils { /** * txt解析方法 * @param url 文件路径 + * update 修改为不重复号码返回 * @return * @throws IOException */ @@ -53,7 +61,7 @@ public class TxtUtils { try { String count; while((count = d.readLine()) != null){ - String u = count.toUpperCase(); + String u = StrUtil.cleanBlank(count.toUpperCase()); list.add(u); } diff --git a/eladmin-system/src/main/resources/config/application-dev.yml b/eladmin-system/src/main/resources/config/application-dev.yml index f9c09f9..b2ee08f 100644 --- a/eladmin-system/src/main/resources/config/application-dev.yml +++ b/eladmin-system/src/main/resources/config/application-dev.yml @@ -46,9 +46,9 @@ spring: redis: #数据库索引 database: 0 - host: 127.0.0.1 + host: 8.130.96.163 port: 6379 - password: '012099' + password: #连接超时时间 timeout: 5000 @@ -137,8 +137,8 @@ sys: debug: true redisson: - address: redis://127.0.0.1:6379 - password: '012099' + address: redis://8.130.96.163:6379 + password: rdsFileRecord: link: downloadUrl: http://116.60.197.152:8000/api/tempFileRecord/downloadFile diff --git a/eladmin-system/src/main/resources/config/application.yml b/eladmin-system/src/main/resources/config/application.yml index 19c9ddf..1dec4b8 100644 --- a/eladmin-system/src/main/resources/config/application.yml +++ b/eladmin-system/src/main/resources/config/application.yml @@ -6,7 +6,7 @@ spring: freemarker: check-template-location: false profiles: - active: prod + active: dev jackson: time-zone: GMT+8 data: