| | |
| | | package com.whyc.util; |
| | | |
| | | import com.whyc.service.OperationLogService; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | /** |
| | | * 通用工具列 |
| | | */ |
| | | @Component |
| | | public class CommonUtil { |
| | | |
| | | private static OperationLogService service; |
| | | //将数转换成二进制字符串并统计1的个数 |
| | | public static int getIntToBinary(int switchState,int[] bit){ |
| | | int count=0; |
| | |
| | | return count; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | //System.out.println(getIntToBinary(511,new int[]{0,1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24})); |
| | | System.out.println(511&(1<<8)); |
| | | /** |
| | | * 手动记录特定日志 |
| | | */ |
| | | public static void record(int type1,int type2, String msg, String msgDetail) { |
| | | service.record(type1, type2, msg, msgDetail); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |