From 23101689139bb1cf5a65b77d1a9898e5142cfbf2 Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Fri, 2 Sep 2022 11:10:31 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=8F=90=E4=BA=A4=E5=AF=BC=E8=88=AA=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E6=A8=A1=E5=9D=97=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=202.=E6=9B=B4=E6=94=B9=E7=99=BB=E5=BD=95=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=94=A8=E6=88=B7id=E7=B1=BB=E5=9E=8B(=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=97=B6=E6=9C=AA=E8=BF=94=E5=9B=9E=E7=94=A8=E6=88=B7id)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SysNavigationStyleController.java | 79 +++++++++++++++++++ .../com/huoran/iasf/entity/SysColumn.java | 9 +++ .../com/huoran/iasf/entity/SysContent.java | 3 + .../iasf/entity/SysNavigationStyle.java | 52 ++++++++++++ .../iasf/mapper/SysNavigationStyleMapper.java | 15 ++++ .../mapper/xml/SysNavigationStyleMapper.xml | 15 ++++ .../service/SysNavigationStyleService.java | 14 ++++ .../impl/SysNavigationStyleServiceImpl.java | 26 ++++++ .../com/huoran/iasf/vo/resp/LoginRespVO.java | 2 +- 9 files changed, 214 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/huoran/iasf/controller/SysNavigationStyleController.java create mode 100644 src/main/java/com/huoran/iasf/entity/SysNavigationStyle.java create mode 100644 src/main/java/com/huoran/iasf/mapper/SysNavigationStyleMapper.java create mode 100644 src/main/java/com/huoran/iasf/mapper/xml/SysNavigationStyleMapper.xml create mode 100644 src/main/java/com/huoran/iasf/service/SysNavigationStyleService.java create mode 100644 src/main/java/com/huoran/iasf/service/impl/SysNavigationStyleServiceImpl.java diff --git a/src/main/java/com/huoran/iasf/controller/SysNavigationStyleController.java b/src/main/java/com/huoran/iasf/controller/SysNavigationStyleController.java new file mode 100644 index 0000000..bbf3327 --- /dev/null +++ b/src/main/java/com/huoran/iasf/controller/SysNavigationStyleController.java @@ -0,0 +1,79 @@ +package com.huoran.iasf.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.annotations.*; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.huoran.iasf.common.utils.R; +import org.springframework.beans.factory.annotation.Autowired; +import org.apache.commons.lang.StringUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.RequestParam; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import com.huoran.iasf.service.SysNavigationStyleService; +import com.huoran.iasf.entity.SysNavigationStyle; + +import java.util.List; + + +/** + * @描述:导航样式配置控制类 + * @作者: Rong + * @日期: 2022-09-01 + */ +@RestController +@RequestMapping("/sysNavigationStyle") +@Api(value = "导航样式配置:SysNavigationStyleController", tags = "R-导航样式配置") +public class SysNavigationStyleController { + + @Autowired + public SysNavigationStyleService service; + + + @PostMapping("/searchAllBySite") + @ApiOperation(value = "按站点搜索所有", response = SysNavigationStyle.class) + public R listByEntity(@ApiParam(name = "siteId", value = "站点id", required = true) @RequestParam Integer siteId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("site_id", siteId); + List pageList = service.list(queryWrapper); + return R.success(pageList); + } + + + @PostMapping("/findById") + @ApiOperation(value = "查询详情", response = SysNavigationStyle.class) + public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { + SysNavigationStyle sysNavigationStyle = service.getById(id); + return R.success(sysNavigationStyle); + } + + + @PostMapping("/save") + @ApiOperation(value = "新增", response = SysNavigationStyle.class) + public R save(@RequestBody @ApiParam(name = "导航样式配置对象", value = "传入json格式", required = true) SysNavigationStyle sysNavigationStyle) { + boolean addState = service.save(sysNavigationStyle); + return addState ? R.success() : R.fail("新增失败"); + } + + + @PostMapping("/update") + @ApiOperation(value = "修改", response = SysNavigationStyle.class) + public R update(@RequestBody @ApiParam(name = "导航样式配置对象", value = "传入json格式", required = true) SysNavigationStyle sysNavigationStyle) { + boolean updateState = service.updateById(sysNavigationStyle); + return updateState ? R.success() : R.fail("编辑失败"); + } + + + @PostMapping("/delete") + @ApiOperation(value = "删除", response = SysNavigationStyle.class) + public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { + boolean delState = service.removeById(id); + return delState ? R.success() : R.fail("删除失败"); + } +} + diff --git a/src/main/java/com/huoran/iasf/entity/SysColumn.java b/src/main/java/com/huoran/iasf/entity/SysColumn.java index df3e16b..524577d 100644 --- a/src/main/java/com/huoran/iasf/entity/SysColumn.java +++ b/src/main/java/com/huoran/iasf/entity/SysColumn.java @@ -106,6 +106,13 @@ public class SysColumn implements Serializable { @NotNull(message = "站点id不能为空!") private Integer siteId; + + @ApiModelProperty(value = "栏目副标题") + private String subtitle; + + + //----------------------非数据库字段Start---------------------- + @ApiModelProperty("子分类") @TableField(exist = false) private List children; @@ -129,4 +136,6 @@ public class SysColumn implements Serializable { return 0; } + //----------------------非数据库字段End---------------------- + } \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/entity/SysContent.java b/src/main/java/com/huoran/iasf/entity/SysContent.java index 03c6160..4bfca1d 100644 --- a/src/main/java/com/huoran/iasf/entity/SysContent.java +++ b/src/main/java/com/huoran/iasf/entity/SysContent.java @@ -107,4 +107,7 @@ public class SysContent implements Serializable { @ApiModelProperty(value = "站点id") @NotNull(message = "站点id不能为空!") private Integer siteId; + + @ApiModelProperty(value = "独立模板状态(0禁用;1启用)") + private Integer templateStatus; } \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/entity/SysNavigationStyle.java b/src/main/java/com/huoran/iasf/entity/SysNavigationStyle.java new file mode 100644 index 0000000..16044c3 --- /dev/null +++ b/src/main/java/com/huoran/iasf/entity/SysNavigationStyle.java @@ -0,0 +1,52 @@ +package com.huoran.iasf.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @描述:导航样式配置 + * @作者: Rong + * @日期: 2022-09-01 + */ +@Data +@ApiModel(value = "导航样式配置") +@TableName("sys_navigation_style") +public class SysNavigationStyle implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + @ApiModelProperty(value = "主键") + private Integer id; + + @ApiModelProperty(value = "导航样式") + private Integer navigationStyle; + + @ApiModelProperty(value = "样式模板") + private Integer styleTemplate; + + @ApiModelProperty(value = "站点id") + private Integer siteId; + + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT) + private Date createTime; + + @ApiModelProperty(value = "更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; + + @ApiModelProperty(value = "是否删除(1未删除;0已删除)") + @TableLogic + private Integer deleted; + + +} \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/mapper/SysNavigationStyleMapper.java b/src/main/java/com/huoran/iasf/mapper/SysNavigationStyleMapper.java new file mode 100644 index 0000000..d4ec26f --- /dev/null +++ b/src/main/java/com/huoran/iasf/mapper/SysNavigationStyleMapper.java @@ -0,0 +1,15 @@ +package com.huoran.iasf.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huoran.iasf.entity.SysNavigationStyle; +import org.apache.ibatis.annotations.Mapper; + +/** + * @描述:导航样式配置 Mapper 接口 + * @作者: Rong + * @日期: 2022-09-01 + */ +@Mapper +public interface SysNavigationStyleMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/mapper/xml/SysNavigationStyleMapper.xml b/src/main/java/com/huoran/iasf/mapper/xml/SysNavigationStyleMapper.xml new file mode 100644 index 0000000..e466f85 --- /dev/null +++ b/src/main/java/com/huoran/iasf/mapper/xml/SysNavigationStyleMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/service/SysNavigationStyleService.java b/src/main/java/com/huoran/iasf/service/SysNavigationStyleService.java new file mode 100644 index 0000000..9df908e --- /dev/null +++ b/src/main/java/com/huoran/iasf/service/SysNavigationStyleService.java @@ -0,0 +1,14 @@ +package com.huoran.iasf.service; + +import com.huoran.iasf.entity.SysNavigationStyle; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @描述:导航样式配置 service接口 + * @作者: Rong + * @日期: 2022-09-01 + */ +public interface SysNavigationStyleService extends IService { + + +} \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/service/impl/SysNavigationStyleServiceImpl.java b/src/main/java/com/huoran/iasf/service/impl/SysNavigationStyleServiceImpl.java new file mode 100644 index 0000000..3b1e289 --- /dev/null +++ b/src/main/java/com/huoran/iasf/service/impl/SysNavigationStyleServiceImpl.java @@ -0,0 +1,26 @@ +package com.huoran.iasf.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huoran.iasf.entity.SysNavigationStyle; +import com.huoran.iasf.mapper.SysNavigationStyleMapper; +import com.huoran.iasf.service.SysNavigationStyleService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; + +import javax.annotation.Resource; + +/** + * @描述:导航样式配置 服务类 + * @作者: Rong + * @日期: 2022-09-01 + */ +@Service +public class SysNavigationStyleServiceImpl extends ServiceImpl implements SysNavigationStyleService { + + @Autowired + private SysNavigationStyleMapper mapper; + +} + + + diff --git a/src/main/java/com/huoran/iasf/vo/resp/LoginRespVO.java b/src/main/java/com/huoran/iasf/vo/resp/LoginRespVO.java index 0f62d01..bec95f3 100644 --- a/src/main/java/com/huoran/iasf/vo/resp/LoginRespVO.java +++ b/src/main/java/com/huoran/iasf/vo/resp/LoginRespVO.java @@ -20,7 +20,7 @@ public class LoginRespVO { @ApiModelProperty(value = "用户名") private String username; @ApiModelProperty(value = "用户id") - private String id; + private Integer id; @ApiModelProperty(value = "电话") private String phone; @ApiModelProperty(value = "用户所拥有的菜单权限")