old mode 100644
new mode 100755
| | |
| | | */ |
| | | package com.java110.job.adapt.hcIot; |
| | | |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.util.StringUtil; |
| | | |
| | | /** |
| | | * HC 物联网常量类 |
| | | * 接口协议地址: https://gitee.com/java110/MicroCommunityThings/blob/master/back/docs/api.md |
| | |
| | | */ |
| | | public class IotConstant { |
| | | |
| | | public static final String IOT_URL = "https://things.homecommunity.cn:9999/"; |
| | | public static final String IOT_DOMAIN = "IOT"; // 物联网域 |
| | | public static final String IOT_URL = "IOT_URL"; // 物联网域 |
| | | public static final String IOT_APP_ID = "APP_ID"; // 物联网域 |
| | | public static final String IOT_APP_SECRET = "APP_SECRET"; // 物联网域 |
| | | |
| | | public static final String APP_ID = "e86a6a373c354927bea5fd21a0bec617"; |
| | | public static final String APP_SECRET = "ead9a2f67f96e2b8ed2fe38cc9709463"; |
| | | private static final String DEFAULT_IOT_URL = "https://things.homecommunity.cn"; |
| | | |
| | | public static final String GET_TOKEN_URL = IOT_URL + " /extApi/auth/getAccessToken?appId=" + APP_ID + "&appSecret=" + APP_SECRET; |
| | | private static final String DEFAULT_APP_ID = "e86a6a373c354927bea5fd21a0bec617"; |
| | | private static final String DEFAULT_APP_SECRET = "ead9a2f67f96e2b8ed2fe38cc9709463"; |
| | | |
| | | public static final String GET_TOKEN_URL = "/extApi/auth/getAccessToken?appId=APP_ID&appSecret=APP_SECRET"; |
| | | |
| | | //添加小区 |
| | | public static final String ADD_COMMUNITY_URL = IOT_URL + "/extApi/community/addCommunity"; |
| | | public static final String ADD_COMMUNITY_URL = "/extApi/community/addCommunity"; |
| | | //修改小区 |
| | | public static final String UPDATE_COMMUNITY_URL = IOT_URL + "/extApi/community/updateCommunity"; |
| | | public static final String UPDATE_COMMUNITY_URL = "/extApi/community/updateCommunity"; |
| | | //删除小区 |
| | | public static final String DELETE_COMMUNITY_URL = IOT_URL + "/extApi/community/deleteCommunity"; |
| | | public static final String DELETE_COMMUNITY_URL = "/extApi/community/deleteCommunity"; |
| | | |
| | | //添加设备 |
| | | public static final String ADD_MACHINE_URL = IOT_URL + "/extApi/machine/addMachine"; |
| | | public static final String ADD_MACHINE_URL = "/extApi/machine/addMachine"; |
| | | //修改设备 |
| | | public static final String UPDATE_MACHINE_URL = IOT_URL + "/extApi/machine/updateMachine"; |
| | | public static final String UPDATE_MACHINE_URL = "/extApi/machine/updateMachine"; |
| | | //删除设备 |
| | | public static final String DELETE_MACHINE_URL = IOT_URL + "/extApi/machine/deleteMachine"; |
| | | public static final String DELETE_MACHINE_URL = "/extApi/machine/deleteMachine"; |
| | | |
| | | //添加停车场 |
| | | public static final String ADD_PARKING_AREA_URL = "/extApi/parkingArea/addParkingArea"; |
| | | //修改停车场 |
| | | public static final String UPDATE_PARKING_AREA_URL = "/extApi/parkingArea/updateParkingArea"; |
| | | //删除停车场 |
| | | public static final String DELETE_PARKING_AREA_URL = "/extApi/parkingArea/deleteParkingArea"; |
| | | |
| | | //添加车辆 |
| | | public static final String ADD_OWNER_CAR_URL = "/extApi/car/addCar"; |
| | | //修改车辆 |
| | | public static final String UPDATE_OWNER_CAR_URL = "/extApi/car/updateCar"; |
| | | //删除车辆 |
| | | public static final String DELETE_OWNER_CAR_URL = "/extApi/car/deleteCar"; |
| | | |
| | | //添加车辆 |
| | | public static final String ADD_CAR_BLACK_WHITE_URL = "/extApi/car/addBlackWhite"; |
| | | |
| | | //删除车辆 |
| | | public static final String DELETE_CAR_BLACK_WHITE_URL = "/extApi/car/deleteBlackWhite"; |
| | | |
| | | //开门接口 |
| | | public static final String OPEN_DOOR = IOT_URL + "/extApi/machine/openDoor"; |
| | | public static final String OPEN_DOOR = "/extApi/machine/openDoor"; |
| | | //重启接口 |
| | | public static final String RESTART_MACHINE = IOT_URL + "/extApi/machine/restartMachine"; |
| | | public static final String RESTART_MACHINE = "/extApi/machine/restartMachine"; |
| | | |
| | | //查询临时停车费订单 |
| | | public static final String GET_TEMP_CAR_FEE_ORDER = "/extApi/fee/getTempCarFeeOrder"; |
| | | |
| | | //查询临时停车费订单 |
| | | public static final String NOTIFY_TEMP_CAR_FEE_ORDER = "/extApi/fee/notifyTempCarFeeOrder"; |
| | | |
| | | //添加车辆 |
| | | public static final String ADD_TEAM_CAR_FEE_CONFIG = "/extApi/fee/addTempCarFee"; |
| | | //修改车辆 |
| | | public static final String UPDATE_TEAM_CAR_FEE_CONFIG = "/extApi/fee/updateTempCarFee"; |
| | | //删除车辆 |
| | | public static final String DELETE_TEAM_CAR_FEE_CONFIG = "/extApi/fee/deleteTempCarFee"; |
| | | |
| | | //添加考勤班次 |
| | | public static final String ADD_ATTENDANCE_CLASSES_STAFFS = "/extApi/attendance/addAttendanceClassStaffs"; |
| | | |
| | | |
| | | //删除考勤班次 |
| | | public static final String DELETE_ATTENDANCE_CLASSES_STAFFS = "/extApi/attendance/deleteAttendanceClassStaff"; |
| | | |
| | | //添加考勤班次 |
| | | public static final String ADD_ATTENDANCE_CLASSES = "/extApi/attendance/addAttendanceClass"; |
| | | //修改考勤班次 |
| | | public static final String UPDATE_ATTENDANCE_CLASSES = "/extApi/attendance/updateAttendanceClass"; |
| | | //删除考勤班次 |
| | | public static final String DELETE_ATTENDANCE_CLASSES = "/extApi/attendance/deleteAttendanceClass"; |
| | | |
| | | public static final String HC_TOKEN = "HC_ACCESS_TOKEN"; |
| | | |
| | |
| | | public static final String ADD_OWNER = "/extApi/user/addUser"; |
| | | public static final String EDIT_OWNER = "/extApi/user/updateUser"; |
| | | public static final String DELETE_OWNER = "/extApi/user/deleteUser"; |
| | | |
| | | |
| | | public static String getUrl(String param) { |
| | | String url = MappingCache.getValue(IOT_DOMAIN, IotConstant.IOT_URL); |
| | | |
| | | if (StringUtil.isEmpty(url)) { |
| | | return DEFAULT_IOT_URL + param; |
| | | } |
| | | |
| | | return url + param; |
| | | } |
| | | |
| | | public static String getAppId() { |
| | | String appId = MappingCache.getValue(IOT_DOMAIN, IotConstant.IOT_APP_ID); |
| | | |
| | | if (StringUtil.isEmpty(appId)) { |
| | | return DEFAULT_APP_ID; |
| | | } |
| | | |
| | | return appId; |
| | | } |
| | | |
| | | public static String getAppSecret() { |
| | | String appSecret = MappingCache.getValue(IOT_DOMAIN, IotConstant.IOT_APP_SECRET); |
| | | |
| | | if (StringUtil.isEmpty(appSecret)) { |
| | | return DEFAULT_APP_SECRET; |
| | | } |
| | | |
| | | return appSecret; |
| | | } |
| | | } |