30 changed files with 713 additions and 27 deletions
@ -0,0 +1,26 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description |
|||
* @ClassName UserEnterGridFormDTO |
|||
* @Author wangc |
|||
* @date 2020.03.30 10:09 |
|||
*/ |
|||
@Data |
|||
public class UserEnterGridFormDTO implements Serializable{ |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@NotBlank(message = "客户Id不能为空") |
|||
private String customerId; |
|||
|
|||
@NotBlank(message = "网格Id不能为空") |
|||
private String gridId; |
|||
|
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.epmet.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.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.dto.form.UserEnterGridFormDTO; |
|||
import com.epmet.dto.result.UserInfoOnEnterGridResultDTO; |
|||
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 用户引导Controller |
|||
* @ClassName UserGuideController |
|||
* @Author wangc |
|||
* @date 2020.03.30 09:34 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("user") |
|||
public class UserGuideController { |
|||
|
|||
|
|||
@PostMapping("entergrid") |
|||
Result<UserInfoOnEnterGridResultDTO> enterGrid(@LoginUser TokenDto token, @RequestBody UserEnterGridFormDTO userEnterGridFormDTO){ |
|||
|
|||
ValidatorUtils.validateEntity(userEnterGridFormDTO); |
|||
|
|||
return null; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.form.UserEnterGridFormDTO; |
|||
import com.epmet.dto.result.UserInfoOnEnterGridResultDTO; |
|||
import com.epmet.service.UserAccessService; |
|||
|
|||
/** |
|||
* @Description |
|||
* @ClassName UserAccessServiceImpl |
|||
* @Author wangc |
|||
* @date 2020.03.30 14:05 |
|||
*/ |
|||
public class UserAccessServiceImpl implements UserAccessService { |
|||
@Override |
|||
public Result<UserInfoOnEnterGridResultDTO> enterGrid(TokenDto tokenDto, UserEnterGridFormDTO formDTO) { |
|||
|
|||
//TODO 加入不放行白名单
|
|||
|
|||
|
|||
return null; |
|||
} |
|||
} |
@ -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,29 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description |
|||
* @ClassName EnterGridFormDTO |
|||
* @Author wangc |
|||
* @date 2020.03.30 14:38 |
|||
*/ |
|||
|
|||
@Data |
|||
public class EnterGridFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@NotBlank(message = "用户Id不能为空") |
|||
private String userId; |
|||
|
|||
@NotBlank(message = "客户Id不能为空") |
|||
private String customerId; |
|||
|
|||
@NotBlank(message = "网格Id不能为空") |
|||
private String gridId; |
|||
|
|||
} |
@ -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,28 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description |
|||
* @ClassName UserRoleFormDTO |
|||
* @Author wangc |
|||
* @date 2020.03.30 15:26 |
|||
*/ |
|||
@Data |
|||
public class UserRoleFormDTO implements Serializable{ |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@NotBlank(message = "用户Id不能为空") |
|||
private String userId; |
|||
|
|||
@NotBlank(message = "客户Id不能为空") |
|||
private String customerId; |
|||
|
|||
@NotBlank(message = "用户来源app不能为空") |
|||
private String app; |
|||
|
|||
} |
@ -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,30 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description |
|||
* @ClassName UserInfoOnEnterGridResultDTO |
|||
* @Author wangc |
|||
* @date 2020.03.30 14:40 |
|||
*/ |
|||
@Data |
|||
public class UserInfoOnEnterGridResultDTO implements Serializable{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
private String currentCustomerId; |
|||
|
|||
private String currentGridId; |
|||
|
|||
private String currentGridName; |
|||
|
|||
private String nickname; |
|||
|
|||
private String userHeadPhoto; |
|||
|
|||
private List<String> userRoleList; |
|||
|
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description |
|||
* @ClassName UserRoleResultDTO |
|||
* @Author wangc |
|||
* @date 2020.03.30 15:29 |
|||
*/ |
|||
@Data |
|||
public class UserRoleResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 角色名称 |
|||
* */ |
|||
private String roleName; |
|||
|
|||
/** |
|||
* 角色key值:normal_resi 、normal_resi 、 normal_resi |
|||
* */ |
|||
private String roleKey; |
|||
|
|||
} |
@ -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