mirror of
https://gitee.com/youlaitech/youlai-mall.git
synced 2024-12-23 05:00:25 +08:00
refactor:项目结构调整
This commit is contained in:
parent
f1ce1eb931
commit
b5ca430125
@ -1,4 +1,4 @@
|
|||||||
package com.youlai.mall.oms.entity;
|
package com.youlai.mall.oms.pojo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
@ -1,9 +1,9 @@
|
|||||||
package com.youlai.mall.pms.bo;
|
package com.youlai.mall.pms.bo;
|
||||||
|
|
||||||
import com.youlai.mall.pms.entity.PmsSku;
|
import com.youlai.mall.pms.pojo.PmsSku;
|
||||||
import com.youlai.mall.pms.entity.PmsSpu;
|
import com.youlai.mall.pms.pojo.PmsSpu;
|
||||||
import com.youlai.mall.pms.entity.PmsSpuAttribute;
|
import com.youlai.mall.pms.pojo.PmsSpuAttribute;
|
||||||
import com.youlai.mall.pms.entity.PmsSpuSpecification;
|
import com.youlai.mall.pms.pojo.PmsSpuSpecification;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.youlai.mall.pms.entity;
|
package com.youlai.mall.pms.pojo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
@ -1,12 +1,10 @@
|
|||||||
package com.youlai.mall.pms.entity;
|
package com.youlai.mall.pms.pojo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.youlai.common.core.base.BaseEntity;
|
import com.youlai.common.core.base.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class PmsCategory extends BaseEntity {
|
public class PmsCategory extends BaseEntity {
|
||||||
|
|
@ -1,12 +1,10 @@
|
|||||||
package com.youlai.mall.pms.entity;
|
package com.youlai.mall.pms.pojo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.youlai.common.core.base.BaseEntity;
|
import com.youlai.common.core.base.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class PmsSku extends BaseEntity {
|
public class PmsSku extends BaseEntity {
|
||||||
@TableId(type = IdType.AUTO)
|
@TableId(type = IdType.AUTO)
|
@ -1,4 +1,4 @@
|
|||||||
package com.youlai.mall.pms.entity;
|
package com.youlai.mall.pms.pojo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
@ -1,4 +1,4 @@
|
|||||||
package com.youlai.mall.pms.entity;
|
package com.youlai.mall.pms.pojo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
@ -1,13 +1,10 @@
|
|||||||
package com.youlai.mall.pms.entity;
|
package com.youlai.mall.pms.pojo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.youlai.common.core.base.BaseEntity;
|
import com.youlai.common.core.base.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author haoxr
|
* @author haoxr
|
||||||
* @date 2020-11-06
|
* @date 2020-11-06
|
15
mall-pms/pms-search/pom.xml
Normal file
15
mall-pms/pms-search/pom.xml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<artifactId>mall-pms</artifactId>
|
||||||
|
<groupId>com.youlai</groupId>
|
||||||
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>pms-search</artifactId>
|
||||||
|
|
||||||
|
|
||||||
|
</project>
|
@ -15,6 +15,7 @@
|
|||||||
<modules>
|
<modules>
|
||||||
<module>pms-api</module>
|
<module>pms-api</module>
|
||||||
<module>pms-biz</module>
|
<module>pms-biz</module>
|
||||||
|
<module>pms-search</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.youlai.mall.sms.entity;
|
package com.youlai.mall.sms.pojo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
@ -1,8 +1,8 @@
|
|||||||
package com.youlai.mall.ums.feign;
|
package com.youlai.mall.ums.api;
|
||||||
|
|
||||||
import com.youlai.common.core.result.Result;
|
import com.youlai.common.core.result.Result;
|
||||||
import com.youlai.mall.ums.dto.MemberDTO;
|
import com.youlai.mall.ums.dto.MemberDTO;
|
||||||
import com.youlai.mall.ums.entity.UmsMember;
|
import com.youlai.mall.ums.pojo.UmsMember;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
@FeignClient("youlai-mall-ums")
|
@FeignClient("youlai-mall-ums")
|
||||||
public interface RemoteUmsMemberService {
|
public interface UmsMemberFeignClient {
|
||||||
|
|
||||||
@GetMapping("/members/member/{openid}")
|
@GetMapping("/members/member/{openid}")
|
||||||
Result<MemberDTO> loadMemberByOpenid(@PathVariable String openid);
|
Result<MemberDTO> loadMemberByOpenid(@PathVariable String openid);
|
@ -1,13 +1,10 @@
|
|||||||
package com.youlai.mall.ums.entity;
|
package com.youlai.mall.ums.pojo;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
@ -1,4 +1,4 @@
|
|||||||
package com.youlai.admin.feign;
|
package com.youlai.admin.api;
|
||||||
|
|
||||||
import com.youlai.admin.dto.UserDTO;
|
import com.youlai.admin.dto.UserDTO;
|
||||||
import com.youlai.common.core.result.Result;
|
import com.youlai.common.core.result.Result;
|
||||||
@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
|
||||||
@FeignClient("youlai-admin")
|
@FeignClient("youlai-admin")
|
||||||
public interface RemoteAdminService {
|
public interface AdminUserFeignClient {
|
||||||
|
|
||||||
@GetMapping("/users/user/{username}")
|
@GetMapping("/users/user/{username}")
|
||||||
Result<UserDTO> loadUserByUsername(@PathVariable String username);
|
Result<UserDTO> loadUserByUsername(@PathVariable String username);
|
@ -1,4 +1,4 @@
|
|||||||
package com.youlai.admin.entity;
|
package com.youlai.admin.pojo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
@ -1,4 +1,4 @@
|
|||||||
package com.youlai.admin.entity;
|
package com.youlai.admin.pojo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
@ -1,4 +1,4 @@
|
|||||||
package com.youlai.admin.entity;
|
package com.youlai.admin.pojo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
@ -1,4 +1,4 @@
|
|||||||
package com.youlai.admin.entity;
|
package com.youlai.admin.pojo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
@ -1,4 +1,4 @@
|
|||||||
package com.youlai.admin.entity;
|
package com.youlai.admin.pojo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
@ -1,4 +1,4 @@
|
|||||||
package com.youlai.admin.entity;
|
package com.youlai.admin.pojo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
@ -1,4 +1,4 @@
|
|||||||
package com.youlai.admin.entity;
|
package com.youlai.admin.pojo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
@ -1,4 +1,4 @@
|
|||||||
package com.youlai.admin.entity;
|
package com.youlai.admin.pojo;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
@ -1,4 +1,4 @@
|
|||||||
package com.youlai.admin.entity;
|
package com.youlai.admin.pojo;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
@ -1,4 +1,4 @@
|
|||||||
package com.youlai.admin.entity;
|
package com.youlai.admin.pojo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
@ -1,4 +1,4 @@
|
|||||||
package com.youlai.admin.entity;
|
package com.youlai.admin.pojo;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
@ -13,8 +13,8 @@ import com.youlai.common.core.result.Result;
|
|||||||
import com.youlai.common.core.result.ResultCode;
|
import com.youlai.common.core.result.ResultCode;
|
||||||
import com.youlai.common.web.exception.BizException;
|
import com.youlai.common.web.exception.BizException;
|
||||||
import com.youlai.mall.ums.dto.MemberDTO;
|
import com.youlai.mall.ums.dto.MemberDTO;
|
||||||
import com.youlai.mall.ums.entity.UmsMember;
|
import com.youlai.mall.ums.pojo.UmsMember;
|
||||||
import com.youlai.mall.ums.feign.RemoteUmsMemberService;
|
import com.youlai.mall.ums.api.UmsMemberFeignClient;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
@ -44,7 +44,7 @@ public class AuthController {
|
|||||||
private TokenEndpoint tokenEndpoint;
|
private TokenEndpoint tokenEndpoint;
|
||||||
private RedisTemplate redisTemplate;
|
private RedisTemplate redisTemplate;
|
||||||
private WxMaService wxService;
|
private WxMaService wxService;
|
||||||
private RemoteUmsMemberService remoteUmsMemberService;
|
private UmsMemberFeignClient umsMemberFeignClient;
|
||||||
private PasswordEncoder passwordEncoder;
|
private PasswordEncoder passwordEncoder;
|
||||||
|
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ public class AuthController {
|
|||||||
String openid = session.getOpenid();
|
String openid = session.getOpenid();
|
||||||
String sessionKey = session.getSessionKey();
|
String sessionKey = session.getSessionKey();
|
||||||
|
|
||||||
Result<MemberDTO> result = remoteUmsMemberService.loadMemberByOpenid(openid);
|
Result<MemberDTO> result = umsMemberFeignClient.loadMemberByOpenid(openid);
|
||||||
if (!ResultCode.SUCCESS.getCode().equals(result.getCode())) {
|
if (!ResultCode.SUCCESS.getCode().equals(result.getCode())) {
|
||||||
throw new BizException("获取会员信息失败");
|
throw new BizException("获取会员信息失败");
|
||||||
}
|
}
|
||||||
@ -139,7 +139,7 @@ public class AuthController {
|
|||||||
.setPassword(passwordEncoder.encode(openid).replace(AuthConstants.BCRYPT, Strings.EMPTY)) // 加密密码移除前缀加密方式 {bcrypt}
|
.setPassword(passwordEncoder.encode(openid).replace(AuthConstants.BCRYPT, Strings.EMPTY)) // 加密密码移除前缀加密方式 {bcrypt}
|
||||||
.setStatus(Constants.STATUS_NORMAL_VALUE);
|
.setStatus(Constants.STATUS_NORMAL_VALUE);
|
||||||
|
|
||||||
Result res = remoteUmsMemberService.add(member);
|
Result res = umsMemberFeignClient.add(member);
|
||||||
if (!ResultCode.SUCCESS.getCode().equals(res.getCode())) {
|
if (!ResultCode.SUCCESS.getCode().equals(res.getCode())) {
|
||||||
throw new BizException("注册会员失败");
|
throw new BizException("注册会员失败");
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package com.youlai.auth.service;
|
package com.youlai.auth.service;
|
||||||
|
|
||||||
import com.youlai.admin.dto.UserDTO;
|
import com.youlai.admin.dto.UserDTO;
|
||||||
import com.youlai.admin.feign.RemoteAdminService;
|
import com.youlai.admin.api.AdminUserFeignClient;
|
||||||
import com.youlai.auth.domain.User;
|
import com.youlai.auth.domain.User;
|
||||||
import com.youlai.common.core.constant.AuthConstants;
|
import com.youlai.common.core.constant.AuthConstants;
|
||||||
import com.youlai.common.core.result.Result;
|
import com.youlai.common.core.result.Result;
|
||||||
import com.youlai.common.core.result.ResultCode;
|
import com.youlai.common.core.result.ResultCode;
|
||||||
import com.youlai.mall.ums.dto.MemberDTO;
|
import com.youlai.mall.ums.dto.MemberDTO;
|
||||||
import com.youlai.mall.ums.feign.RemoteUmsMemberService;
|
import com.youlai.mall.ums.api.UmsMemberFeignClient;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.security.authentication.AccountExpiredException;
|
import org.springframework.security.authentication.AccountExpiredException;
|
||||||
import org.springframework.security.authentication.CredentialsExpiredException;
|
import org.springframework.security.authentication.CredentialsExpiredException;
|
||||||
@ -28,8 +28,8 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class UserDetailsServiceImpl implements UserDetailsService {
|
public class UserDetailsServiceImpl implements UserDetailsService {
|
||||||
|
|
||||||
private RemoteAdminService remoteAdminService;
|
private AdminUserFeignClient adminUserFeignClient;
|
||||||
private RemoteUmsMemberService remoteUmsMemberService;
|
private UmsMemberFeignClient umsMemberFeignClient;
|
||||||
private HttpServletRequest request;
|
private HttpServletRequest request;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -38,7 +38,7 @@ public class UserDetailsServiceImpl implements UserDetailsService {
|
|||||||
User user = null;
|
User user = null;
|
||||||
switch (clientId) {
|
switch (clientId) {
|
||||||
case AuthConstants.ADMIN_CLIENT_ID: // 后台用户
|
case AuthConstants.ADMIN_CLIENT_ID: // 后台用户
|
||||||
Result<UserDTO> userResult = remoteAdminService.loadUserByUsername(username);
|
Result<UserDTO> userResult = adminUserFeignClient.loadUserByUsername(username);
|
||||||
if (userResult == null || !ResultCode.SUCCESS.getCode().equals(userResult.getCode())) {
|
if (userResult == null || !ResultCode.SUCCESS.getCode().equals(userResult.getCode())) {
|
||||||
throw new UsernameNotFoundException("用户不存在");
|
throw new UsernameNotFoundException("用户不存在");
|
||||||
}
|
}
|
||||||
@ -47,7 +47,7 @@ public class UserDetailsServiceImpl implements UserDetailsService {
|
|||||||
user = new User(userDTO);
|
user = new User(userDTO);
|
||||||
break;
|
break;
|
||||||
case AuthConstants.WEAPP_CLIENT_ID: // 小程序会员
|
case AuthConstants.WEAPP_CLIENT_ID: // 小程序会员
|
||||||
Result<MemberDTO> memberResult = remoteUmsMemberService.loadMemberByOpenid(username);
|
Result<MemberDTO> memberResult = umsMemberFeignClient.loadMemberByOpenid(username);
|
||||||
if (memberResult == null || !ResultCode.SUCCESS.getCode().equals(memberResult.getCode())) {
|
if (memberResult == null || !ResultCode.SUCCESS.getCode().equals(memberResult.getCode())) {
|
||||||
throw new UsernameNotFoundException("会员不存在");
|
throw new UsernameNotFoundException("会员不存在");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user