文章分类新增可选商户帮助中心
This commit is contained in:
parent
c637407334
commit
f02ba8bb3e
|
@ -4,9 +4,12 @@ import com.ruoyi.common.annotation.Excel;
|
||||||
import com.ruoyi.common.core.domain.TreeEntity;
|
import com.ruoyi.common.core.domain.TreeEntity;
|
||||||
import com.ruoyi.common.core.interfaces.LogBizParam;
|
import com.ruoyi.common.core.interfaces.LogBizParam;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.validate.ValidGroup;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文章分类对象 bst_article_category
|
* 文章分类对象 bst_article_category
|
||||||
*
|
*
|
||||||
|
@ -22,12 +25,19 @@ public class ArticleCategory extends TreeEntity implements LogBizParam
|
||||||
|
|
||||||
@Excel(name = "分类名称")
|
@Excel(name = "分类名称")
|
||||||
@ApiModelProperty("分类名称")
|
@ApiModelProperty("分类名称")
|
||||||
|
@NotBlank(message = "分类名称不能为空", groups = {ValidGroup.Create.class})
|
||||||
private String categoryName;
|
private String categoryName;
|
||||||
|
|
||||||
@Excel(name = "状态:0-禁用 1-启用")
|
@Excel(name = "状态:0-禁用 1-启用")
|
||||||
@ApiModelProperty("状态:0-禁用 1-启用")
|
@ApiModelProperty("状态:0-禁用 1-启用")
|
||||||
|
@NotBlank(message = "状态不能为空", groups = {ValidGroup.Create.class})
|
||||||
private String categoryStatus;
|
private String categoryStatus;
|
||||||
|
|
||||||
|
@Excel(name = "类型:1-其他 2-商户帮助中心")
|
||||||
|
@ApiModelProperty("类型:1-其他 2-商户帮助中心")
|
||||||
|
@NotBlank(message = "文章类型不能为空", groups = {ValidGroup.Create.class})
|
||||||
|
private String type;
|
||||||
|
|
||||||
@Excel(name = "父分类ID")
|
@Excel(name = "父分类ID")
|
||||||
@ApiModelProperty("父分类ID")
|
@ApiModelProperty("父分类ID")
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
|
|
|
@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="categoryStatus" column="category_status" />
|
<result property="categoryStatus" column="category_status" />
|
||||||
<result property="sort" column="sort" />
|
<result property="sort" column="sort" />
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="type" column="type" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectArticleCategoryVo">
|
<sql id="selectArticleCategoryVo">
|
||||||
|
@ -20,6 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
bac.parent_id,
|
bac.parent_id,
|
||||||
bac.category_status,
|
bac.category_status,
|
||||||
bac.sort,
|
bac.sort,
|
||||||
|
bac.type,
|
||||||
bac.create_time
|
bac.create_time
|
||||||
from bst_article_category bac
|
from bst_article_category bac
|
||||||
</sql>
|
</sql>
|
||||||
|
@ -30,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="query.parentId != null "> and bac.parent_id = #{query.parentId}</if>
|
<if test="query.parentId != null "> and bac.parent_id = #{query.parentId}</if>
|
||||||
<if test="query.categoryStatus != null "> and bac.category_status = #{query.categoryStatus}</if>
|
<if test="query.categoryStatus != null "> and bac.category_status = #{query.categoryStatus}</if>
|
||||||
<if test="query.sort != null "> and bac.sort = #{query.sort}</if>
|
<if test="query.sort != null "> and bac.sort = #{query.sort}</if>
|
||||||
|
<if test="query.type != null "> and bac.type = #{query.type}</if>
|
||||||
${query.params.dataScope}
|
${query.params.dataScope}
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
@ -68,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="categoryStatus != null">category_status,</if>
|
<if test="categoryStatus != null">category_status,</if>
|
||||||
<if test="sort != null">sort,</if>
|
<if test="sort != null">sort,</if>
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="type != null">type,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="categoryName != null and categoryName != ''">#{categoryName},</if>
|
<if test="categoryName != null and categoryName != ''">#{categoryName},</if>
|
||||||
|
@ -75,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="categoryStatus != null">#{categoryStatus},</if>
|
<if test="categoryStatus != null">#{categoryStatus},</if>
|
||||||
<if test="sort != null">#{sort},</if>
|
<if test="sort != null">#{sort},</if>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="type != null">#{type},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
@ -188,6 +193,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="categoryStatus != null">category_status = #{data.categoryStatus},</if>
|
<if test="categoryStatus != null">category_status = #{data.categoryStatus},</if>
|
||||||
<if test="sort != null">sort = #{data.sort},</if>
|
<if test="sort != null">sort = #{data.sort},</if>
|
||||||
<if test="createTime != null">create_time = #{data.createTime},</if>
|
<if test="createTime != null">create_time = #{data.createTime},</if>
|
||||||
|
<if test="type != null">type = #{data.type},</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<delete id="deleteArticleCategoryById" parameterType="Long">
|
<delete id="deleteArticleCategoryById" parameterType="Long">
|
||||||
|
|
|
@ -4,8 +4,10 @@ import java.util.List;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.validate.ValidGroup;
|
||||||
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;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
@ -80,7 +82,7 @@ public class ArticleCategoryController extends BaseController
|
||||||
@PreAuthorize("@ss.hasPermi('bst:articleCategory:add')")
|
@PreAuthorize("@ss.hasPermi('bst:articleCategory:add')")
|
||||||
@Log(title = "新增文章分类", businessType = BusinessType.INSERT, bizIdName = "arg0", bizType = LogBizType.ARTICLE_CATEGORY)
|
@Log(title = "新增文章分类", businessType = BusinessType.INSERT, bizIdName = "arg0", bizType = LogBizType.ARTICLE_CATEGORY)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody ArticleCategory articleCategory )
|
public AjaxResult add(@RequestBody @Validated(ValidGroup.Create.class) ArticleCategory articleCategory )
|
||||||
{
|
{
|
||||||
return toAjax(articleCategoryService.insertArticleCategory(articleCategory));
|
return toAjax(articleCategoryService.insertArticleCategory(articleCategory));
|
||||||
}
|
}
|
||||||
|
@ -93,7 +95,7 @@ public class ArticleCategoryController extends BaseController
|
||||||
@PreAuthorize("@ss.hasPermi('bst:articleCategory:edit')")
|
@PreAuthorize("@ss.hasPermi('bst:articleCategory:edit')")
|
||||||
@Log(title = "修改文章分类", businessType = BusinessType.UPDATE, bizIdName = "arg0", bizType = LogBizType.ARTICLE_CATEGORY)
|
@Log(title = "修改文章分类", businessType = BusinessType.UPDATE, bizIdName = "arg0", bizType = LogBizType.ARTICLE_CATEGORY)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody ArticleCategory articleCategory)
|
public AjaxResult edit(@RequestBody @Validated(ValidGroup.Update.class) ArticleCategory articleCategory)
|
||||||
{
|
{
|
||||||
return toAjax(articleCategoryService.updateArticleCategory(articleCategory));
|
return toAjax(articleCategoryService.updateArticleCategory(articleCategory));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user