2024.7.30 新元素官网
This commit is contained in:
		
							parent
							
								
									2b84036f44
								
							
						
					
					
						commit
						e8d14dda95
					
				| @ -8,8 +8,10 @@ import com.ruoyi.common.enums.BusinessType; | ||||
| import com.ruoyi.common.utils.poi.ExcelUtil; | ||||
| import com.ruoyi.common.utils.sign.Base64; | ||||
| import com.ruoyi.system.domain.XysArticle; | ||||
| import com.ruoyi.system.domain.XysCategory; | ||||
| import com.ruoyi.system.domain.XysImg; | ||||
| import com.ruoyi.system.service.IXysArticleService; | ||||
| import com.ruoyi.system.service.IXysCategoryService; | ||||
| import com.ruoyi.system.service.IXysImgService; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| @ -32,6 +34,8 @@ public class DoorController extends BaseController | ||||
|     private IXysArticleService xysArticleService; | ||||
|     @Autowired | ||||
|     private IXysImgService xysImgService; | ||||
|     @Autowired | ||||
|     private IXysCategoryService categoryService; | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
| @ -45,7 +49,7 @@ public class DoorController extends BaseController | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 查询新闻动态文章列表 | ||||
|      * 查询文章列表 | ||||
|      */ | ||||
|     @GetMapping("/getArticleList") | ||||
|     public TableDataInfo getArticleList(XysArticle xysArticle) | ||||
| @ -75,4 +79,15 @@ public class DoorController extends BaseController | ||||
|         return success(xysArticleService.selectXysArticleById(id)); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 获取文章管理详细信息 | ||||
|      */ | ||||
|     @GetMapping(value = "/getCategory/{parentId}") | ||||
|     public AjaxResult getCategory(@PathVariable("parentId") Long parentId) | ||||
|     { | ||||
|         XysCategory category = new XysCategory(); | ||||
|         category.setParentId(parentId); | ||||
|         return success(categoryService.selectXysCategoryList(category)); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  | ||||
| @ -22,6 +22,16 @@ public class XysCategory extends BaseEntity | ||||
|     @Excel(name = "上级分类") | ||||
|     private Long parentId; | ||||
| 
 | ||||
|     public String getParentName() { | ||||
|         return parentName; | ||||
|     } | ||||
| 
 | ||||
|     public void setParentName(String parentName) { | ||||
|         this.parentName = parentName; | ||||
|     } | ||||
| 
 | ||||
|     private String parentName; | ||||
| 
 | ||||
|     /** 分类名称 */ | ||||
|     @Excel(name = "分类名称") | ||||
|     private String title; | ||||
|  | ||||
| @ -41,7 +41,14 @@ public class XysCategoryServiceImpl implements IXysCategoryService | ||||
|     @Override | ||||
|     public List<XysCategory> selectXysCategoryList(XysCategory xysCategory) | ||||
|     { | ||||
|         return xysCategoryMapper.selectXysCategoryList(xysCategory); | ||||
|         List<XysCategory> list = xysCategoryMapper.selectXysCategoryList(xysCategory); | ||||
|         for(XysCategory category:list){ | ||||
|             if(category.getParentId() != null){ | ||||
|                 XysCategory cg = xysCategoryMapper.selectXysCategoryById(category.getParentId()); | ||||
|                 category.setParentName(cg.getTitle()); | ||||
|             } | ||||
|         } | ||||
|         return list; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user