From 910a7e8d791c545eb3808bc0b89dcaf787073e93 Mon Sep 17 00:00:00 2001
From: zhangyongzhangyong <2012005003@qq.coom>
Date: Thu, 30 Jul 2020 17:20:19 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=8A=A5=E5=90=8D=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3=EF=BC=8C=E5=A2=9E=E5=8A=A0=E8=BF=94=E5=9B=9E=E5=86=85?=
=?UTF-8?q?=E5=AE=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../resi/ResiActRegistrationResultDTO.java | 45 +++++++++++++++++++
.../controller/ResiActListController.java | 4 +-
.../epmet/service/ActUserRelationService.java | 7 +--
.../impl/ActUserRelationServiceImpl.java | 13 ++++--
4 files changed, 61 insertions(+), 8 deletions(-)
create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRegistrationResultDTO.java
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRegistrationResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRegistrationResultDTO.java
new file mode 100644
index 0000000000..14e8cbd9b3
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRegistrationResultDTO.java
@@ -0,0 +1,45 @@
+/**
+ * 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.result.resi;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 活动内容
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-19
+ */
+@Data
+public class ResiActRegistrationResultDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 编码
+ */
+ private Integer flag;
+
+ /**
+ * 提示信息
+ */
+ private String tip;
+}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java
index 73605d19a9..046a2c6854 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java
@@ -294,12 +294,12 @@ public class ResiActListController {
*
* @param tokenDto
* @param formDTO
- * @return com.epmet.commons.tools.utils.Result
+ * @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 16:26 2020-07-28
**/
@PostMapping("registration")
- public Result registration(@LoginUser TokenDto tokenDto, @RequestBody ResiActRegistrationFormDTO formDTO) {
+ public Result registration(@LoginUser TokenDto tokenDto, @RequestBody ResiActRegistrationFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ResiActRegistrationFormDTO.AddUserInternalGroup.class);
return actUserRelationService.registration(tokenDto, formDTO);
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java
index f77b373208..91ec9355da 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java
@@ -24,6 +24,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ActUserRelationDTO;
import com.epmet.dto.form.resi.ResiActRegistrationFormDTO;
import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO;
+import com.epmet.dto.result.resi.ResiActRegistrationResultDTO;
import com.epmet.entity.ActUserRelationEntity;
import org.apache.ibatis.annotations.Param;
@@ -145,9 +146,9 @@ public interface ActUserRelationService extends BaseService
* @Author zhangyong
- * @Date 15:54 2020-07-28
+ * @Date 17:14 2020-07-30
**/
- Result registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO);
+ Result registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO);
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java
index e9e675b7e4..f8c48c27a5 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java
@@ -39,6 +39,7 @@ import com.epmet.dto.ActUserRelationDTO;
import com.epmet.dto.form.resi.ResiActRegistrationFormDTO;
import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO;
import com.epmet.dto.result.UserRoleResultDTO;
+import com.epmet.dto.result.resi.ResiActRegistrationResultDTO;
import com.epmet.entity.ActUserLogEntity;
import com.epmet.entity.ActUserRelationEntity;
import com.epmet.entity.HeartUserInfoEntity;
@@ -195,7 +196,7 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
boolean satisfy = false;
@@ -221,12 +222,18 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl().ok(dto);
}
} else {
// 不满足,提示用户去认证志愿者
logger.info(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER);
- throw new RenException(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getCode());
+ ResiActRegistrationResultDTO dto = new ResiActRegistrationResultDTO();
+ dto.setFlag(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getCode());
+ dto.setTip(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getMsg());
+ return new Result().ok(dto);
}
return new Result();
}