refactor:项目结构调整

This commit is contained in:
haoxr 2020-11-13 21:31:32 +08:00
parent f1ce1eb931
commit b5ca430125
27 changed files with 56 additions and 50 deletions

View File

@ -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.TableId;

View File

@ -1,9 +1,9 @@
package com.youlai.mall.pms.bo;
import com.youlai.mall.pms.entity.PmsSku;
import com.youlai.mall.pms.entity.PmsSpu;
import com.youlai.mall.pms.entity.PmsSpuAttribute;
import com.youlai.mall.pms.entity.PmsSpuSpecification;
import com.youlai.mall.pms.pojo.PmsSku;
import com.youlai.mall.pms.pojo.PmsSpu;
import com.youlai.mall.pms.pojo.PmsSpuAttribute;
import com.youlai.mall.pms.pojo.PmsSpuSpecification;
import lombok.Data;
import java.util.List;

View File

@ -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.TableId;

View File

@ -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.TableId;
import com.youlai.common.core.base.BaseEntity;
import lombok.Data;
import java.util.Date;
@Data
public class PmsCategory extends BaseEntity {

View File

@ -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.TableId;
import com.youlai.common.core.base.BaseEntity;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class PmsSku extends BaseEntity {
@TableId(type = IdType.AUTO)

View File

@ -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.TableField;

View File

@ -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.TableId;

View File

@ -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.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.youlai.common.core.base.BaseEntity;
import lombok.Data;
import java.util.List;
/**
* @author haoxr
* @date 2020-11-06

View 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>

View File

@ -15,6 +15,7 @@
<modules>
<module>pms-api</module>
<module>pms-biz</module>
<module>pms-search</module>
</modules>
<properties>

View File

@ -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.TableId;

View File

@ -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.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.web.bind.annotation.GetMapping;
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;
@FeignClient("youlai-mall-ums")
public interface RemoteUmsMemberService {
public interface UmsMemberFeignClient {
@GetMapping("/members/member/{openid}")
Result<MemberDTO> loadMemberByOpenid(@PathVariable String openid);

View File

@ -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.experimental.Accessors;
import java.time.LocalDate;
import java.util.Date;
@Data
@Accessors(chain = true)

View File

@ -1,4 +1,4 @@
package com.youlai.admin.feign;
package com.youlai.admin.api;
import com.youlai.admin.dto.UserDTO;
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;
@FeignClient("youlai-admin")
public interface RemoteAdminService {
public interface AdminUserFeignClient {
@GetMapping("/users/user/{username}")
Result<UserDTO> loadUserByUsername(@PathVariable String username);

View File

@ -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.TableId;

View File

@ -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.TableId;

View File

@ -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.TableId;

View File

@ -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.TableId;

View File

@ -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.TableField;

View File

@ -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.TableField;

View File

@ -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.TableField;

View File

@ -1,4 +1,4 @@
package com.youlai.admin.entity;
package com.youlai.admin.pojo;
import lombok.Data;
import lombok.experimental.Accessors;

View File

@ -1,4 +1,4 @@
package com.youlai.admin.entity;
package com.youlai.admin.pojo;
import lombok.Data;
import lombok.experimental.Accessors;

View File

@ -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.TableId;

View File

@ -1,4 +1,4 @@
package com.youlai.admin.entity;
package com.youlai.admin.pojo;
import lombok.Data;

View File

@ -13,8 +13,8 @@ import com.youlai.common.core.result.Result;
import com.youlai.common.core.result.ResultCode;
import com.youlai.common.web.exception.BizException;
import com.youlai.mall.ums.dto.MemberDTO;
import com.youlai.mall.ums.entity.UmsMember;
import com.youlai.mall.ums.feign.RemoteUmsMemberService;
import com.youlai.mall.ums.pojo.UmsMember;
import com.youlai.mall.ums.api.UmsMemberFeignClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@ -44,7 +44,7 @@ public class AuthController {
private TokenEndpoint tokenEndpoint;
private RedisTemplate redisTemplate;
private WxMaService wxService;
private RemoteUmsMemberService remoteUmsMemberService;
private UmsMemberFeignClient umsMemberFeignClient;
private PasswordEncoder passwordEncoder;
@ -116,7 +116,7 @@ public class AuthController {
String openid = session.getOpenid();
String sessionKey = session.getSessionKey();
Result<MemberDTO> result = remoteUmsMemberService.loadMemberByOpenid(openid);
Result<MemberDTO> result = umsMemberFeignClient.loadMemberByOpenid(openid);
if (!ResultCode.SUCCESS.getCode().equals(result.getCode())) {
throw new BizException("获取会员信息失败");
}
@ -139,7 +139,7 @@ public class AuthController {
.setPassword(passwordEncoder.encode(openid).replace(AuthConstants.BCRYPT, Strings.EMPTY)) // 加密密码移除前缀加密方式 {bcrypt}
.setStatus(Constants.STATUS_NORMAL_VALUE);
Result res = remoteUmsMemberService.add(member);
Result res = umsMemberFeignClient.add(member);
if (!ResultCode.SUCCESS.getCode().equals(res.getCode())) {
throw new BizException("注册会员失败");
}

View File

@ -1,13 +1,13 @@
package com.youlai.auth.service;
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.common.core.constant.AuthConstants;
import com.youlai.common.core.result.Result;
import com.youlai.common.core.result.ResultCode;
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 org.springframework.security.authentication.AccountExpiredException;
import org.springframework.security.authentication.CredentialsExpiredException;
@ -28,8 +28,8 @@ import javax.servlet.http.HttpServletRequest;
@AllArgsConstructor
public class UserDetailsServiceImpl implements UserDetailsService {
private RemoteAdminService remoteAdminService;
private RemoteUmsMemberService remoteUmsMemberService;
private AdminUserFeignClient adminUserFeignClient;
private UmsMemberFeignClient umsMemberFeignClient;
private HttpServletRequest request;
@Override
@ -38,7 +38,7 @@ public class UserDetailsServiceImpl implements UserDetailsService {
User user = null;
switch (clientId) {
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())) {
throw new UsernameNotFoundException("用户不存在");
}
@ -47,7 +47,7 @@ public class UserDetailsServiceImpl implements UserDetailsService {
user = new User(userDTO);
break;
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())) {
throw new UsernameNotFoundException("会员不存在");
}