5 files modified
18 files added
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入architecture") |
| | | public R save(@Valid @RequestBody Architecture architecture) { |
| | | architecture.setPitch("-80"); |
| | | architecture.setPitch("-90"); |
| | | architecture.setHeading("0"); |
| | | architecture.setRoll("0"); |
| | | architecture.setGd("0"); |
| | |
| | | return R.data(list2); |
| | | } |
| | | |
| | | // /** |
| | | // * 校园搜索 |
| | | // * |
| | | // * @param mechanismName 名称模糊查询 |
| | | // * @return |
| | | // */ |
| | | // @GetMapping("/selectLook") |
| | | // public R selectLook(String mechanismName) { |
| | | // List list = new ArrayList(); |
| | | // String sub = ""; |
| | | // List<Map<Object, Object>> maps = architectureService.selectLook(mechanismName); |
| | | // //排除为null的数据 |
| | | // List<Map<Object, Object>> list2 = maps.parallelStream().filter(Objects::nonNull).collect(Collectors.toList()); |
| | | // if (list2.size() != 0) { |
| | | // for (int i = 0; i < list2.size(); i++) { |
| | | // String mechanismname = list2.get(i).get("mechanismname").toString(); |
| | | // if (i == list2.size() - 1) { |
| | | // sub += mechanismname; |
| | | // } else { |
| | | // sub += mechanismname + ","; |
| | | // } |
| | | // } |
| | | // String[] split = sub.split(","); |
| | | // long startTime = System.currentTimeMillis(); //获取开始时间 |
| | | // for (int j = 0; j < split.length; j++) { |
| | | // //机构设施 |
| | | // Mechanism mechanism = new Mechanism(); |
| | | // mechanism.setMechanismname(split[j]); |
| | | // Mechanism one = mechanismService.getOne(Condition.getQueryWrapper(mechanism)); |
| | | // //建筑 |
| | | // Architecture architecture = new Architecture(); |
| | | // architecture.setMechanismname(split[j]); |
| | | // Architecture one1 = architectureService.getOne(Condition.getQueryWrapper(architecture)); |
| | | // //生活 |
| | | // Life life = new Life(); |
| | | // life.setMechanismname(split[j]); |
| | | // Life one2 = lifeService.getOne(Condition.getQueryWrapper(life)); |
| | | // //机构设施 |
| | | // if (one != null) { |
| | | // Map map = new HashMap(); |
| | | // map.put("name", split[j]); |
| | | // map.put("list", one); |
| | | // list.add(map); |
| | | // } |
| | | // //建筑 |
| | | // else if (one1 != null) { |
| | | // Map map = new HashMap(); |
| | | //// //教学科研行政 |
| | | //// String jx = mechanismService.selectIn(one1.getId().toString()); |
| | | //// //生活设施 |
| | | //// String sh = architectureService.selectIns(one1.getId().toString()); |
| | | //// map.put("jx", jx); |
| | | //// map.put("sh", sh); |
| | | // map.put("name", split[j]); |
| | | // map.put("list", one1); |
| | | // list.add(map); |
| | | // } |
| | | // //生活 |
| | | // else { |
| | | // Map map = new HashMap(); |
| | | // map.put("name", split[j]); |
| | | // map.put("list", one2); |
| | | // list.add(map); |
| | | // } |
| | | // |
| | | // } |
| | | // long endTime = System.currentTimeMillis(); //获取结束时间 |
| | | // System.out.println("程序运行时间: " + (endTime - startTime) + "ms"); |
| | | // } |
| | | // return R.data(list); |
| | | // } |
| | | |
| | | /** |
| | | * 校园搜索 |
| | | * |
| | |
| | | @GetMapping("/selectLook") |
| | | public R selectLook(String mechanismName) { |
| | | List list = new ArrayList(); |
| | | String sub = ""; |
| | | List<Map<Object, Object>> maps = architectureService.selectLook(mechanismName); |
| | | //排除为null的数据 |
| | | List<Map<Object, Object>> list2 = maps.parallelStream().filter(Objects::nonNull).collect(Collectors.toList()); |
| | | if (list2.size() != 0) { |
| | | for (int i = 0; i < list2.size(); i++) { |
| | | String mechanismname = list2.get(i).get("mechanismname").toString(); |
| | | if (i == list2.size() - 1) { |
| | | sub += mechanismname; |
| | | } else { |
| | | sub += mechanismname + ","; |
| | | } |
| | | } |
| | | String[] split = sub.split(","); |
| | | for (int j = 0; j < split.length; j++) { |
| | | //机构设施 |
| | | Mechanism mechanism = new Mechanism(); |
| | | mechanism.setMechanismname(split[j]); |
| | | Mechanism one = mechanismService.getOne(Condition.getQueryWrapper(mechanism)); |
| | | //建筑 |
| | | Architecture architecture = new Architecture(); |
| | | architecture.setMechanismname(split[j]); |
| | | Architecture one1 = architectureService.getOne(Condition.getQueryWrapper(architecture)); |
| | | //生活 |
| | | Life life = new Life(); |
| | | life.setMechanismname(split[j]); |
| | | Life one2 = lifeService.getOne(Condition.getQueryWrapper(life)); |
| | | //机构设施 |
| | | if (one != null) { |
| | | Map map = new HashMap(); |
| | | map.put("name", split[j]); |
| | | map.put("list", one); |
| | | list.add(map); |
| | | } |
| | | //建筑 |
| | | else if (one1 != null) { |
| | | Map map = new HashMap(); |
| | | //教学科研行政 |
| | | String jx = mechanismService.selectIn(one1.getId().toString()); |
| | | //生活设施 |
| | | String sh = architectureService.selectIns(one1.getId().toString()); |
| | | map.put("jx", jx); |
| | | map.put("sh", sh); |
| | | map.put("name", split[j]); |
| | | map.put("list", one1); |
| | | list.add(map); |
| | | } |
| | | //生活 |
| | | else { |
| | | Map map = new HashMap(); |
| | | map.put("name", split[j]); |
| | | map.put("list", one2); |
| | | list.add(map); |
| | | } |
| | | |
| | | } |
| | | } |
| | | return R.data(list); |
| | | // for (int i = 0; i < list2.size(); i++) { |
| | | // Map map = new HashMap(); |
| | | // map.put("name", list2.get(i).get("mechanismname")); |
| | | // map.put("list", list2); |
| | | // list.add(map); |
| | | // } |
| | | return R.data(list2); |
| | | } |
| | | } |
| | |
| | | WHERE loutype = #{id} and is_deleted = 0 |
| | | </select> |
| | | |
| | | <select id="selectLook" resultType="java.util.HashMap"> |
| | | SELECT GROUP_CONCAT(mechanismName) AS mechanismname |
| | | FROM sys_architecture |
| | | WHERE mechanismName LIKE '%${mechanismName}%' |
| | | UNION |
| | | SELECT GROUP_CONCAT(mechanismName) AS mechanismname |
| | | FROM sys_mechanism |
| | | WHERE mechanismName LIKE '%${mechanismName}%' |
| | | UNION |
| | | SELECT GROUP_CONCAT(mechanismName) AS mechanismname |
| | | FROM sys_life |
| | | WHERE mechanismName LIKE '%${mechanismName}%' and is_deleted = 0 |
| | | </select> |
| | | <!-- <select id="selectLook" resultType="java.util.HashMap">--> |
| | | <!-- SELECT GROUP_CONCAT(mechanismName) AS mechanismname--> |
| | | <!-- FROM sys_architecture--> |
| | | <!-- WHERE mechanismName LIKE '%${mechanismName}%' and is_deleted = 0--> |
| | | <!-- UNION--> |
| | | <!-- SELECT GROUP_CONCAT(mechanismName) AS mechanismname--> |
| | | <!-- FROM sys_mechanism--> |
| | | <!-- WHERE mechanismName LIKE '%${mechanismName}%' and is_deleted = 0--> |
| | | <!-- UNION--> |
| | | <!-- SELECT GROUP_CONCAT(mechanismName) AS mechanismname--> |
| | | <!-- FROM sys_life--> |
| | | <!-- WHERE mechanismName LIKE '%${mechanismName}%' and is_deleted = 0--> |
| | | <!-- </select>--> |
| | | |
| | | <!--视频监控--> |
| | | <select id="selectVideo" resultType="java.util.HashMap"> |
| | |
| | | WHERE videourl IS NOT NULL |
| | | AND videourl != '' and is_deleted = 0 |
| | | </select> |
| | | |
| | | <select id="selectLook" resultType="java.util.HashMap"> |
| | | SELECT |
| | | mechanismName AS mechanismname,address,telePhone AS telephone,introduce,jd,wd,gd,tpUrl as tpurl,codeUrl as codeurl,heading,pitch,roll,videourl,panoramaurl |
| | | FROM |
| | | sys_architecture |
| | | WHERE |
| | | mechanismName LIKE '%${mechanismName}%' |
| | | AND is_deleted = 0 UNION |
| | | SELECT |
| | | mechanismName AS mechanismname,address,telePhone AS telephone,introduce,jd,wd,gd,tpUrl as tpurl,codeUrl as codeurl,heading,pitch,roll,videourl,panoramaurl |
| | | FROM |
| | | sys_mechanism |
| | | WHERE |
| | | mechanismName LIKE '%${mechanismName}%' |
| | | AND is_deleted = 0 UNION |
| | | SELECT |
| | | mechanismName AS mechanismname,address,telePhone AS telephone,introduce,jd,wd,gd,tpUrl as tpurl,codeUrl as codeurl,heading,pitch,roll,videourl,panoramaurl |
| | | FROM |
| | | sys_life |
| | | WHERE |
| | | mechanismName LIKE '%${mechanismName}%' |
| | | AND is_deleted = 0 |
| | | </select> |
| | | </mapper> |
| | |
| | | * 全景地址 |
| | | */ |
| | | private String panoramaurl; |
| | | private String url; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.layer.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.layer.entity.Layer; |
| | | import org.springblade.modules.layer.vo.LayerVO; |
| | | import org.springblade.modules.layer.service.ILayerService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-16 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("layer/layer") |
| | | @Api(value = "", tags = "接口") |
| | | public class LayerController extends BladeController { |
| | | |
| | | private final ILayerService layerService; |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入layer") |
| | | public R<Layer> detail(Layer layer) { |
| | | Layer detail = layerService.getOne(Condition.getQueryWrapper(layer)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入layer") |
| | | public R<IPage<Layer>> list(Layer layer, Query query) { |
| | | IPage<Layer> pages = layerService.page(Condition.getPage(query), Condition.getQueryWrapper(layer)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入layer") |
| | | public R<IPage<LayerVO>> page(LayerVO layer, Query query) { |
| | | IPage<LayerVO> pages = layerService.selectLayerPage(Condition.getPage(query), layer); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入layer") |
| | | public R save(@Valid @RequestBody Layer layer) { |
| | | return R.status(layerService.save(layer)); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入layer") |
| | | public R update(@Valid @RequestBody Layer layer) { |
| | | return R.status(layerService.updateById(layer)); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入layer") |
| | | public R submit(@Valid @RequestBody Layer layer) { |
| | | return R.status(layerService.saveOrUpdate(layer)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(layerService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.layer.dto; |
| | | |
| | | import org.springblade.modules.layer.entity.Layer; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * 数据传输对象实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-16 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class LayerDTO extends Layer { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.layer.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * 实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-16 |
| | | */ |
| | | @Data |
| | | @TableName("sys_layer") |
| | | @ApiModel(value = "Layer对象", description = "Layer对象") |
| | | public class Layer implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private Integer id; |
| | | /** |
| | | * 图层名称 |
| | | */ |
| | | @ApiModelProperty(value = "图层名称") |
| | | private String layername; |
| | | /** |
| | | * 图层地址 |
| | | */ |
| | | @ApiModelProperty(value = "图层地址") |
| | | private String layerurl; |
| | | /** |
| | | * 类型 |
| | | */ |
| | | @ApiModelProperty(value = "类型") |
| | | private String type; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.layer.mapper; |
| | | |
| | | import org.springblade.modules.layer.entity.Layer; |
| | | import org.springblade.modules.layer.vo.LayerVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-16 |
| | | */ |
| | | public interface LayerMapper extends BaseMapper<Layer> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param layer |
| | | * @return |
| | | */ |
| | | List<LayerVO> selectLayerPage(IPage page, LayerVO layer); |
| | | |
| | | } |
| New file |
| | |
| | | <?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="org.springblade.modules.layer.mapper.LayerMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="layerResultMap" type="org.springblade.modules.layer.entity.Layer"> |
| | | <id column="id" property="id"/> |
| | | <result column="layername" property="layername"/> |
| | | <result column="layerurl" property="layerurl"/> |
| | | <result column="type" property="type"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectLayerPage" resultMap="layerResultMap"> |
| | | select * from sys_layer where is_deleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.layer.service; |
| | | |
| | | import org.springblade.modules.layer.entity.Layer; |
| | | import org.springblade.modules.layer.vo.LayerVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | /** |
| | | * 服务类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-16 |
| | | */ |
| | | public interface ILayerService extends IService<Layer> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param layer |
| | | * @return |
| | | */ |
| | | IPage<LayerVO> selectLayerPage(IPage<LayerVO> page, LayerVO layer); |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.layer.service.impl; |
| | | |
| | | import org.springblade.modules.layer.entity.Layer; |
| | | import org.springblade.modules.layer.vo.LayerVO; |
| | | import org.springblade.modules.layer.mapper.LayerMapper; |
| | | import org.springblade.modules.layer.service.ILayerService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-16 |
| | | */ |
| | | @Service |
| | | public class LayerServiceImpl extends ServiceImpl<LayerMapper, Layer> implements ILayerService { |
| | | |
| | | @Override |
| | | public IPage<LayerVO> selectLayerPage(IPage<LayerVO> page, LayerVO layer) { |
| | | return page.setRecords(baseMapper.selectLayerPage(page, layer)); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.layer.vo; |
| | | |
| | | import org.springblade.modules.layer.entity.Layer; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import io.swagger.annotations.ApiModel; |
| | | |
| | | /** |
| | | * 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-16 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "LayerVO对象", description = "LayerVO对象") |
| | | public class LayerVO extends Layer { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入life") |
| | | public R save(@Valid @RequestBody Life life) { |
| | | life.setPitch("-90"); |
| | | life.setHeading("0"); |
| | | life.setRoll("0"); |
| | | life.setGd("0"); |
| | | return R.status(lifeService.save(life)); |
| | | } |
| | | |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入mechanism") |
| | | public R save(@Valid @RequestBody Mechanism mechanism) { |
| | | mechanism.setPitch("-80"); |
| | | mechanism.setPitch("-90"); |
| | | mechanism.setHeading("0"); |
| | | mechanism.setRoll("0"); |
| | | mechanism.setGd("0"); |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.tagging.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.tagging.entity.Tagging; |
| | | import org.springblade.modules.tagging.vo.TaggingVO; |
| | | import org.springblade.modules.tagging.service.ITaggingService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-17 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("tagging/tagging") |
| | | @Api(value = "", tags = "接口") |
| | | public class TaggingController extends BladeController { |
| | | |
| | | private final ITaggingService taggingService; |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入tagging") |
| | | public R<Tagging> detail(Tagging tagging) { |
| | | Tagging detail = taggingService.getOne(Condition.getQueryWrapper(tagging)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入tagging") |
| | | public R<IPage<Tagging>> list(Tagging tagging, Query query) { |
| | | IPage<Tagging> pages = taggingService.page(Condition.getPage(query), Condition.getQueryWrapper(tagging)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入tagging") |
| | | public R<IPage<TaggingVO>> page(TaggingVO tagging, Query query) { |
| | | IPage<TaggingVO> pages = taggingService.selectTaggingPage(Condition.getPage(query), tagging); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入tagging") |
| | | public R save(@Valid @RequestBody Tagging tagging) { |
| | | return R.status(taggingService.save(tagging)); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入tagging") |
| | | public R update(@Valid @RequestBody Tagging tagging) { |
| | | return R.status(taggingService.updateById(tagging)); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入tagging") |
| | | public R submit(@Valid @RequestBody Tagging tagging) { |
| | | return R.status(taggingService.saveOrUpdate(tagging)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(taggingService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.tagging.dto; |
| | | |
| | | import org.springblade.modules.tagging.entity.Tagging; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * 数据传输对象实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-17 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class TaggingDTO extends Tagging { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.tagging.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * 实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-17 |
| | | */ |
| | | @Data |
| | | @TableName("sys_tagging") |
| | | @ApiModel(value = "Tagging对象", description = "Tagging对象") |
| | | public class Tagging implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private Integer id; |
| | | private String name; |
| | | private String jd; |
| | | private String wd; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.tagging.mapper; |
| | | |
| | | import org.springblade.modules.tagging.entity.Tagging; |
| | | import org.springblade.modules.tagging.vo.TaggingVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-17 |
| | | */ |
| | | public interface TaggingMapper extends BaseMapper<Tagging> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param tagging |
| | | * @return |
| | | */ |
| | | List<TaggingVO> selectTaggingPage(IPage page, TaggingVO tagging); |
| | | |
| | | } |
| New file |
| | |
| | | <?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="org.springblade.modules.tagging.mapper.TaggingMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="taggingResultMap" type="org.springblade.modules.tagging.entity.Tagging"> |
| | | <id column="id" property="id"/> |
| | | <result column="name" property="name"/> |
| | | <result column="jd" property="jd"/> |
| | | <result column="wd" property="wd"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectTaggingPage" resultMap="taggingResultMap"> |
| | | select * from sys_tagging where is_deleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.tagging.service; |
| | | |
| | | import org.springblade.modules.tagging.entity.Tagging; |
| | | import org.springblade.modules.tagging.vo.TaggingVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | /** |
| | | * 服务类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-17 |
| | | */ |
| | | public interface ITaggingService extends IService<Tagging> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param tagging |
| | | * @return |
| | | */ |
| | | IPage<TaggingVO> selectTaggingPage(IPage<TaggingVO> page, TaggingVO tagging); |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.tagging.service.impl; |
| | | |
| | | import org.springblade.modules.tagging.entity.Tagging; |
| | | import org.springblade.modules.tagging.vo.TaggingVO; |
| | | import org.springblade.modules.tagging.mapper.TaggingMapper; |
| | | import org.springblade.modules.tagging.service.ITaggingService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-17 |
| | | */ |
| | | @Service |
| | | public class TaggingServiceImpl extends ServiceImpl<TaggingMapper, Tagging> implements ITaggingService { |
| | | |
| | | @Override |
| | | public IPage<TaggingVO> selectTaggingPage(IPage<TaggingVO> page, TaggingVO tagging) { |
| | | return page.setRecords(baseMapper.selectTaggingPage(page, tagging)); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.tagging.vo; |
| | | |
| | | import org.springblade.modules.tagging.entity.Tagging; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import io.swagger.annotations.ApiModel; |
| | | |
| | | /** |
| | | * 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-17 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "TaggingVO对象", description = "TaggingVO对象") |
| | | public class TaggingVO extends Tagging { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1493850155069448198', 1123598815738675201, 'layer', '图层管理', 'menu', '/layer/layer', NULL, 1, 1, 0, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1493850155069448199', '1493850155069448198', 'layer_add', '新增', 'add', '/layer/layer/add', 'plus', 1, 2, 1, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1493850155069448200', '1493850155069448198', 'layer_edit', '修改', 'edit', '/layer/layer/edit', 'form', 2, 2, 2, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1493850155069448201', '1493850155069448198', 'layer_delete', '删除', 'delete', '/api/layer/layer/remove', 'delete', 3, 2, 3, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1493850155069448202', '1493850155069448198', 'layer_view', '查看', 'view', '/layer/layer/view', 'file-text', 4, 2, 2, 1, NULL, 0); |
| New file |
| | |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1494192251223609351', 1123598815738675201, 'tagging', '标注', 'menu', '/tagging/tagging', NULL, 1, 1, 0, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1494192251223609352', '1494192251223609351', 'tagging_add', '新增', 'add', '/tagging/tagging/add', 'plus', 1, 2, 1, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1494192251223609353', '1494192251223609351', 'tagging_edit', '修改', 'edit', '/tagging/tagging/edit', 'form', 2, 2, 2, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1494192251223609354', '1494192251223609351', 'tagging_delete', '删除', 'delete', '/api/tagging/tagging/remove', 'delete', 3, 2, 3, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1494192251223609355', '1494192251223609351', 'tagging_view', '查看', 'view', '/tagging/tagging/view', 'file-text', 4, 2, 2, 1, NULL, 0); |