| 13 | import java.util.List; |
| 14 | |
| 15 | @Service |
| 16 | public class KeysServiceImpl implements KeysService { |
| 17 | |
| 18 | @Autowired |
| 19 | private KeysMapper keysMapper; |
| 20 | @Autowired |
| 21 | private NOSImageupload nOSImageupload; |
| 22 | @Autowired |
| 23 | private OSSImageupload ossImageupload; |
| 24 | @Autowired |
| 25 | private USSImageupload ussImageupload; |
| 26 | @Autowired |
| 27 | private KODOImageupload kodoImageupload; |
| 28 | @Autowired |
| 29 | private COSImageupload cosImageupload; |
| 30 | @Autowired |
| 31 | private FtpServiceImpl ftpService; |
| 32 | @Autowired |
| 33 | private S3Imageupload s3Imageupload; |
| 34 | @Autowired |
| 35 | private WebDAVImageupload webDAVImageupload; |
| 36 | |
| 37 | |
| 38 | @Override |
| 39 | public Keys selectKeys(Integer id) { |
| 40 | // TODO Auto-generated method stub |
| 41 | return keysMapper.selectKeys(id); |
| 42 | } |
| 43 | @Override |
| 44 | public List<Keys> getStorageName() { |
| 45 | return keysMapper.getStorageName(); |
| 46 | } |
| 47 | |
| 48 | @Override |
| 49 | public List<Keys> getStorage() { |
| 50 | return keysMapper.getStorage(); |
| 51 | } |
| 52 | |
| 53 | @Override |
| 54 | public Msg updateKey(Keys key) { |
| 55 | Msg msg = new Msg(); |
| 56 | Integer ret = -2; |
| 57 | //修正一边数据格式,去除末尾的斜杠 |
| 58 | if(key.getStorageType()==9 || key.getStorageType()==8){ |
| 59 | //s3或者webdav |
| 60 | if(!StringUtils.isBlank(key.getRootPath()) && !key.getRootPath().equals("/")){ |
| 61 | if (key.getRootPath().endsWith("/")) { |
| 62 | String rootpath = key.getRootPath(); |
| 63 | key.setRootPath(rootpath.substring(0, rootpath.length() - 1)); |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | if(!StringUtils.isBlank(key.getEndpoint())){ |
| 68 | final String endpoint = key.getEndpoint(); |
| 69 | if (endpoint.endsWith("/")) { |
| 70 | key.setEndpoint(endpoint.substring(0, endpoint.length() - 1)); |
| 71 | } |
| 72 | } |
nothing calls this directly
no outgoing calls
no test coverage detected