From 954bd11a2d09f5557ba94fd00516c412ef3cc970 Mon Sep 17 00:00:00 2001 From: "Ray.Hao" <1490493387@qq.com> Date: Tue, 3 Sep 2024 18:22:46 +0800 Subject: [PATCH] =?UTF-8?q?wip:=20=E9=A1=B9=E7=9B=AE=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E9=87=8D=E6=9E=84=E5=BC=80=E5=8F=91=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mall-member/member-boot/pom.xml | 7 -- .../controller/admin/MemberController.java | 18 ++- .../mall/member/mapper/MemberMapper.java | 2 +- .../mall/member/service/MemberService.java | 2 +- .../service/impl/MemberServiceImpl.java | 4 +- .../main/resources/mapper/MemberMapper.xml | 2 +- .../mall/product/ProductApplication.java | 6 + mall-sale/sale-boot/pom.xml | 19 +--- .../controller/admin/AdvertController.java | 19 ++-- .../impl/CouponHistoryServiceImpl.java | 5 +- pom.xml | 3 +- youlai-auth/pom.xml | 25 +++-- .../youlai/auth/config/SecurityConfig.java | 13 ++- .../oidc/CustomOidcUserInfoService.java | 1 - .../common/core/decoder/FeignDecoder.java | 3 +- .../common-framework/common-security/pom.xml | 2 - .../config/PasswordEncoderConfig.java | 0 .../common-service/common-file/pom.xml | 5 + .../file/contoller}/FileController.java | 25 ++++- youlai-common/pom.xml | 1 + .../youlai/gateway/GatewayApplication.java | 3 +- ...r.java => TokenBlacklistGlobalFilter.java} | 2 +- youlai-system/system-boot/pom.xml | 21 ++-- .../com/youlai/system/SystemApplication.java | 3 +- ...eptController.java => DeptController.java} | 6 +- ...ictController.java => DictController.java} | 2 +- ...enuController.java => MenuController.java} | 6 +- ...oleController.java => RoleController.java} | 6 +- ...serController.java => UserController.java} | 21 ++-- .../system/converter/DeptConverter.java | 8 +- .../system/converter/DictConverter.java | 8 +- .../system/converter/DictItemConverter.java | 18 +-- .../system/converter/MenuConverter.java | 8 +- .../system/converter/RoleConverter.java | 12 +- .../system/converter/UserConverter.java | 10 +- .../listener/excel/UserImportListener.java | 40 +++---- .../listener/rabbitmq/CanalListener.java | 7 +- .../{SysDeptMapper.java => DeptMapper.java} | 6 +- ...ictItemMapper.java => DictItemMapper.java} | 4 +- .../{SysDictMapper.java => DictMapper.java} | 4 +- .../{SysMenuMapper.java => MenuMapper.java} | 4 +- .../{SysRoleMapper.java => RoleMapper.java} | 4 +- ...oleMenuMapper.java => RoleMenuMapper.java} | 4 +- .../{SysUserMapper.java => UserMapper.java} | 6 +- ...serRoleMapper.java => UserRoleMapper.java} | 4 +- .../model/entity/{SysDept.java => Dept.java} | 2 +- .../model/entity/{SysDict.java => Dict.java} | 2 +- .../{SysDictItem.java => DictItem.java} | 5 +- .../youlai/system/model/entity/GenConfig.java | 53 +++++++++ .../system/model/entity/GenFieldConfig.java | 105 ++++++++++++++++++ .../model/entity/{SysMenu.java => Menu.java} | 3 +- .../model/entity/{SysRole.java => Role.java} | 3 +- .../{SysRoleMenu.java => RoleMenu.java} | 9 +- .../model/entity/{SysUser.java => User.java} | 9 +- .../{SysUserRole.java => UserRole.java} | 5 +- .../{SysDeptService.java => DeptService.java} | 4 +- ...tItemService.java => DictItemService.java} | 4 +- .../{SysDictService.java => DictService.java} | 4 +- .../{SysMenuService.java => MenuService.java} | 4 +- ...eMenuService.java => RoleMenuService.java} | 4 +- .../{SysRoleService.java => RoleService.java} | 4 +- ...rRoleService.java => UserRoleService.java} | 4 +- .../{SysUserService.java => UserService.java} | 10 +- ...tServiceImpl.java => DeptServiceImpl.java} | 60 +++++----- ...viceImpl.java => DictItemServiceImpl.java} | 8 +- ...uServiceImpl.java => MenuServiceImpl.java} | 46 ++++---- ...viceImpl.java => RoleMenuServiceImpl.java} | 8 +- ...eServiceImpl.java => RoleServiceImpl.java} | 60 +++++----- .../service/impl/SysDictServiceImpl.java | 58 +++++----- ...viceImpl.java => UserRoleServiceImpl.java} | 24 ++-- ...rServiceImpl.java => UserServiceImpl.java} | 56 +++++----- .../{SysDeptMapper.xml => DeptMapper.xml} | 2 +- ...sDictItemMapper.xml => DictItemMapper.xml} | 2 +- .../{SysDictMapper.xml => DictMapper.xml} | 4 +- .../{SysMenuMapper.xml => MenuMapper.xml} | 2 +- .../{SysRoleMapper.xml => RoleMapper.xml} | 2 +- ...sRoleMenuMapper.xml => RoleMenuMapper.xml} | 2 +- .../{SysUserMapper.xml => UserMapper.xml} | 6 +- ...sUserRoleMapper.xml => UserRoleMapper.xml} | 2 +- 79 files changed, 564 insertions(+), 391 deletions(-) rename {youlai-system/system-boot/src/main/java/com/youlai/system => youlai-common/common-framework/common-security/src/main/java/com/youlai/common/security}/config/PasswordEncoderConfig.java (100%) rename {youlai-system/system-boot/src/main/java/com/youlai/system/controller => youlai-common/common-service/common-file/src/main/java/com/youlai/common/file/contoller}/FileController.java (63%) rename youlai-gateway/src/main/java/com/youlai/gateway/filter/{TokenValidationGlobalFilter.java => TokenBlacklistGlobalFilter.java} (97%) rename youlai-system/system-boot/src/main/java/com/youlai/system/controller/{SysDeptController.java => DeptController.java} (95%) rename youlai-system/system-boot/src/main/java/com/youlai/system/controller/{SysDictController.java => DictController.java} (98%) rename youlai-system/system-boot/src/main/java/com/youlai/system/controller/{SysMenuController.java => MenuController.java} (96%) rename youlai-system/system-boot/src/main/java/com/youlai/system/controller/{SysRoleController.java => RoleController.java} (96%) rename youlai-system/system-boot/src/main/java/com/youlai/system/controller/{SysUserController.java => UserController.java} (94%) rename youlai-system/system-boot/src/main/java/com/youlai/system/mapper/{SysDeptMapper.java => DeptMapper.java} (69%) rename youlai-system/system-boot/src/main/java/com/youlai/system/mapper/{SysDictItemMapper.java => DictItemMapper.java} (64%) rename youlai-system/system-boot/src/main/java/com/youlai/system/mapper/{SysDictMapper.java => DictMapper.java} (84%) rename youlai-system/system-boot/src/main/java/com/youlai/system/mapper/{SysMenuMapper.java => MenuMapper.java} (78%) rename youlai-system/system-boot/src/main/java/com/youlai/system/mapper/{SysRoleMapper.java => RoleMapper.java} (75%) rename youlai-system/system-boot/src/main/java/com/youlai/system/mapper/{SysRoleMenuMapper.java => RoleMenuMapper.java} (82%) rename youlai-system/system-boot/src/main/java/com/youlai/system/mapper/{SysUserMapper.java => UserMapper.java} (88%) rename youlai-system/system-boot/src/main/java/com/youlai/system/mapper/{SysUserRoleMapper.java => UserRoleMapper.java} (74%) rename youlai-system/system-boot/src/main/java/com/youlai/system/model/entity/{SysDept.java => Dept.java} (94%) rename youlai-system/system-boot/src/main/java/com/youlai/system/model/entity/{SysDict.java => Dict.java} (93%) rename youlai-system/system-boot/src/main/java/com/youlai/system/model/entity/{SysDictItem.java => DictItem.java} (87%) create mode 100644 youlai-system/system-boot/src/main/java/com/youlai/system/model/entity/GenConfig.java create mode 100644 youlai-system/system-boot/src/main/java/com/youlai/system/model/entity/GenFieldConfig.java rename youlai-system/system-boot/src/main/java/com/youlai/system/model/entity/{SysMenu.java => Menu.java} (96%) rename youlai-system/system-boot/src/main/java/com/youlai/system/model/entity/{SysRole.java => Role.java} (88%) rename youlai-system/system-boot/src/main/java/com/youlai/system/model/entity/{SysRoleMenu.java => RoleMenu.java} (65%) rename youlai-system/system-boot/src/main/java/com/youlai/system/model/entity/{SysUser.java => User.java} (89%) rename youlai-system/system-boot/src/main/java/com/youlai/system/model/entity/{SysUserRole.java => UserRole.java} (68%) rename youlai-system/system-boot/src/main/java/com/youlai/system/service/{SysDeptService.java => DeptService.java} (89%) rename youlai-system/system-boot/src/main/java/com/youlai/system/service/{SysDictItemService.java => DictItemService.java} (71%) rename youlai-system/system-boot/src/main/java/com/youlai/system/service/{SysDictService.java => DictService.java} (92%) rename youlai-system/system-boot/src/main/java/com/youlai/system/service/{SysMenuService.java => MenuService.java} (91%) rename youlai-system/system-boot/src/main/java/com/youlai/system/service/{SysRoleMenuService.java => RoleMenuService.java} (87%) rename youlai-system/system-boot/src/main/java/com/youlai/system/service/{SysRoleService.java => RoleService.java} (95%) rename youlai-system/system-boot/src/main/java/com/youlai/system/service/{SysUserRoleService.java => UserRoleService.java} (83%) rename youlai-system/system-boot/src/main/java/com/youlai/system/service/{SysUserService.java => UserService.java} (94%) rename youlai-system/system-boot/src/main/java/com/youlai/system/service/impl/{SysDeptServiceImpl.java => DeptServiceImpl.java} (76%) rename youlai-system/system-boot/src/main/java/com/youlai/system/service/impl/{SysDictItemServiceImpl.java => DictItemServiceImpl.java} (63%) rename youlai-system/system-boot/src/main/java/com/youlai/system/service/impl/{SysMenuServiceImpl.java => MenuServiceImpl.java} (88%) rename youlai-system/system-boot/src/main/java/com/youlai/system/service/impl/{SysRoleMenuServiceImpl.java => RoleMenuServiceImpl.java} (91%) rename youlai-system/system-boot/src/main/java/com/youlai/system/service/impl/{SysRoleServiceImpl.java => RoleServiceImpl.java} (77%) rename youlai-system/system-boot/src/main/java/com/youlai/system/service/impl/{SysUserRoleServiceImpl.java => UserRoleServiceImpl.java} (74%) rename youlai-system/system-boot/src/main/java/com/youlai/system/service/impl/{SysUserServiceImpl.java => UserServiceImpl.java} (86%) rename youlai-system/system-boot/src/main/resources/mapper/{SysDeptMapper.xml => DeptMapper.xml} (74%) rename youlai-system/system-boot/src/main/resources/mapper/{SysDictItemMapper.xml => DictItemMapper.xml} (90%) rename youlai-system/system-boot/src/main/resources/mapper/{SysDictMapper.xml => DictMapper.xml} (86%) rename youlai-system/system-boot/src/main/resources/mapper/{SysMenuMapper.xml => MenuMapper.xml} (97%) rename youlai-system/system-boot/src/main/resources/mapper/{SysRoleMapper.xml => RoleMapper.xml} (93%) rename youlai-system/system-boot/src/main/resources/mapper/{SysRoleMenuMapper.xml => RoleMenuMapper.xml} (95%) rename youlai-system/system-boot/src/main/resources/mapper/{SysUserMapper.xml => UserMapper.xml} (96%) rename youlai-system/system-boot/src/main/resources/mapper/{SysUserRoleMapper.xml => UserRoleMapper.xml} (93%) diff --git a/mall-member/member-boot/pom.xml b/mall-member/member-boot/pom.xml index 753508853..2fcda6440 100644 --- a/mall-member/member-boot/pom.xml +++ b/mall-member/member-boot/pom.xml @@ -23,13 +23,6 @@ spring-boot-configuration-processor - - - org.springframework.boot - spring-boot-starter-test - test - - org.springframework.cloud diff --git a/mall-member/member-boot/src/main/java/com/youlai/mall/member/controller/admin/MemberController.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/controller/admin/MemberController.java index 84e5dca45..be972e062 100644 --- a/mall-member/member-boot/src/main/java/com/youlai/mall/member/controller/admin/MemberController.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/controller/admin/MemberController.java @@ -17,6 +17,12 @@ import org.springframework.web.bind.annotation.*; import java.util.Arrays; +/** + * 会员管理 + * + * @author Ray + * @since 1.0.0 + */ @Tag(name = "Admin-会员管理") @RestController @@ -26,14 +32,14 @@ public class MemberController { private final MemberService memberService; - @Operation(summary= "会员分页列表") + @Operation(summary = "会员分页列表") @GetMapping("/page") - public PageResult listPagedMembers(MemberPageQuery pageQuery) { - IPage page = memberService.listPagedMembers(pageQuery); + public PageResult getMemberPage(MemberPageQuery pageQuery) { + IPage page = memberService.getMemberPage(pageQuery); return PageResult.success(page); } - @Operation(summary= "修改会员") + @Operation(summary = "修改会员") @PutMapping(value = "/{memberId}") public Result update( @Parameter(description = "会员ID") @PathVariable Long memberId, @@ -43,7 +49,7 @@ public class MemberController { return Result.judge(status); } - @Operation(summary= "修改会员状态") + @Operation(summary = "修改会员状态") @PatchMapping("/{memberId}/status") public Result updateMemberStatus( @Parameter(description = "会员ID") @PathVariable Long memberId, @@ -57,7 +63,7 @@ public class MemberController { return Result.judge(status); } - @Operation(summary= "删除会员") + @Operation(summary = "删除会员") @DeleteMapping("/{ids}") public Result delete( @Parameter(description = "会员ID,多个以英文逗号(,)拼接") @PathVariable String ids diff --git a/mall-member/member-boot/src/main/java/com/youlai/mall/member/mapper/MemberMapper.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/mapper/MemberMapper.java index 143256873..8f79b8771 100644 --- a/mall-member/member-boot/src/main/java/com/youlai/mall/member/mapper/MemberMapper.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/mapper/MemberMapper.java @@ -25,5 +25,5 @@ public interface MemberMapper extends BaseMapper { * @param queryParams 查询参数 * @return */ - Page listPagedMembers(Page page, MemberPageQuery queryParams); + Page getMemberPage(Page page, MemberPageQuery queryParams); } diff --git a/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/MemberService.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/MemberService.java index dc7d0e5fe..15f8faf59 100644 --- a/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/MemberService.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/MemberService.java @@ -25,7 +25,7 @@ public interface MemberService extends IService { /** * 会员分页列表 */ - IPage listPagedMembers(MemberPageQuery queryParams); + IPage getMemberPage(MemberPageQuery queryParams); /** diff --git a/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/impl/MemberServiceImpl.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/impl/MemberServiceImpl.java index a466ad745..3eb56167d 100644 --- a/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/impl/MemberServiceImpl.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/impl/MemberServiceImpl.java @@ -51,8 +51,8 @@ public class MemberServiceImpl extends ServiceImpl impleme * @return 会员分页列表 */ @Override - public IPage listPagedMembers(MemberPageQuery queryParams) { - Page boPage = this.baseMapper.listPagedMembers( + public IPage getMemberPage(MemberPageQuery queryParams) { + Page boPage = this.baseMapper.getMemberPage( new Page<>(queryParams.getPageNum(), queryParams.getPageSize()), queryParams ); diff --git a/mall-member/member-boot/src/main/resources/mapper/MemberMapper.xml b/mall-member/member-boot/src/main/resources/mapper/MemberMapper.xml index 1d9b2b0d3..50d11a633 100644 --- a/mall-member/member-boot/src/main/resources/mapper/MemberMapper.xml +++ b/mall-member/member-boot/src/main/resources/mapper/MemberMapper.xml @@ -12,7 +12,7 @@ - SELECT id, nickName, diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/ProductApplication.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/ProductApplication.java index 4bf58a214..43079c3b8 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/ProductApplication.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/ProductApplication.java @@ -6,6 +6,12 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.openfeign.EnableFeignClients; +/** + * 商品服务启动类 + * + * @since 1.0.0 + * @author Ray + */ @SpringBootApplication @EnableDiscoveryClient @EnableFeignClients(basePackageClasses = {MemberFeignClient.class}) diff --git a/mall-sale/sale-boot/pom.xml b/mall-sale/sale-boot/pom.xml index e2365771a..73a0db575 100644 --- a/mall-sale/sale-boot/pom.xml +++ b/mall-sale/sale-boot/pom.xml @@ -11,7 +11,6 @@ sale-boot - 8804 32002 @@ -23,13 +22,6 @@ spring-boot-configuration-processor - - - org.springframework.boot - spring-boot-starter-test - test - - org.springframework.cloud @@ -53,11 +45,6 @@ spring-cloud-starter-alibaba-nacos-config - - com.youlai - sale-api - - com.youlai common-core @@ -73,6 +60,11 @@ common-security + + com.youlai + sale-api + + @@ -85,5 +77,4 @@ - diff --git a/mall-sale/sale-boot/src/main/java/com/youlai/mall/sale/controller/admin/AdvertController.java b/mall-sale/sale-boot/src/main/java/com/youlai/mall/sale/controller/admin/AdvertController.java index 01d1bdb64..35c17a21f 100644 --- a/mall-sale/sale-boot/src/main/java/com/youlai/mall/sale/controller/admin/AdvertController.java +++ b/mall-sale/sale-boot/src/main/java/com/youlai/mall/sale/controller/admin/AdvertController.java @@ -16,6 +16,13 @@ import org.springframework.web.bind.annotation.*; import java.util.Arrays; + +/** + * 营销广告 + * + * @author Ray + * @since 1.0.0 + */ @Tag(name = "Admin-营销广告") @RestController @RequestMapping("/api/v1/adverts") @@ -24,7 +31,7 @@ public class AdvertController { private final AdvertService advertService; - @Operation(summary= "广告分页列表") + @Operation(summary = "广告分页列表") @GetMapping("/page") public PageResult getAdvertPage(AdvertPageQuery queryParams) { @@ -43,7 +50,7 @@ public class AdvertController { return PageResult.success(result); } - @Operation(summary= "广告详情") + @Operation(summary = "广告详情") @GetMapping("/{id}") public Result getAdvertDetail( @Parameter(description = "广告ID") @PathVariable Long id @@ -52,14 +59,14 @@ public class AdvertController { return Result.success(advert); } - @Operation(summary= "新增广告") + @Operation(summary = "新增广告") @PostMapping public Result addAvert(@RequestBody Advert advert) { boolean status = advertService.save(advert); return Result.judge(status); } - @Operation(summary= "修改广告") + @Operation(summary = "修改广告") @PutMapping(value = "/{id}") public Result updateAdvert( @Parameter(description = "广告ID") @PathVariable Long id, @@ -68,13 +75,11 @@ public class AdvertController { return Result.judge(status); } - @Operation(summary= "删除广告") + @Operation(summary = "删除广告") @DeleteMapping("/{ids}") public Result deleteAdverts(@Parameter(description = "广告ID,多个以英文逗号(,)分割") @PathVariable("ids") String ids) { boolean status = advertService.removeByIds(Arrays.asList(ids.split(","))); return Result.judge(status); - - } } diff --git a/mall-sale/sale-boot/src/main/java/com/youlai/mall/sale/service/impl/CouponHistoryServiceImpl.java b/mall-sale/sale-boot/src/main/java/com/youlai/mall/sale/service/impl/CouponHistoryServiceImpl.java index 9bed01572..2100a23b8 100644 --- a/mall-sale/sale-boot/src/main/java/com/youlai/mall/sale/service/impl/CouponHistoryServiceImpl.java +++ b/mall-sale/sale-boot/src/main/java/com/youlai/mall/sale/service/impl/CouponHistoryServiceImpl.java @@ -7,11 +7,14 @@ import com.youlai.mall.sale.mapper.CouponHistoryMapper; import org.springframework.stereotype.Service; /** + * 优惠券领取历史记录 服务实现类 * + * @author Ray + * @since 2.0.0 */ @Service public class CouponHistoryServiceImpl extends ServiceImpl -implements CouponHistoryService { + implements CouponHistoryService { } diff --git a/pom.xml b/pom.xml index f8978172c..bbf93f3a8 100644 --- a/pom.xml +++ b/pom.xml @@ -21,8 +21,7 @@ mall-member mall-product mall-order - youlai-common/common-framework - youlai-common/common-service + youlai-generator diff --git a/youlai-auth/pom.xml b/youlai-auth/pom.xml index 91cd9f3b0..030602650 100644 --- a/youlai-auth/pom.xml +++ b/youlai-auth/pom.xml @@ -64,6 +64,21 @@ weixin-java-miniapp + + com.youlai + common-base + + + + com.youlai + common-mybatis + + + + com.youlai + common-sms + + com.youlai member-api @@ -74,16 +89,6 @@ system-api - - com.youlai - common-base - - - - com.youlai - common-sms - - diff --git a/youlai-auth/src/main/java/com/youlai/auth/config/SecurityConfig.java b/youlai-auth/src/main/java/com/youlai/auth/config/SecurityConfig.java index 3dd1f0b6c..fdac79864 100644 --- a/youlai-auth/src/main/java/com/youlai/auth/config/SecurityConfig.java +++ b/youlai-auth/src/main/java/com/youlai/auth/config/SecurityConfig.java @@ -20,7 +20,10 @@ import org.springframework.web.servlet.handler.HandlerMappingIntrospector; import java.util.List; /** - * 默认安全配置 + * Spring Security安全配置 + * + * @author Ray + * @since 3.0.0 */ @ConfigurationProperties(prefix = "security") @Configuration(proxyBeanMethods = false) @@ -31,7 +34,7 @@ public class SecurityConfig { * 白名单路径列表 */ @Setter - private List whitelistPaths; + private List ignoreUris; /** * Spring Security 安全过滤器链配置 @@ -45,9 +48,9 @@ public class SecurityConfig { MvcRequestMatcher.Builder mvcMatcherBuilder = new MvcRequestMatcher.Builder(introspector); http.authorizeHttpRequests((requests) -> { - if (CollectionUtil.isNotEmpty(whitelistPaths)) { - for (String whitelistPath : whitelistPaths) { - requests.requestMatchers(mvcMatcherBuilder.pattern(whitelistPath)).permitAll(); + if (CollectionUtil.isNotEmpty(ignoreUris)) { + for (String ignoreUri : ignoreUris) { + requests.requestMatchers(mvcMatcherBuilder.pattern(ignoreUri)).permitAll(); } } requests.anyRequest().authenticated(); diff --git a/youlai-auth/src/main/java/com/youlai/auth/oauth2/oidc/CustomOidcUserInfoService.java b/youlai-auth/src/main/java/com/youlai/auth/oauth2/oidc/CustomOidcUserInfoService.java index e6550ee03..d9c9720ae 100644 --- a/youlai-auth/src/main/java/com/youlai/auth/oauth2/oidc/CustomOidcUserInfoService.java +++ b/youlai-auth/src/main/java/com/youlai/auth/oauth2/oidc/CustomOidcUserInfoService.java @@ -6,7 +6,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import java.util.Map; -import java.util.Optional; /** * 自定义 OIDC 用户信息服务 diff --git a/youlai-common/common-core/src/main/java/com/youlai/common/core/decoder/FeignDecoder.java b/youlai-common/common-core/src/main/java/com/youlai/common/core/decoder/FeignDecoder.java index b33e915a0..0cffbc513 100644 --- a/youlai-common/common-core/src/main/java/com/youlai/common/core/decoder/FeignDecoder.java +++ b/youlai-common/common-core/src/main/java/com/youlai/common/core/decoder/FeignDecoder.java @@ -14,8 +14,9 @@ import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; /** + * Feign 响应解码器 + * * @author Ray - * @link https://zhuanlan.zhihu.com/p/545505705 * @since 2023/8/23 */ public class FeignDecoder implements Decoder { diff --git a/youlai-common/common-framework/common-security/pom.xml b/youlai-common/common-framework/common-security/pom.xml index 2f6cdbc87..59eedfdfe 100644 --- a/youlai-common/common-framework/common-security/pom.xml +++ b/youlai-common/common-framework/common-security/pom.xml @@ -52,8 +52,6 @@ true - - \ No newline at end of file diff --git a/youlai-system/system-boot/src/main/java/com/youlai/system/config/PasswordEncoderConfig.java b/youlai-common/common-framework/common-security/src/main/java/com/youlai/common/security/config/PasswordEncoderConfig.java similarity index 100% rename from youlai-system/system-boot/src/main/java/com/youlai/system/config/PasswordEncoderConfig.java rename to youlai-common/common-framework/common-security/src/main/java/com/youlai/common/security/config/PasswordEncoderConfig.java diff --git a/youlai-common/common-service/common-file/pom.xml b/youlai-common/common-service/common-file/pom.xml index 0ee5d729e..f4841b051 100644 --- a/youlai-common/common-service/common-file/pom.xml +++ b/youlai-common/common-service/common-file/pom.xml @@ -23,6 +23,11 @@ spring-boot-starter-web + + com.youlai + common-base + + io.minio diff --git a/youlai-system/system-boot/src/main/java/com/youlai/system/controller/FileController.java b/youlai-common/common-service/common-file/src/main/java/com/youlai/common/file/contoller/FileController.java similarity index 63% rename from youlai-system/system-boot/src/main/java/com/youlai/system/controller/FileController.java rename to youlai-common/common-service/common-file/src/main/java/com/youlai/common/file/contoller/FileController.java index d1210fd50..bb7ed9536 100644 --- a/youlai-system/system-boot/src/main/java/com/youlai/system/controller/FileController.java +++ b/youlai-common/common-service/common-file/src/main/java/com/youlai/common/file/contoller/FileController.java @@ -1,8 +1,10 @@ -package com.youlai.system.controller; +package com.youlai.common.file.contoller; import com.youlai.common.file.model.FileInfo; import com.youlai.common.file.service.OssService; import com.youlai.common.result.Result; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -10,7 +12,14 @@ import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -@Tag(name = "06.文件接口") + +/** + * 文件控制器 + * + * @author Ray + * @since 1.0.0 + */ +@Tag(name = "11.文件接口") @RestController @RequestMapping("/api/v1/files") @RequiredArgsConstructor @@ -19,9 +28,15 @@ public class FileController { private final OssService ossService; @PostMapping - @Operation(summary= "文件上传") + @Operation(summary = "上传文件") public Result uploadFile( - @Parameter(name = "file",description = "表单文件对象") + @Parameter( + name = "file", + description = "表单文件对象", + required = true, + in = ParameterIn.DEFAULT, + schema = @Schema(name = "file", format = "binary") + ) @RequestParam(value = "file") MultipartFile file ) { FileInfo fileInfo = ossService.uploadFile(file); @@ -29,7 +44,7 @@ public class FileController { } @DeleteMapping - @Operation(summary= "文件删除") + @Operation(summary = "删除文件") public Result deleteFile( @Parameter(description = "文件路径") @RequestParam String filePath ) { diff --git a/youlai-common/pom.xml b/youlai-common/pom.xml index 0e7e01fff..8fb4b0d2a 100644 --- a/youlai-common/pom.xml +++ b/youlai-common/pom.xml @@ -16,6 +16,7 @@ common-base common-core + common-framework common-middleware common-service diff --git a/youlai-gateway/src/main/java/com/youlai/gateway/GatewayApplication.java b/youlai-gateway/src/main/java/com/youlai/gateway/GatewayApplication.java index de365e952..e80829128 100644 --- a/youlai-gateway/src/main/java/com/youlai/gateway/GatewayApplication.java +++ b/youlai-gateway/src/main/java/com/youlai/gateway/GatewayApplication.java @@ -7,7 +7,8 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient; /** * 网关服务启动类 * - * @author ray + * @author Ray + * @since 0.0.1 */ @SpringBootApplication @EnableDiscoveryClient diff --git a/youlai-gateway/src/main/java/com/youlai/gateway/filter/TokenValidationGlobalFilter.java b/youlai-gateway/src/main/java/com/youlai/gateway/filter/TokenBlacklistGlobalFilter.java similarity index 97% rename from youlai-gateway/src/main/java/com/youlai/gateway/filter/TokenValidationGlobalFilter.java rename to youlai-gateway/src/main/java/com/youlai/gateway/filter/TokenBlacklistGlobalFilter.java index 99e9d3713..da75eca9c 100644 --- a/youlai-gateway/src/main/java/com/youlai/gateway/filter/TokenValidationGlobalFilter.java +++ b/youlai-gateway/src/main/java/com/youlai/gateway/filter/TokenBlacklistGlobalFilter.java @@ -30,7 +30,7 @@ import java.text.ParseException; @Component @RequiredArgsConstructor @Slf4j -public class TokenValidationGlobalFilter implements GlobalFilter, Ordered { +public class TokenBlacklistGlobalFilter implements GlobalFilter, Ordered { private final RedisTemplate redisTemplate; diff --git a/youlai-system/system-boot/pom.xml b/youlai-system/system-boot/pom.xml index 42f616200..55530bed7 100644 --- a/youlai-system/system-boot/pom.xml +++ b/youlai-system/system-boot/pom.xml @@ -18,13 +18,6 @@ - - - org.springframework.boot - spring-boot-starter-test - test - - org.springframework.cloud @@ -73,12 +66,7 @@ com.youlai - system-api - - - - com.youlai - common-mybatis + common-core @@ -88,7 +76,7 @@ com.youlai - common-core + common-mybatis @@ -106,6 +94,11 @@ common-file + + com.youlai + system-api + + diff --git a/youlai-system/system-boot/src/main/java/com/youlai/system/SystemApplication.java b/youlai-system/system-boot/src/main/java/com/youlai/system/SystemApplication.java index b11510dc6..7e5362c5e 100644 --- a/youlai-system/system-boot/src/main/java/com/youlai/system/SystemApplication.java +++ b/youlai-system/system-boot/src/main/java/com/youlai/system/SystemApplication.java @@ -7,7 +7,8 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient; /** * 系统服务启动类 * - * @author ray + * @author Ray + * @since 0.0.1 */ @SpringBootApplication @EnableDiscoveryClient diff --git a/youlai-system/system-boot/src/main/java/com/youlai/system/controller/SysDeptController.java b/youlai-system/system-boot/src/main/java/com/youlai/system/controller/DeptController.java similarity index 95% rename from youlai-system/system-boot/src/main/java/com/youlai/system/controller/SysDeptController.java rename to youlai-system/system-boot/src/main/java/com/youlai/system/controller/DeptController.java index 1314d4b72..5873bacbf 100644 --- a/youlai-system/system-boot/src/main/java/com/youlai/system/controller/SysDeptController.java +++ b/youlai-system/system-boot/src/main/java/com/youlai/system/controller/DeptController.java @@ -6,7 +6,7 @@ import com.youlai.system.model.form.DeptForm; import com.youlai.system.model.query.DeptQuery; import com.youlai.system.model.vo.DeptVO; import com.youlai.common.core.model.Option; -import com.youlai.system.service.SysDeptService; +import com.youlai.system.service.DeptService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -30,8 +30,8 @@ import java.util.List; @RequestMapping("/api/v1/dept") @RequiredArgsConstructor @Slf4j -public class SysDeptController { - private final SysDeptService deptService; +public class DeptController { + private final DeptService deptService; @Operation(summary = "获取部门列表") @GetMapping diff --git a/youlai-system/system-boot/src/main/java/com/youlai/system/controller/SysDictController.java b/youlai-system/system-boot/src/main/java/com/youlai/system/controller/DictController.java similarity index 98% rename from youlai-system/system-boot/src/main/java/com/youlai/system/controller/SysDictController.java rename to youlai-system/system-boot/src/main/java/com/youlai/system/controller/DictController.java index 276e2f991..b5160887a 100644 --- a/youlai-system/system-boot/src/main/java/com/youlai/system/controller/SysDictController.java +++ b/youlai-system/system-boot/src/main/java/com/youlai/system/controller/DictController.java @@ -28,7 +28,7 @@ import java.util.List; @RestController @RequestMapping("/api/v1/dict") @RequiredArgsConstructor -public class SysDictController { +public class DictController { private final SysDictService dictService; diff --git a/youlai-system/system-boot/src/main/java/com/youlai/system/controller/SysMenuController.java b/youlai-system/system-boot/src/main/java/com/youlai/system/controller/MenuController.java similarity index 96% rename from youlai-system/system-boot/src/main/java/com/youlai/system/controller/SysMenuController.java rename to youlai-system/system-boot/src/main/java/com/youlai/system/controller/MenuController.java index 437380fcd..c06bf4ef0 100644 --- a/youlai-system/system-boot/src/main/java/com/youlai/system/controller/SysMenuController.java +++ b/youlai-system/system-boot/src/main/java/com/youlai/system/controller/MenuController.java @@ -8,7 +8,7 @@ import com.youlai.system.model.query.MenuQuery; import com.youlai.system.model.vo.MenuVO; import com.youlai.common.core.model.Option; import com.youlai.system.model.vo.RouteVO; -import com.youlai.system.service.SysMenuService; +import com.youlai.system.service.MenuService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -33,9 +33,9 @@ import java.util.Set; @RequestMapping("/api/v1/menus") @RequiredArgsConstructor @Slf4j -public class SysMenuController { +public class MenuController { - private final SysMenuService menuService; + private final MenuService menuService; @Operation(summary = "菜单列表") @GetMapping diff --git a/youlai-system/system-boot/src/main/java/com/youlai/system/controller/SysRoleController.java b/youlai-system/system-boot/src/main/java/com/youlai/system/controller/RoleController.java similarity index 96% rename from youlai-system/system-boot/src/main/java/com/youlai/system/controller/SysRoleController.java rename to youlai-system/system-boot/src/main/java/com/youlai/system/controller/RoleController.java index 249446aa7..24ad7e1d6 100644 --- a/youlai-system/system-boot/src/main/java/com/youlai/system/controller/SysRoleController.java +++ b/youlai-system/system-boot/src/main/java/com/youlai/system/controller/RoleController.java @@ -8,7 +8,7 @@ import com.youlai.common.core.model.Option; import com.youlai.system.model.form.RoleForm; import com.youlai.system.model.query.RolePageQuery; import com.youlai.system.model.vo.RolePageVO; -import com.youlai.system.service.SysRoleService; +import com.youlai.system.service.RoleService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -25,9 +25,9 @@ import java.util.List; @RestController @RequestMapping("/api/v1/roles") @RequiredArgsConstructor -public class SysRoleController { +public class RoleController { - private final SysRoleService roleService; + private final RoleService roleService; @Operation(summary = "角色分页列表" ) @GetMapping("/page") diff --git a/youlai-system/system-boot/src/main/java/com/youlai/system/controller/SysUserController.java b/youlai-system/system-boot/src/main/java/com/youlai/system/controller/UserController.java similarity index 94% rename from youlai-system/system-boot/src/main/java/com/youlai/system/controller/SysUserController.java rename to youlai-system/system-boot/src/main/java/com/youlai/system/controller/UserController.java index beb4ee001..7b9578847 100644 --- a/youlai-system/system-boot/src/main/java/com/youlai/system/controller/SysUserController.java +++ b/youlai-system/system-boot/src/main/java/com/youlai/system/controller/UserController.java @@ -9,12 +9,13 @@ import com.youlai.common.result.Result; import com.youlai.common.core.annotation.RepeatSubmit; import com.youlai.system.dto.UserAuthInfo; import com.youlai.system.listener.excel.UserImportListener; -import com.youlai.system.model.entity.SysUser; +import com.youlai.system.model.entity.User; import com.youlai.system.model.form.UserForm; import com.youlai.system.model.form.UserRegisterForm; import com.youlai.system.model.query.UserPageQuery; +import com.youlai.mall.system.model.vo.*; import com.youlai.system.model.vo.*; -import com.youlai.system.service.SysUserService; +import com.youlai.system.service.UserService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -38,22 +39,22 @@ import java.util.List; * 用户控制器 * * @author Ray - * @since 2022/10/16 + * @since 0.0.1 */ @Tag(name = "01.用户接口") @RestController @RequestMapping("/api/v1/users") @RequiredArgsConstructor -public class SysUserController { +public class UserController { - private final SysUserService userService; + private final UserService userService; @Operation(summary = "用户分页列表") @GetMapping("/page") - public PageResult listPagedUsers( + public PageResult getUserPage( @ParameterObject UserPageQuery queryParams ) { - IPage result = userService.listPagedUsers(queryParams); + IPage result = userService.getUserPage(queryParams); return PageResult.success(result); } @@ -114,9 +115,9 @@ public class SysUserController { @Parameter(description = "用户ID") @PathVariable Long userId, @Parameter(description = "用户状态(1:启用;0:禁用)") @RequestParam Integer status ) { - boolean result = userService.update(new LambdaUpdateWrapper() - .eq(SysUser::getId, userId) - .set(SysUser::getStatus, status) + boolean result = userService.update(new LambdaUpdateWrapper() + .eq(User::getId, userId) + .set(User::getStatus, status) ); return Result.judge(result); } diff --git a/youlai-system/system-boot/src/main/java/com/youlai/system/converter/DeptConverter.java b/youlai-system/system-boot/src/main/java/com/youlai/system/converter/DeptConverter.java index f150d3484..53e53d09a 100644 --- a/youlai-system/system-boot/src/main/java/com/youlai/system/converter/DeptConverter.java +++ b/youlai-system/system-boot/src/main/java/com/youlai/system/converter/DeptConverter.java @@ -1,6 +1,6 @@ package com.youlai.system.converter; -import com.youlai.system.model.entity.SysDept; +import com.youlai.system.model.entity.Dept; import com.youlai.system.model.form.DeptForm; import com.youlai.system.model.vo.DeptVO; import org.mapstruct.Mapper; @@ -14,9 +14,9 @@ import org.mapstruct.Mapper; @Mapper(componentModel = "spring") public interface DeptConverter { - DeptForm convertToForm(SysDept entity); - DeptVO entity2Vo(SysDept entity); + DeptForm convertToForm(Dept entity); + DeptVO entity2Vo(Dept entity); - SysDept convertToForm(DeptForm deptForm); + Dept convertToForm(DeptForm deptForm); } \ No newline at end of file diff --git a/youlai-system/system-boot/src/main/java/com/youlai/system/converter/DictConverter.java b/youlai-system/system-boot/src/main/java/com/youlai/system/converter/DictConverter.java index cb28b4fd9..8b5b515ea 100644 --- a/youlai-system/system-boot/src/main/java/com/youlai/system/converter/DictConverter.java +++ b/youlai-system/system-boot/src/main/java/com/youlai/system/converter/DictConverter.java @@ -1,7 +1,7 @@ package com.youlai.system.converter; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.youlai.system.model.entity.SysDict; +import com.youlai.system.model.entity.Dict; import com.youlai.system.model.form.DictForm; import com.youlai.system.model.vo.DictPageVO; import org.mapstruct.Mapper; @@ -15,9 +15,9 @@ import org.mapstruct.Mapper; @Mapper(componentModel = "spring") public interface DictConverter { - Page convertToPageVo(Page page); + Page convertToPageVo(Page page); - DictForm convertToForm(SysDict entity); + DictForm convertToForm(Dict entity); - SysDict convertToEntity(DictForm entity); + Dict convertToEntity(DictForm entity); } diff --git a/youlai-system/system-boot/src/main/java/com/youlai/system/converter/DictItemConverter.java b/youlai-system/system-boot/src/main/java/com/youlai/system/converter/DictItemConverter.java index b1331c078..ad2293615 100644 --- a/youlai-system/system-boot/src/main/java/com/youlai/system/converter/DictItemConverter.java +++ b/youlai-system/system-boot/src/main/java/com/youlai/system/converter/DictItemConverter.java @@ -2,7 +2,7 @@ package com.youlai.system.converter; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.youlai.common.core.model.Option; -import com.youlai.system.model.entity.SysDictItem; +import com.youlai.system.model.entity.DictItem; import com.youlai.system.model.form.DictForm; import com.youlai.system.model.vo.DictPageVO; import org.mapstruct.Mapper; @@ -20,20 +20,20 @@ import java.util.List; @Mapper(componentModel = "spring") public interface DictItemConverter { - Page convertToPageVo(Page page); + Page convertToPageVo(Page page); - DictForm convertToForm(SysDictItem entity); + DictForm convertToForm(DictItem entity); - SysDictItem convertToEntity(DictForm.DictItem dictFormDictItems); - List convertToEntity(List dictFormDictItems); + DictItem convertToEntity(DictForm.DictItem dictFormDictItems); + List convertToEntity(List dictFormDictItems); - DictForm.DictItem convertToDictFormDictItem(SysDictItem entity); - List convertToDictFormDictItem(List entities); + DictForm.DictItem convertToDictFormDictItem(DictItem entity); + List convertToDictFormDictItem(List entities); @Mappings({ @Mapping(target = "value", source = "id"), @Mapping(target = "label", source = "name") }) - Option convertToOption(SysDictItem dictItem); - List