5 files modified
7 files added
| | |
| | | secureRegistry.excludePathPatterns("/qrCode/**"); |
| | | secureRegistry.excludePathPatterns("/blade-hd/hd/**"); |
| | | secureRegistry.excludePathPatterns("/tagging/tagging/**"); |
| | | secureRegistry.excludePathPatterns("/blade-resource/oss/endpoint/**"); |
| | | return secureRegistry; |
| | | } |
| | | |
| | |
| | | lqw.eq(Oss::getOssCode, ossCode); |
| | | } else { |
| | | lqw.eq(Oss::getStatus, OssStatusEnum.ENABLE.getNum()); |
| | | Oss o= ossService.getOne(lqw); |
| | | if(Func.notNull(o)){ |
| | | key=o.getOssCode(); |
| | | } |
| | | } |
| | | Oss oss = CacheUtil.get(RESOURCE_CACHE, OSS_CODE, key, () -> { |
| | | Oss o = ossService.getOne(lqw); |
| | |
| | | */ |
| | | package org.springblade.modules.resource.endpoint; |
| | | |
| | | import io.minio.*; |
| | | import io.minio.errors.*; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | |
| | | import org.springblade.modules.resource.service.IAttachService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.security.InvalidKeyException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * 对象存储端点 |
| | |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | /** |
| | | * 文件上传,个人头像上传 |
| | | * |
| | | * @param file 图片对象 |
| | | */ |
| | | @PostMapping("put-files-talk") |
| | | public String putFilestak(@RequestParam MultipartFile file) throws IOException, ServerException, InsufficientDataException, InternalException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, XmlParserException, ErrorResponseException { |
| | | //填写你文件上传的地址以及相应信息 |
| | | String url = "http://223.82.109.183:2081"; |
| | | String access = "zhbaadmin"; |
| | | String secret = "zhbapassword"; |
| | | String bucket = "zhxy"; |
| | | MinioClient minioClient = |
| | | MinioClient.builder() |
| | | .endpoint(url) |
| | | .credentials(access, secret) |
| | | .build(); |
| | | // 检查存储桶是否已经存在 |
| | | boolean isExist = minioClient.bucketExists(BucketExistsArgs.builder().bucket(bucket).build()); |
| | | if (!isExist) { |
| | | // 创建一个名为zip的存储桶,用于zip文件。 |
| | | minioClient.makeBucket(MakeBucketArgs.builder().bucket(bucket).build()); |
| | | minioClient.setBucketPolicy(SetBucketPolicyArgs.builder().bucket(bucket).build()); |
| | | } |
| | | String fileName = file.getOriginalFilename(); |
| | | String newName = "upload/picture/" + UUID.randomUUID().toString().replaceAll("-", "") |
| | | + fileName.substring(fileName.lastIndexOf(".")); |
| | | InputStream in = file.getInputStream(); |
| | | String[] split = newName.split("/"); |
| | | //创建头部信息 |
| | | Map<String, String> headers = new HashMap<>(1 << 2); |
| | | //添加自定义内容类型 |
| | | headers.put("Content-Type", "application/octet-stream"); |
| | | //上传 |
| | | minioClient.putObject( |
| | | PutObjectArgs.builder().bucket(bucket).object(newName).stream( |
| | | in, in.available(), -1) |
| | | .headers(headers) |
| | | .build()); |
| | | |
| | | //文件推送 |
| | | String urls = "http://223.82.109.183:2081/zhxy/"+newName; |
| | | //返回 |
| | | return urls; |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | package org.springblade.modules.tagging.controller; |
| | | |
| | | import com.google.gson.JsonArray; |
| | | import com.google.gson.JsonObject; |
| | | import com.google.zxing.WriterException; |
| | | 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.common.utils.QRCodeUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | |
| | | import org.springblade.modules.tagging.vo.TaggingVO; |
| | | import org.springblade.modules.tagging.service.ITaggingService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import sun.misc.BASE64Encoder; |
| | | |
| | | import java.io.FileOutputStream; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | |
| | | import static org.springblade.common.config.qCodeConfig.*; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入tagging") |
| | | public R save(@Valid @RequestBody Tagging tagging) { |
| | | public R save(@Valid @RequestBody Tagging tagging) throws IOException, WriterException { |
| | | String path = "D:\\QrCode\\"; |
| | | FileOutputStream fileOutputStream = null; |
| | | //本地url地址 |
| | | String urlz = locaPath; |
| | | System.out.println(urlz); |
| | | //String url = "http://192.168.0.222:8080/#/mobileLayout/default?data="; |
| | | String url = "http://171.34.197.243:786/#/mobileLayout/default?data="; |
| | | JsonObject lan1 = new JsonObject(); |
| | | lan1.addProperty("methods", "goto"); |
| | | lan1.addProperty("jd", URLEncoder.encode(tagging.getJd(), "UTF-8")); |
| | | lan1.addProperty("wd", URLEncoder.encode(tagging.getWd(), "UTF-8")); |
| | | lan1.addProperty("name", URLEncoder.encode(tagging.getName(), "UTF-8")); |
| | | String urls = url + lan1; |
| | | //生成标注二维码 |
| | | byte[] qrCodeImage = QRCodeUtil.getQRCodeImage(urls, 350, 350); |
| | | String encode = new BASE64Encoder().encode(qrCodeImage); |
| | | //设置二维码 |
| | | String a = "data:image/png;base64," + encode; |
| | | tagging.setQrcode(a); |
| | | return R.status(taggingService.save(tagging)); |
| | | } |
| | | |
| | |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(taggingService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | package org.springblade.modules.tagging.entity; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | |
| | | private String name; |
| | | private String jd; |
| | | private String wd; |
| | | @ColumnWidth(16) |
| | | @ExcelProperty("二维码图片") |
| | | private String qrcode; |
| | | |
| | | |
| | | } |
| 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.vr.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.vr.entity.Vr; |
| | | import org.springblade.modules.vr.vo.VrVO; |
| | | import org.springblade.modules.vr.service.IVrService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-03-03 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("blade-vr/vr") |
| | | @Api(value = "", tags = "接口") |
| | | public class VrController extends BladeController { |
| | | |
| | | private final IVrService vrService; |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入vr") |
| | | public R<Vr> detail(Vr vr) { |
| | | Vr detail = vrService.getOne(Condition.getQueryWrapper(vr)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入vr") |
| | | public R<IPage<Vr>> list(Vr vr, Query query) { |
| | | IPage<Vr> pages = vrService.page(Condition.getPage(query), Condition.getQueryWrapper(vr)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入vr") |
| | | public R<IPage<VrVO>> page(VrVO vr, Query query) { |
| | | IPage<VrVO> pages = vrService.selectVrPage(Condition.getPage(query), vr); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入vr") |
| | | public R save(@Valid @RequestBody Vr vr) { |
| | | return R.status(vrService.save(vr)); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入vr") |
| | | public R update(@Valid @RequestBody Vr vr) { |
| | | return R.status(vrService.updateById(vr)); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入vr") |
| | | public R submit(@Valid @RequestBody Vr vr) { |
| | | return R.status(vrService.saveOrUpdate(vr)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(vrService.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.vr.dto; |
| | | |
| | | import org.springblade.modules.vr.entity.Vr; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * 数据传输对象实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-03-03 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class VrDTO extends Vr { |
| | | 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.vr.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * 实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-03-03 |
| | | */ |
| | | @Data |
| | | @TableName("sys_vr") |
| | | @ApiModel(value = "Vr对象", description = "Vr对象") |
| | | public class Vr implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * VR名称 |
| | | */ |
| | | @ApiModelProperty(value = "VR名称") |
| | | @TableField("VrName") |
| | | private String vrname; |
| | | /** |
| | | * VR地址 |
| | | */ |
| | | @ApiModelProperty(value = "VR地址") |
| | | @TableField("VrUrl") |
| | | private String vrurl; |
| | | |
| | | |
| | | } |
| 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.vr.mapper; |
| | | |
| | | import org.springblade.modules.vr.entity.Vr; |
| | | import org.springblade.modules.vr.vo.VrVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-03-03 |
| | | */ |
| | | public interface VrMapper extends BaseMapper<Vr> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param vr |
| | | * @return |
| | | */ |
| | | List<VrVO> selectVrPage(IPage page, VrVO vr); |
| | | |
| | | } |
| 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.vr.mapper.VrMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="vrResultMap" type="org.springblade.modules.vr.entity.Vr"> |
| | | <id column="id" property="id"/> |
| | | <result column="VrName" property="vrname"/> |
| | | <result column="VrUrl" property="vrurl"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectVrPage" resultMap="vrResultMap"> |
| | | select * from sys_vr 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.vr.service.impl; |
| | | |
| | | import org.springblade.modules.vr.entity.Vr; |
| | | import org.springblade.modules.vr.vo.VrVO; |
| | | import org.springblade.modules.vr.mapper.VrMapper; |
| | | import org.springblade.modules.vr.service.IVrService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-03-03 |
| | | */ |
| | | @Service |
| | | public class VrServiceImpl extends ServiceImpl<VrMapper, Vr> implements IVrService { |
| | | |
| | | @Override |
| | | public IPage<VrVO> selectVrPage(IPage<VrVO> page, VrVO vr) { |
| | | return page.setRecords(baseMapper.selectVrPage(page, vr)); |
| | | } |
| | | |
| | | } |
| 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.vr.vo; |
| | | |
| | | import org.springblade.modules.vr.entity.Vr; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import io.swagger.annotations.ApiModel; |
| | | |
| | | /** |
| | | * 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-03-03 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "VrVO对象", description = "VrVO对象") |
| | | public class VrVO extends Vr { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |