13 changed files with 367 additions and 24 deletions
			
			
		@ -0,0 +1,38 @@ | 
				
			|||
package com.epmet.modules.resiregister.controller; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.tools.annotation.LoginUser; | 
				
			|||
import com.epmet.commons.tools.security.dto.TokenDto; | 
				
			|||
import com.epmet.commons.tools.utils.Result; | 
				
			|||
import com.epmet.dto.form.ResiRegisterFormDTO; | 
				
			|||
import com.epmet.dto.result.ResiRegisterResultDTO; | 
				
			|||
import com.epmet.modules.resiregister.service.ResiRegisterService; | 
				
			|||
import org.springframework.beans.factory.annotation.Autowired; | 
				
			|||
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; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description 居民端居民注册相关接口入口 | 
				
			|||
 * @Author sun | 
				
			|||
 * @Date 2020/3/30 | 
				
			|||
 * @since v1.0.0 | 
				
			|||
 */ | 
				
			|||
@RestController | 
				
			|||
@RequestMapping("resiregister") | 
				
			|||
public class ResiRegisterController { | 
				
			|||
    @Autowired | 
				
			|||
    private ResiRegisterService resiMineGridService; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * @param | 
				
			|||
     * @Author sun | 
				
			|||
     * @Description 居民端-居民注册页面初始化-居民注册访问记录表新增数据 | 
				
			|||
     * @Date 2020/3/30 | 
				
			|||
     **/ | 
				
			|||
    @PostMapping("init") | 
				
			|||
    public Result<ResiRegisterResultDTO> init(@LoginUser TokenDto tokenDTO, @RequestBody ResiRegisterFormDTO resiRegisterFormDTO) { | 
				
			|||
        return resiMineGridService.init(tokenDTO, resiRegisterFormDTO); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,25 @@ | 
				
			|||
package com.epmet.modules.resiregister.service; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.tools.security.dto.TokenDto; | 
				
			|||
import com.epmet.commons.tools.utils.Result; | 
				
			|||
import com.epmet.dto.form.ResiRegisterFormDTO; | 
				
			|||
import com.epmet.dto.result.ResiRegisterResultDTO; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description 居民端居民注册信息service | 
				
			|||
 * @Author sun | 
				
			|||
 * @Date 2020/3/30 | 
				
			|||
 */ | 
				
			|||
public interface ResiRegisterService { | 
				
			|||
 | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 居民端-居民注册页面初始化-居民注册访问记录表新增数据 | 
				
			|||
     * | 
				
			|||
     * @param | 
				
			|||
     * @return void | 
				
			|||
     * @author sun | 
				
			|||
     */ | 
				
			|||
    Result<ResiRegisterResultDTO> init(TokenDto tokenDTO, ResiRegisterFormDTO formDTO); | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,33 @@ | 
				
			|||
package com.epmet.modules.resiregister.service.impl; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.tools.security.dto.TokenDto; | 
				
			|||
import com.epmet.commons.tools.utils.Result; | 
				
			|||
import com.epmet.dto.form.ResiRegisterFormDTO; | 
				
			|||
import com.epmet.dto.result.ResiRegisterResultDTO; | 
				
			|||
import com.epmet.modules.feign.EpmetUserFeignClient; | 
				
			|||
import com.epmet.modules.resiregister.service.ResiRegisterService; | 
				
			|||
import com.epmet.modules.utils.ModuleConstant; | 
				
			|||
import org.apache.commons.lang3.StringUtils; | 
				
			|||
import org.springframework.beans.factory.annotation.Autowired; | 
				
			|||
import org.springframework.stereotype.Service; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description 居民端居民注册信息service | 
				
			|||
 * @Author sun | 
				
			|||
 * @Date 2020/3/30 | 
				
			|||
 */ | 
				
			|||
@Service | 
				
			|||
public class ResiRegisterServiceImpl implements ResiRegisterService { | 
				
			|||
 | 
				
			|||
    @Autowired | 
				
			|||
    private EpmetUserFeignClient epmetUserFeignClient; | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public Result<ResiRegisterResultDTO> init(TokenDto tokenDTO, ResiRegisterFormDTO formDTO) { | 
				
			|||
        if (null == tokenDTO || StringUtils.isBlank(tokenDTO.getUserId())) { | 
				
			|||
            return new Result<ResiRegisterResultDTO>().error(ModuleConstant.USER_NOT_NULL); | 
				
			|||
        } | 
				
			|||
        formDTO.setUserId(tokenDTO.getUserId()); | 
				
			|||
        return epmetUserFeignClient.init(formDTO); | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
@ -0,0 +1,59 @@ | 
				
			|||
/** | 
				
			|||
 * 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; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 居民端-居民注册页面初始化-居民访问记录表新增数据-配置入参 | 
				
			|||
 * @author sun | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class ResiRegisterFormDTO implements Serializable { | 
				
			|||
 | 
				
			|||
    private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 客户Id CUSTOMER.id | 
				
			|||
     */ | 
				
			|||
    @NotBlank(message = "客户ID不能为空") | 
				
			|||
    private String customerId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 网格Id | 
				
			|||
     */ | 
				
			|||
    @NotBlank(message = "网格ID不能为空") | 
				
			|||
    private String gridId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 访问来源 指的是用户点的那个功能进入到的注册页面,就是一个功能模块的Id(value:feature+action) | 
				
			|||
     */ | 
				
			|||
    @NotBlank(message = "访问来源不能为空") | 
				
			|||
    private String visitFrom; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 用户Id | 
				
			|||
     */ | 
				
			|||
    @NotBlank(message = "用户ID不能为空") | 
				
			|||
    private String userId; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,40 @@ | 
				
			|||
/** | 
				
			|||
 * 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.result; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 居民端-居民注册页面初始化-居民访问记录表新增数据-配置入参 | 
				
			|||
 * @author sun | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class ResiRegisterResultDTO implements Serializable { | 
				
			|||
 | 
				
			|||
    private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 用户居民端注册访问记录表(user_resi_register_visit)Id | 
				
			|||
     */ | 
				
			|||
    private String UserResiRegisterVisitId; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,37 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright (c) 2018 人人开源 All rights reserved. | 
				
			|||
 * <p> | 
				
			|||
 * https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * 版权所有,侵权必究! | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.constant; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 常量 | 
				
			|||
 * @author sun | 
				
			|||
 * @since 1.0.0 | 
				
			|||
 */ | 
				
			|||
public interface UserResiRegisterConstant { | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 最后一次操作行为-初始化 | 
				
			|||
     */ | 
				
			|||
    String INITIALIZE = "initialize"; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 最后一次操作行为-获取手机验证码 | 
				
			|||
     */ | 
				
			|||
    String SMS_CODE = "sms_code"; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 最后一次操作行为-提交成功 | 
				
			|||
     */ | 
				
			|||
    String SUCCESS = "success"; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 最后一次操作行为-提交失败 | 
				
			|||
     */ | 
				
			|||
    String FAILD="faild"; | 
				
			|||
} | 
				
			|||
					Loading…
					
					
				
		Reference in new issue