!77 update 对象存储配置 重构到数据库 动态配置
* 增加对象存储配置sql
* 修改对象存储配置
* Merge branch 'dev' of https://gitee.com/JavaLionLi/RuoYi-Vue-Plus into dev
* 增加对象存储配置
* 增加对象存储配置
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.annotation.RepeatSubmit; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.validate.AddGroup; |
| | | import com.ruoyi.common.core.validate.EditGroup; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.domain.SysOssConfig; |
| | | import com.ruoyi.system.domain.bo.SysOssConfigBo; |
| | | import com.ruoyi.system.domain.vo.SysOssConfigVo; |
| | | import com.ruoyi.system.service.ISysOssConfigService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * äºåå¨é
ç½®Controller |
| | | * |
| | | * @author ruoyi |
| | | * @date 2021-08-11 |
| | | */ |
| | | @Validated |
| | | @Api(value = "äºåå¨é
ç½®æ§å¶å¨", tags = {"äºåå¨é
置管ç"}) |
| | | @RequiredArgsConstructor(onConstructor_ = @Autowired) |
| | | @RestController |
| | | @RequestMapping("/system/sysOssConfig") |
| | | public class SysOssConfigController extends BaseController { |
| | | |
| | | private final ISysOssConfigService iSysOssConfigService; |
| | | |
| | | /** |
| | | * æ¥è¯¢äºåå¨é
ç½®å表 |
| | | */ |
| | | @ApiOperation("æ¥è¯¢äºåå¨é
ç½®å表") |
| | | @PreAuthorize("@ss.hasPermi('system:sysOssConfig:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<SysOssConfigVo> list(@Validated SysOssConfigBo bo) { |
| | | return iSysOssConfigService.queryPageList(bo); |
| | | } |
| | | |
| | | /** |
| | | * è·åäºåå¨é
置详ç»ä¿¡æ¯ |
| | | */ |
| | | @ApiOperation("è·åäºåå¨é
置详ç»ä¿¡æ¯") |
| | | @PreAuthorize("@ss.hasPermi('system:sysOssConfig:query')") |
| | | @GetMapping("/{ossConfigId}") |
| | | public AjaxResult<SysOssConfigVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable("ossConfigId") Integer ossConfigId) { |
| | | return AjaxResult.success(iSysOssConfigService.queryById(ossConfigId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢äºåå¨é
ç½® |
| | | */ |
| | | @ApiOperation("æ°å¢äºåå¨é
ç½®") |
| | | @PreAuthorize("@ss.hasPermi('system:sysOssConfig:add')") |
| | | @Log(title = "äºåå¨é
ç½®", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit() |
| | | @PostMapping() |
| | | public AjaxResult<Void> add(@Validated(AddGroup.class) @RequestBody SysOssConfigBo bo) { |
| | | if (StringUtils.isNotEmpty(bo.getConfigKey()) |
| | | && UserConstants.NOT_UNIQUE.equals(iSysOssConfigService.checkConfigKeyUnique(bo))) { |
| | | return AjaxResult.error("æ°å¢äºé
ç½®'" + bo.getConfigKey() + "'失败ï¼configKeyå·²åå¨"); |
| | | } |
| | | return toAjax(iSysOssConfigService.insertByBo(bo) ? 1 : 0); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹äºåå¨é
ç½® |
| | | */ |
| | | @ApiOperation("ä¿®æ¹äºåå¨é
ç½®") |
| | | @PreAuthorize("@ss.hasPermi('system:sysOssConfig:edit')") |
| | | @Log(title = "äºåå¨é
ç½®", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping() |
| | | public AjaxResult<Void> edit(@Validated(EditGroup.class) @RequestBody SysOssConfigBo bo) { |
| | | if (StringUtils.isNotEmpty(bo.getConfigKey()) |
| | | && UserConstants.NOT_UNIQUE.equals(iSysOssConfigService.checkConfigKeyUnique(bo))) { |
| | | return AjaxResult.error("ä¿®æ¹äºé
ç½®'" + bo.getConfigKey() + "'失败ï¼configKeyå·²åå¨"); |
| | | } |
| | | return toAjax(iSysOssConfigService.updateByBo(bo) ? 1 : 0); |
| | | } |
| | | |
| | | /** |
| | | * å é¤äºåå¨é
ç½® |
| | | */ |
| | | @ApiOperation("å é¤äºåå¨é
ç½®") |
| | | @PreAuthorize("@ss.hasPermi('system:sysOssConfig:remove')") |
| | | @Log(title = "äºåå¨é
ç½®", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ossConfigIds}") |
| | | public AjaxResult<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Integer[] ossConfigIds) { |
| | | List<SysOssConfig> list = iSysOssConfigService.list(); |
| | | if(ObjectUtil.isNotNull(list)&&list.size()==1){ |
| | | return AjaxResult.error("å¿
é¡»ä¿ç䏿¡äºé
ç½®æä»¶"); |
| | | } |
| | | return toAjax(iSysOssConfigService.deleteWithValidByIds(Arrays.asList(ossConfigIds), true) ? 1 : 0); |
| | | } |
| | | |
| | | /** |
| | | * ç¶æä¿®æ¹ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:sysOssConfig:edit')") |
| | | @Log(title = "äºåå¨ç¶æä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public AjaxResult changeStatus(@RequestBody SysOssConfig sysOssConfig) { |
| | | return toAjax(iSysOssConfigService.updateOssConfigStatus(sysOssConfig)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * äºåå¨é
置对象 sys_oss_config |
| | | * |
| | | * @author ruoyi |
| | | * @date 2021-08-11 |
| | | */ |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_oss_config") |
| | | public class SysOssConfig implements Serializable { |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | |
| | | /** |
| | | * 主建 |
| | | */ |
| | | @TableId(value = "oss_config_id") |
| | | private Integer ossConfigId; |
| | | |
| | | /** |
| | | * é
ç½®key |
| | | */ |
| | | private String configKey; |
| | | |
| | | /** |
| | | * accessKey |
| | | */ |
| | | private String accessKey; |
| | | |
| | | /** |
| | | * ç§é¥ |
| | | */ |
| | | private String secretKey; |
| | | |
| | | /** |
| | | * æ¡¶åç§° |
| | | */ |
| | | private String bucketName; |
| | | |
| | | /** |
| | | * åç¼ |
| | | */ |
| | | private String prefix; |
| | | |
| | | /** |
| | | * 访é®ç«ç¹ |
| | | */ |
| | | private String endpoint; |
| | | |
| | | /** |
| | | * æ¯å¦htppsï¼0å¦ 1æ¯ï¼ |
| | | */ |
| | | private String isHttps; |
| | | |
| | | /** |
| | | * å |
| | | */ |
| | | private String region; |
| | | |
| | | /** |
| | | * ç¶æ(0æ£å¸¸ 1åç¨) |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * æ©å±å段 |
| | | */ |
| | | private String ext1; |
| | | |
| | | /** |
| | | * å建è
|
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private String createBy; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * æ´æ°è
|
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private String updateBy; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.bo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.ruoyi.common.core.validate.AddGroup; |
| | | import com.ruoyi.common.core.validate.EditGroup; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import javax.validation.constraints.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * äºåå¨é
ç½®ä¸å¡å¯¹è±¡ sys_oss_config |
| | | * |
| | | * @author ruoyi |
| | | * @date 2021-08-11 |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel("äºåå¨é
ç½®ä¸å¡å¯¹è±¡") |
| | | public class SysOssConfigBo extends BaseEntity { |
| | | |
| | | /** |
| | | * 主建 |
| | | */ |
| | | @ApiModelProperty("主建") |
| | | private Integer ossConfigId; |
| | | /** |
| | | * é
ç½®key |
| | | */ |
| | | @ApiModelProperty(value = "configKey", required = true) |
| | | @NotBlank(message = "configKeyä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 2, max = 100, message = "configKeyé¿åº¦å¿
é¡»ä»äº2å20 ä¹é´") |
| | | private String configKey; |
| | | |
| | | /** |
| | | * accessKey |
| | | */ |
| | | @ApiModelProperty(value = "accessKey") |
| | | @NotBlank(message = "accessKeyä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 2, max = 100, message = "accessKeyé¿åº¦å¿
é¡»ä»äº2å100 ä¹é´") |
| | | private String accessKey; |
| | | |
| | | /** |
| | | * ç§é¥ |
| | | */ |
| | | @ApiModelProperty(value = "secretKey") |
| | | @NotBlank(message = "secretKeyä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 2, max = 100, message = "secretKeyé¿åº¦å¿
é¡»ä»äº2å100 ä¹é´") |
| | | private String secretKey; |
| | | |
| | | /** |
| | | * æ¡¶åç§° |
| | | */ |
| | | @ApiModelProperty(value = "bucketName") |
| | | @NotBlank(message = "bucketNameä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 2, max = 100, message = "bucketNameé¿åº¦å¿
é¡»ä»äº2å100ä¹é´") |
| | | private String bucketName; |
| | | |
| | | /** |
| | | * åç¼ |
| | | */ |
| | | @ApiModelProperty(value = "åç¼") |
| | | private String prefix; |
| | | |
| | | /** |
| | | * 访é®ç«ç¹ |
| | | */ |
| | | @ApiModelProperty(value = "endpoint") |
| | | @NotBlank(message = "endpointä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 2, max = 100, message = "endpointé¿åº¦å¿
é¡»ä»äº2å100ä¹é´") |
| | | private String endpoint; |
| | | |
| | | /** |
| | | * æ¯å¦htppsï¼0å¦ 1æ¯ï¼ |
| | | */ |
| | | @ApiModelProperty(value = "æ¯å¦htppsï¼0å¦ 1æ¯ï¼") |
| | | private String isHttps; |
| | | |
| | | /** |
| | | * å |
| | | */ |
| | | @ApiModelProperty(value = "region") |
| | | private String region; |
| | | |
| | | /** |
| | | * æ©å±å段 |
| | | */ |
| | | @ApiModelProperty(value = "æ©å±å段") |
| | | private String ext1; |
| | | |
| | | |
| | | /** |
| | | * åé¡µå¤§å° |
| | | */ |
| | | @ApiModelProperty("å页大å°") |
| | | private Integer pageSize; |
| | | |
| | | /** |
| | | * å½åé¡µæ° |
| | | */ |
| | | @ApiModelProperty("å½å页æ°") |
| | | private Integer pageNum; |
| | | |
| | | /** |
| | | * æåºå |
| | | */ |
| | | @ApiModelProperty("æåºå") |
| | | private String orderByColumn; |
| | | |
| | | /** |
| | | * æåºçæ¹ådescæè
asc |
| | | */ |
| | | @ApiModelProperty(value = "æåºçæ¹å", example = "asc,desc") |
| | | private String isAsc; |
| | | /** |
| | | * ç¶æ(0æ£å¸¸ 1åç¨) |
| | | */ |
| | | @ApiModelProperty("ç¶æ(0æ£å¸¸ 1åç¨)") |
| | | private String status; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.ruoyi.common.annotation.ExcelDictFormat; |
| | | import com.ruoyi.common.convert.ExcelDictConvert; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | |
| | | |
| | | /** |
| | | * äºåå¨é
ç½®è§å¾å¯¹è±¡ sys_oss_config |
| | | * |
| | | * @author ruoyi |
| | | * @date 2021-08-11 |
| | | */ |
| | | @Data |
| | | @ApiModel("äºåå¨é
ç½®è§å¾å¯¹è±¡") |
| | | @ExcelIgnoreUnannotated |
| | | public class SysOssConfigVo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主建 |
| | | */ |
| | | @ApiModelProperty("主建") |
| | | private Integer ossConfigId; |
| | | |
| | | /** |
| | | * é
ç½®key |
| | | */ |
| | | @ApiModelProperty("é
ç½®key") |
| | | private String configKey; |
| | | |
| | | /** |
| | | * accessKey |
| | | */ |
| | | @ApiModelProperty("accessKey") |
| | | private String accessKey; |
| | | |
| | | /** |
| | | * ç§é¥ |
| | | */ |
| | | @ApiModelProperty("secretKey") |
| | | private String secretKey; |
| | | |
| | | /** |
| | | * æ¡¶åç§° |
| | | */ |
| | | @ApiModelProperty("æ¡¶åç§°") |
| | | private String bucketName; |
| | | |
| | | /** |
| | | * åç¼ |
| | | */ |
| | | @ApiModelProperty("åç¼") |
| | | private String prefix; |
| | | |
| | | /** |
| | | * 访é®ç«ç¹ |
| | | */ |
| | | @ApiModelProperty("访é®ç«ç¹") |
| | | private String endpoint; |
| | | |
| | | /** |
| | | * æ¯å¦htppsï¼0å¦ 1æ¯ï¼ |
| | | */ |
| | | @ApiModelProperty("æ¯å¦htppsï¼0å¦ 1æ¯ï¼") |
| | | private String isHttps; |
| | | |
| | | /** |
| | | * å |
| | | */ |
| | | @ApiModelProperty("å") |
| | | private String region; |
| | | |
| | | /** |
| | | * ç¶æ(0æ£å¸¸ 1åç¨) |
| | | */ |
| | | @ApiModelProperty("ç¶æ(0æ£å¸¸ 1åç¨)") |
| | | private String status; |
| | | |
| | | /** |
| | | * æ©å±å段 |
| | | */ |
| | | @ApiModelProperty("æ©å±å段") |
| | | private String ext1; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.ruoyi.system.domain.SysOssConfig; |
| | | import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; |
| | | import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache; |
| | | import org.apache.ibatis.annotations.CacheNamespace; |
| | | |
| | | /** |
| | | * äºåå¨é
ç½®Mapperæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2021-08-11 |
| | | */ |
| | | public interface SysOssConfigMapper extends BaseMapperPlus<SysOssConfig> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.ruoyi.system.domain.SysOssConfig; |
| | | import com.ruoyi.system.domain.vo.SysOssConfigVo; |
| | | import com.ruoyi.system.domain.bo.SysOssConfigBo; |
| | | import com.ruoyi.common.core.mybatisplus.core.IServicePlus; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * äºåå¨é
ç½®Serviceæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2021-08-11 |
| | | */ |
| | | public interface ISysOssConfigService extends IServicePlus<SysOssConfig, SysOssConfigVo> { |
| | | /** |
| | | * æ¥è¯¢å个 |
| | | * @return |
| | | */ |
| | | SysOssConfigVo queryById(Integer ossConfigId); |
| | | |
| | | /** |
| | | * æ¥è¯¢å表 |
| | | */ |
| | | TableDataInfo<SysOssConfigVo> queryPageList(SysOssConfigBo bo); |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°å¢ä¸å¡å¯¹è±¡æå
¥äºåå¨é
ç½® |
| | | * @param bo äºåå¨é
ç½®æ°å¢ä¸å¡å¯¹è±¡ |
| | | * @return |
| | | */ |
| | | Boolean insertByBo(SysOssConfigBo bo); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¼è¾ä¸å¡å¯¹è±¡ä¿®æ¹äºåå¨é
ç½® |
| | | * @param bo äºåå¨é
ç½®ç¼è¾ä¸å¡å¯¹è±¡ |
| | | * @return |
| | | */ |
| | | Boolean updateByBo(SysOssConfigBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶å 餿°æ® |
| | | * @param ids 主é®éå |
| | | * @param isValid æ¯å¦æ ¡éª,true-å é¤åæ ¡éª,false-䏿 ¡éª |
| | | * @return |
| | | */ |
| | | Boolean deleteWithValidByIds(Collection<Integer> ids, Boolean isValid); |
| | | |
| | | /** |
| | | * å¯ç¨åç¨ç¶æ |
| | | * @param sysOssConfig |
| | | * @return |
| | | */ |
| | | int updateOssConfigStatus(SysOssConfig sysOssConfig); |
| | | |
| | | /** |
| | | * 夿configkeyæ¯å¦å¯ä¸ |
| | | * @param bo |
| | | * @return |
| | | */ |
| | | String checkConfigKeyUnique(SysOssConfigBo bo); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.exception.CustomException; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.core.page.PagePlus; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.oss.constant.CloudConstant; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.mapper.SysConfigMapper; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.system.domain.bo.SysOssConfigBo; |
| | | import com.ruoyi.system.domain.vo.SysOssConfigVo; |
| | | import com.ruoyi.system.domain.SysOssConfig; |
| | | import com.ruoyi.system.mapper.SysOssConfigMapper; |
| | | import com.ruoyi.system.service.ISysOssConfigService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Collection; |
| | | |
| | | /** |
| | | * äºåå¨é
ç½®Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | * @date 2021-08-11 |
| | | */ |
| | | @Service |
| | | public class SysOssConfigServiceImpl extends ServicePlusImpl<SysOssConfigMapper, SysOssConfig, SysOssConfigVo> implements ISysOssConfigService { |
| | | |
| | | @Autowired |
| | | private ISysConfigService iSysConfigService; |
| | | @Autowired |
| | | private SysConfigMapper sysConfigMapper; |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | @Override |
| | | public SysOssConfigVo queryById(Integer ossConfigId){ |
| | | return getVoById(ossConfigId); |
| | | } |
| | | |
| | | @Override |
| | | public TableDataInfo<SysOssConfigVo> queryPageList(SysOssConfigBo bo) { |
| | | PagePlus<SysOssConfig, SysOssConfigVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo)); |
| | | return PageUtils.buildDataInfo(result); |
| | | } |
| | | |
| | | |
| | | private LambdaQueryWrapper<SysOssConfig> buildQueryWrapper(SysOssConfigBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<SysOssConfig> lqw = Wrappers.lambdaQuery(); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getConfigKey()), SysOssConfig::getConfigKey, bo.getConfigKey()); |
| | | lqw.like(StringUtils.isNotBlank(bo.getBucketName()), SysOssConfig::getBucketName, bo.getBucketName()); |
| | | return lqw; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean insertByBo(SysOssConfigBo bo) { |
| | | SysOssConfig add = BeanUtil.toBean(bo, SysOssConfig.class); |
| | | validEntityBeforeSave(add); |
| | | return save(add); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean updateByBo(SysOssConfigBo bo) { |
| | | SysOssConfig update = BeanUtil.toBean(bo, SysOssConfig.class); |
| | | validEntityBeforeSave(update); |
| | | return updateById(update); |
| | | } |
| | | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | * |
| | | * @param entity å®ä½ç±»æ°æ® |
| | | */ |
| | | private void validEntityBeforeSave(SysOssConfig entity){ |
| | | //TODO åä¸äºæ°æ®æ ¡éª,å¦å¯ä¸çº¦æ |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteWithValidByIds(Collection<Integer> ids, Boolean isValid) { |
| | | return removeByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * 夿configKeyæ¯å¦å¯ä¸ |
| | | * @param bo |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String checkConfigKeyUnique(SysOssConfigBo bo) { |
| | | Long ossConfigId = StringUtils.isNull(bo.getOssConfigId()) ? -1L : bo.getOssConfigId(); |
| | | SysOssConfig info = getOne(new LambdaQueryWrapper<SysOssConfig>() |
| | | .select(SysOssConfig::getOssConfigId, SysOssConfig::getConfigKey) |
| | | .eq(SysOssConfig::getConfigKey, bo.getConfigKey()).last("limit 1")); |
| | | if (StringUtils.isNotNull(info) && info.getOssConfigId().longValue() != ossConfigId.longValue()) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | | } |
| | | |
| | | /** |
| | | * å¯ç¨ç¦ç¨ç¶æ |
| | | * @param sysOssConfig |
| | | * @return |
| | | */ |
| | | @Override |
| | | public int updateOssConfigStatus(SysOssConfig sysOssConfig) { |
| | | LambdaQueryWrapper<SysConfig> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(SysConfig::getConfigKey, CloudConstant.CLOUD_STORAGE_CONFIG_KEY); |
| | | SysConfig sysConfig = sysConfigMapper.selectOne(queryWrapper); |
| | | |
| | | if(ObjectUtil.isNotNull(sysConfig)){ |
| | | sysConfig.setConfigValue(sysOssConfig.getConfigKey()); |
| | | iSysConfigService.updateConfig(sysConfig); |
| | | } |
| | | return baseMapper.updateById(sysOssConfig); |
| | | } |
| | | |
| | | /** |
| | | * 设置cache key |
| | | * |
| | | * @param configKey åæ°é® |
| | | * @return ç¼åé®key |
| | | */ |
| | | private String getCacheKey(String configKey) { |
| | | return Constants.SYS_CONFIG_KEY + configKey; |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.ruoyi.system.mapper.SysOssConfigMapper"> |
| | | |
| | | <resultMap type="com.ruoyi.system.domain.SysOssConfig" id="SysOssConfigResult"> |
| | | <result property="ossConfigId" column="oss_config_id"/> |
| | | <result property="configKey" column="config_key"/> |
| | | <result property="accessKey" column="access_key"/> |
| | | <result property="secretKey" column="secret_key"/> |
| | | <result property="bucketName" column="bucket_name"/> |
| | | <result property="prefix" column="prefix"/> |
| | | <result property="endpoint" column="endpoint"/> |
| | | <result property="isHttps" column="is_https"/> |
| | | <result property="region" column="region"/> |
| | | <result property="status" column="status"/> |
| | | <result property="ext1" column="ext1"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="remark" column="remark"/> |
| | | </resultMap> |
| | | |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ¥è¯¢äºåå¨é
ç½®å表 |
| | | export function listSysOssConfig(query) { |
| | | return request({ |
| | | url: '/system/sysOssConfig/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢äºåå¨é
ç½®è¯¦ç» |
| | | export function getSysOssConfig(ossConfigId) { |
| | | return request({ |
| | | url: '/system/sysOssConfig/' + ossConfigId, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢äºåå¨é
ç½® |
| | | export function addSysOssConfig(data) { |
| | | return request({ |
| | | url: '/system/sysOssConfig', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹äºåå¨é
ç½® |
| | | export function updateSysOssConfig(data) { |
| | | return request({ |
| | | url: '/system/sysOssConfig', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å é¤äºåå¨é
ç½® |
| | | export function delSysOssConfig(ossConfigId) { |
| | | return request({ |
| | | url: '/system/sysOssConfig/' + ossConfigId, |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | |
| | | // ç¨æ·ç¶æä¿®æ¹ |
| | | export function changeOssConfigStatus(ossConfigId, status,configKey) { |
| | | const data = { |
| | | ossConfigId, |
| | | status, |
| | | configKey |
| | | } |
| | | return request({ |
| | | url: '/system/sysOssConfig/changeStatus', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form |
| | | :model="queryParams" |
| | | ref="queryForm" |
| | | :inline="true" |
| | | v-show="showSearch" |
| | | label-width="100px" |
| | | > |
| | | <el-form-item label="configKey" prop="configKey"> |
| | | <el-input |
| | | v-model="queryParams.configKey" |
| | | placeholder="请è¾å
¥configKey" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="bucketName" prop="bucketName"> |
| | | <el-input |
| | | v-model="queryParams.bucketName" |
| | | placeholder="请è¾å
¥bucketName" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | size="mini" |
| | | @click="handleQuery" |
| | | >æç´¢</el-button |
| | | > |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" |
| | | >éç½®</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:sysOssConfig:add']" |
| | | >æ°å¢</el-button |
| | | > |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['system:sysOssConfig:edit']" |
| | | >ä¿®æ¹</el-button |
| | | > |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | :loading="exportLoading" |
| | | @click="handleExport" |
| | | v-hasPermi="['system:sysOssConfig:export']" |
| | | >导åº</el-button |
| | | > |
| | | </el-col> |
| | | <right-toolbar |
| | | :showSearch.sync="showSearch" |
| | | @queryTable="getList" |
| | | ></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="sysOssConfigList"> |
| | | <el-table-column |
| | | label="主建" |
| | | align="center" |
| | | prop="ossConfigId" |
| | | v-if="false" |
| | | /> |
| | | <el-table-column label="configKey" align="center" prop="configKey" /> |
| | | <el-table-column label="accessKey" align="center" prop="accessKey" /> |
| | | <el-table-column label="seretKey" align="center" prop="secretKey" /> |
| | | <el-table-column label="bucketName" align="center" prop="bucketName" /> |
| | | <el-table-column |
| | | label="endpoint" |
| | | width="200" |
| | | align="center" |
| | | prop="endpoint" |
| | | /> |
| | | <el-table-column label="åç¼" align="center" prop="prefix" /> |
| | | <el-table-column |
| | | label="æ¯å¦htpps" |
| | | align="center" |
| | | prop="isHttps" |
| | | :formatter="isHttpsFormat" |
| | | /> |
| | | <el-table-column label="region" align="center" prop="region" /> |
| | | <el-table-column label="ç¶æ" align="center" prop="status"> |
| | | <template slot-scope="scope"> |
| | | <el-switch |
| | | v-model="scope.row.status" |
| | | active-value="0" |
| | | inactive-value="1" |
| | | @change="handleStatusChange(scope.row)" |
| | | ></el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æä½" |
| | | align="center" |
| | | class-name="small-padding fixed-width" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['system:sysOssConfig:edit']" |
| | | >ä¿®æ¹</el-button |
| | | > |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:sysOssConfig:remove']" |
| | | >å é¤</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- æ·»å æä¿®æ¹äºåå¨é
ç½®å¯¹è¯æ¡ --> |
| | | <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="120px"> |
| | | <el-form-item label="configKey" prop="configKey"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-select v-model="form.configKey" placeholder="è¯·éæ©"> |
| | | <el-option |
| | | v-for="item in configKeyOptions" |
| | | :key="item.configKey" |
| | | :label="item.label" |
| | | :value="item.configKey" |
| | | > |
| | | <span style="float: left">{{ item.configKey }}</span> |
| | | <span style="float: right; color: #8492a6; font-size: 13px">{{ |
| | | item.label |
| | | }}</span> |
| | | </el-option> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="bucketName" prop="bucketName"> |
| | | <el-input |
| | | v-model="form.bucketName" |
| | | placeholder="请è¾å
¥bucketName" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form-item> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="accessKey" prop="accessKey"> |
| | | <el-input |
| | | v-model="form.accessKey" |
| | | placeholder="请è¾å
¥accessKey" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="secretKey" prop="secretKey"> |
| | | <el-input |
| | | v-model="form.secretKey" |
| | | placeholder="请è¾å
¥secretKey" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-form-item label="endpoint" prop="endpoint"> |
| | | <el-input v-model="form.endpoint" placeholder="请è¾å
¥endpoint" /> |
| | | </el-form-item> |
| | | <el-form-item label="åç¼" prop="prefix"> |
| | | <el-input v-model="form.prefix" placeholder="请è¾å
¥åç¼" /> |
| | | </el-form-item> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç¶æ"> |
| | | <el-radio-group v-model="form.status"> |
| | | <el-radio label="0">å¯ç¨</el-radio> |
| | | <el-radio label="1">ç¦ç¨</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¯å¦htpps"> |
| | | <el-radio-group v-model="form.isHttps"> |
| | | <el-radio label="0">å¦</el-radio> |
| | | <el-radio label="1">æ¯</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-form-item label="region" prop="region"> |
| | | <el-input v-model="form.region" placeholder="请è¾å
¥region" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input |
| | | v-model="form.remark" |
| | | type="textarea" |
| | | placeholder="请è¾å
¥å
容" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm" |
| | | >ç¡® å®</el-button |
| | | > |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | listSysOssConfig, |
| | | getSysOssConfig, |
| | | delSysOssConfig, |
| | | addSysOssConfig, |
| | | updateSysOssConfig, |
| | | changeOssConfigStatus, |
| | | } from "@/api/system/sysOssConfig"; |
| | | import { downLoadExcel } from "@/utils/download"; |
| | | |
| | | export default { |
| | | name: "SysOssConfig", |
| | | data() { |
| | | return { |
| | | // æé®loading |
| | | buttonLoading: false, |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // 导åºé®ç½©å± |
| | | exportLoading: false, |
| | | // é䏿°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // äºåå¨é
ç½®è¡¨æ ¼æ°æ® |
| | | sysOssConfigList: [], |
| | | //configKeyOptions |
| | | configKeyOptions: [], |
| | | configKeyDatas: [ |
| | | { configKey: "monio", label: "minio" }, |
| | | { configKey: "qcloud", label: "è
¾è®¯äº" }, |
| | | { configKey: "aliyun", label: "é¿éäº" }, |
| | | { configKey: "qiniu", label: "ä¸çäº" }, |
| | | ], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | configKey: undefined, |
| | | bucketName: undefined, |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | // è¡¨åæ ¡éª |
| | | rules: { |
| | | configKey: [ |
| | | { required: true, message: "configKeyä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | accessKey: [ |
| | | { required: true, message: "accessKeyä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | { |
| | | min: 2, |
| | | max: 200, |
| | | message: "accessKeyé¿åº¦å¿
é¡»ä»äº 2 å 100 ä¹é´", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | secretKey: [ |
| | | { required: true, message: "secretKeyä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | { |
| | | min: 2, |
| | | max: 100, |
| | | message: "secretKeyé¿åº¦å¿
é¡»ä»äº 2 å 100 ä¹é´", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | bucketName: [ |
| | | { required: true, message: "bucketNameä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | { |
| | | min: 2, |
| | | max: 100, |
| | | message: "bucketNameé¿åº¦å¿
é¡»ä»äº 2 å 100 ä¹é´", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | endpoint: [ |
| | | { required: true, message: "endpointä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | { |
| | | min: 2, |
| | | max: 100, |
| | | message: "endpointåç§°é¿åº¦å¿
é¡»ä»äº 2 å 100 ä¹é´", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | this.configKeyOptions = this.configKeyDatas; |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢äºåå¨é
ç½®å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listSysOssConfig(this.queryParams).then((response) => { |
| | | this.sysOssConfigList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // æ¯å¦htppsåå
¸ç¿»è¯ |
| | | isHttpsFormat(row, column) { |
| | | return row.isHttps == "0" ? "å¦" : "æ¯"; |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | ossConfigId: undefined, |
| | | configKey: undefined, |
| | | accessKey: undefined, |
| | | secretKey: undefined, |
| | | bucketName: undefined, |
| | | prefix: undefined, |
| | | endpoint: undefined, |
| | | isHttps: "0", |
| | | region: undefined, |
| | | status: "1", |
| | | remark: undefined, |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "æ·»å äºåå¨é
ç½®"; |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.loading = true; |
| | | this.reset(); |
| | | const ossConfigId = row.ossConfigId || this.ids; |
| | | getSysOssConfig(ossConfigId).then((response) => { |
| | | this.loading = false; |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "ä¿®æ¹äºåå¨é
ç½®"; |
| | | }); |
| | | }, |
| | | /** æäº¤æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate((valid) => { |
| | | if (valid) { |
| | | this.buttonLoading = true; |
| | | if (this.form.ossConfigId != null) { |
| | | updateSysOssConfig(this.form) |
| | | .then((response) => { |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }) |
| | | .finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } else { |
| | | addSysOssConfig(this.form) |
| | | .then((response) => { |
| | | this.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }) |
| | | .finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const ossConfigIds = row.ossConfigId || this.ids; |
| | | this.$confirm( |
| | | 'æ¯å¦ç¡®è®¤å é¤configKey为"' + row.configKey + '"çæ°æ®é¡¹?', |
| | | "è¦å", |
| | | { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | } |
| | | ) |
| | | .then(() => { |
| | | return delSysOssConfig(ossConfigIds); |
| | | }) |
| | | .then(() => { |
| | | this.loading = false; |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | /** å¯¼åºæé®æä½ */ |
| | | handleExport() { |
| | | downLoadExcel("/system/sysOssConfig/export", this.queryParams); |
| | | }, |
| | | // äºåå¨é
ç½®ç¶æä¿®æ¹ |
| | | handleStatusChange(row) { |
| | | let text = row.status === "0" ? "å¯ç¨" : "åç¨"; |
| | | this.$confirm( |
| | | '确认è¦"' + text + '""' + row.configKey + '"é
ç½®å?', |
| | | "è¦å", |
| | | { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | } |
| | | ) |
| | | .then(function () { |
| | | return changeOssConfigStatus( |
| | | row.ossConfigId, |
| | | row.status, |
| | | row.configKey |
| | | ); |
| | | }) |
| | | .then(() => { |
| | | this.msgSuccess(text + "æå"); |
| | | }) |
| | | .catch(function () { |
| | | row.status = row.status === "0" ? "1" : "0"; |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | Navicat MySQL Data Transfer |
| | | |
| | | Source Server : mysql57 |
| | | Source Server Version : 50735 |
| | | Source Host : localhost:3306 |
| | | Source Database : ry-vue |
| | | |
| | | Target Server Type : MYSQL |
| | | Target Server Version : 50735 |
| | | File Encoding : 65001 |
| | | |
| | | Date: 2021-08-12 09:01:33 |
| | | */ |
| | | |
| | | SET FOREIGN_KEY_CHECKS=0; |
| | | |
| | | -- ---------------------------- |
| | | -- Table structure for sys_oss_config |
| | | -- ---------------------------- |
| | | DROP TABLE IF EXISTS `sys_oss_config`; |
| | | CREATE TABLE `sys_oss_config` ( |
| | | `oss_config_id` int(5) NOT NULL AUTO_INCREMENT COMMENT '主建', |
| | | `config_key` varchar(255) NOT NULL DEFAULT '' COMMENT 'é
ç½®key', |
| | | `access_key` varchar(255) DEFAULT '' COMMENT 'access_key', |
| | | `secret_key` varchar(255) DEFAULT '' COMMENT 'ç§é¥', |
| | | `bucket_name` varchar(255) DEFAULT '' COMMENT 'æ¡¶åç§°', |
| | | `prefix` varchar(255) DEFAULT '' COMMENT 'åç¼', |
| | | `endpoint` varchar(255) DEFAULT '' COMMENT '访é®ç«ç¹', |
| | | `is_https` char(1) DEFAULT '0' COMMENT 'æ¯å¦htppsï¼0å¦ 1æ¯ï¼', |
| | | `region` varchar(255) DEFAULT '' COMMENT 'å', |
| | | `status` char(1) DEFAULT '0' COMMENT 'ç¶æ(0æ£å¸¸ 1åç¨)', |
| | | `ext1` varchar(255) DEFAULT '' COMMENT 'æ©å±å段', |
| | | `create_by` varchar(64) DEFAULT '' COMMENT 'å建è
', |
| | | `create_time` datetime DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | `update_by` varchar(64) DEFAULT '' COMMENT 'æ´æ°è
', |
| | | `update_time` datetime DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | `remark` varchar(500) DEFAULT NULL COMMENT '夿³¨', |
| | | PRIMARY KEY (`oss_config_id`) |
| | | ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='äºåå¨é
置表'; |
| | | |
| | | -- ---------------------------- |
| | | -- Records of sys_oss_config |
| | | -- ---------------------------- |
| | | INSERT INTO `sys_oss_config` VALUES ('1', 'minio3', 'ruoyi', 'ruoyi123', 'ruoyi', '', 'http://localhost:9000', '0', '', '0', '', 'admin', '2021-08-11 21:29:37', 'admin', '2021-08-11 22:52:41', null); |