#
Junjie
2024-01-08 986390a2a8d5e7cff2f522daa9251bf41fda7c1b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.zy.asrs.common.openapi.service.impl;
 
import com.zy.asrs.common.openapi.mapper.HostKeyMapper;
import com.zy.asrs.common.openapi.entity.HostKey;
import com.zy.asrs.common.openapi.service.HostKeyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zy.asrs.framework.common.Cools;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
@Service("hostKeyService")
public class HostKeyServiceImpl extends ServiceImpl<HostKeyMapper, HostKey> implements HostKeyService {
 
    @Override
    public List<HostKey> getList() {
        List<HostKey> list = this.baseMapper.getList();
        for (HostKey hostKey : list) {//对signKey进行脱敏处理
            if (Cools.isEmpty(hostKey.getSignKey())) {
                continue;
            }
            String signKey = hostKey.getSignKey();
            StringBuilder builder = new StringBuilder(signKey);
            for (int i = 5; i < 27; i++) {
                builder.setCharAt(i, '*');
            }
            builder.delete(5, 22);
            hostKey.setSignKey(builder.toString());
        }
        return list;
    }
}