diff --git a/docs/sql/mysql5/oauth2_server.sql b/docs/sql/mysql5/oauth2_server.sql index 7889e0ae6..68f2e268f 100644 --- a/docs/sql/mysql5/oauth2_server.sql +++ b/docs/sql/mysql5/oauth2_server.sql @@ -10,9 +10,12 @@ use oauth2_server; SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; + + -- ---------------------------- -- 2.1 oauth2_authorization 令牌发放记录表 -- ---------------------------- +DROP TABLE IF EXISTS oauth2_authorization; CREATE TABLE oauth2_authorization ( id varchar(100) NOT NULL, registered_client_id varchar(100) NOT NULL, @@ -22,30 +25,30 @@ CREATE TABLE oauth2_authorization ( attributes blob DEFAULT NULL, state varchar(500) DEFAULT NULL, authorization_code_value blob DEFAULT NULL, - authorization_code_issued_at timestamp DEFAULT NULL, - authorization_code_expires_at timestamp DEFAULT NULL, + authorization_code_issued_at datetime DEFAULT NULL, + authorization_code_expires_at datetime DEFAULT NULL, authorization_code_metadata blob DEFAULT NULL, access_token_value blob DEFAULT NULL, - access_token_issued_at timestamp DEFAULT NULL, - access_token_expires_at timestamp DEFAULT NULL, + access_token_issued_at datetime DEFAULT NULL, + access_token_expires_at datetime DEFAULT NULL, access_token_metadata blob DEFAULT NULL, access_token_type varchar(100) DEFAULT NULL, access_token_scopes varchar(1000) DEFAULT NULL, oidc_id_token_value blob DEFAULT NULL, - oidc_id_token_issued_at timestamp DEFAULT NULL, - oidc_id_token_expires_at timestamp DEFAULT NULL, + oidc_id_token_issued_at datetime DEFAULT NULL, + oidc_id_token_expires_at datetime DEFAULT NULL, oidc_id_token_metadata blob DEFAULT NULL, refresh_token_value blob DEFAULT NULL, - refresh_token_issued_at timestamp DEFAULT NULL, - refresh_token_expires_at timestamp DEFAULT NULL, + refresh_token_issued_at datetime DEFAULT NULL, + refresh_token_expires_at datetime DEFAULT NULL, refresh_token_metadata blob DEFAULT NULL, user_code_value blob DEFAULT NULL, - user_code_issued_at timestamp DEFAULT NULL, - user_code_expires_at timestamp DEFAULT NULL, + user_code_issued_at datetime DEFAULT NULL, + user_code_expires_at datetime DEFAULT NULL, user_code_metadata blob DEFAULT NULL, device_code_value blob DEFAULT NULL, - device_code_issued_at timestamp DEFAULT NULL, - device_code_expires_at timestamp DEFAULT NULL, + device_code_issued_at datetime DEFAULT NULL, + device_code_expires_at datetime DEFAULT NULL, device_code_metadata blob DEFAULT NULL, PRIMARY KEY (id) ); @@ -53,6 +56,7 @@ CREATE TABLE oauth2_authorization ( -- ---------------------------- -- 2.2 oauth2_authorization_consent 授权记录表 -- ---------------------------- +DROP TABLE IF EXISTS oauth2_authorization_consent; CREATE TABLE oauth2_authorization_consent ( registered_client_id varchar(100) NOT NULL, principal_name varchar(200) NOT NULL, @@ -63,12 +67,13 @@ CREATE TABLE oauth2_authorization_consent ( -- ---------------------------- -- 2.3 oauth2-registered-client OAuth2 客户端信息表 -- ---------------------------- +DROP TABLE IF EXISTS oauth2_registered_client; CREATE TABLE oauth2_registered_client ( id varchar(100) NOT NULL, client_id varchar(100) NOT NULL, - client_id_issued_at timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + client_id_issued_at datetime DEFAULT CURRENT_TIMESTAMP NOT NULL, client_secret varchar(200) DEFAULT NULL, - client_secret_expires_at timestamp DEFAULT NULL, + client_secret_expires_at datetime DEFAULT NULL, client_name varchar(200) NOT NULL, client_authentication_methods varchar(1000) NOT NULL, authorization_grant_types varchar(1000) NOT NULL, diff --git a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/controller/app/CartController.java b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/controller/app/CartController.java index 0ea455765..f36e02887 100644 --- a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/controller/app/CartController.java +++ b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/controller/app/CartController.java @@ -2,7 +2,7 @@ package com.youlai.mall.oms.controller.app; import com.youlai.common.result.Result; import com.youlai.common.security.util.SecurityUtils; -import com.youlai.mall.oms.model.dto.CartItemDTO; +import com.youlai.mall.oms.model.dto.CartItemDto; import com.youlai.mall.oms.service.app.CartService; import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; @@ -30,7 +30,7 @@ public class CartController { @Operation(summary = "查询购物车") @GetMapping public Result getCart() { - List result = cartService.listCartItems(SecurityUtils.getMemberId()); + List result = cartService.listCartItems(SecurityUtils.getMemberId()); return Result.success((T) result); } @@ -52,7 +52,7 @@ public class CartController { @PutMapping("/skuId/{skuId}") public Result updateCartItem( @PathVariable Long skuId, - @RequestBody CartItemDTO cartItem + @RequestBody CartItemDto cartItem ) { cartItem.setSkuId(skuId); boolean result = cartService.updateCartItem(cartItem); diff --git a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/converter/CartConverter.java b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/converter/CartConverter.java index 847da7932..715d69dd3 100644 --- a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/converter/CartConverter.java +++ b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/converter/CartConverter.java @@ -1,7 +1,7 @@ package com.youlai.mall.oms.converter; -import com.youlai.mall.oms.model.dto.CartItemDTO; +import com.youlai.mall.oms.model.dto.CartItemDto; import com.youlai.mall.pms.model.dto.SkuInfoDTO; import org.mapstruct.Mapper; import org.mapstruct.Mapping; @@ -19,6 +19,6 @@ public interface CartConverter { @Mappings({ @Mapping(target = "skuId", source = "id"), }) - CartItemDTO sku2CartItem(SkuInfoDTO skuInfo); + CartItemDto sku2CartItem(SkuInfoDTO skuInfo); } \ No newline at end of file diff --git a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/model/dto/CartItemDto.java b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/model/dto/CartItemDto.java new file mode 100644 index 000000000..682323d1a --- /dev/null +++ b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/model/dto/CartItemDto.java @@ -0,0 +1,30 @@ +package com.youlai.mall.oms.model.dto; + +import lombok.Data; + +import java.io.Serializable; +/** + * 购物车商品项 + * + * @author Ray Hao + * @since 0.0.1 + */ +@Data +public class CartItemDto implements Serializable { + + /** + * 商品库存ID + */ + private Long skuId; + + /** + * 商品数量 + */ + private Integer count; + + /** + * 是否选中 + */ + private Boolean checked; + +} diff --git a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/model/dto/CartItemDTO.java b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/model/dto/CartItemVo.java similarity index 50% rename from mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/model/dto/CartItemDTO.java rename to mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/model/dto/CartItemVo.java index 7d70af96e..b868847f5 100644 --- a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/model/dto/CartItemDTO.java +++ b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/model/dto/CartItemVo.java @@ -3,12 +3,16 @@ package com.youlai.mall.oms.model.dto; import lombok.Data; import java.io.Serializable; +import java.util.Set; /** - * 购物车商品传输层实体 + * 购物车商品项 + * + * @author Ray Hao + * @since 0.0.1 */ @Data -public class CartItemDTO implements Serializable { +public class CartItemVo implements Serializable { /** * 商品库存ID @@ -16,48 +20,38 @@ public class CartItemDTO implements Serializable { private Long skuId; /** - * 商品库存名称 + * 商品名称 */ - private String skuName; + private String spuName; /** - * 商品编码 + * 规格集合 */ - private String skuSn; + private Set specs; /** * 商品图片 */ - private String picUrl; + private String imageUrl; /** - * 商品数量 + * 加购数量· */ private Integer count; /** - * 加入购物车时价格,因会变动,不能作为订单计算因子,订单提交时需验价 + * 商品价格 */ private Long price; - /** - * 优惠券金额 - */ - private Long coupon; - /** * 是否选中 */ private Boolean checked; /** - * 商品库存数量,页面控制能选择最大数量 + * 商品库存 */ private Integer stock; - /** - * 商品名称 - */ - private String spuName; - } diff --git a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/app/CartService.java b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/app/CartService.java index 1f71e4740..9d9ac6ead 100644 --- a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/app/CartService.java +++ b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/app/CartService.java @@ -1,6 +1,6 @@ package com.youlai.mall.oms.service.app; -import com.youlai.mall.oms.model.dto.CartItemDTO; +import com.youlai.mall.oms.model.dto.CartItemDto; import java.util.List; @@ -12,13 +12,13 @@ import java.util.List; */ public interface CartService { - List listCartItems(Long memberId); + List listCartItems(Long memberId); boolean deleteCart(); boolean addCartItem(Long skuId); - boolean updateCartItem(CartItemDTO cartItem); + boolean updateCartItem(CartItemDto cartItem); boolean removeCartItem(Long skuId); diff --git a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/app/impl/CartServiceImpl.java b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/app/impl/CartServiceImpl.java index 9018972b8..ddd556b95 100644 --- a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/app/impl/CartServiceImpl.java +++ b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/app/impl/CartServiceImpl.java @@ -5,7 +5,7 @@ import com.youlai.common.security.util.SecurityUtils; import com.youlai.common.web.exception.BizException; import com.youlai.mall.oms.constant.OrderConstants; import com.youlai.mall.oms.converter.CartConverter; -import com.youlai.mall.oms.model.dto.CartItemDTO; +import com.youlai.mall.oms.model.dto.CartItemDto; import com.youlai.mall.oms.service.app.CartService; import com.youlai.mall.pms.api.SkuFeignClient; import com.youlai.mall.pms.model.dto.SkuInfoDTO; @@ -39,10 +39,10 @@ public class CartServiceImpl implements CartService { private final CartConverter cartConverter; @Override - public List listCartItems(Long memberId) { + public List listCartItems(Long memberId) { if (memberId != null) { BoundHashOperations cartHashOperations = getCartHashOperations(memberId); - List cartItems = cartHashOperations.values(); + List cartItems = cartHashOperations.values(); return cartItems; } return Collections.EMPTY_LIST; @@ -64,10 +64,10 @@ public class CartServiceImpl implements CartService { @Override public boolean addCartItem(Long skuId) { Long memberId = SecurityUtils.getMemberId(); - BoundHashOperations cartHashOperations = getCartHashOperations(memberId); + BoundHashOperations cartHashOperations = getCartHashOperations(memberId); String hKey = String.valueOf(skuId); - CartItemDTO cartItem = cartHashOperations.get(hKey); + CartItemDto cartItem = cartHashOperations.get(hKey); if (cartItem != null) { // 购物车已存在该商品,更新商品数量 @@ -90,7 +90,7 @@ public class CartServiceImpl implements CartService { * 更新购物车总商品数量、选中状态 */ @Override - public boolean updateCartItem(CartItemDTO cartItem) { + public boolean updateCartItem(CartItemDto cartItem) { Long memberId; try { memberId = SecurityUtils.getMemberId(); @@ -100,7 +100,7 @@ public class CartServiceImpl implements CartService { BoundHashOperations cartHashOperations = getCartHashOperations(memberId); String hKey = cartItem.getSkuId() + ""; if (cartHashOperations.get(hKey) != null) { - CartItemDTO cacheCartItem = (CartItemDTO) cartHashOperations.get(hKey); + CartItemDto cacheCartItem = (CartItemDto) cartHashOperations.get(hKey); if (cartItem.getChecked() != null) { cacheCartItem.setChecked(cartItem.getChecked()); } @@ -143,7 +143,7 @@ public class CartServiceImpl implements CartService { } BoundHashOperations cartHashOperations = getCartHashOperations(memberId); for (Object value : cartHashOperations.values()) { - CartItemDTO cartItem = (CartItemDTO) value; + CartItemDto cartItem = (CartItemDto) value; cartItem.setChecked(checked); String hKey = cartItem.getSkuId() + ""; cartHashOperations.put(hKey, cartItem); @@ -165,7 +165,7 @@ public class CartServiceImpl implements CartService { } BoundHashOperations cartHashOperations = getCartHashOperations(memberId); for (Object value : cartHashOperations.values()) { - CartItemDTO cartItem = (CartItemDTO) value; + CartItemDto cartItem = (CartItemDto) value; if (cartItem.getChecked()) { cartHashOperations.delete(cartItem.getSkuId() + ""); } diff --git a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/app/impl/OrderServiceImpl.java b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/app/impl/OrderServiceImpl.java index f2b8ef52a..4126f06c2 100644 --- a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/app/impl/OrderServiceImpl.java +++ b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/app/impl/OrderServiceImpl.java @@ -31,7 +31,7 @@ import com.youlai.mall.oms.enums.OrderStatusEnum; import com.youlai.mall.oms.enums.PaymentMethodEnum; import com.youlai.mall.oms.mapper.OrderMapper; import com.youlai.mall.oms.model.bo.OrderBO; -import com.youlai.mall.oms.model.dto.CartItemDTO; +import com.youlai.mall.oms.model.dto.CartItemDto; import com.youlai.mall.oms.model.dto.OrderItemDTO; import com.youlai.mall.oms.model.entity.OmsOrder; import com.youlai.mall.oms.model.entity.OmsOrderItem; @@ -461,9 +461,9 @@ public class OrderServiceImpl extends ServiceImpl impleme orderItemDTO.setQuantity(1); // 直接购买商品的数量为1 orderItems.add(orderItemDTO); } else { // 购物车结算 - List cartItems = cartService.listCartItems(memberId); + List cartItems = cartService.listCartItems(memberId); orderItems = cartItems.stream() - .filter(CartItemDTO::getChecked) + .filter(CartItemDto::getChecked) .map(cartItem -> { OrderItemDTO orderItemDTO = new OrderItemDTO(); BeanUtil.copyProperties(cartItem, orderItemDTO); diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/app/AdvertController.java b/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/app/AdvertController.java index 50c2d950f..8e4d647fe 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/app/AdvertController.java +++ b/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/app/AdvertController.java @@ -1,7 +1,7 @@ package com.youlai.mall.sms.controller.app; import com.youlai.common.result.Result; -import com.youlai.mall.sms.model.vo.AdBannerVO; +import com.youlai.mall.sms.model.vo.BannerVO; import com.youlai.mall.sms.service.SmsAdvertService; import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; @@ -21,10 +21,10 @@ import java.util.List; public class AdvertController { private SmsAdvertService smsAdvertService; - @Operation(summary= "广告横幅列表") + @Operation(summary= "APP首页广告横幅列表") @GetMapping("/banners") - public Result> listAdBanners() { - List list = smsAdvertService.listAdBanners(); + public Result> getBannerList() { + List list = smsAdvertService.getBannerList(); return Result.success(list); } } diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/converter/AdvertConverter.java b/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/converter/AdvertConverter.java index 3270bdc45..54ea69653 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/converter/AdvertConverter.java +++ b/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/converter/AdvertConverter.java @@ -3,7 +3,7 @@ package com.youlai.mall.sms.converter; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.youlai.mall.sms.model.entity.SmsAdvert; -import com.youlai.mall.sms.model.vo.AdBannerVO; +import com.youlai.mall.sms.model.vo.BannerVO; import com.youlai.mall.sms.model.vo.AdvertPageVO; import org.mapstruct.Mapper; @@ -22,7 +22,7 @@ public interface AdvertConverter { Page entity2PageVo(Page po); - AdBannerVO entity2BannerVo(SmsAdvert entity); + BannerVO entity2BannerVo(SmsAdvert entity); - List entity2BannerVo(List entities); + List entity2BannerVo(List entities); } \ No newline at end of file diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsAdvert.java b/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsAdvert.java index 84e5be6ef..b9877d9b2 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsAdvert.java +++ b/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsAdvert.java @@ -16,10 +16,10 @@ public class SmsAdvert extends BaseEntity { private String title; - private String picUrl; + private String imageUrl; @JsonFormat( pattern = "yyyy-MM-dd", timezone = "GMT+8") - private Date beginTime; + private Date startTime; @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date endTime; diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/vo/AdBannerVO.java b/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/vo/BannerVO.java similarity index 75% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/vo/AdBannerVO.java rename to mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/vo/BannerVO.java index 02598351d..1a0556187 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/vo/AdBannerVO.java +++ b/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/vo/BannerVO.java @@ -3,15 +3,15 @@ package com.youlai.mall.sms.model.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@Schema(description = "广告横幅对象") +@Schema(description = "横幅视图对象") @Data -public class AdBannerVO { +public class BannerVO { @Schema(description="广告标题") private String title; @Schema(description="横幅图片URL") - private String picUrl; + private String imageUrl; @Schema(description="跳转URL") private String redirectUrl; diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/SmsAdvertService.java b/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/SmsAdvertService.java index 212bf6c97..c32af1b14 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/SmsAdvertService.java +++ b/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/SmsAdvertService.java @@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.youlai.mall.sms.model.entity.SmsAdvert; import com.youlai.mall.sms.model.query.AdvertPageQuery; -import com.youlai.mall.sms.model.vo.AdBannerVO; +import com.youlai.mall.sms.model.vo.BannerVO; import com.youlai.mall.sms.model.vo.AdvertPageVO; import java.util.List; @@ -19,5 +19,5 @@ public interface SmsAdvertService extends IService { */ Page getAdvertPage(AdvertPageQuery queryParams); - List listAdBanners(); + List getBannerList(); } diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/impl/SmsAdvertServiceImpl.java b/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/impl/SmsAdvertServiceImpl.java index d5881de90..826191477 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/impl/SmsAdvertServiceImpl.java +++ b/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/impl/SmsAdvertServiceImpl.java @@ -8,7 +8,7 @@ import com.youlai.mall.sms.converter.AdvertConverter; import com.youlai.mall.sms.model.entity.SmsAdvert; import com.youlai.mall.sms.mapper.SmsAdvertMapper; import com.youlai.mall.sms.model.query.AdvertPageQuery; -import com.youlai.mall.sms.model.vo.AdBannerVO; +import com.youlai.mall.sms.model.vo.BannerVO; import com.youlai.mall.sms.model.vo.AdvertPageVO; import com.youlai.mall.sms.service.SmsAdvertService; import lombok.RequiredArgsConstructor; @@ -19,7 +19,7 @@ import java.util.List; /** * 广告业务实现类 * - * @author haoxr + * @author Ray Hao * @since 2022/5/28 */ @Service @@ -31,33 +31,27 @@ public class SmsAdvertServiceImpl extends ServiceImpl getAdvertPage(AdvertPageQuery queryParams) { - Page entities = this.baseMapper.getAdvertPage(new Page<>(queryParams.getPageNum(), + Page page = this.baseMapper.getAdvertPage(new Page<>(queryParams.getPageNum(), queryParams.getPageSize()), queryParams); - - Page advertVOPage = advertConverter.entity2PageVo(entities); - - return advertVOPage; + return advertConverter.entity2PageVo(page); } /** - * 广告横幅列表对象 - * - * @return + * 获取广告横幅列表 */ @Override - public List listAdBanners() { + public List getBannerList() { List entities = this.list(new LambdaQueryWrapper(). eq(SmsAdvert::getStatus, StatusEnum.ENABLE.getValue()) - .select(SmsAdvert::getTitle, SmsAdvert::getPicUrl, SmsAdvert::getRedirectUrl) + .select(SmsAdvert::getTitle, SmsAdvert::getImageUrl, SmsAdvert::getRedirectUrl) ); - List list = advertConverter.entity2BannerVo(entities); - return list; + return advertConverter.entity2BannerVo(entities); } } diff --git a/youlai-common/common-security/src/main/java/com/youlai/common/security/config/ResourceServerConfig.java b/youlai-common/common-security/src/main/java/com/youlai/common/security/config/ResourceServerConfig.java index 992dac1a3..bdc952084 100644 --- a/youlai-common/common-security/src/main/java/com/youlai/common/security/config/ResourceServerConfig.java +++ b/youlai-common/common-security/src/main/java/com/youlai/common/security/config/ResourceServerConfig.java @@ -12,6 +12,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.convert.converter.Converter; import org.springframework.security.authentication.AbstractAuthenticationToken; +import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer; @@ -38,6 +39,7 @@ import java.util.List; @ConfigurationProperties(prefix = "security") @Configuration @EnableWebSecurity +@EnableMethodSecurity @RequiredArgsConstructor @Slf4j public class ResourceServerConfig { 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/SysDictController.java index 6f51be2f7..8a6c18351 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/SysDictController.java @@ -140,4 +140,14 @@ public class SysDictController { return Result.judge(result); } + @Operation(summary = "获取字典类型的数据项") + @GetMapping("/types/{typeCode}/items") + public Result> listDictTypeItems( + @Parameter(description ="字典类型编码") @PathVariable String typeCode + ) { + List