Browse Source

解决关于入参对象嵌套的问题

master
sunyuchao 5 years ago
parent
commit
96b3a72355
  1. 5
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/resiregister/service/impl/ResiRegisterServiceImpl.java
  2. 84
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java
  3. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiInfoSubmitFormDTO.java

5
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/resiregister/service/impl/ResiRegisterServiceImpl.java

@ -1,8 +1,10 @@
package com.epmet.modules.resiregister.service.impl;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.form.InfoSubmitFromDTO;
import com.epmet.dto.form.ResiInfoSubmitFormDTO;
import com.epmet.dto.form.ResiRegisterFormDTO;
import com.epmet.dto.form.VerificationCodeFormDTO;
@ -46,7 +48,8 @@ public class ResiRegisterServiceImpl implements ResiRegisterService {
**/
@Override
public Result submit(TokenDto tokenDTO, ResiInfoSubmitFormDTO resiInfoSubmitFormDTO) {
UserResiInfoDTO userResiInfoDTO = resiInfoSubmitFormDTO.getResiInfo();
InfoSubmitFromDTO infoSubmitFromDTO = resiInfoSubmitFormDTO.getResiInfo();
UserResiInfoDTO userResiInfoDTO = ConvertUtils.sourceToTarget(infoSubmitFromDTO, UserResiInfoDTO.class);
userResiInfoDTO.setUserId(tokenDTO.getUserId());
userResiInfoDTO.setApp(tokenDTO.getApp());
userResiInfoDTO.setCustomerId(resiInfoSubmitFormDTO.getCustomerId());

84
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java

@ -0,0 +1,84 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* 用户居民端注册信息表 用户在居民端完善的个人信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-30
*/
@Data
public class InfoSubmitFromDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 手机号(注册手机号)
*/
@NotBlank(message = "手机号不能为空")
private String regMobile;
/**
* 姓氏
*/
@NotBlank(message = "姓氏不能为空")
private String surname;
/**
* 名称
*/
@NotBlank(message = "名称不能为空")
private String name;
/**
* 街道
*/
@NotBlank(message = "所在街道不能为空")
private String street;
/**
* 小区名称
*/
private String district;
/**
* 楼栋单元
*/
private String buildingAddress;
/**
* 居民注册行为记录表Id resi_visit.id
*/
private String resiVisitId;
/**
* 手机验证码
*/
@NotBlank(message = "手机验证码不能为空")
private String mobileCode;
}

4
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiInfoSubmitFormDTO.java

@ -20,6 +20,7 @@ package com.epmet.dto.form;
import com.epmet.dto.UserResiInfoDTO;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
@ -58,7 +59,8 @@ public class ResiInfoSubmitFormDTO implements Serializable {
/**
* 用户在居民端完善的个人信息
*/
private UserResiInfoDTO resiInfo;
@Valid
private InfoSubmitFromDTO resiInfo;
}

Loading…
Cancel
Save