parent
570c6d0582
commit
2310168913
9 changed files with 214 additions and 1 deletions
@ -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<SysNavigationStyle> queryWrapper = new QueryWrapper<>(); |
||||
queryWrapper.eq("site_id", siteId); |
||||
List<SysNavigationStyle> 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("删除失败"); |
||||
} |
||||
} |
||||
|
@ -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; |
||||
|
||||
|
||||
} |
@ -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<SysNavigationStyle> { |
||||
|
||||
} |
@ -0,0 +1,15 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.huoran.iasf.mapper.SysNavigationStyleMapper"> |
||||
|
||||
<!-- 通用查询映射结果 --> |
||||
<resultMap id="BaseResultMap" type="com.huoran.iasf.entity.SysNavigationStyle"> |
||||
<id column="id" property="id"/> |
||||
<result column="navigation_style" property="navigationStyle"/> |
||||
<result column="style_template" property="styleTemplate"/> |
||||
<result column="site_id" property="siteId"/> |
||||
<result column="create_time" property="createTime"/> |
||||
<result column="update_time" property="updateTime"/> |
||||
</resultMap> |
||||
|
||||
</mapper> |
@ -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<SysNavigationStyle> { |
||||
|
||||
|
||||
} |
@ -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<SysNavigationStyleMapper, SysNavigationStyle> implements SysNavigationStyleService { |
||||
|
||||
@Autowired |
||||
private SysNavigationStyleMapper mapper; |
||||
|
||||
} |
||||
|
||||
|
||||
|
Loading…
Reference in new issue