| | |
| | | package com.qianwen.smartman.modules.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.validation.Valid; |
| | | import com.qianwen.smartman.common.cache.RegionCache; |
| | | import com.qianwen.smartman.common.utils.Lambda; |
| | | |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.qianwen.core.boot.ctrl.BladeController; |
| | | import com.qianwen.core.mp.support.Condition; |
| | | import com.qianwen.core.mp.support.Query; |
| | |
| | | import com.qianwen.core.scanner.modular.stereotype.ApiResource; |
| | | import com.qianwen.core.tool.api.R; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.cache.RegionCache; |
| | | import com.qianwen.smartman.common.utils.Lambda; |
| | | import com.qianwen.smartman.modules.system.convert.GalleryConvert; |
| | | import com.qianwen.smartman.modules.system.convert.GalleryItemConvert; |
| | | import com.qianwen.smartman.modules.system.entity.Gallery; |
| | |
| | | import com.qianwen.smartman.modules.system.service.IGalleryService; |
| | | import com.qianwen.smartman.modules.system.vo.GalleryTreeVO; |
| | | import com.qianwen.smartman.modules.system.vo.GalleryVO; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | @Api(value = "图库管理", tags = {"图库管理"}) |
| | |
| | | public class GalleryController extends BladeController { |
| | | private IGalleryService galleryService; |
| | | private IGalleryItemService galleryItemService; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case 98245393: |
| | | if (implMethodName.equals("getId")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | case 309945687: |
| | | if (implMethodName.equals("getGalleryId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | } |
| | | switch (z) { |
| | | case false: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getId(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/GalleryItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getGalleryId(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | public GalleryController(final IGalleryService galleryService, final IGalleryItemService galleryItemService) { |
| | | this.galleryService = galleryService; |
| | |
| | | List<Gallery> list = this.galleryService.list(Lambda.create()); |
| | | List<GalleryTreeVO> treeVOS = GalleryConvert.INSTANCE.convertTree(list); |
| | | for (GalleryTreeVO tree : treeVOS) { |
| | | List<GalleryItem> items = this.galleryItemService.list(Lambda.eq(GalleryItem::getGalleryId, tree.getId()).limit(count).orderByDesc(GalleryItem::getId)); |
| | | /* |
| | | List<GalleryItem> items = this.galleryItemService.list((Wrapper) Lambda.eq((v0) -> { |
| | | return v0.getGalleryId(); |
| | | }, tree.getId()).limit(count).orderByDesc((v0) -> { |
| | | return v0.getId(); |
| | | })); |
| | | }));*/ |
| | | tree.setChildren(GalleryItemConvert.INSTANCE.convert(items)); |
| | | } |
| | | return R.data(treeVOS); |