2024.7.30 新元素官网

This commit is contained in:
lee 2024-07-30 08:52:34 +08:00
parent 2b84036f44
commit e8d14dda95
3 changed files with 34 additions and 2 deletions

View File

@ -8,8 +8,10 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.utils.sign.Base64; import com.ruoyi.common.utils.sign.Base64;
import com.ruoyi.system.domain.XysArticle; import com.ruoyi.system.domain.XysArticle;
import com.ruoyi.system.domain.XysCategory;
import com.ruoyi.system.domain.XysImg; import com.ruoyi.system.domain.XysImg;
import com.ruoyi.system.service.IXysArticleService; import com.ruoyi.system.service.IXysArticleService;
import com.ruoyi.system.service.IXysCategoryService;
import com.ruoyi.system.service.IXysImgService; import com.ruoyi.system.service.IXysImgService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@ -32,6 +34,8 @@ public class DoorController extends BaseController
private IXysArticleService xysArticleService; private IXysArticleService xysArticleService;
@Autowired @Autowired
private IXysImgService xysImgService; private IXysImgService xysImgService;
@Autowired
private IXysCategoryService categoryService;
/** /**
@ -45,7 +49,7 @@ public class DoorController extends BaseController
} }
/** /**
* 查询新闻动态文章列表 * 查询文章列表
*/ */
@GetMapping("/getArticleList") @GetMapping("/getArticleList")
public TableDataInfo getArticleList(XysArticle xysArticle) public TableDataInfo getArticleList(XysArticle xysArticle)
@ -75,4 +79,15 @@ public class DoorController extends BaseController
return success(xysArticleService.selectXysArticleById(id)); 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));
}
} }

View File

@ -22,6 +22,16 @@ public class XysCategory extends BaseEntity
@Excel(name = "上级分类") @Excel(name = "上级分类")
private Long parentId; private Long parentId;
public String getParentName() {
return parentName;
}
public void setParentName(String parentName) {
this.parentName = parentName;
}
private String parentName;
/** 分类名称 */ /** 分类名称 */
@Excel(name = "分类名称") @Excel(name = "分类名称")
private String title; private String title;

View File

@ -41,7 +41,14 @@ public class XysCategoryServiceImpl implements IXysCategoryService
@Override @Override
public List<XysCategory> selectXysCategoryList(XysCategory xysCategory) 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;
} }
/** /**