| | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.highdatas.mdm.entity.Maintain; |
| | | import com.highdatas.mdm.entity.MaintainField; |
| | | import com.highdatas.mdm.entity.TUser; |
| | | import com.highdatas.mdm.entity.TableSchemaResult; |
| | | import com.highdatas.mdm.pojo.Segment; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.lang.reflect.Field; |
| | | import java.lang.reflect.Method; |
| | | import java.security.MessageDigest; |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | public static String getFieldRedisKey(String tableName, String field) { |
| | | if (StringUtils.isEmpty(tableName) && StringUtils.isEmpty(field)) { |
| | | return null; |
| | | }else if (StringUtils.isEmpty(field)){ |
| | | return tableName; |
| | | }else if (StringUtils.isEmpty(tableName)){ |
| | | return field; |
| | | }else { |
| | | return tableName + Constant.UnderLine + field; |
| | | } |
| | | } |
| | | |
| | | public static List<String> split(String redisVal) { |
| | | if (StringUtils.isEmpty(redisVal)) { |
| | | return null; |
| | | } |
| | | String[] split = redisVal.split(Constant.SEMICOLON); |
| | | List<String> strings = Arrays.asList(split); |
| | | return strings; |
| | | } |
| | | |
| | | public static TUser getUser(HttpServletRequest request) { |
| | | return (TUser) request.getSession().getAttribute(Constant.USER); |
| | | } |
| | | |
| | | public static Set<String> getRoleByUser(String userId) { |
| | | Set<String> roleIds = new HashSet<>(); |
| | | roleIds.add("R001"); |
| | | roleIds.add("R002"); |
| | | return roleIds; |
| | | } |
| | | } |