| | |
| | | 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 javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * äºåå¨é
ç½®Controller |
| | | * |
| | | * @author ruoyi |
| | | * @date 2021-08-11 |
| | | * @author Lion Li |
| | | * @author å¤èçé¨ |
| | | * @date 2021-08-13 |
| | | */ |
| | | @Validated |
| | | @Api(value = "äºåå¨é
ç½®æ§å¶å¨", tags = {"äºåå¨é
置管ç"}) |
| | | @RequiredArgsConstructor(onConstructor_ = @Autowired) |
| | | @RestController |
| | | @RequestMapping("/system/sysOssConfig") |
| | | @RequestMapping("/system/oss/config") |
| | | public class SysOssConfigController extends BaseController { |
| | | |
| | | private final ISysOssConfigService iSysOssConfigService; |
| | |
| | | * æ¥è¯¢äºåå¨é
ç½®å表 |
| | | */ |
| | | @ApiOperation("æ¥è¯¢äºåå¨é
ç½®å表") |
| | | @PreAuthorize("@ss.hasPermi('system:sysOssConfig:list')") |
| | | @PreAuthorize("@ss.hasPermi('system:oss:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<SysOssConfigVo> list(@Validated SysOssConfigBo bo) { |
| | | return iSysOssConfigService.queryPageList(bo); |
| | |
| | | * è·åäºåå¨é
置详ç»ä¿¡æ¯ |
| | | */ |
| | | @ApiOperation("è·åäºåå¨é
置详ç»ä¿¡æ¯") |
| | | @PreAuthorize("@ss.hasPermi('system:sysOssConfig:query')") |
| | | @PreAuthorize("@ss.hasPermi('system:oss:query')") |
| | | @GetMapping("/{ossConfigId}") |
| | | public AjaxResult<SysOssConfigVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable("ossConfigId") Integer ossConfigId) { |
| | |
| | | * æ°å¢äºåå¨é
ç½® |
| | | */ |
| | | @ApiOperation("æ°å¢äºåå¨é
ç½®") |
| | | @PreAuthorize("@ss.hasPermi('system:sysOssConfig:add')") |
| | | @PreAuthorize("@ss.hasPermi('system:oss: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')") |
| | | @PreAuthorize("@ss.hasPermi('system:oss: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')") |
| | | @PreAuthorize("@ss.hasPermi('system:oss: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')") |
| | | @PreAuthorize("@ss.hasPermi('system:oss:edit')") |
| | | @Log(title = "äºåå¨ç¶æä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public AjaxResult changeStatus(@RequestBody SysOssConfig sysOssConfig) { |
| | | return toAjax(iSysOssConfigService.updateOssConfigStatus(sysOssConfig)); |
| | | public AjaxResult changeStatus(@RequestBody SysOssConfigBo bo) { |
| | | return toAjax(iSysOssConfigService.updateOssConfigStatus(bo)); |
| | | } |
| | | } |
| | |
| | | private String endpoint; |
| | | |
| | | /** |
| | | * æ¯å¦htppsï¼0å¦ 1æ¯ï¼ |
| | | * æ¯å¦httpsï¼0å¦ 1æ¯ï¼ |
| | | */ |
| | | private String isHttps; |
| | | |
| | |
| | | package com.ruoyi.system.domain.bo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | 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; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Size; |
| | | |
| | | /** |
| | | * äºåå¨é
ç½®ä¸å¡å¯¹è±¡ sys_oss_config |
| | | * |
| | | * @author ruoyi |
| | | * @date 2021-08-11 |
| | | * @author Lion Li |
| | | * @author å¤èçé¨ |
| | | * @date 2021-08-13 |
| | | */ |
| | | |
| | | @Data |
| | |
| | | /** |
| | | * 主建 |
| | | */ |
| | | @ApiModelProperty("主建") |
| | | private Integer ossConfigId; |
| | | @ApiModelProperty(value = "主建", required = true) |
| | | @NotNull(message = "主建ä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long ossConfigId; |
| | | |
| | | /** |
| | | * é
ç½®key |
| | | */ |
| | |
| | | /** |
| | | * accessKey |
| | | */ |
| | | @ApiModelProperty(value = "accessKey") |
| | | @ApiModelProperty(value = "accessKey", required = true) |
| | | @NotBlank(message = "accessKeyä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 2, max = 100, message = "accessKeyé¿åº¦å¿
é¡»ä»äº2å100 ä¹é´") |
| | | private String accessKey; |
| | |
| | | /** |
| | | * ç§é¥ |
| | | */ |
| | | @ApiModelProperty(value = "secretKey") |
| | | @ApiModelProperty(value = "secretKey", required = true) |
| | | @NotBlank(message = "secretKeyä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 2, max = 100, message = "secretKeyé¿åº¦å¿
é¡»ä»äº2å100 ä¹é´") |
| | | private String secretKey; |
| | |
| | | /** |
| | | * æ¡¶åç§° |
| | | */ |
| | | @ApiModelProperty(value = "bucketName") |
| | | @ApiModelProperty(value = "bucketName", required = true) |
| | | @NotBlank(message = "bucketNameä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 2, max = 100, message = "bucketNameé¿åº¦å¿
é¡»ä»äº2å100ä¹é´") |
| | | private String bucketName; |
| | |
| | | /** |
| | | * 访é®ç«ç¹ |
| | | */ |
| | | @ApiModelProperty(value = "endpoint") |
| | | @ApiModelProperty(value = "endpoint", required = true) |
| | | @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; |
| | | /** |
| | | * æ¯å¦httpsï¼Y=æ¯,N=å¦ï¼ |
| | | */ |
| | | @ApiModelProperty("æ¯å¦httpsï¼Y=æ¯,N=å¦ï¼") |
| | | private String isHttps; |
| | | |
| | | /** |
| | | * ç¶æï¼0=æ£å¸¸,1=åç¨ï¼ |
| | | */ |
| | | @ApiModelProperty("ç¶æï¼0=æ£å¸¸,1=åç¨ï¼") |
| | | private String status; |
| | | |
| | | /** |
| | | * å |
| | |
| | | */ |
| | | @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 |
| | | * @author Lion Li |
| | | * @author å¤èçé¨ |
| | | * @date 2021-08-13 |
| | | */ |
| | | @Data |
| | | @ApiModel("äºåå¨é
ç½®è§å¾å¯¹è±¡") |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主建 |
| | | * 主建 |
| | | */ |
| | | @ApiModelProperty("主建") |
| | | private Integer ossConfigId; |
| | | private Long ossConfigId; |
| | | |
| | | /** |
| | | * é
ç½®key |
| | |
| | | private String endpoint; |
| | | |
| | | /** |
| | | * æ¯å¦htppsï¼0å¦ 1æ¯ï¼ |
| | | * æ¯å¦httpsï¼Y=æ¯,N=å¦ï¼ |
| | | */ |
| | | @ApiModelProperty("æ¯å¦htppsï¼0å¦ 1æ¯ï¼") |
| | | @ApiModelProperty("æ¯å¦httpsï¼Y=æ¯,N=å¦ï¼") |
| | | private String isHttps; |
| | | |
| | | /** |
| | |
| | | private String region; |
| | | |
| | | /** |
| | | * ç¶æ(0æ£å¸¸ 1åç¨) |
| | | * ç¶æï¼0=æ£å¸¸,1=åç¨ï¼ |
| | | */ |
| | | @ApiModelProperty("ç¶æ(0æ£å¸¸ 1åç¨)") |
| | | @ApiModelProperty("ç¶æï¼0=æ£å¸¸,1=åç¨ï¼") |
| | | private String status; |
| | | |
| | | /** |
| | |
| | | @ApiModelProperty("æ©å±å段") |
| | | private String ext1; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty("夿³¨") |
| | | private String remark; |
| | | |
| | | } |
| | |
| | | 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; |
| | | import com.ruoyi.system.domain.SysOssConfig; |
| | | |
| | | /** |
| | | * äºåå¨é
ç½®Mapperæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2021-08-11 |
| | | * @author Lion Li |
| | | * @author å¤èçé¨ |
| | | * @date 2021-08-13 |
| | | */ |
| | | 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 com.ruoyi.system.domain.SysOssConfig; |
| | | import com.ruoyi.system.domain.bo.SysOssConfigBo; |
| | | import com.ruoyi.system.domain.vo.SysOssConfigVo; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * äºåå¨é
ç½®Serviceæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2021-08-11 |
| | | * @author Lion Li |
| | | * @author å¤èçé¨ |
| | | * @date 2021-08-13 |
| | | */ |
| | | public interface ISysOssConfigService extends IServicePlus<SysOssConfig, SysOssConfigVo> { |
| | | |
| | | /** |
| | | * æ¥è¯¢å个 |
| | | * @return |
| | | */ |
| | | SysOssConfigVo queryById(Integer ossConfigId); |
| | | |
| | |
| | | |
| | | /** |
| | | * å¯ç¨åç¨ç¶æ |
| | | * @param sysOssConfig |
| | | * @return |
| | | */ |
| | | int updateOssConfigStatus(SysOssConfig sysOssConfig); |
| | | int updateOssConfigStatus(SysOssConfigBo bo); |
| | | |
| | | /** |
| | | * 夿configkeyæ¯å¦å¯ä¸ |
| | | * @param bo |
| | | * @return |
| | | */ |
| | | String checkConfigKeyUnique(SysOssConfigBo bo); |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | 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.mybatisplus.core.ServicePlusImpl; |
| | | import com.ruoyi.common.core.page.PagePlus; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.exception.CustomException; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | 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.SysOssConfig; |
| | | 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.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysOssConfigService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Collection; |
| | | |
| | | /** |
| | | * äºåå¨é
ç½®Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | * @date 2021-08-11 |
| | | * @author Lion Li |
| | | * @author å¤èçé¨ |
| | | * @date 2021-08-13 |
| | | */ |
| | | @RequiredArgsConstructor(onConstructor_ = @Autowired) |
| | | @Service |
| | | public class SysOssConfigServiceImpl extends ServicePlusImpl<SysOssConfigMapper, SysOssConfig, SysOssConfigVo> implements ISysOssConfigService { |
| | | |
| | | @Autowired |
| | | private ISysConfigService iSysConfigService; |
| | | @Autowired |
| | | private SysConfigMapper sysConfigMapper; |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | private final ISysConfigService iSysConfigService; |
| | | |
| | | @Override |
| | | public SysOssConfigVo queryById(Integer ossConfigId){ |
| | |
| | | |
| | | |
| | | 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; |
| | | lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysOssConfig::getStatus, bo.getStatus()); |
| | | return lqw; |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | * |
| | | * @param entity å®ä½ç±»æ°æ® |
| | | */ |
| | | private void validEntityBeforeSave(SysOssConfig entity){ |
| | | //TODO åä¸äºæ°æ®æ ¡éª,å¦å¯ä¸çº¦æ |
| | | if (StringUtils.isNotEmpty(entity.getConfigKey()) |
| | | && UserConstants.NOT_UNIQUE.equals(checkConfigKeyUnique(entity))) { |
| | | throw new CustomException("æä½é
ç½®'" + entity.getConfigKey() + "'失败, é
ç½®keyå·²åå¨!"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteWithValidByIds(Collection<Integer> ids, Boolean isValid) { |
| | | if(isValid) { |
| | | if (CollUtil.containsAll(ids, CollUtil.newArrayList(1, 2, 3, 4))) { |
| | | throw new CustomException("ç³»ç»å
ç½®, ä¸å¯å é¤!"); |
| | | } |
| | | } |
| | | return removeByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * 夿configKeyæ¯å¦å¯ä¸ |
| | | * @param bo |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String checkConfigKeyUnique(SysOssConfigBo bo) { |
| | | Long ossConfigId = StringUtils.isNull(bo.getOssConfigId()) ? -1L : bo.getOssConfigId(); |
| | | private String checkConfigKeyUnique(SysOssConfig sysOssConfig) { |
| | | long ossConfigId = StringUtils.isNull(sysOssConfig.getOssConfigId()) ? -1L : sysOssConfig.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()) { |
| | | .eq(SysOssConfig::getConfigKey, sysOssConfig.getConfigKey())); |
| | | if (StringUtils.isNotNull(info) && info.getOssConfigId() != ossConfigId) { |
| | | 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); |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int updateOssConfigStatus(SysOssConfigBo bo) { |
| | | SysConfig sysConfig = iSysConfigService.getOne(new LambdaQueryWrapper<SysConfig>() |
| | | .eq(SysConfig::getConfigKey, CloudConstant.CLOUD_STORAGE_CONFIG_KEY)); |
| | | if(ObjectUtil.isNotNull(sysConfig)){ |
| | | sysConfig.setConfigValue(sysOssConfig.getConfigKey()); |
| | | sysConfig.setConfigValue(bo.getConfigKey()); |
| | | iSysConfigService.updateConfig(sysConfig); |
| | | } else { |
| | | throw new CustomException("缺å°'äºåå¨é
ç½®KEY'åæ°!"); |
| | | } |
| | | SysOssConfig sysOssConfig = BeanUtil.toBean(bo, SysOssConfig.class); |
| | | baseMapper.update(null, new LambdaUpdateWrapper<SysOssConfig>() |
| | | .set(SysOssConfig::getStatus, "1")); |
| | | return baseMapper.updateById(sysOssConfig); |
| | | } |
| | | |
| | | /** |
| | | * 设置cache key |
| | | * |
| | | * @param configKey åæ°é® |
| | | * @return ç¼åé®key |
| | | */ |
| | | private String getCacheKey(String configKey) { |
| | | return Constants.SYS_CONFIG_KEY + configKey; |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ¥è¯¢äºåå¨é
ç½®å表 |
| | | export function listOssConfig(query) { |
| | | return request({ |
| | | url: '/system/oss/config/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢äºåå¨é
ç½®è¯¦ç» |
| | | export function getOssConfig(ossConfigId) { |
| | | return request({ |
| | | url: '/system/oss/config/' + ossConfigId, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢äºåå¨é
ç½® |
| | | export function addOssConfig(data) { |
| | | return request({ |
| | | url: '/system/oss/config', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹äºåå¨é
ç½® |
| | | export function updateOssConfig(data) { |
| | | return request({ |
| | | url: '/system/oss/config', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å é¤äºåå¨é
ç½® |
| | | export function delOssConfig(ossConfigId) { |
| | | return request({ |
| | | url: '/system/oss/config/' + ossConfigId, |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | |
| | | // ç¨æ·ç¶æä¿®æ¹ |
| | | export function changeOssConfigStatus(ossConfigId, status, configKey) { |
| | | const data = { |
| | | ossConfigId, |
| | | status, |
| | | configKey |
| | | } |
| | | return request({ |
| | | url: '/system/oss/config/changeStatus', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | |
| | | ] |
| | | }, |
| | | { |
| | | path: '/system/oss-config', |
| | | component: Layout, |
| | | hidden: true, |
| | | children: [ |
| | | { |
| | | path: 'index', |
| | | component: (resolve) => require(['@/views/system/oss/config'], resolve), |
| | | name: 'OssConfig', |
| | | meta: { title: 'é
置管ç', activeMenu: '/system/oss'} |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | path: '/monitor/job-log', |
| | | component: Layout, |
| | | hidden: true, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="é
ç½®key" prop="configKey"> |
| | | <el-select v-model="queryParams.configKey" placeholder="è¯·éæ©é
ç½®key" clearable size="small"> |
| | | <el-option |
| | | v-for="configKey in configKeyOptions" |
| | | :key="configKey.configKey" |
| | | :label="configKey.label" |
| | | :value="configKey.configKey" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ¡¶åç§°" prop="bucketName"> |
| | | <el-input |
| | | v-model="queryParams.bucketName" |
| | | placeholder="请è¾å
¥æ¡¶åç§°" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ" prop="status"> |
| | | <el-select v-model="queryParams.status" placeholder="è¯·éæ©ç¶æ" clearable size="small"> |
| | | <el-option |
| | | v-for="dict in statusOptions" |
| | | :key="dict.dictValue" |
| | | :label="dict.dictLabel" |
| | | :value="dict.dictValue" |
| | | /> |
| | | </el-select> |
| | | </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:oss: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:oss:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['system:oss:remove']" |
| | | >å é¤</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:ossConfig:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="ossConfigList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="主建" align="center" prop="ossConfigId" v-if="false"/> |
| | | <el-table-column label="é
ç½®key" align="center" prop="configKey" /> |
| | | <el-table-column label="访é®ç«ç¹" align="center" prop="endpoint" width="200" /> |
| | | <el-table-column label="æ¡¶åç§°" align="center" prop="bucketName" /> |
| | | <el-table-column label="åç¼" align="center" prop="prefix" /> |
| | | <el-table-column label="å" 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:oss:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:oss: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="é
ç½®key" prop="configKey"> |
| | | <el-select v-model="form.configKey" placeholder="è¯·éæ©é
ç½®key"> |
| | | <el-option |
| | | v-for="configKey in configKeyOptions" |
| | | :key="configKey.configKey" |
| | | :label="configKey.label" |
| | | :value="configKey.configKey" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="访é®ç«ç¹" prop="endpoint"> |
| | | <el-input v-model="form.endpoint" placeholder="请è¾å
¥è®¿é®ç«ç¹" /> |
| | | </el-form-item> |
| | | <el-form-item label="accessKey" prop="accessKey"> |
| | | <el-input v-model="form.accessKey" placeholder="请è¾å
¥accessKey" /> |
| | | </el-form-item> |
| | | <el-form-item label="secretKey" prop="secretKey"> |
| | | <el-input v-model="form.secretKey" placeholder="请è¾å
¥ç§é¥" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¡¶åç§°" prop="bucketName"> |
| | | <el-input v-model="form.bucketName" placeholder="请è¾å
¥æ¡¶åç§°" /> |
| | | </el-form-item> |
| | | <el-form-item label="åç¼" prop="prefix"> |
| | | <el-input v-model="form.prefix" placeholder="请è¾å
¥åç¼" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦HTTPS"> |
| | | <el-radio-group v-model="form.isHttps"> |
| | | <el-radio |
| | | v-for="dict in isHttpsOptions" |
| | | :key="dict.dictValue" |
| | | :label="dict.dictValue" |
| | | >{{dict.dictLabel}}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="å" prop="region"> |
| | | <el-input v-model="form.region" placeholder="请è¾å
¥å" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ"> |
| | | <el-radio-group v-model="form.status"> |
| | | <el-radio |
| | | v-for="dict in statusOptions" |
| | | :key="dict.dictValue" |
| | | :label="dict.dictValue" |
| | | >{{dict.dictLabel}}</el-radio> |
| | | </el-radio-group> |
| | | </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 { |
| | | listOssConfig, |
| | | getOssConfig, |
| | | delOssConfig, |
| | | addOssConfig, |
| | | updateOssConfig, |
| | | changeOssConfigStatus |
| | | } from "@/api/system/ossConfig"; |
| | | |
| | | export default { |
| | | name: "OssConfig", |
| | | data() { |
| | | return { |
| | | // æé®loading |
| | | buttonLoading: false, |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // 导åºé®ç½©å± |
| | | exportLoading: false, |
| | | // é䏿°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // äºåå¨é
ç½®è¡¨æ ¼æ°æ® |
| | | ossConfigList: [], |
| | | // configKeyOptions |
| | | configKeyOptions: [], |
| | | configKeyDatas: [ |
| | | { configKey: "minio", label: "Minio" }, |
| | | { configKey: "qiniu", label: "ä¸çäº" }, |
| | | { configKey: "aliyun", label: "é¿éäº" }, |
| | | { configKey: "qcloud", label: "è
¾è®¯äº" }, |
| | | ], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¯å¦httpsåå
¸ |
| | | isHttpsOptions: [], |
| | | // ç¶æ(0æ£å¸¸ 1åç¨)åå
¸ |
| | | statusOptions: [], |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | configKey: undefined, |
| | | bucketName: undefined, |
| | | status: 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.getDicts("sys_yes_no").then(response => { |
| | | this.isHttpsOptions = response.data; |
| | | }); |
| | | this.getDicts("sys_normal_disable").then(response => { |
| | | this.statusOptions = response.data; |
| | | }); |
| | | this.configKeyOptions = this.configKeyDatas; |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢äºåå¨é
ç½®å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listOssConfig(this.queryParams).then((response) => { |
| | | this.ossConfigList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | ossConfigId: undefined, |
| | | configKey: undefined, |
| | | accessKey: undefined, |
| | | secretKey: undefined, |
| | | bucketName: undefined, |
| | | prefix: undefined, |
| | | endpoint: undefined, |
| | | isHttps: "N", |
| | | 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; |
| | | getOssConfig(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) { |
| | | updateOssConfig(this.form).then(response => { |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }).finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } else { |
| | | addOssConfig(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('æ¯å¦ç¡®è®¤å é¤äºåå¨é
ç½®ç¼å·ä¸º"' + ossConfigIds + '"çæ°æ®é¡¹?', "è¦å", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning" |
| | | }).then(() => { |
| | | this.loading = true; |
| | | return delOssConfig(ossConfigIds); |
| | | }).then(() => { |
| | | this.loading = false; |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }).catch(() => {}); |
| | | }, |
| | | // äºåå¨é
ç½®ç¶æä¿®æ¹ |
| | | 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.getList() |
| | | this.msgSuccess(text + "æå"); |
| | | }).catch(function () { |
| | | row.status = row.status === "0" ? "1" : "0"; |
| | | }).finally(() => { |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | v-hasPermi="['system:oss:remove']" |
| | | >å é¤</el-button> |
| | | </el-col> |
| | | |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="info" |
| | | plain |
| | | icon="el-icon-s-operation" |
| | | size="mini" |
| | | @click="handleOssConfig" |
| | | v-hasPermi="['system:oss:list']" |
| | | >é
置管ç</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | |
| | | this.single = selection.length!==1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** 任塿¥å¿å表æ¥è¯¢ */ |
| | | handleOssConfig() { |
| | | this.$router.push({ path: '/system/oss-config/index'}) |
| | | }, |
| | | /** æä»¶æé®æä½ */ |
| | | handleFile() { |
| | | this.reset(); |
| | |
| | | primary key (oss_id) |
| | | ) engine=innodb comment ='OSSäºåå¨è¡¨'; |
| | | |
| | | -- ---------------------------- |
| | | -- OSSäºåå¨å¨æé
置表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_oss_config; |
| | | create table sys_oss_config ( |
| | | oss_config_id bigint(20) not null auto_increment comment '主建', |
| | | config_key varchar(255) not null default '' comment 'é
ç½®key', |
| | | access_key varchar(255) default '' comment 'accessKey', |
| | | 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 'N' comment 'æ¯å¦httpsï¼Y=æ¯,N=å¦ï¼', |
| | | region varchar(255) default '' comment 'å', |
| | | status char(1) default '1' 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 comment='äºåå¨é
置表'; |
| | | |
| | | insert into sys_config values(10, 'OSSäºå卿å¡å', 'sys.oss.cloudStorageService', 'minio', 'Y', 'admin', sysdate(), '', null, 'OSSäºå卿å¡å(qiniu:ä¸çäº, aliyun:é¿éäº, qcloud:è
¾è®¯äº, minio: Minio)'); |
| | | insert into sys_config values(11, 'OSSé¢è§åè¡¨èµæºå¼å
³', 'sys.oss.previewListResource', 'true', 'Y', 'admin', sysdate(), '', null, 'true:å¼å¯, false:å
³é'); |
| | | |
| | |
| | | insert into sys_menu values('1601', 'æä»¶ä¸ä¼ ', '118', '2', '#', '', 1, 0, 'F', '0', '0', 'system:oss:upload', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1602', 'æä»¶ä¸è½½', '118', '3', '#', '', 1, 0, 'F', '0', '0', 'system:oss:download', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1603', 'æä»¶å é¤', '118', '4', '#', '', 1, 0, 'F', '0', '0', 'system:oss:remove', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1604', 'é
置添å ', '118', '5', '#', '', 1, 0, 'F', '0', '0', 'system:oss:add', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1605', 'é
ç½®ç¼è¾', '118', '6', '#', '', 1, 0, 'F', '0', '0', 'system:oss:edit', '#', 'admin', sysdate(), '', null, ''); |
| | | |
| | | insert into sys_oss_config values (1, 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', 'http://localhost:9000', 'N', '', '0', '', 'admin', sysdate(), 'admin', sysdate(), NULL); |
| | | insert into sys_oss_config values (2, 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'http://XXX.XXXX.com', 'N', 'z0', '1', '', 'admin', sysdate(), 'admin', sysdate(), NULL); |
| | | insert into sys_oss_config values (3, 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'http://oss-cn-beijing.aliyuncs.com', 'N', '', '1', '', 'admin', sysdate(), 'admin', sysdate(), NULL); |
| | | insert into sys_oss_config values (4, 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1250000000', '', 'http://cos.ap-beijing.myqcloud.com', 'N', 'ap-beijing', '1', '', 'admin', sysdate(), 'admin', sysdate(), NULL); |