文章分类新增可选商户帮助中心
This commit is contained in:
parent
0944cb3cfa
commit
af02a0ae0b
|
@ -0,0 +1,13 @@
|
|||
package com.ruoyi.bst.articleCategory.domain.enums;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ArticleCategoryType {
|
||||
OTHERS("1", "其他"),
|
||||
STOREHELP("2", "商户帮助中心");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
}
|
|
@ -172,7 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</update>
|
||||
|
||||
<update id="updateArticleCategory" parameterType="ArticleCategory">
|
||||
update bst_article_category
|
||||
update bst_article_category bac
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<include refid="updateColumns"/>
|
||||
</trim>
|
||||
|
@ -183,17 +183,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<update id="updateArticleCategorySortAndStatusOnly" parameterType="ArticleCategory">
|
||||
update bst_article_category set
|
||||
<if test="categoryStatus != null">category_status = #{categoryStatus},</if>
|
||||
<if test="sort != null">sort = #{sort}</if>
|
||||
<if test="sort != null">sort = #{sort},</if>
|
||||
<if test="type != null">type = #{type}</if>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="updateColumns">
|
||||
<if test="categoryName != null and categoryName != ''">category_name = #{data.categoryName},</if>
|
||||
<if test="parentId != null">parent_id = #{data.parentId},</if>
|
||||
<if test="categoryStatus != null">category_status = #{data.categoryStatus},</if>
|
||||
<if test="sort != null">sort = #{data.sort},</if>
|
||||
<if test="createTime != null">create_time = #{data.createTime},</if>
|
||||
<if test="type != null">type = #{data.type},</if>
|
||||
<if test="categoryName != null and categoryName != ''">bac.category_name = #{data.categoryName},</if>
|
||||
<if test="parentId != null">bac.parent_id = #{data.parentId},</if>
|
||||
<if test="categoryStatus != null">bac.category_status = #{data.categoryStatus},</if>
|
||||
<if test="sort != null">bac.sort = #{data.sort},</if>
|
||||
<if test="createTime != null">bac.create_time = #{data.createTime},</if>
|
||||
<if test="type != null">bac.type = #{data.type},</if>
|
||||
</sql>
|
||||
|
||||
<delete id="deleteArticleCategoryById" parameterType="Long">
|
||||
|
|
|
@ -113,7 +113,7 @@ public class ArticleCategoryServiceImpl implements ArticleCategoryService
|
|||
public int updateArticleCategory(ArticleCategory articleCategory)
|
||||
{
|
||||
ArticleCategoryVO vo = articleCategoryMapper.selectArticleCategoryById(articleCategory.getId());
|
||||
//检查是否仅修改排序或状态字段
|
||||
//检查是否需要分类校验
|
||||
if (vo != null && vo.getParentId().equals(articleCategory.getParentId())&&vo.getCategoryName().equals(articleCategory.getCategoryName())) {
|
||||
// 新增状态变更方向判断
|
||||
boolean isEnabling = vo.getCategoryStatus().equals(ArticleCategoryStatus.DISABLED.getCode())
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.ruoyi.bst.article.service.ArticleService;
|
|||
import com.ruoyi.bst.articleCategory.domain.ArticleCategoryQuery;
|
||||
import com.ruoyi.bst.articleCategory.domain.ArticleCategoryVO;
|
||||
import com.ruoyi.bst.articleCategory.domain.enums.ArticleCategoryStatus;
|
||||
import com.ruoyi.bst.articleCategory.domain.enums.ArticleCategoryType;
|
||||
import com.ruoyi.bst.articleCategory.service.ArticleCategoryService;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
|
@ -14,6 +15,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
@ -48,6 +50,17 @@ public class AppAtricleCategoryController extends BaseController {
|
|||
return getDataTable(articleCategoryService.selectArticleCategoryList(articleCategoryQuery));
|
||||
}
|
||||
|
||||
@ApiOperation("查询分类为商户帮助中心的分类信息")
|
||||
@GetMapping("/storeHelp/list")
|
||||
@Anonymous
|
||||
public TableDataInfo getStoreHelpArticle(ArticleCategoryQuery articleCategoryQuery) {
|
||||
startPage();
|
||||
//查询分类的文章
|
||||
articleCategoryQuery.setCategoryStatus(ArticleCategoryStatus.ENABLED.getCode());
|
||||
articleCategoryQuery.setType(ArticleCategoryType.STOREHELP.getCode());
|
||||
return getDataTable(articleCategoryService.selectArticleCategoryList(articleCategoryQuery));
|
||||
}
|
||||
|
||||
@ApiOperation("查询分类下的文章")
|
||||
@GetMapping("/article")
|
||||
@Anonymous
|
||||
|
|
Loading…
Reference in New Issue
Block a user