├── README.md ├── backend ├── .gitignore ├── pom.xml └── src │ └── main │ ├── java │ └── cc │ │ └── mrbird │ │ └── febs │ │ ├── FebsApplication.java │ │ ├── common │ │ ├── annotation │ │ │ ├── IsCron.java │ │ │ ├── Limit.java │ │ │ └── Log.java │ │ ├── aspect │ │ │ ├── LimitAspect.java │ │ │ └── LogAspect.java │ │ ├── authentication │ │ │ ├── JWTFilter.java │ │ │ ├── JWTToken.java │ │ │ ├── JWTUtil.java │ │ │ ├── ShiroConfig.java │ │ │ └── ShiroRealm.java │ │ ├── config │ │ │ ├── AlipayConfig.java │ │ │ ├── AsyncExecutorPoolConfig.java │ │ │ ├── MinioConfig.java │ │ │ ├── MyWebMvcConfigurerAdapter.java │ │ │ ├── MybatisPlusConfig.java │ │ │ ├── P6spySqlFormatConfig.java │ │ │ └── RedisConfig.java │ │ ├── controller │ │ │ └── BaseController.java │ │ ├── converter │ │ │ └── TimeConverter.java │ │ ├── domain │ │ │ ├── ActiveUser.java │ │ │ ├── FebsConstant.java │ │ │ ├── FebsResponse.java │ │ │ ├── LimitType.java │ │ │ ├── QueryRequest.java │ │ │ ├── RedisInfo.java │ │ │ ├── RegexpConstant.java │ │ │ ├── Tree.java │ │ │ └── router │ │ │ │ ├── RouterMeta.java │ │ │ │ └── VueRouter.java │ │ ├── exception │ │ │ ├── FebsException.java │ │ │ ├── LimitAccessException.java │ │ │ ├── RedisConnectException.java │ │ │ └── TokenTimeoutException.java │ │ ├── function │ │ │ ├── CacheSelector.java │ │ │ └── JedisExecutor.java │ │ ├── generator │ │ │ └── CodeGenerator.java │ │ ├── handler │ │ │ └── GlobalExceptionHandler.java │ │ ├── mqtt │ │ │ ├── DeviceMqttConfig.java │ │ │ ├── DeviceMqttInboundMessageHandler.java │ │ │ └── DeviceMqttProperties.java │ │ ├── properties │ │ │ ├── FebsProperties.java │ │ │ └── ShiroProperties.java │ │ ├── runner │ │ │ ├── CacheInitRunner.java │ │ │ └── StartedUpRunner.java │ │ ├── service │ │ │ ├── CacheService.java │ │ │ ├── RedisService.java │ │ │ └── impl │ │ │ │ ├── CacheServiceImpl.java │ │ │ │ └── RedisServiceImpl.java │ │ ├── task │ │ │ └── CacheTask.java │ │ ├── utils │ │ │ ├── AddressUtil.java │ │ │ ├── DateUtil.java │ │ │ ├── EncryptUtil.java │ │ │ ├── FebsUtil.java │ │ │ ├── FileDownloadUtils.java │ │ │ ├── FileNameUtils.java │ │ │ ├── FileUtil.java │ │ │ ├── HttpContextUtil.java │ │ │ ├── HttpUtil.java │ │ │ ├── IPUtil.java │ │ │ ├── MD5Util.java │ │ │ ├── R.java │ │ │ ├── SortUtil.java │ │ │ ├── SpaceUtil.java │ │ │ ├── SpringContextUtil.java │ │ │ └── TreeUtil.java │ │ └── validator │ │ │ └── CronValidator.java │ │ ├── cos │ │ ├── controller │ │ │ ├── BulletinInfoController.java │ │ │ ├── DeviceAlertInfoController.java │ │ │ ├── DeviceHistoryInfoController.java │ │ │ ├── DeviceInfoController.java │ │ │ ├── DeviceOfflineRecordController.java │ │ │ ├── DeviceTypeController.java │ │ │ ├── EventDetailController.java │ │ │ ├── EventInfoController.java │ │ │ ├── FileController.java │ │ │ ├── MessageInfoController.java │ │ │ ├── OperateRecordInfoController.java │ │ │ └── UserInfoController.java │ │ ├── dao │ │ │ ├── BulletinInfoMapper.java │ │ │ ├── DeviceAlertInfoMapper.java │ │ │ ├── DeviceHistoryInfoMapper.java │ │ │ ├── DeviceInfoMapper.java │ │ │ ├── DeviceOfflineRecordMapper.java │ │ │ ├── DeviceTypeMapper.java │ │ │ ├── EventDetailMapper.java │ │ │ ├── EventInfoMapper.java │ │ │ ├── MessageInfoMapper.java │ │ │ ├── OperateRecordInfoMapper.java │ │ │ └── UserInfoMapper.java │ │ ├── entity │ │ │ ├── BulletinInfo.java │ │ │ ├── DeviceAlertInfo.java │ │ │ ├── DeviceHistoryInfo.java │ │ │ ├── DeviceInfo.java │ │ │ ├── DeviceOfflineRecord.java │ │ │ ├── DeviceType.java │ │ │ ├── EventDetail.java │ │ │ ├── EventInfo.java │ │ │ ├── MessageInfo.java │ │ │ ├── OperateRecordInfo.java │ │ │ └── UserInfo.java │ │ └── service │ │ │ ├── IBulletinInfoService.java │ │ │ ├── IDeviceAlertInfoService.java │ │ │ ├── IDeviceHistoryInfoService.java │ │ │ ├── IDeviceInfoService.java │ │ │ ├── IDeviceOfflineRecordService.java │ │ │ ├── IDeviceTypeService.java │ │ │ ├── IEventDetailService.java │ │ │ ├── IEventInfoService.java │ │ │ ├── IMailService.java │ │ │ ├── IMessageInfoService.java │ │ │ ├── IOperateRecordInfoService.java │ │ │ ├── IUserInfoService.java │ │ │ └── impl │ │ │ ├── BulletinInfoServiceImpl.java │ │ │ ├── DeviceAlertInfoServiceImpl.java │ │ │ ├── DeviceHistoryInfoServiceImpl.java │ │ │ ├── DeviceInfoServiceImpl.java │ │ │ ├── DeviceOfflineRecordServiceImpl.java │ │ │ ├── DeviceTypeServiceImpl.java │ │ │ ├── EventDetailServiceImpl.java │ │ │ ├── EventInfoServiceImpl.java │ │ │ ├── IMailServiceImpl.java │ │ │ ├── MessageInfoServiceImpl.java │ │ │ ├── OperateRecordInfoServiceImpl.java │ │ │ └── UserInfoServiceImpl.java │ │ ├── system │ │ ├── controller │ │ │ ├── DeptController.java │ │ │ ├── DictController.java │ │ │ ├── LogController.java │ │ │ ├── LoginController.java │ │ │ ├── MenuController.java │ │ │ ├── RedisController.java │ │ │ ├── RoleController.java │ │ │ ├── TestController.java │ │ │ └── UserController.java │ │ ├── dao │ │ │ ├── DeptMapper.java │ │ │ ├── DictMapper.java │ │ │ ├── LogMapper.java │ │ │ ├── LoginLogMapper.java │ │ │ ├── MenuMapper.java │ │ │ ├── RoleMapper.java │ │ │ ├── RoleMenuMapper.java │ │ │ ├── TestMapper.java │ │ │ ├── UserConfigMapper.java │ │ │ ├── UserMapper.java │ │ │ └── UserRoleMapper.java │ │ ├── domain │ │ │ ├── Dept.java │ │ │ ├── Dict.java │ │ │ ├── LoginLog.java │ │ │ ├── Menu.java │ │ │ ├── Role.java │ │ │ ├── RoleMenu.java │ │ │ ├── SysLog.java │ │ │ ├── Test.java │ │ │ ├── User.java │ │ │ ├── UserConfig.java │ │ │ └── UserRole.java │ │ ├── manager │ │ │ └── UserManager.java │ │ └── service │ │ │ ├── DeptService.java │ │ │ ├── DictService.java │ │ │ ├── LogService.java │ │ │ ├── LoginLogService.java │ │ │ ├── MenuService.java │ │ │ ├── RoleMenuServie.java │ │ │ ├── RoleService.java │ │ │ ├── TestService.java │ │ │ ├── UserConfigService.java │ │ │ ├── UserRoleService.java │ │ │ ├── UserService.java │ │ │ └── impl │ │ │ ├── DeptServiceImpl.java │ │ │ ├── DictServiceImpl.java │ │ │ ├── LogServiceImpl.java │ │ │ ├── LoginLogServiceImpl.java │ │ │ ├── MenuServiceImpl.java │ │ │ ├── RoleMenuServiceImpl.java │ │ │ ├── RoleServiceImpl.java │ │ │ ├── TestServiceImpl.java │ │ │ ├── UserConfigServiceImpl.java │ │ │ ├── UserRoleServiceImpl.java │ │ │ └── UserServiceImpl.java │ │ └── web │ │ └── controller │ │ ├── ArticleController.java │ │ ├── MovieController.java │ │ └── WeatherController.java │ └── resources │ ├── ValidationMessages.properties │ ├── application.yml │ ├── banner.txt │ ├── config │ └── alipay.properties │ ├── generator │ └── templates │ │ ├── controller.java.ftl │ │ ├── entity.java.ftl │ │ ├── mapper.java.ftl │ │ ├── mapper.xml.ftl │ │ ├── service.java.ftl │ │ └── serviceImpl.java.ftl │ ├── ip2region │ └── ip2region.db │ ├── logback-spring.xml │ ├── mapper │ ├── cos │ │ ├── BulletinInfoMapper.xml │ │ ├── DeviceAlertInfoMapper.xml │ │ ├── DeviceHistoryInfoMapper.xml │ │ ├── DeviceInfoMapper.xml │ │ ├── DeviceOfflineRecordMapper.xml │ │ ├── DeviceTypeMapper.xml │ │ ├── EventDetailMapper.xml │ │ ├── EventInfoMapper.xml │ │ ├── MessageInfoMapper.xml │ │ ├── OperateRecordInfoMapper.xml │ │ └── UserInfoMapper.xml │ └── system │ │ ├── LoginLogMapper.xml │ │ ├── MenuMapper.xml │ │ ├── RoleMapper.xml │ │ ├── UserMapper.xml │ │ └── UserRoleMapper.xml │ ├── spy.properties │ └── templates │ ├── email.html │ └── registerEmail.html └── frontend ├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitattributes ├── .idea ├── .gitignore ├── frontend.iml ├── git_toolbox_blame.xml ├── inspectionProfiles │ └── Project_Default.xml ├── modules.xml └── vcs.xml ├── .postcssrc.js ├── build ├── build.js ├── check-versions.js ├── logo.png ├── utils.js ├── vue-loader.conf.js ├── webpack.base.conf.js ├── webpack.dev.conf.js └── webpack.prod.conf.js ├── config ├── dev.env.js ├── index.js ├── prod.env.js └── test.env.js ├── index.html ├── package-lock.json ├── package.json ├── src ├── FEBS.vue ├── components │ ├── checkbox │ │ ├── ColorCheckbox.vue │ │ └── ImgCheckbox.vue │ ├── datetime │ │ └── RangeDate.vue │ ├── exception │ │ ├── ExceptionPage.vue │ │ └── typeConfig.js │ ├── menu │ │ ├── Contextmenu.vue │ │ ├── SiderMenu.vue │ │ └── menu.js │ ├── setting │ │ ├── Setting.vue │ │ ├── SettingItem.vue │ │ └── StyleItem.vue │ └── tool │ │ └── Drawer.vue ├── main.js ├── router │ └── index.js ├── store │ ├── index.js │ └── modules │ │ ├── account.js │ │ └── setting.js ├── utils │ ├── color.js │ ├── common.js │ ├── device.js │ ├── install.js │ ├── localstorage.js │ ├── map │ │ ├── baiduMap.js │ │ ├── gisMap.js │ │ └── searchmap │ │ │ ├── drawerMap.vue │ │ │ └── index.vue │ ├── permissionDirect.js │ ├── request.js │ └── utils.less └── views │ ├── HomePage.vue │ ├── common │ ├── EmptyPageView.vue │ ├── GlobalFooter.vue │ ├── GlobalHeader.vue │ ├── GlobalLayout.vue │ ├── HeadInfo.vue │ ├── HeaderAvatar.vue │ ├── MenuView.vue │ ├── PageContent.vue │ ├── PageLayout.vue │ └── PageView.vue │ ├── error │ ├── 403.vue │ ├── 404.vue │ └── 500.vue │ ├── login │ ├── Common.vue │ ├── Login.vue │ └── Regist.vue │ ├── manage │ ├── alert │ │ ├── Alert.vue │ │ ├── AlertAdd.vue │ │ ├── AlertEdit.vue │ │ └── AlertView.vue │ ├── bulletin │ │ ├── Bulletin.vue │ │ ├── BulletinAdd.vue │ │ └── BulletinEdit.vue │ ├── commodity │ │ ├── Commodity.vue │ │ ├── CommodityAdd.vue │ │ ├── CommodityEdit.vue │ │ └── CommodityView.vue │ ├── component │ │ ├── home │ │ │ └── Home.vue │ │ └── work │ │ │ └── Work.vue │ ├── device │ │ ├── Device.vue │ │ ├── DeviceAdd.vue │ │ ├── DeviceEdit.vue │ │ └── DeviceView.vue │ ├── event │ │ ├── Event.vue │ │ ├── EventAdd.vue │ │ ├── EventEdit.vue │ │ └── EventView.vue │ ├── history │ │ ├── History.vue │ │ ├── HistoryAdd.vue │ │ ├── HistoryEdit.vue │ │ └── HistoryView.vue │ ├── message │ │ ├── Message.vue │ │ ├── MessageAdd.vue │ │ └── MessageEdit.vue │ ├── offline │ │ ├── Offline.vue │ │ ├── OfflineAdd.vue │ │ ├── OfflineEdit.vue │ │ └── OfflineView.vue │ ├── record │ │ ├── Record.vue │ │ ├── RecordAdd.vue │ │ ├── RecordEdit.vue │ │ └── RecordView.vue │ ├── type │ │ ├── Type.vue │ │ ├── TypeAdd.vue │ │ ├── TypeEdit.vue │ │ └── TypeView.vue │ └── user │ │ ├── User.vue │ │ ├── UserAdd.vue │ │ ├── UserEdit.vue │ │ └── UserView.vue │ ├── monitor │ ├── Httptrace.vue │ ├── JvmInfo.vue │ ├── Online.vue │ ├── RedisInfo.vue │ ├── RedisTerminal.vue │ ├── SystemInfo.vue │ ├── SystemLog.vue │ └── TomcatInfo.vue │ ├── others │ ├── Excel.vue │ └── ImportResult.vue │ ├── personal │ ├── Profile.vue │ ├── UpdateAvatar.vue │ ├── UpdatePassword.vue │ └── UpdateProfile.vue │ ├── quartz │ ├── job │ │ ├── Job.vue │ │ ├── JobAdd.vue │ │ └── JobEdit.vue │ └── log │ │ └── JobLog.vue │ ├── statistics │ ├── history │ │ └── History.vue │ └── online │ │ └── Online.vue │ ├── system │ ├── dept │ │ ├── Dept.vue │ │ ├── DeptAdd.vue │ │ ├── DeptEdit.vue │ │ └── DeptInputTree.vue │ ├── dict │ │ ├── Dict.vue │ │ ├── DictAdd.vue │ │ └── DictEdit.vue │ ├── menu │ │ ├── ButtonAdd.vue │ │ ├── ButtonEdit.vue │ │ ├── Icon.less │ │ ├── Icons.vue │ │ ├── Menu.vue │ │ ├── MenuAdd.vue │ │ └── MenuEdit.vue │ ├── role │ │ ├── Role.vue │ │ ├── RoleAdd.vue │ │ ├── RoleEdit.vue │ │ └── RoleInfo.vue │ └── user │ │ ├── User.vue │ │ ├── UserAdd.vue │ │ ├── UserEdit.vue │ │ ├── UserInfo.less │ │ └── UserInfo.vue │ ├── user │ ├── alert │ │ ├── Alert.vue │ │ ├── AlertAdd.vue │ │ ├── AlertEdit.vue │ │ └── AlertView.vue │ ├── device │ │ ├── Device.vue │ │ ├── DeviceAdd.vue │ │ ├── DeviceEdit.vue │ │ └── DeviceView.vue │ ├── event │ │ ├── Event.vue │ │ ├── EventAdd.vue │ │ ├── EventEdit.vue │ │ └── EventView.vue │ ├── history │ │ ├── History.vue │ │ ├── HistoryAdd.vue │ │ ├── HistoryEdit.vue │ │ └── HistoryView.vue │ ├── message │ │ ├── Message.vue │ │ ├── MessageAdd.vue │ │ └── MessageEdit.vue │ ├── offline │ │ ├── Offline.vue │ │ ├── OfflineAdd.vue │ │ ├── OfflineEdit.vue │ │ └── OfflineView.vue │ ├── personal │ │ └── Personal.vue │ └── record │ │ ├── Record.vue │ │ ├── RecordAdd.vue │ │ ├── RecordEdit.vue │ │ └── RecordView.vue │ └── web │ ├── DailyArticle.vue │ ├── MovieComing.vue │ ├── MovieHot.vue │ └── Weather.vue ├── static ├── .gitkeep ├── avatar │ ├── 17e420c250804efe904a09a33796d5a10.jpg │ ├── 17e420c250804efe904a09a33796d5a16.jpg │ ├── 19034103295190235.jpg │ ├── 1d22f3e41d284f50b2c8fc32e0788698.jpeg │ ├── 20180414165754.jpg │ ├── 20180414165815.jpg │ ├── 20180414165821.jpg │ ├── 20180414165827.jpg │ ├── 20180414165834.jpg │ ├── 20180414165840.jpg │ ├── 20180414165846.jpg │ ├── 20180414165855.jpg │ ├── 20180414165909.jpg │ ├── 20180414165914.jpg │ ├── 20180414165920.jpg │ ├── 20180414165927.jpg │ ├── 20180414165936.jpg │ ├── 20180414165942.jpg │ ├── 20180414165947.jpg │ ├── 20180414165955.jpg │ ├── 20180414170003.jpg │ ├── 2dd7a2d09fa94bf8b5c52e5318868b4d9.jpg │ ├── 2dd7a2d09fa94bf8b5c52e5318868b4df.jpg │ ├── 496b3ace787342f7954b7045b8b06804.jpeg │ ├── 595ba7b05f2e485eb50565a50cb6cc3c.jpeg │ ├── 5997fedcc7bd4cffbd350b40d1b5b9824.jpg │ ├── 5997fedcc7bd4cffbd350b40d1b5b987.jpg │ ├── 87d8194bc9834e9f8f0228e9e530beb1.jpeg │ ├── 8f5b60ef00714a399ee544d331231820.jpeg │ ├── 964e40b005724165b8cf772355796c8c.jpeg │ ├── BiazfanxmamNRoxxVxka.png │ ├── WhxKECPNujWoWEFNdnJE.png │ ├── a3b10296862e40edb811418d64455d00.jpeg │ ├── a43456282d684e0b9319cf332f8ac468.jpeg │ ├── bba284ac05b041a8b8b0d1927868d5c9x.jpg │ ├── c7c4ee7be3eb4e73a19887dc713505145.jpg │ ├── cnrhVkzwxjPwAaCfPbdc.png │ ├── default.jpg │ ├── ff698bb2d25c4d218b3256b46c706ece.jpeg │ ├── gaOngJwsRYRaVAuXXcmB.png │ ├── jZUIxmJycoymBprLOUbT.png │ └── ubnKSIfAJTxIgXOKlciN.png ├── file │ └── city.json ├── img │ ├── 1work-4997565_1280.png │ ├── delete.png │ ├── download.png │ ├── error.png │ ├── favicon.ico │ ├── home.png │ ├── loading.png │ ├── logo-blue.png │ ├── logo.png │ ├── record.png │ ├── side-bar-dark.svg │ ├── side-bar-left.svg │ ├── side-bar-light.svg │ ├── side-bar-top.svg │ ├── template.png │ ├── total.png │ └── work-4997565_1280.png └── less │ ├── Color.less │ ├── Common.less │ ├── jsmind.css │ └── jsmind.js └── yarn.lock /backend/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Example user template template 3 | ### Example user template 4 | 5 | # IntelliJ project files 6 | .idea 7 | *.iml 8 | out 9 | gen 10 | /target/ 11 | /log/ 12 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/FebsApplication.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs; 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication; 4 | import org.springframework.boot.builder.SpringApplicationBuilder; 5 | import org.springframework.scheduling.annotation.EnableAsync; 6 | import org.springframework.scheduling.annotation.EnableScheduling; 7 | import org.springframework.transaction.annotation.EnableTransactionManagement; 8 | 9 | @SpringBootApplication 10 | @EnableTransactionManagement 11 | @EnableScheduling 12 | @EnableAsync 13 | public class FebsApplication { 14 | 15 | public static void main(String[] args) { 16 | new SpringApplicationBuilder(FebsApplication.class) 17 | .run(args); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/annotation/IsCron.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.annotation; 2 | 3 | import cc.mrbird.febs.common.validator.CronValidator; 4 | 5 | import javax.validation.Constraint; 6 | import javax.validation.Payload; 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | @Target({ElementType.FIELD}) 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @Constraint(validatedBy = CronValidator.class) 15 | public @interface IsCron { 16 | 17 | String message(); 18 | 19 | Class[] groups() default {}; 20 | 21 | Class[] payload() default {}; 22 | } 23 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/annotation/Limit.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.annotation; 2 | 3 | import cc.mrbird.febs.common.domain.LimitType; 4 | 5 | import java.lang.annotation.ElementType; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | import java.lang.annotation.Target; 9 | 10 | @Target(ElementType.METHOD) 11 | @Retention(RetentionPolicy.RUNTIME) 12 | public @interface Limit { 13 | 14 | // 资源名称,用于描述接口功能 15 | String name() default ""; 16 | 17 | // 资源 key 18 | String key() default ""; 19 | 20 | // key prefix 21 | String prefix() default ""; 22 | 23 | // 时间的,单位秒 24 | int period(); 25 | 26 | // 限制访问次数 27 | int count(); 28 | 29 | // 限制类型 30 | LimitType limitType() default LimitType.CUSTOMER; 31 | } 32 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/annotation/Log.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target(ElementType.METHOD) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface Log { 11 | String value() default ""; 12 | } 13 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/authentication/JWTToken.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.authentication; 2 | 3 | import lombok.Data; 4 | import org.apache.shiro.authc.AuthenticationToken; 5 | 6 | /** 7 | * JSON Web Token 8 | */ 9 | @Data 10 | public class JWTToken implements AuthenticationToken { 11 | 12 | private static final long serialVersionUID = 1282057025599826155L; 13 | 14 | private String token; 15 | 16 | private String exipreAt; 17 | 18 | public JWTToken(String token) { 19 | this.token = token; 20 | } 21 | 22 | public JWTToken(String token, String exipreAt) { 23 | this.token = token; 24 | this.exipreAt = exipreAt; 25 | } 26 | 27 | @Override 28 | public Object getPrincipal() { 29 | return token; 30 | } 31 | 32 | @Override 33 | public Object getCredentials() { 34 | return token; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/config/AlipayConfig.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.context.annotation.PropertySource; 7 | import org.springframework.stereotype.Component; 8 | 9 | /** 10 | * 配置文件读取 11 | * 12 | * @author 小道仙 13 | * @date 2020年2月18日 14 | */ 15 | @Configuration 16 | @ConfigurationProperties 17 | @PropertySource("classpath:config/alipay.properties") 18 | @Data 19 | @Component 20 | public class AlipayConfig { 21 | 22 | /** 23 | * 应用ID,您的APPID,收款账号既是您的APPID对应支付宝账号 24 | */ 25 | private String appId; 26 | 27 | /** 28 | * 商户私钥,您的PKCS8格式RSA2私钥 29 | */ 30 | private String privateKey; 31 | 32 | /** 33 | * 支付宝公钥, 34 | */ 35 | private String publicKey; 36 | 37 | /** 38 | * 服务器异步通知页面路径需http://格式的完整路径,不能加?id=123这类自定义参数 39 | */ 40 | private String notifyUrl; 41 | 42 | /** 43 | * 页面跳转同步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数 44 | */ 45 | private String returnUrl; 46 | 47 | /** 48 | * 签名方式 49 | */ 50 | private String signType; 51 | 52 | /** 53 | * 字符编码格式 54 | */ 55 | private String charset; 56 | 57 | /** 58 | * 支付宝网关 59 | */ 60 | private String gatewayUrl; 61 | 62 | /** 63 | * 支付宝网关 64 | */ 65 | private String logPath; 66 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/config/AsyncExecutorPoolConfig.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.scheduling.annotation.AsyncConfigurerSupport; 6 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; 7 | 8 | import java.util.concurrent.Executor; 9 | import java.util.concurrent.ThreadPoolExecutor; 10 | 11 | @Configuration 12 | public class AsyncExecutorPoolConfig extends AsyncConfigurerSupport { 13 | @Bean 14 | public Executor taskExecutor() { 15 | ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); 16 | 17 | executor.setCorePoolSize(5); 18 | executor.setMaxPoolSize(20); 19 | executor.setQueueCapacity(100); 20 | executor.setKeepAliveSeconds(30); 21 | executor.setThreadNamePrefix("asyncTaskExecutor-"); 22 | 23 | executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); 24 | return executor; 25 | } 26 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/config/MyWebMvcConfigurerAdapter.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | 7 | @Configuration 8 | public class MyWebMvcConfigurerAdapter implements WebMvcConfigurer { 9 | 10 | @Override 11 | public void addResourceHandlers(ResourceHandlerRegistry registry) { 12 | registry.addResourceHandler("/imagesWeb/**").addResourceLocations("file:G:/Project/20240725智能家居管理系统/db/"); 13 | WebMvcConfigurer.super.addResourceHandlers(registry); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.config; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | @Configuration 9 | @MapperScan(value = {"cc.mrbird.febs.*.dao"}) 10 | public class MybatisPlusConfig { 11 | 12 | /** 13 | * 分页插件 14 | */ 15 | @Bean 16 | public PaginationInterceptor paginationInterceptor() { 17 | return new PaginationInterceptor(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/config/P6spySqlFormatConfig.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.config; 2 | 3 | import cc.mrbird.febs.common.utils.DateUtil; 4 | import com.p6spy.engine.spy.appender.MessageFormattingStrategy; 5 | import org.apache.commons.lang3.StringUtils; 6 | 7 | import java.time.LocalDateTime; 8 | 9 | /** 10 | * 自定义 p6spy sql输出格式 11 | * 12 | * @author MrBird 13 | */ 14 | public class P6spySqlFormatConfig implements MessageFormattingStrategy { 15 | 16 | /** 17 | * 过滤掉定时任务的 SQL 18 | */ 19 | @Override 20 | public String formatMessage(int connectionId, String now, long elapsed, String category, String prepared, String sql, String url) { 21 | return StringUtils.isNotBlank(sql) ? DateUtil.formatFullTime(LocalDateTime.now(), DateUtil.FULL_TIME_SPLIT_PATTERN) 22 | + " | 耗时 " + elapsed + " ms | SQL 语句:" + StringUtils.LF + sql.replaceAll("[\\s]+", StringUtils.SPACE) + ";" : ""; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/controller/BaseController.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.controller; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | public class BaseController { 9 | 10 | protected Map getDataTable(IPage pageInfo) { 11 | Map rspData = new HashMap<>(); 12 | rspData.put("rows", pageInfo.getRecords()); 13 | rspData.put("total", pageInfo.getTotal()); 14 | return rspData; 15 | } 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/converter/TimeConverter.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.converter; 2 | 3 | import cc.mrbird.febs.common.utils.DateUtil; 4 | import com.wuwenze.poi.convert.WriteConverter; 5 | import com.wuwenze.poi.exception.ExcelKitWriteConverterException; 6 | import lombok.extern.slf4j.Slf4j; 7 | 8 | /** 9 | * Execl导出时间类型字段格式化 10 | */ 11 | @Slf4j 12 | public class TimeConverter implements WriteConverter { 13 | @Override 14 | public String convert(Object value) throws ExcelKitWriteConverterException { 15 | try { 16 | if (value == null) 17 | return ""; 18 | else { 19 | return DateUtil.formatCSTTime(value.toString(), DateUtil.FULL_TIME_SPLIT_PATTERN); 20 | } 21 | } catch (Exception e) { 22 | log.error("时间转换异常", e); 23 | return ""; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/domain/ActiveUser.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.domain; 2 | 3 | import cc.mrbird.febs.common.utils.DateUtil; 4 | import com.fasterxml.jackson.annotation.JsonInclude; 5 | import lombok.Data; 6 | import org.apache.commons.lang3.RandomStringUtils; 7 | 8 | import java.io.Serializable; 9 | import java.time.LocalDateTime; 10 | 11 | /** 12 | * 在线用户 13 | */ 14 | @Data 15 | @JsonInclude(JsonInclude.Include.NON_NULL) 16 | public class ActiveUser implements Serializable { 17 | private static final long serialVersionUID = 2055229953429884344L; 18 | 19 | // 唯一编号 20 | private String id = RandomStringUtils.randomAlphanumeric(20); 21 | // 用户名 22 | private String username; 23 | // ip地址 24 | private String ip; 25 | // token(加密后) 26 | private String token; 27 | // 登录时间 28 | private String loginTime = DateUtil.formatFullTime(LocalDateTime.now(),DateUtil.FULL_TIME_SPLIT_PATTERN); 29 | // 登录地点 30 | private String loginAddress; 31 | } 32 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/domain/FebsConstant.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.domain; 2 | 3 | /** 4 | * FEBS常量 5 | */ 6 | public class FebsConstant { 7 | 8 | // user缓存前缀 9 | public static final String USER_CACHE_PREFIX = "febs.cache.user."; 10 | // user角色缓存前缀 11 | public static final String USER_ROLE_CACHE_PREFIX = "febs.cache.user.role."; 12 | // user权限缓存前缀 13 | public static final String USER_PERMISSION_CACHE_PREFIX = "febs.cache.user.permission."; 14 | // user个性化配置前缀 15 | public static final String USER_CONFIG_CACHE_PREFIX = "febs.cache.user.config."; 16 | // token缓存前缀 17 | public static final String TOKEN_CACHE_PREFIX = "febs.cache.token."; 18 | 19 | // 存储在线用户的 zset前缀 20 | public static final String ACTIVE_USERS_ZSET_PREFIX = "febs.user.active"; 21 | 22 | // 排序规则: descend 降序 23 | public static final String ORDER_DESC = "descend"; 24 | // 排序规则: ascend 升序 25 | public static final String ORDER_ASC = "ascend"; 26 | 27 | // 按钮 28 | public static final String TYPE_BUTTON = "1"; 29 | // 菜单 30 | public static final String TYPE_MENU = "0"; 31 | 32 | // 网络资源 Url 33 | public static final String MEIZU_WEATHER_URL = "http://aider.meizu.com/app/weather/listWeather"; 34 | public static final String MRYW_TODAY_URL = "https://interface.meiriyiwen.com/article/today"; 35 | public static final String MRYW_DAY_URL = "https://interface.meiriyiwen.com/article/day"; 36 | public static final String TIME_MOVIE_HOT_URL = "https://api-m.mtime.cn/Showtime/LocationMovies.api"; 37 | public static final String TIME_MOVIE_DETAIL_URL = "https://ticket-api-m.mtime.cn/movie/detail.api"; 38 | public static final String TIME_MOVIE_COMING_URL = "https://api-m.mtime.cn/Movie/MovieComingNew.api"; 39 | public static final String TIME_MOVIE_COMMENTS_URL = "https://ticket-api-m.mtime.cn/movie/hotComment.api"; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/domain/FebsResponse.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.domain; 2 | 3 | import java.util.HashMap; 4 | 5 | public class FebsResponse extends HashMap { 6 | 7 | private static final long serialVersionUID = -8713837118340960775L; 8 | 9 | public FebsResponse message(String message) { 10 | this.put("message", message); 11 | return this; 12 | } 13 | 14 | public FebsResponse data(Object data) { 15 | this.put("data", data); 16 | return this; 17 | } 18 | 19 | @Override 20 | public FebsResponse put(String key, Object value) { 21 | super.put(key, value); 22 | return this; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/domain/LimitType.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.domain; 2 | 3 | public enum LimitType { 4 | // 传统类型 5 | CUSTOMER, 6 | // 根据 IP 限制 7 | IP; 8 | } 9 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/domain/QueryRequest.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.domain; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | 6 | import java.io.Serializable; 7 | 8 | @Data 9 | public class QueryRequest implements Serializable { 10 | 11 | private static final long serialVersionUID = -4869594085374385813L; 12 | 13 | private int pageSize = 10; 14 | private int pageNum = 1; 15 | 16 | private String sortField; 17 | private String sortOrder; 18 | } 19 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/domain/RegexpConstant.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.domain; 2 | 3 | /** 4 | * 正则常量 5 | */ 6 | public class RegexpConstant { 7 | 8 | // 简单手机号正则(这里只是简单校验是否为11位,实际规则很复杂) 9 | public static final String MOBILE_REG = "[1]\\d{10}"; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/domain/Tree.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.domain; 2 | 3 | import com.fasterxml.jackson.annotation.JsonInclude; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | import java.util.ArrayList; 8 | import java.util.Date; 9 | import java.util.List; 10 | 11 | @Data 12 | @JsonInclude(JsonInclude.Include.NON_NULL) 13 | public class Tree { 14 | 15 | private String id; 16 | 17 | private String key; 18 | 19 | private String icon; 20 | 21 | private String title; 22 | 23 | private String value; 24 | 25 | private String text; 26 | 27 | private String permission; 28 | 29 | private String type; 30 | 31 | private Double order; 32 | 33 | private String path; 34 | 35 | private String component; 36 | 37 | private List> children; 38 | 39 | private String parentId; 40 | 41 | private boolean hasParent = false; 42 | 43 | private boolean hasChildren = false; 44 | 45 | private Date createTime; 46 | 47 | private Date modifyTime; 48 | 49 | public void initChildren(){ 50 | this.children = new ArrayList<>(); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/domain/router/RouterMeta.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.domain.router; 2 | 3 | import com.fasterxml.jackson.annotation.JsonInclude; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Data; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * Vue路由 Meta 11 | */ 12 | @Data 13 | @AllArgsConstructor 14 | @JsonInclude(JsonInclude.Include.NON_NULL) 15 | public class RouterMeta implements Serializable { 16 | 17 | private static final long serialVersionUID = 5499925008927195914L; 18 | 19 | private Boolean closeable; 20 | 21 | private Boolean isShow; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/domain/router/VueRouter.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.domain.router; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; 4 | import com.fasterxml.jackson.annotation.JsonInclude; 5 | import lombok.Data; 6 | import lombok.ToString; 7 | 8 | import java.io.Serializable; 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | 12 | /** 13 | * 构建 Vue路由 14 | */ 15 | @Data 16 | @JsonInclude(JsonInclude.Include.NON_NULL) 17 | public class VueRouter implements Serializable { 18 | 19 | private static final long serialVersionUID = -3327478146308500708L; 20 | 21 | @JsonIgnore 22 | private String id; 23 | 24 | @JsonIgnore 25 | private String parentId; 26 | 27 | private String path; 28 | 29 | private String name; 30 | 31 | private String component; 32 | 33 | private String icon; 34 | 35 | private String redirect; 36 | 37 | private RouterMeta meta; 38 | 39 | private List> children; 40 | 41 | @JsonIgnore 42 | private boolean hasParent = false; 43 | 44 | @JsonIgnore 45 | private boolean hasChildren = false; 46 | 47 | public void initChildren(){ 48 | this.children = new ArrayList<>(); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/exception/FebsException.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.exception; 2 | 3 | /** 4 | * FEBS 系统内部异常 5 | */ 6 | public class FebsException extends Exception { 7 | 8 | private static final long serialVersionUID = -994962710559017255L; 9 | 10 | public FebsException(String message) { 11 | super(message); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/exception/LimitAccessException.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.exception; 2 | 3 | /** 4 | * 限流异常 5 | */ 6 | public class LimitAccessException extends Exception { 7 | 8 | private static final long serialVersionUID = -3608667856397125671L; 9 | 10 | public LimitAccessException(String message) { 11 | super(message); 12 | } 13 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/exception/RedisConnectException.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.exception; 2 | 3 | /** 4 | * Redis 连接异常 5 | */ 6 | public class RedisConnectException extends Exception { 7 | 8 | private static final long serialVersionUID = 1639374111871115063L; 9 | 10 | public RedisConnectException(String message) { 11 | super(message); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/exception/TokenTimeoutException.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.exception; 2 | 3 | import org.apache.shiro.authc.AuthenticationException; 4 | 5 | /** 6 | * token过期抛出这个 7 | */ 8 | public class TokenTimeoutException extends AuthenticationException { 9 | 10 | private static final long serialVersionUID = -8313101744886192005L; 11 | 12 | public TokenTimeoutException(String message) { 13 | super(message); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/function/CacheSelector.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.function; 2 | 3 | @FunctionalInterface 4 | public interface CacheSelector { 5 | T select() throws Exception; 6 | } 7 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/function/JedisExecutor.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.function; 2 | 3 | import cc.mrbird.febs.common.exception.RedisConnectException; 4 | 5 | @FunctionalInterface 6 | public interface JedisExecutor { 7 | R excute(T t) throws RedisConnectException; 8 | } 9 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/mqtt/DeviceMqttInboundMessageHandler.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.mqtt; 2 | 3 | import cc.mrbird.febs.cos.service.IDeviceTypeService; 4 | import cn.hutool.core.util.StrUtil; 5 | import lombok.RequiredArgsConstructor; 6 | import lombok.extern.slf4j.Slf4j; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.messaging.Message; 9 | import org.springframework.messaging.MessageHandler; 10 | import org.springframework.messaging.MessagingException; 11 | import org.springframework.stereotype.Component; 12 | 13 | @Slf4j 14 | @Component 15 | @RequiredArgsConstructor(onConstructor = @__(@Autowired)) 16 | public class DeviceMqttInboundMessageHandler implements MessageHandler { 17 | 18 | private final IDeviceTypeService deviceTypeService; 19 | 20 | @Override 21 | public void handleMessage(Message message) throws MessagingException { 22 | if (StrUtil.isEmpty(message.getPayload().toString())) { 23 | return; 24 | } 25 | System.out.println("接收到MQTT消息:" + message.getPayload()); 26 | // 解析数据 27 | deviceTypeService.setDeviceRecordMqtt(message.getPayload().toString()); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/mqtt/DeviceMqttProperties.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.mqtt; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Data 8 | @Component 9 | @ConfigurationProperties(prefix = "mqtt-toilet") 10 | public class DeviceMqttProperties { 11 | 12 | private String url; 13 | private String username; 14 | private String password; 15 | private String clientId; 16 | private String topics; 17 | private String defaultTopic; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/properties/FebsProperties.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.properties; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | @Data 8 | @Configuration 9 | @ConfigurationProperties(prefix = "febs") 10 | public class FebsProperties { 11 | 12 | private ShiroProperties shiro = new ShiroProperties(); 13 | 14 | private boolean openAopLog = true; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/properties/ShiroProperties.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.properties; 2 | 3 | public class ShiroProperties { 4 | 5 | private String anonUrl; 6 | 7 | /** 8 | * token默认有效时间 1天 9 | */ 10 | private Long jwtTimeOut = 86400L; 11 | 12 | public String getAnonUrl() { 13 | return anonUrl; 14 | } 15 | 16 | public void setAnonUrl(String anonUrl) { 17 | this.anonUrl = anonUrl; 18 | } 19 | 20 | public Long getJwtTimeOut() { 21 | return jwtTimeOut; 22 | } 23 | 24 | public void setJwtTimeOut(Long jwtTimeOut) { 25 | this.jwtTimeOut = jwtTimeOut; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/runner/CacheInitRunner.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.runner; 2 | 3 | import cc.mrbird.febs.common.exception.RedisConnectException; 4 | import cc.mrbird.febs.common.service.CacheService; 5 | import cc.mrbird.febs.system.domain.User; 6 | import cc.mrbird.febs.system.manager.UserManager; 7 | import cc.mrbird.febs.system.service.UserService; 8 | import lombok.extern.slf4j.Slf4j; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.boot.ApplicationArguments; 11 | import org.springframework.boot.ApplicationRunner; 12 | import org.springframework.context.ConfigurableApplicationContext; 13 | import org.springframework.stereotype.Component; 14 | 15 | import java.util.List; 16 | 17 | /** 18 | * 缓存初始化 19 | */ 20 | @Slf4j 21 | @Component 22 | public class CacheInitRunner implements ApplicationRunner { 23 | 24 | @Autowired 25 | private UserService userService; 26 | 27 | @Autowired 28 | private CacheService cacheService; 29 | @Autowired 30 | private UserManager userManager; 31 | 32 | @Autowired 33 | private ConfigurableApplicationContext context; 34 | 35 | @Override 36 | public void run(ApplicationArguments args) { 37 | try { 38 | log.info("Redis连接中 ······"); 39 | cacheService.testConnect(); 40 | 41 | log.info("缓存初始化 ······"); 42 | log.info("缓存用户数据 ······"); 43 | List list = this.userService.list(); 44 | for (User user : list) { 45 | userManager.loadUserRedisCache(user); 46 | } 47 | } catch (Exception e) { 48 | log.error("缓存初始化失败,{}", e.getMessage()); 49 | log.error(" ____ __ _ _ "); 50 | log.error("| |_ / /\\ | | | |"); 51 | log.error("|_| /_/--\\ |_| |_|__"); 52 | log.error(" "); 53 | log.error("FEBS启动失败 "); 54 | if (e instanceof RedisConnectException) 55 | log.error("Redis连接异常,请检查Redis连接配置并确保Redis服务已启动"); 56 | // 关闭 FEBS 57 | context.close(); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/runner/StartedUpRunner.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.runner; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.boot.ApplicationArguments; 6 | import org.springframework.boot.ApplicationRunner; 7 | import org.springframework.context.ConfigurableApplicationContext; 8 | import org.springframework.core.annotation.Order; 9 | import org.springframework.stereotype.Component; 10 | 11 | import java.time.LocalDateTime; 12 | 13 | @Order 14 | @Slf4j 15 | @Component 16 | public class StartedUpRunner implements ApplicationRunner { 17 | 18 | @Autowired 19 | private ConfigurableApplicationContext context; 20 | 21 | @Override 22 | public void run(ApplicationArguments args) { 23 | if (context.isActive()) { 24 | log.info(" __ ___ _ ___ _ ____ _____ ____ "); 25 | log.info("/ /` / / \\ | |\\/| | |_) | | | |_ | | | |_ "); 26 | log.info("\\_\\_, \\_\\_/ |_| | |_| |_|__ |_|__ |_| |_|__ "); 27 | log.info(" "); 28 | log.info("启动完毕,时间:" + LocalDateTime.now()); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/task/CacheTask.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.task; 2 | 3 | import cc.mrbird.febs.common.domain.FebsConstant; 4 | import cc.mrbird.febs.common.service.RedisService; 5 | import cc.mrbird.febs.common.utils.DateUtil; 6 | import lombok.extern.slf4j.Slf4j; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.scheduling.annotation.Scheduled; 9 | import org.springframework.stereotype.Component; 10 | 11 | import java.time.LocalDateTime; 12 | 13 | /** 14 | * 主要用于定时删除 Redis中 key为 febs.user.active 中 15 | * 已经过期的 score 16 | */ 17 | @Slf4j 18 | @Component 19 | public class CacheTask { 20 | 21 | @Autowired 22 | private RedisService redisService; 23 | 24 | @Scheduled(fixedRate = 3600000) 25 | public void run() { 26 | try { 27 | String now = DateUtil.formatFullTime(LocalDateTime.now()); 28 | redisService.zremrangeByScore(FebsConstant.ACTIVE_USERS_ZSET_PREFIX, "-inf", now); 29 | log.info("delete expired user"); 30 | } catch (Exception ignore) { 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/utils/AddressUtil.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.utils; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.apache.commons.io.FileUtils; 5 | import org.lionsoul.ip2region.DataBlock; 6 | import org.lionsoul.ip2region.DbConfig; 7 | import org.lionsoul.ip2region.DbSearcher; 8 | import org.lionsoul.ip2region.Util; 9 | 10 | import java.io.File; 11 | import java.io.IOException; 12 | import java.lang.reflect.Method; 13 | import java.util.Objects; 14 | 15 | @Slf4j 16 | public class AddressUtil { 17 | 18 | public static String getCityInfo(String ip) { 19 | DbSearcher searcher = null; 20 | try { 21 | String dbPath = AddressUtil.class.getResource("/ip2region/ip2region.db").getPath(); 22 | File file = new File(dbPath); 23 | if (!file.exists()) { 24 | String tmpDir = System.getProperties().getProperty("java.io.tmpdir"); 25 | dbPath = tmpDir + "ip.db"; 26 | file = new File(dbPath); 27 | FileUtils.copyInputStreamToFile(Objects.requireNonNull(AddressUtil.class.getClassLoader().getResourceAsStream("classpath:ip2region/ip2region.db")), file); 28 | } 29 | int algorithm = DbSearcher.BTREE_ALGORITHM; 30 | DbConfig config = new DbConfig(); 31 | searcher = new DbSearcher(config, file.getPath()); 32 | Method method = null; 33 | method = searcher.getClass().getMethod("btreeSearch", String.class); 34 | DataBlock dataBlock = null; 35 | if (!Util.isIpAddress(ip)) { 36 | log.error("Error: Invalid ip address"); 37 | } 38 | dataBlock = (DataBlock) method.invoke(searcher, ip); 39 | return dataBlock.getRegion(); 40 | } catch (Exception e) { 41 | log.error("获取地址信息异常", e); 42 | } finally { 43 | if (searcher != null) { 44 | try { 45 | searcher.close(); 46 | } catch (IOException e) { 47 | e.printStackTrace(); 48 | } 49 | } 50 | } 51 | return ""; 52 | } 53 | 54 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/utils/DateUtil.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.utils; 2 | 3 | import java.text.ParseException; 4 | import java.text.SimpleDateFormat; 5 | import java.time.LocalDateTime; 6 | import java.time.format.DateTimeFormatter; 7 | import java.util.Date; 8 | import java.util.Locale; 9 | 10 | /** 11 | * 时间工具类 12 | */ 13 | public class DateUtil { 14 | 15 | public static final String FULL_TIME_PATTERN = "yyyyMMddHHmmss"; 16 | 17 | public static final String FULL_TIME_SPLIT_PATTERN = "yyyy-MM-dd HH:mm:ss"; 18 | 19 | public static String formatFullTime(LocalDateTime localDateTime) { 20 | return formatFullTime(localDateTime, FULL_TIME_PATTERN); 21 | } 22 | 23 | public static String formatFullTime(LocalDateTime localDateTime, String pattern) { 24 | DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(pattern); 25 | return localDateTime.format(dateTimeFormatter); 26 | } 27 | 28 | private static String getDateFormat(Date date, String dateFormatType) { 29 | SimpleDateFormat simformat = new SimpleDateFormat(dateFormatType); 30 | return simformat.format(date); 31 | } 32 | 33 | public static String formatCSTTime(String date, String format) throws ParseException { 34 | SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US); 35 | Date d = sdf.parse(date); 36 | return DateUtil.getDateFormat(d, format); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/utils/FileNameUtils.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.utils; 2 | 3 | import java.util.Date; 4 | 5 | public class FileNameUtils { 6 | 7 | /** 8 | * 获取文件后缀 9 | * @param fileName 10 | * @return 11 | */ 12 | public static String getSuffix(String fileName){ 13 | return fileName.substring(fileName.lastIndexOf(".")); 14 | } 15 | 16 | /** 17 | * 生成新的文件名 18 | * @param fileOriginName 源文件名 19 | * @return 20 | */ 21 | public static String getFileName(String fileOriginName){ 22 | return ("SA" + new Date().getTime()+ FileNameUtils.getSuffix(fileOriginName)); 23 | } 24 | 25 | /** 26 | * 生成新的文件名 27 | * @param fileOriginName 源文件名 28 | * @return 29 | */ 30 | public static String getFileNameByVideo(String fileOriginName){ 31 | return ("OA" + new Date().getTime()+ FileNameUtils.getSuffix(fileOriginName)); 32 | } 33 | 34 | /** 35 | * 生成新的文件名 36 | * @param fileOriginName 37 | * @return 38 | */ 39 | public static String getFileNameByZip(String fileOriginName) { 40 | return ("7Z" + new Date().getTime()+ FileNameUtils.getSuffix(fileOriginName)); 41 | } 42 | 43 | 44 | } 45 | 46 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/utils/HttpContextUtil.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.utils; 2 | 3 | import org.springframework.web.context.request.RequestContextHolder; 4 | import org.springframework.web.context.request.ServletRequestAttributes; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import java.util.Objects; 8 | 9 | public class HttpContextUtil { 10 | 11 | private HttpContextUtil(){ 12 | 13 | } 14 | public static HttpServletRequest getHttpServletRequest() { 15 | return ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/utils/IPUtil.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.utils; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | 5 | public class IPUtil { 6 | 7 | private static final String UNKNOWN = "unknown"; 8 | 9 | protected IPUtil(){ 10 | 11 | } 12 | 13 | /** 14 | * 获取 IP地址 15 | * 使用 Nginx等反向代理软件, 则不能通过 request.getRemoteAddr()获取 IP地址 16 | * 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址, 17 | * X-Forwarded-For中第一个非 unknown的有效IP字符串,则为真实IP地址 18 | */ 19 | public static String getIpAddr(HttpServletRequest request) { 20 | String ip = request.getHeader("x-forwarded-for"); 21 | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { 22 | ip = request.getHeader("Proxy-Client-IP"); 23 | } 24 | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { 25 | ip = request.getHeader("WL-Proxy-Client-IP"); 26 | } 27 | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { 28 | ip = request.getRemoteAddr(); 29 | } 30 | return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/utils/MD5Util.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.utils; 2 | 3 | import org.apache.shiro.crypto.hash.SimpleHash; 4 | import org.apache.shiro.util.ByteSource; 5 | 6 | public class MD5Util { 7 | 8 | protected MD5Util(){ 9 | 10 | } 11 | 12 | private static final String ALGORITH_NAME = "md5"; 13 | 14 | private static final int HASH_ITERATIONS = 2; 15 | 16 | public static String encrypt(String password) { 17 | return new SimpleHash(ALGORITH_NAME, password, ByteSource.Util.bytes(password), HASH_ITERATIONS).toHex(); 18 | } 19 | 20 | public static String encrypt(String username, String password) { 21 | return new SimpleHash(ALGORITH_NAME, password, ByteSource.Util.bytes(username.toLowerCase() + password), 22 | HASH_ITERATIONS).toHex(); 23 | } 24 | 25 | public static void main(String[] args) { 26 | System.out.println(encrypt("mrbird","1234qwer")); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/utils/R.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.utils; 2 | 3 | import org.apache.http.HttpStatus; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | /** 9 | * @ClassName: R 10 | * @Description: 返回数据 11 | * @author: Ming 12 | * @date: 2018年12月3日 上午10:28:39 13 | */ 14 | public class R extends HashMap { 15 | private static final long serialVersionUID = 1L; 16 | 17 | public R() { 18 | put("code", 0); 19 | put("msg", "success"); 20 | } 21 | 22 | public static R error() { 23 | return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, "未知异常,请联系管理员"); 24 | } 25 | 26 | public static R error(String msg) { 27 | return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, msg); 28 | } 29 | 30 | public static R error(int code, String msg) { 31 | R r = new R(); 32 | r.put("code", code); 33 | r.put("msg", msg); 34 | return r; 35 | } 36 | 37 | public static R ok(String msg) { 38 | R r = new R(); 39 | r.put("msg", msg); 40 | return r; 41 | } 42 | 43 | public static R ok(Map map) { 44 | R r = new R(); 45 | r.putAll(map); 46 | return r; 47 | } 48 | 49 | public static R ok() { 50 | return new R(); 51 | } 52 | 53 | public static R ok(Object data) { 54 | R r = new R(); 55 | r.put("data",data); 56 | return r; 57 | } 58 | 59 | public R put(String key, Object value) { 60 | super.put(key, value); 61 | return this; 62 | } 63 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/utils/SpaceUtil.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.utils; 2 | 3 | import cn.hutool.core.util.StrUtil; 4 | import cn.hutool.http.HttpUtil; 5 | import cn.hutool.json.JSONObject; 6 | import cn.hutool.json.JSONUtil; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | 10 | public class SpaceUtil { 11 | 12 | static String AK = "A73cbd90c90dc8f155d0a5ccd00e130c"; // 百度地图密钥 13 | 14 | public static void main(String[] args) { 15 | String dom = "北京王府井"; 16 | String coordinate = getCoordinate(dom); 17 | System.out.println("'" + dom + "'的经纬度为:" + coordinate); 18 | // System.err.println("######同步坐标已达到日配额6000限制,请明天再试!#####"); 19 | } 20 | 21 | // 调用百度地图API根据地址,获取坐标 22 | public static String getCoordinate(String address) { 23 | if (address != null && !"".equals(address)) { 24 | address = address.replaceAll("\\s*", "").replace("#", "栋"); 25 | String url = "http://api.map.baidu.com/geocoder/v2/?address=" + address + "&output=json&ak=" + AK; 26 | String json = HttpUtil.get(url); 27 | System.out.println(json); 28 | if (StrUtil.isNotEmpty(json)) { 29 | JSONObject obj = JSONUtil.parseObj(json); 30 | if ("0".equals(obj.get("status").toString())) { 31 | double lng = obj.getJSONObject("result").getJSONObject("location").getDouble("lng"); 32 | double lat = obj.getJSONObject("result").getJSONObject("location").getDouble("lat"); 33 | System.out.println(lng + "," + lat); 34 | return lng + "," + lat; 35 | } 36 | } 37 | return null; 38 | } 39 | return null; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/utils/SpringContextUtil.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.utils; 2 | 3 | import org.springframework.beans.BeansException; 4 | import org.springframework.context.ApplicationContext; 5 | import org.springframework.context.ApplicationContextAware; 6 | import org.springframework.stereotype.Component; 7 | 8 | /** 9 | * Spring Context 工具类 10 | * 11 | * @author MrBird 12 | * 13 | */ 14 | @Component 15 | public class SpringContextUtil implements ApplicationContextAware { 16 | private static ApplicationContext applicationContext; 17 | 18 | @Override 19 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { 20 | SpringContextUtil.applicationContext = applicationContext; 21 | } 22 | 23 | public static Object getBean(String name) { 24 | return applicationContext.getBean(name); 25 | } 26 | public static T getBean(Class clazz){ 27 | return applicationContext.getBean(clazz); 28 | } 29 | 30 | public static T getBean(String name, Class requiredType) { 31 | return applicationContext.getBean(name, requiredType); 32 | } 33 | 34 | public static boolean containsBean(String name) { 35 | return applicationContext.containsBean(name); 36 | } 37 | 38 | public static boolean isSingleton(String name) { 39 | return applicationContext.isSingleton(name); 40 | } 41 | 42 | public static Class getType(String name) { 43 | return applicationContext.getType(name); 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/common/validator/CronValidator.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.common.validator; 2 | 3 | import cc.mrbird.febs.common.annotation.IsCron; 4 | import org.quartz.CronExpression; 5 | 6 | import javax.validation.ConstraintValidator; 7 | import javax.validation.ConstraintValidatorContext; 8 | 9 | /** 10 | * 校验是否为合法的 Cron表达式 11 | */ 12 | public class CronValidator implements ConstraintValidator { 13 | 14 | @Override 15 | public void initialize(IsCron isCron) { 16 | } 17 | 18 | @Override 19 | public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) { 20 | try { 21 | return CronExpression.isValidExpression(value); 22 | } catch (Exception e) { 23 | return false; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/controller/EventDetailController.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.controller; 2 | 3 | 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | * 场景事件详情 控制层 10 | * 11 | * @author FanK 12 | */ 13 | @RestController 14 | @RequestMapping("/cos/event-detail") 15 | public class EventDetailController { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/controller/FileController.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.controller; 2 | 3 | import cc.mrbird.febs.common.utils.FileUtil; 4 | import lombok.AllArgsConstructor; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RequestParam; 8 | import org.springframework.web.bind.annotation.ResponseBody; 9 | import org.springframework.web.multipart.MultipartFile; 10 | 11 | /** 12 | * 文件上传 13 | * 14 | * @author FanK 15 | */ 16 | @Controller 17 | @RequestMapping("/file") 18 | @AllArgsConstructor 19 | public class FileController { 20 | 21 | /** 22 | * 文件上传 23 | * 24 | * @param file 上传的文件 25 | * @return 文件名称 26 | */ 27 | @ResponseBody 28 | @RequestMapping("/fileUpload") 29 | public String upload(@RequestParam("avatar") MultipartFile file) { 30 | // 1定义要上传文件 的存放路径 31 | String localPath = "G:/Project/20240725智能家居管理系统/db"; 32 | // 2获得文件名字 33 | String fileName = file.getOriginalFilename(); 34 | // 2上传失败提示 35 | String warning = ""; 36 | String newFileName = FileUtil.upload(file, localPath, fileName); 37 | if (newFileName != null) { 38 | //上传成功 39 | warning = newFileName; 40 | 41 | } else { 42 | warning = "上传失败"; 43 | } 44 | System.out.println(warning); 45 | return warning; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/dao/BulletinInfoMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.dao; 2 | 3 | import cc.mrbird.febs.cos.entity.BulletinInfo; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.baomidou.mybatisplus.core.metadata.IPage; 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.LinkedHashMap; 10 | 11 | /** 12 | * @author FanK 13 | */ 14 | public interface BulletinInfoMapper extends BaseMapper { 15 | 16 | /** 17 | * 分页获取公告信息 18 | * @param page 分页对象 19 | * @param bulletinInfo 公告信息 20 | * @return 结果 21 | */ 22 | IPage> getBulletinByPage(Page page, @Param("bulletinInfo") BulletinInfo bulletinInfo); 23 | } 24 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/dao/DeviceAlertInfoMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.dao; 2 | 3 | import cc.mrbird.febs.cos.entity.DeviceAlertInfo; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.baomidou.mybatisplus.core.metadata.IPage; 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.LinkedHashMap; 10 | 11 | /** 12 | * 设备报警配置 mapper层 13 | * 14 | * @author FanK 15 | */ 16 | public interface DeviceAlertInfoMapper extends BaseMapper { 17 | 18 | /** 19 | * 分页获取设备报警配置信息 20 | * 21 | * @param page 分页对象 22 | * @param deviceAlertInfo 设备报警配置信息 23 | * @return 结果 24 | */ 25 | IPage> selectDeviceAlertPage(Page page, @Param("deviceAlertInfo") DeviceAlertInfo deviceAlertInfo); 26 | } 27 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/dao/DeviceHistoryInfoMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.dao; 2 | 3 | import cc.mrbird.febs.cos.entity.DeviceHistoryInfo; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.baomidou.mybatisplus.core.metadata.IPage; 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.LinkedHashMap; 10 | import java.util.List; 11 | 12 | /** 13 | * 设备上报历史数据 mapper层 14 | * 15 | * @author FanK 16 | */ 17 | public interface DeviceHistoryInfoMapper extends BaseMapper { 18 | 19 | /** 20 | * 分页获取设备上报历史数据信息 21 | * 22 | * @param page 分页对象 23 | * @param deviceHistoryInfo 设备上报历史数据信息 24 | * @return 结果 25 | */ 26 | IPage> selectHistoryPage(Page page, @Param("deviceHistoryInfo") DeviceHistoryInfo deviceHistoryInfo); 27 | 28 | /** 29 | * 根据设备ID获取统计信息 30 | * 31 | * @param deviceId 设备ID 32 | * @param date 统计日期 33 | * @return 结果 34 | */ 35 | List selectRateByDeviceId(@Param("deviceId") Integer deviceId, @Param("date") String date); 36 | } 37 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/dao/DeviceInfoMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.dao; 2 | 3 | import cc.mrbird.febs.cos.entity.DeviceInfo; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.baomidou.mybatisplus.core.metadata.IPage; 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.LinkedHashMap; 10 | 11 | /** 12 | * 设备管理 mapper层 13 | * 14 | * @author FanK 15 | */ 16 | public interface DeviceInfoMapper extends BaseMapper { 17 | 18 | /** 19 | * 分页获取设备管理信息 20 | * 21 | * @param page 分页对象 22 | * @param deviceInfo 设备管理信息 23 | * @return 结果 24 | */ 25 | IPage> selectDevicePage(Page page, @Param("deviceInfo") DeviceInfo deviceInfo); 26 | } 27 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/dao/DeviceOfflineRecordMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.dao; 2 | 3 | import cc.mrbird.febs.cos.entity.DeviceOfflineRecord; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.baomidou.mybatisplus.core.metadata.IPage; 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.LinkedHashMap; 10 | 11 | /** 12 | * 设备上下线记录 mapper层 13 | * 14 | * @author FanK 15 | */ 16 | public interface DeviceOfflineRecordMapper extends BaseMapper { 17 | 18 | /** 19 | * 分页获取设备上下线记录信息 20 | * 21 | * @param page 分页对象 22 | * @param deviceOfflineRecord 设备上下线记录信息 23 | * @return 结果 24 | */ 25 | IPage> selectOfflineRecordPage(Page page, @Param("deviceOfflineRecord") DeviceOfflineRecord deviceOfflineRecord); 26 | } 27 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/dao/DeviceTypeMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.dao; 2 | 3 | import cc.mrbird.febs.cos.entity.DeviceType; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.baomidou.mybatisplus.core.metadata.IPage; 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.LinkedHashMap; 10 | import java.util.List; 11 | 12 | /** 13 | * 设备类型 mapper层 14 | * 15 | * @author FanK 16 | */ 17 | public interface DeviceTypeMapper extends BaseMapper { 18 | 19 | /** 20 | * 分页获取设备类型信息 21 | * 22 | * @param page 分页对象 23 | * @param deviceType 设备类型信息 24 | * @return 结果 25 | */ 26 | IPage> selectDeviceTypePage(Page page, @Param("deviceType") DeviceType deviceType); 27 | 28 | /** 29 | * 根据事件获取数据上报数量 30 | * 31 | * @param year 年份 32 | * @param month 月份 33 | * @return 结果 34 | */ 35 | Integer selectDataByMonth(@Param("year") Integer year, @Param("month") Integer month); 36 | 37 | /** 38 | * 根据事件获取数据报警数量 39 | * 40 | * @param year 年份 41 | * @param month 月份 42 | * @return 结果 43 | */ 44 | Integer selectAlertByMonth(@Param("year") Integer year, @Param("month") Integer month); 45 | 46 | /** 47 | * 十天内上报数量数量统计 48 | * 49 | * @param userId 用户ID 50 | * @return 结果 51 | */ 52 | List> selectDataNumWithinDays(@Param("userId") Integer userId); 53 | 54 | /** 55 | * 十天内报警统计 56 | * 57 | * @param userId 用户ID 58 | * @return 结果 59 | */ 60 | List> selectAlertNumWithinDays(@Param("userId") Integer userId); 61 | } 62 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/dao/EventDetailMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.dao; 2 | 3 | import cc.mrbird.febs.cos.entity.EventDetail; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | * 场景事件详情 mapper层 8 | * 9 | * @author FanK 10 | */ 11 | public interface EventDetailMapper extends BaseMapper { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/dao/EventInfoMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.dao; 2 | 3 | import cc.mrbird.febs.cos.entity.EventInfo; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.baomidou.mybatisplus.core.metadata.IPage; 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.LinkedHashMap; 10 | import java.util.List; 11 | 12 | /** 13 | * 用户场景事件 mapper层 14 | * 15 | * @author FanK 16 | */ 17 | public interface EventInfoMapper extends BaseMapper { 18 | 19 | /** 20 | * 分页获取场景事件信息 21 | * 22 | * @param page 分页对象 23 | * @param eventInfo 场景事件信息 24 | * @return 结果 25 | */ 26 | IPage> queryEventPage(Page page, @Param("eventInfo") EventInfo eventInfo); 27 | 28 | /** 29 | * 获取事件详情 30 | * 31 | * @param eventId 事件ID 32 | * @return 结果 33 | */ 34 | List> queryEventDetail(@Param("eventId") Integer eventId); 35 | } 36 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/dao/MessageInfoMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.dao; 2 | 3 | import cc.mrbird.febs.cos.entity.MessageInfo; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.baomidou.mybatisplus.core.metadata.IPage; 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.LinkedHashMap; 10 | 11 | /** 12 | * 系统消息 mapper层 13 | * 14 | * @author FanK 15 | */ 16 | public interface MessageInfoMapper extends BaseMapper { 17 | 18 | /** 19 | * 分页获取系统消息信息 20 | * 21 | * @param page 分页对象 22 | * @param messageInfo 系统消息信息 23 | * @return 结果 24 | */ 25 | IPage> selectMessagePage(Page page, @Param("messageInfo") MessageInfo messageInfo); 26 | } 27 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/dao/OperateRecordInfoMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.dao; 2 | 3 | import cc.mrbird.febs.cos.entity.OperateRecordInfo; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.baomidou.mybatisplus.core.metadata.IPage; 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.LinkedHashMap; 10 | 11 | /** 12 | * 操作记录 mapper层 13 | * 14 | * @author FanK 15 | */ 16 | public interface OperateRecordInfoMapper extends BaseMapper { 17 | 18 | /** 19 | * 分页获取操作记录信息 20 | * 21 | * @param page 分页对象 22 | * @param operateRecordInfo 操作记录信息 23 | * @return 结果 24 | */ 25 | IPage> selectOperateRecordPage(Page page, @Param("operateRecordInfo") OperateRecordInfo operateRecordInfo); 26 | } 27 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/dao/UserInfoMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.dao; 2 | 3 | import cc.mrbird.febs.cos.entity.UserInfo; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.baomidou.mybatisplus.core.metadata.IPage; 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.LinkedHashMap; 10 | 11 | /** 12 | * 用户信息 mapper层 13 | * 14 | * @author FanK 15 | */ 16 | public interface UserInfoMapper extends BaseMapper { 17 | 18 | /** 19 | * 分页获取用户管理 20 | * 21 | * @param page 分页对象 22 | * @param userInfo 用户管理 23 | * @return 结果 24 | */ 25 | IPage> selectUserPage(Page page, @Param("userInfo") UserInfo userInfo); 26 | } 27 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/entity/BulletinInfo.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | import lombok.experimental.Accessors; 8 | 9 | import java.io.Serializable; 10 | 11 | /** 12 | * 公告信息 13 | * 14 | * @author FanK 15 | */ 16 | @Data 17 | @EqualsAndHashCode(callSuper = false) 18 | @Accessors(chain = true) 19 | public class BulletinInfo implements Serializable { 20 | 21 | /** 22 | * 主键ID 23 | */ 24 | @TableId(type = IdType.AUTO) 25 | private Integer id; 26 | 27 | private static final long serialVersionUID = 1L; 28 | 29 | /** 30 | * 标题 31 | */ 32 | private String title; 33 | 34 | /** 35 | * 内容 36 | */ 37 | private String content; 38 | 39 | /** 40 | * 公告时间 41 | */ 42 | private String date; 43 | 44 | /** 45 | * 上下架(0.下架 1.发布) 46 | */ 47 | private Integer rackUp; 48 | 49 | /** 50 | * 消息类型 51 | */ 52 | private Integer type; 53 | 54 | /** 55 | * 发布人 56 | */ 57 | private String publisher; 58 | 59 | 60 | } 61 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/entity/DeviceAlertInfo.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.entity; 2 | 3 | import java.time.LocalDateTime; 4 | import java.io.Serializable; 5 | 6 | import com.baomidou.mybatisplus.annotation.IdType; 7 | import com.baomidou.mybatisplus.annotation.TableField; 8 | import com.baomidou.mybatisplus.annotation.TableId; 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import lombok.experimental.Accessors; 12 | 13 | /** 14 | * 设备报警配置 15 | * 16 | * @author FanK 17 | */ 18 | @Data 19 | @EqualsAndHashCode(callSuper = false) 20 | @Accessors(chain = true) 21 | public class DeviceAlertInfo implements Serializable { 22 | 23 | private static final long serialVersionUID = 1L; 24 | 25 | /** 26 | * 主键ID 27 | */ 28 | @TableId(type = IdType.AUTO) 29 | private Integer id; 30 | 31 | /** 32 | * 设备ID 33 | */ 34 | private Integer deviceId; 35 | 36 | /** 37 | * 设备类型ID 38 | */ 39 | private Integer deviceTypeId; 40 | 41 | /** 42 | * 预警类型(1.设备开关状态时常报警 2.目标值越界) 43 | */ 44 | private String type; 45 | 46 | /** 47 | * 报警值 48 | */ 49 | private Integer score; 50 | 51 | /** 52 | * 创建时间 53 | */ 54 | private String createDate; 55 | 56 | /** 57 | * 备注 58 | */ 59 | private String remark; 60 | 61 | @TableField(exist = false) 62 | private String deviceName; 63 | 64 | @TableField(exist = false) 65 | private String typeName; 66 | 67 | @TableField(exist = false) 68 | private String userName; 69 | 70 | @TableField(exist = false) 71 | private Integer userId; 72 | } 73 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/entity/DeviceHistoryInfo.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.entity; 2 | 3 | import java.time.LocalDateTime; 4 | import java.io.Serializable; 5 | 6 | import com.baomidou.mybatisplus.annotation.IdType; 7 | import com.baomidou.mybatisplus.annotation.TableField; 8 | import com.baomidou.mybatisplus.annotation.TableId; 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import lombok.experimental.Accessors; 12 | 13 | /** 14 | * 设备上报历史数据 15 | * 16 | * @author FanK 17 | */ 18 | @Data 19 | @EqualsAndHashCode(callSuper = false) 20 | @Accessors(chain = true) 21 | public class DeviceHistoryInfo implements Serializable { 22 | 23 | private static final long serialVersionUID = 1L; 24 | 25 | /** 26 | * 主键ID 27 | */ 28 | @TableId(type = IdType.AUTO) 29 | private Integer id; 30 | 31 | /** 32 | * 设备ID 33 | */ 34 | private Integer deviceId; 35 | 36 | /** 37 | * 设备值 38 | */ 39 | private String deviceValue; 40 | 41 | 42 | /** 43 | * 预警值 44 | */ 45 | private String alertValue; 46 | 47 | /** 48 | * 上报时间 49 | */ 50 | private String createDate; 51 | 52 | /** 53 | * 设备值 54 | */ 55 | @TableField(exist = false) 56 | private Double deviceValue1; 57 | 58 | @TableField(exist = false) 59 | private String deviceName; 60 | 61 | @TableField(exist = false) 62 | private String typeName; 63 | 64 | @TableField(exist = false) 65 | private String userName; 66 | 67 | @TableField(exist = false) 68 | private Integer hour; 69 | 70 | @TableField(exist = false) 71 | private Integer day; 72 | 73 | @TableField(exist = false) 74 | private Integer month; 75 | 76 | @TableField(exist = false) 77 | private Integer userId; 78 | 79 | @TableField(exist = false) 80 | private String valueType; 81 | 82 | @TableField(exist = false) 83 | private Integer eventId; 84 | } 85 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/entity/DeviceInfo.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.entity; 2 | 3 | import java.time.LocalDateTime; 4 | import java.io.Serializable; 5 | 6 | import com.baomidou.mybatisplus.annotation.IdType; 7 | import com.baomidou.mybatisplus.annotation.TableField; 8 | import com.baomidou.mybatisplus.annotation.TableId; 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import lombok.experimental.Accessors; 12 | 13 | /** 14 | * 设备管理 15 | * 16 | * @author FanK 17 | */ 18 | @Data 19 | @EqualsAndHashCode(callSuper = false) 20 | @Accessors(chain = true) 21 | public class DeviceInfo implements Serializable { 22 | 23 | private static final long serialVersionUID = 1L; 24 | 25 | /** 26 | * 主键ID 27 | */ 28 | @TableId(type = IdType.AUTO) 29 | private Integer id; 30 | 31 | /** 32 | * 设备编号 33 | */ 34 | private String code; 35 | 36 | /** 37 | * 设备名称 38 | */ 39 | private String name; 40 | 41 | /** 42 | * 设备类型 43 | */ 44 | private Integer typeId; 45 | 46 | /** 47 | * 设备是否在线(0.否 1.是) 48 | */ 49 | private String onlineFlag; 50 | 51 | /** 52 | * 设备创建时间 53 | */ 54 | private String createDate; 55 | 56 | /** 57 | * 设备开关状态(0.关闭 1.开启) 58 | */ 59 | private String openFlag; 60 | 61 | /** 62 | * 设备值 63 | */ 64 | private String deviceValue; 65 | 66 | /** 67 | * 设备报警值 68 | */ 69 | private String alertValue; 70 | 71 | /** 72 | * 值类型(1.整数 2.小数 2.boolean) 73 | */ 74 | private String valueType; 75 | 76 | /** 77 | * 备注 78 | */ 79 | private String remark; 80 | 81 | /** 82 | * 所属用户 83 | */ 84 | private Integer userId; 85 | 86 | /** 87 | * 上次开启时间 88 | */ 89 | private String lastOpenDate; 90 | 91 | /** 92 | * 设置位置 93 | */ 94 | private String address; 95 | 96 | @TableField(exist = false) 97 | private String deviceName; 98 | 99 | @TableField(exist = false) 100 | private String typeName; 101 | 102 | @TableField(exist = false) 103 | private String userName; 104 | } 105 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/entity/DeviceOfflineRecord.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.entity; 2 | 3 | import java.time.LocalDateTime; 4 | import java.io.Serializable; 5 | 6 | import com.baomidou.mybatisplus.annotation.IdType; 7 | import com.baomidou.mybatisplus.annotation.TableField; 8 | import com.baomidou.mybatisplus.annotation.TableId; 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import lombok.experimental.Accessors; 12 | 13 | /** 14 | * 设备上下线记录 15 | * 16 | * @author FanK 17 | */ 18 | @Data 19 | @EqualsAndHashCode(callSuper = false) 20 | @Accessors(chain = true) 21 | public class DeviceOfflineRecord implements Serializable { 22 | 23 | private static final long serialVersionUID = 1L; 24 | 25 | /** 26 | * 主键ID 27 | */ 28 | @TableId(type = IdType.AUTO) 29 | private Integer id; 30 | 31 | /** 32 | * 设备ID 33 | */ 34 | private Integer deviceId; 35 | 36 | /** 37 | * 上线时间 38 | */ 39 | private String onlineDate; 40 | 41 | /** 42 | * 下线时间 43 | */ 44 | private String offline; 45 | 46 | /** 47 | * 类型 0.下线 1.上线 48 | */ 49 | private String type; 50 | 51 | @TableField(exist = false) 52 | private String deviceName; 53 | 54 | @TableField(exist = false) 55 | private String typeName; 56 | 57 | @TableField(exist = false) 58 | private String userName; 59 | 60 | @TableField(exist = false) 61 | private String userId; 62 | } 63 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/entity/DeviceType.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.entity; 2 | 3 | import java.time.LocalDateTime; 4 | import java.io.Serializable; 5 | 6 | import com.baomidou.mybatisplus.annotation.IdType; 7 | import com.baomidou.mybatisplus.annotation.TableId; 8 | import lombok.Data; 9 | import lombok.EqualsAndHashCode; 10 | import lombok.experimental.Accessors; 11 | 12 | /** 13 | * 设备类型 14 | * 15 | * @author FanK 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper = false) 19 | @Accessors(chain = true) 20 | public class DeviceType implements Serializable { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | /** 25 | * 主键ID 26 | */ 27 | @TableId(type = IdType.AUTO) 28 | private Integer id; 29 | 30 | /** 31 | * 类型编号 32 | */ 33 | private String code; 34 | 35 | /** 36 | * 类型名称 37 | */ 38 | private String name; 39 | 40 | /** 41 | * 备注 42 | */ 43 | private String remark; 44 | 45 | /** 46 | * 创建时间 47 | */ 48 | private String createDate; 49 | 50 | /** 51 | * 图片 52 | */ 53 | private String images; 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/entity/EventDetail.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.entity; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.baomidou.mybatisplus.annotation.IdType; 6 | import com.baomidou.mybatisplus.annotation.TableId; 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import lombok.experimental.Accessors; 10 | 11 | /** 12 | * 场景事件详情 13 | * 14 | * @author FanK 15 | */ 16 | @Data 17 | @EqualsAndHashCode(callSuper = false) 18 | @Accessors(chain = true) 19 | public class EventDetail implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | /** 24 | * 主键ID 25 | */ 26 | @TableId(type = IdType.AUTO) 27 | private Integer id; 28 | 29 | /** 30 | * 设备ID 31 | */ 32 | private Integer deviceId; 33 | 34 | /** 35 | * 设备开关状态(0.关闭 1.开启) 36 | */ 37 | private String openFlag; 38 | 39 | /** 40 | * 事件ID 41 | */ 42 | private Integer eventId; 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/entity/EventInfo.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.entity; 2 | 3 | import java.time.LocalDateTime; 4 | import java.io.Serializable; 5 | 6 | import com.baomidou.mybatisplus.annotation.IdType; 7 | import com.baomidou.mybatisplus.annotation.TableField; 8 | import com.baomidou.mybatisplus.annotation.TableId; 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import lombok.experimental.Accessors; 12 | 13 | /** 14 | * 用户场景事件 15 | * 16 | * @author FanK 17 | */ 18 | @Data 19 | @EqualsAndHashCode(callSuper = false) 20 | @Accessors(chain = true) 21 | public class EventInfo implements Serializable { 22 | 23 | private static final long serialVersionUID = 1L; 24 | 25 | /** 26 | * 主键ID 27 | */ 28 | @TableId(type = IdType.AUTO) 29 | private Integer id; 30 | 31 | /** 32 | * 事件编号 33 | */ 34 | private String code; 35 | 36 | /** 37 | * 事件名称 38 | */ 39 | private String name; 40 | 41 | /** 42 | * 所属用户 43 | */ 44 | private Integer userId; 45 | 46 | /** 47 | * 备注 48 | */ 49 | private String content; 50 | 51 | /** 52 | * 创建时间 53 | */ 54 | private String createDate; 55 | 56 | @TableField(exist = false) 57 | private String userName; 58 | 59 | @TableField(exist = false) 60 | private String eventDetail; 61 | 62 | } 63 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/entity/MessageInfo.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.entity; 2 | 3 | import java.time.LocalDateTime; 4 | import java.io.Serializable; 5 | 6 | import com.baomidou.mybatisplus.annotation.IdType; 7 | import com.baomidou.mybatisplus.annotation.TableField; 8 | import com.baomidou.mybatisplus.annotation.TableId; 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import lombok.experimental.Accessors; 12 | 13 | /** 14 | * 系统消息 15 | * 16 | * @author FanK 17 | */ 18 | @Data 19 | @EqualsAndHashCode(callSuper = false) 20 | @Accessors(chain = true) 21 | public class MessageInfo implements Serializable { 22 | 23 | private static final long serialVersionUID = 1L; 24 | 25 | /** 26 | * 主键ID 27 | */ 28 | @TableId(type = IdType.AUTO) 29 | private Integer id; 30 | 31 | /** 32 | * 发送用户 33 | */ 34 | private Integer sendUser; 35 | 36 | /** 37 | * 消息内容 38 | */ 39 | private String content; 40 | 41 | /** 42 | * 创建时间 43 | */ 44 | private String createDate; 45 | 46 | /** 47 | * 状态 0.未读 1.已读 48 | */ 49 | private Integer readStatus; 50 | 51 | @TableField(exist = false) 52 | private Integer userId; 53 | 54 | @TableField(exist = false) 55 | private String userName; 56 | } 57 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/entity/OperateRecordInfo.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.entity; 2 | 3 | import java.time.LocalDateTime; 4 | import java.io.Serializable; 5 | 6 | import com.baomidou.mybatisplus.annotation.IdType; 7 | import com.baomidou.mybatisplus.annotation.TableField; 8 | import com.baomidou.mybatisplus.annotation.TableId; 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import lombok.experimental.Accessors; 12 | 13 | /** 14 | * 操作记录 15 | * 16 | * @author FanK 17 | */ 18 | @Data 19 | @EqualsAndHashCode(callSuper = false) 20 | @Accessors(chain = true) 21 | public class OperateRecordInfo implements Serializable { 22 | 23 | private static final long serialVersionUID = 1L; 24 | 25 | /** 26 | * 主键ID 27 | */ 28 | @TableId(type = IdType.AUTO) 29 | private Integer id; 30 | 31 | /** 32 | * 设备ID 33 | */ 34 | private Integer deviceId; 35 | 36 | /** 37 | * 设备开关状态(0.关闭 1.开启 2.重启) 38 | */ 39 | private String openFlag; 40 | 41 | /** 42 | * 设备值 43 | */ 44 | private String deviceValue; 45 | 46 | /** 47 | * 设备值(旧) 48 | */ 49 | private String deviceOldValue; 50 | 51 | /** 52 | * 操作时间 53 | */ 54 | private String createDate; 55 | 56 | @TableField(exist = false) 57 | private String deviceName; 58 | 59 | @TableField(exist = false) 60 | private String typeName; 61 | 62 | @TableField(exist = false) 63 | private String userName; 64 | 65 | @TableField(exist = false) 66 | private String userId; 67 | } 68 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/entity/UserInfo.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.entity; 2 | 3 | import java.time.LocalDateTime; 4 | import java.io.Serializable; 5 | 6 | import com.baomidou.mybatisplus.annotation.IdType; 7 | import com.baomidou.mybatisplus.annotation.TableId; 8 | import lombok.Data; 9 | import lombok.EqualsAndHashCode; 10 | import lombok.experimental.Accessors; 11 | 12 | /** 13 | * 用户信息 14 | * 15 | * @author FanK 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper = false) 19 | @Accessors(chain = true) 20 | public class UserInfo implements Serializable { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | /** 25 | * 主键ID 26 | */ 27 | @TableId(type = IdType.AUTO) 28 | private Integer id; 29 | 30 | /** 31 | * 用户编号 32 | */ 33 | private String code; 34 | 35 | /** 36 | * 用户名称 37 | */ 38 | private String name; 39 | 40 | /** 41 | * 备注 42 | */ 43 | private String remark; 44 | 45 | /** 46 | * 头像 47 | */ 48 | private String images; 49 | 50 | /** 51 | * 创建时间 52 | */ 53 | private String createDate; 54 | 55 | /** 56 | * 所属账户 57 | */ 58 | private Integer userId; 59 | 60 | 61 | } 62 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/IBulletinInfoService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service; 2 | 3 | import cc.mrbird.febs.cos.entity.BulletinInfo; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.baomidou.mybatisplus.extension.service.IService; 7 | 8 | import java.util.LinkedHashMap; 9 | 10 | /** 11 | * @author FanK 12 | */ 13 | public interface IBulletinInfoService extends IService { 14 | 15 | /** 16 | * 分页获取公告信息 17 | * @param page 分页对象 18 | * @param bulletinInfo 公告信息 19 | * @return 结果 20 | */ 21 | IPage> getBulletinByPage(Page page, BulletinInfo bulletinInfo); 22 | } 23 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/IDeviceAlertInfoService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service; 2 | 3 | import cc.mrbird.febs.cos.entity.DeviceAlertInfo; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.baomidou.mybatisplus.extension.service.IService; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.LinkedHashMap; 10 | 11 | /** 12 | * 设备报警配置 service层 13 | * 14 | * @author FanK 15 | */ 16 | public interface IDeviceAlertInfoService extends IService { 17 | 18 | /** 19 | * 分页获取设备报警配置信息 20 | * 21 | * @param page 分页对象 22 | * @param deviceAlertInfo 设备报警配置信息 23 | * @return 结果 24 | */ 25 | IPage> selectDeviceAlertPage(Page page, DeviceAlertInfo deviceAlertInfo); 26 | } 27 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/IDeviceHistoryInfoService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service; 2 | 3 | import cc.mrbird.febs.cos.entity.DeviceHistoryInfo; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.baomidou.mybatisplus.extension.service.IService; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.LinkedHashMap; 10 | import java.util.List; 11 | 12 | /** 13 | * 设备上报历史数据 service层 14 | * 15 | * @author FanK 16 | */ 17 | public interface IDeviceHistoryInfoService extends IService { 18 | 19 | /** 20 | * 分页获取设备上报历史数据信息 21 | * 22 | * @param page 分页对象 23 | * @param deviceHistoryInfo 设备上报历史数据信息 24 | * @return 结果 25 | */ 26 | IPage> selectHistoryPage(Page page, DeviceHistoryInfo deviceHistoryInfo); 27 | 28 | /** 29 | * 根据设备ID获取统计信息 30 | * 31 | * @param deviceId 设备ID 32 | * @param date 统计日期 33 | * @return 结果 34 | */ 35 | List> selectRateByDeviceId(Integer deviceId, String date); 36 | } 37 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/IDeviceInfoService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service; 2 | 3 | import cc.mrbird.febs.cos.entity.DeviceInfo; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.baomidou.mybatisplus.extension.service.IService; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.LinkedHashMap; 10 | 11 | /** 12 | * 设备管理 service层 13 | * 14 | * @author FanK 15 | */ 16 | public interface IDeviceInfoService extends IService { 17 | 18 | /** 19 | * 分页获取设备管理信息 20 | * 21 | * @param page 分页对象 22 | * @param deviceInfo 设备管理信息 23 | * @return 结果 24 | */ 25 | IPage> selectDevicePage(Page page, DeviceInfo deviceInfo); 26 | 27 | /** 28 | * 场景事件处理 29 | * 30 | * @param eventId 事件ID 31 | */ 32 | void eventCheck(Integer eventId); 33 | } 34 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/IDeviceOfflineRecordService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service; 2 | 3 | import cc.mrbird.febs.cos.entity.DeviceOfflineRecord; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.baomidou.mybatisplus.extension.service.IService; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.LinkedHashMap; 10 | 11 | /** 12 | * 设备上下线记录 service层 13 | * 14 | * @author FanK 15 | */ 16 | public interface IDeviceOfflineRecordService extends IService { 17 | 18 | /** 19 | * 分页获取设备上下线记录信息 20 | * 21 | * @param page 分页对象 22 | * @param deviceOfflineRecord 设备上下线记录信息 23 | * @return 结果 24 | */ 25 | IPage> selectOfflineRecordPage(Page page, DeviceOfflineRecord deviceOfflineRecord); 26 | } 27 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/IDeviceTypeService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service; 2 | 3 | import cc.mrbird.febs.cos.entity.DeviceType; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.baomidou.mybatisplus.extension.service.IService; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.LinkedHashMap; 10 | 11 | /** 12 | * 设备类型 service层 13 | * 14 | * @author FanK 15 | */ 16 | public interface IDeviceTypeService extends IService { 17 | 18 | /** 19 | * 分页获取设备类型信息 20 | * 21 | * @param page 分页对象 22 | * @param deviceType 设备类型信息 23 | * @return 结果 24 | */ 25 | IPage> selectDeviceTypePage(Page page, DeviceType deviceType); 26 | 27 | /** 28 | * 获取首页统计数据 29 | * 30 | * @return 结果 31 | */ 32 | LinkedHashMap homeData(); 33 | 34 | /** 35 | * mqtt数据解析 36 | * 37 | * @param message 消息内容 38 | */ 39 | void setDeviceRecordMqtt(String message); 40 | } 41 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/IEventDetailService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service; 2 | 3 | import cc.mrbird.febs.cos.entity.EventDetail; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | /** 7 | * 场景事件详情 service层 8 | * 9 | * @author FanK 10 | */ 11 | public interface IEventDetailService extends IService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/IEventInfoService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service; 2 | 3 | import cc.mrbird.febs.cos.entity.EventInfo; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.baomidou.mybatisplus.extension.service.IService; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.LinkedHashMap; 10 | import java.util.List; 11 | 12 | /** 13 | * 用户场景事件 service层 14 | * 15 | * @author FanK 16 | */ 17 | public interface IEventInfoService extends IService { 18 | 19 | /** 20 | * 分页获取场景事件信息 21 | * 22 | * @param page 分页对象 23 | * @param eventInfo 场景事件信息 24 | * @return 结果 25 | */ 26 | IPage> queryEventPage(Page page, EventInfo eventInfo); 27 | 28 | /** 29 | * 获取事件详情 30 | * 31 | * @param eventId 事件ID 32 | * @return 结果 33 | */ 34 | List> queryEventDetail(Integer eventId); 35 | } 36 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/IMailService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service; 2 | 3 | public interface IMailService { 4 | 5 | /** 6 | * 发送文本邮件 7 | * @param to 收件人 8 | * @param subject 主题 9 | * @param content 内容 10 | */ 11 | void sendSimpleMail(String to, String subject, String content); 12 | 13 | /** 14 | * 发送HTML邮件 15 | * @param to 收件人 16 | * @param subject 主题 17 | * @param content 内容 18 | */ 19 | void sendHtmlMail(String to, String subject, String content); 20 | 21 | 22 | 23 | /** 24 | * 发送带附件的邮件 25 | * @param to 收件人 26 | * @param subject 主题 27 | * @param content 内容 28 | * @param filePath 附件 29 | */ 30 | void sendAttachmentsMail(String to, String subject, String content, String filePath); 31 | } 32 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/IMessageInfoService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service; 2 | 3 | import cc.mrbird.febs.cos.entity.MessageInfo; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.baomidou.mybatisplus.extension.service.IService; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.LinkedHashMap; 10 | 11 | /** 12 | * 系统消息 service层 13 | * 14 | * @author FanK 15 | */ 16 | public interface IMessageInfoService extends IService { 17 | 18 | /** 19 | * 分页获取系统消息信息 20 | * 21 | * @param page 分页对象 22 | * @param messageInfo 系统消息信息 23 | * @return 结果 24 | */ 25 | IPage> selectMessagePage(Page page, MessageInfo messageInfo); 26 | } 27 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/IOperateRecordInfoService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service; 2 | 3 | import cc.mrbird.febs.cos.entity.OperateRecordInfo; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.baomidou.mybatisplus.extension.service.IService; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.LinkedHashMap; 10 | 11 | /** 12 | * 操作记录 service层 13 | * 14 | * @author FanK 15 | */ 16 | public interface IOperateRecordInfoService extends IService { 17 | 18 | /** 19 | * 分页获取操作记录信息 20 | * 21 | * @param page 分页对象 22 | * @param operateRecordInfo 操作记录信息 23 | * @return 结果 24 | */ 25 | IPage> selectOperateRecordPage(Page page, OperateRecordInfo operateRecordInfo); 26 | } 27 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/IUserInfoService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service; 2 | 3 | import cc.mrbird.febs.cos.entity.UserInfo; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.baomidou.mybatisplus.extension.service.IService; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.LinkedHashMap; 10 | 11 | /** 12 | * 用户信息 service层 13 | * 14 | * @author FanK 15 | */ 16 | public interface IUserInfoService extends IService { 17 | 18 | /** 19 | * 分页获取用户管理 20 | * 21 | * @param page 分页对象 22 | * @param userInfo 用户管理 23 | * @return 结果 24 | */ 25 | IPage> selectUserPage(Page page, UserInfo userInfo); 26 | } 27 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/impl/BulletinInfoServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service.impl; 2 | 3 | import cc.mrbird.febs.cos.dao.BulletinInfoMapper; 4 | import cc.mrbird.febs.cos.entity.BulletinInfo; 5 | import cc.mrbird.febs.cos.service.IBulletinInfoService; 6 | import com.baomidou.mybatisplus.core.metadata.IPage; 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 8 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.LinkedHashMap; 12 | 13 | /** 14 | * @author FanK 15 | */ 16 | @Service 17 | public class BulletinInfoServiceImpl extends ServiceImpl implements IBulletinInfoService { 18 | 19 | /** 20 | * 分页获取公告信息 21 | * 22 | * @param page 分页对象 23 | * @param bulletinInfo 公告信息 24 | * @return 结果 25 | */ 26 | @Override 27 | public IPage> getBulletinByPage(Page page, BulletinInfo bulletinInfo) { 28 | return baseMapper.getBulletinByPage(page, bulletinInfo); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/impl/DeviceAlertInfoServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service.impl; 2 | 3 | import cc.mrbird.febs.cos.entity.DeviceAlertInfo; 4 | import cc.mrbird.febs.cos.dao.DeviceAlertInfoMapper; 5 | import cc.mrbird.febs.cos.service.IDeviceAlertInfoService; 6 | import com.baomidou.mybatisplus.core.metadata.IPage; 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 8 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.LinkedHashMap; 12 | 13 | /** 14 | * 设备报警配置 实现层 15 | * 16 | * @author FanK 17 | */ 18 | @Service 19 | public class DeviceAlertInfoServiceImpl extends ServiceImpl implements IDeviceAlertInfoService { 20 | 21 | /** 22 | * 分页获取设备报警配置信息 23 | * 24 | * @param page 分页对象 25 | * @param deviceAlertInfo 设备报警配置信息 26 | * @return 结果 27 | */ 28 | @Override 29 | public IPage> selectDeviceAlertPage(Page page, DeviceAlertInfo deviceAlertInfo) { 30 | return baseMapper.selectDeviceAlertPage(page, deviceAlertInfo); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/impl/DeviceOfflineRecordServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service.impl; 2 | 3 | import cc.mrbird.febs.cos.entity.DeviceOfflineRecord; 4 | import cc.mrbird.febs.cos.dao.DeviceOfflineRecordMapper; 5 | import cc.mrbird.febs.cos.service.IDeviceOfflineRecordService; 6 | import com.baomidou.mybatisplus.core.metadata.IPage; 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 8 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.LinkedHashMap; 12 | 13 | /** 14 | * 设备上下线记录 实现层 15 | * 16 | * @author FanK 17 | */ 18 | @Service 19 | public class DeviceOfflineRecordServiceImpl extends ServiceImpl implements IDeviceOfflineRecordService { 20 | 21 | /** 22 | * 分页获取设备上下线记录信息 23 | * 24 | * @param page 分页对象 25 | * @param deviceOfflineRecord 设备上下线记录信息 26 | * @return 结果 27 | */ 28 | @Override 29 | public IPage> selectOfflineRecordPage(Page page, DeviceOfflineRecord deviceOfflineRecord) { 30 | return baseMapper.selectOfflineRecordPage(page, deviceOfflineRecord); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/impl/EventDetailServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service.impl; 2 | 3 | import cc.mrbird.febs.cos.entity.EventDetail; 4 | import cc.mrbird.febs.cos.dao.EventDetailMapper; 5 | import cc.mrbird.febs.cos.service.IEventDetailService; 6 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * 场景事件详情 实现层 11 | * 12 | * @author FanK 13 | */ 14 | @Service 15 | public class EventDetailServiceImpl extends ServiceImpl implements IEventDetailService { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/impl/EventInfoServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service.impl; 2 | 3 | import cc.mrbird.febs.cos.entity.EventInfo; 4 | import cc.mrbird.febs.cos.dao.EventInfoMapper; 5 | import cc.mrbird.febs.cos.service.IEventInfoService; 6 | import com.baomidou.mybatisplus.core.metadata.IPage; 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 8 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.LinkedHashMap; 12 | import java.util.List; 13 | 14 | /** 15 | * 用户场景事件 实现层 16 | * 17 | * @author FanK 18 | */ 19 | @Service 20 | public class EventInfoServiceImpl extends ServiceImpl implements IEventInfoService { 21 | 22 | /** 23 | * 分页获取场景事件信息 24 | * 25 | * @param page 分页对象 26 | * @param eventInfo 场景事件信息 27 | * @return 结果 28 | */ 29 | @Override 30 | public IPage> queryEventPage(Page page, EventInfo eventInfo) { 31 | return baseMapper.queryEventPage(page, eventInfo); 32 | } 33 | 34 | /** 35 | * 获取事件详情 36 | * 37 | * @param eventId 事件ID 38 | * @return 结果 39 | */ 40 | @Override 41 | public List> queryEventDetail(Integer eventId) { 42 | return baseMapper.queryEventDetail(eventId); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/impl/MessageInfoServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service.impl; 2 | 3 | import cc.mrbird.febs.cos.entity.MessageInfo; 4 | import cc.mrbird.febs.cos.dao.MessageInfoMapper; 5 | import cc.mrbird.febs.cos.service.IMessageInfoService; 6 | import com.baomidou.mybatisplus.core.metadata.IPage; 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 8 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.LinkedHashMap; 12 | 13 | /** 14 | * 系统消息 实现层 15 | * 16 | * @author FanK 17 | */ 18 | @Service 19 | public class MessageInfoServiceImpl extends ServiceImpl implements IMessageInfoService { 20 | 21 | /** 22 | * 分页获取系统消息信息 23 | * 24 | * @param page 分页对象 25 | * @param messageInfo 系统消息信息 26 | * @return 结果 27 | */ 28 | @Override 29 | public IPage> selectMessagePage(Page page, MessageInfo messageInfo) { 30 | return baseMapper.selectMessagePage(page, messageInfo); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/impl/OperateRecordInfoServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service.impl; 2 | 3 | import cc.mrbird.febs.cos.entity.OperateRecordInfo; 4 | import cc.mrbird.febs.cos.dao.OperateRecordInfoMapper; 5 | import cc.mrbird.febs.cos.service.IOperateRecordInfoService; 6 | import com.baomidou.mybatisplus.core.metadata.IPage; 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 8 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.LinkedHashMap; 12 | 13 | /** 14 | * 操作记录 实现层 15 | * 16 | * @author FanK 17 | */ 18 | @Service 19 | public class OperateRecordInfoServiceImpl extends ServiceImpl implements IOperateRecordInfoService { 20 | 21 | /** 22 | * 分页获取操作记录信息 23 | * 24 | * @param page 分页对象 25 | * @param operateRecordInfo 操作记录信息 26 | * @return 结果 27 | */ 28 | @Override 29 | public IPage> selectOperateRecordPage(Page page, OperateRecordInfo operateRecordInfo) { 30 | return baseMapper.selectOperateRecordPage(page, operateRecordInfo); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/cos/service/impl/UserInfoServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.cos.service.impl; 2 | 3 | import cc.mrbird.febs.cos.entity.UserInfo; 4 | import cc.mrbird.febs.cos.dao.UserInfoMapper; 5 | import cc.mrbird.febs.cos.service.IUserInfoService; 6 | import com.baomidou.mybatisplus.core.metadata.IPage; 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 8 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.LinkedHashMap; 12 | 13 | /** 14 | * 用户信息 实现层 15 | * 16 | * @author FanK 17 | */ 18 | @Service 19 | public class UserInfoServiceImpl extends ServiceImpl implements IUserInfoService { 20 | 21 | /** 22 | * 分页获取用户管理 23 | * 24 | * @param page 分页对象 25 | * @param userInfo 用户管理 26 | * @return 结果 27 | */ 28 | @Override 29 | public IPage> selectUserPage(Page page, UserInfo userInfo) { 30 | return baseMapper.selectUserPage(page, userInfo); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/controller/RedisController.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.controller; 2 | 3 | import cc.mrbird.febs.common.domain.FebsResponse; 4 | import cc.mrbird.febs.common.domain.RedisInfo; 5 | import cc.mrbird.febs.common.service.RedisService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | @RestController 15 | @RequestMapping("redis") 16 | public class RedisController { 17 | 18 | @Autowired 19 | private RedisService redisService; 20 | 21 | @GetMapping("info") 22 | public FebsResponse getRedisInfo() throws Exception { 23 | List infoList = this.redisService.getRedisInfo(); 24 | return new FebsResponse().data(infoList); 25 | } 26 | 27 | @GetMapping("keysSize") 28 | public Map getKeysSize() throws Exception { 29 | return redisService.getKeysSize(); 30 | } 31 | 32 | @GetMapping("memoryInfo") 33 | public Map getMemoryInfo() throws Exception { 34 | return redisService.getMemoryInfo(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/dao/DeptMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.dao; 2 | 3 | import cc.mrbird.febs.system.domain.Dept; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | public interface DeptMapper extends BaseMapper { 7 | 8 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/dao/DictMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.dao; 2 | 3 | import cc.mrbird.febs.system.domain.Dict; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | public interface DictMapper extends BaseMapper { 7 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/dao/LogMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.dao; 2 | 3 | import cc.mrbird.febs.system.domain.SysLog; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | public interface LogMapper extends BaseMapper { 7 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/dao/LoginLogMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.dao; 2 | 3 | 4 | import cc.mrbird.febs.system.domain.LoginLog; 5 | import cc.mrbird.febs.system.domain.User; 6 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 7 | 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | public interface LoginLogMapper extends BaseMapper { 12 | 13 | /** 14 | * 获取系统总访问次数 15 | * 16 | * @return Long 17 | */ 18 | Long findTotalVisitCount(); 19 | 20 | /** 21 | * 获取系统今日访问次数 22 | * 23 | * @return Long 24 | */ 25 | Long findTodayVisitCount(); 26 | 27 | /** 28 | * 获取系统今日访问 IP数 29 | * 30 | * @return Long 31 | */ 32 | Long findTodayIp(); 33 | 34 | /** 35 | * 获取系统近七天来的访问记录 36 | * 37 | * @param user 用户 38 | * @return 系统近七天来的访问记录 39 | */ 40 | List> findLastSevenDaysVisitCount(User user); 41 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/dao/MenuMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.dao; 2 | 3 | import cc.mrbird.febs.system.domain.Menu; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | import java.util.List; 7 | 8 | public interface MenuMapper extends BaseMapper { 9 | 10 | List findUserPermissions(String userName); 11 | 12 | List findUserMenus(String userName); 13 | 14 | /** 15 | * 查找当前菜单/按钮关联的用户 ID 16 | * 17 | * @param menuId menuId 18 | * @return 用户 ID集合 19 | */ 20 | List findUserIdsByMenuId(String menuId); 21 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/dao/RoleMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.dao; 2 | 3 | import cc.mrbird.febs.system.domain.Role; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | import java.util.List; 7 | 8 | public interface RoleMapper extends BaseMapper { 9 | 10 | List findUserRole(String userName); 11 | 12 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/dao/RoleMenuMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.dao; 2 | 3 | import cc.mrbird.febs.system.domain.RoleMenu; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | public interface RoleMenuMapper extends BaseMapper { 7 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/dao/TestMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.dao; 2 | 3 | import cc.mrbird.febs.system.domain.Test; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | public interface TestMapper extends BaseMapper { 7 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/dao/UserConfigMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.dao; 2 | 3 | import cc.mrbird.febs.system.domain.UserConfig; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | public interface UserConfigMapper extends BaseMapper { 7 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.dao; 2 | 3 | import cc.mrbird.febs.system.domain.User; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.baomidou.mybatisplus.core.metadata.IPage; 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | public interface UserMapper extends BaseMapper { 10 | 11 | IPage findUserDetail(Page page, @Param("user") User user); 12 | 13 | /** 14 | * 获取单个用户详情 15 | * 16 | * @param username 用户名 17 | * @return 用户信息 18 | */ 19 | User findDetail(String username); 20 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/dao/UserRoleMapper.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.dao; 2 | 3 | import cc.mrbird.febs.system.domain.UserRole; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | public interface UserRoleMapper extends BaseMapper { 8 | 9 | /** 10 | * 根据用户Id删除该用户的角色关系 11 | * 12 | * @param userId 用户ID 13 | * @return boolean 14 | * @author lzx 15 | * @date 2019年03月04日17:46:49 16 | */ 17 | Boolean deleteByUserId(@Param("userId") Long userId); 18 | 19 | /** 20 | * 根据角色Id删除该角色的用户关系 21 | * 22 | * @param roleId 角色ID 23 | * @return boolean 24 | * @author lzx 25 | * @date 2019年03月04日17:47:16 26 | */ 27 | Boolean deleteByRoleId(@Param("roleId") Long roleId); 28 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/domain/Dept.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.domain; 2 | 3 | import cc.mrbird.febs.common.converter.TimeConverter; 4 | import com.baomidou.mybatisplus.annotation.IdType; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import com.wuwenze.poi.annotation.Excel; 8 | import com.wuwenze.poi.annotation.ExcelField; 9 | import lombok.Data; 10 | 11 | import javax.validation.constraints.NotBlank; 12 | import javax.validation.constraints.Size; 13 | import java.io.Serializable; 14 | import java.util.Date; 15 | 16 | @Data 17 | @TableName("t_dept") 18 | @Excel("部门信息表") 19 | public class Dept implements Serializable { 20 | 21 | private static final long serialVersionUID = -7790334862410409053L; 22 | 23 | @TableId(value = "DEPT_ID", type = IdType.AUTO) 24 | private Long deptId; 25 | 26 | private Long parentId; 27 | 28 | @NotBlank(message = "{required}") 29 | @Size(max = 20, message = "{noMoreThan}") 30 | @ExcelField(value = "部门名称") 31 | private String deptName; 32 | 33 | private Double orderNum; 34 | 35 | @ExcelField(value = "创建时间", writeConverter = TimeConverter.class) 36 | private Date createTime; 37 | 38 | @ExcelField(value = "修改时间", writeConverter = TimeConverter.class) 39 | private Date modifyTime; 40 | 41 | private transient String createTimeFrom; 42 | 43 | private transient String createTimeTo; 44 | 45 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/domain/Dict.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.domain; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import com.wuwenze.poi.annotation.Excel; 7 | import com.wuwenze.poi.annotation.ExcelField; 8 | import lombok.Data; 9 | import lombok.ToString; 10 | 11 | import javax.validation.constraints.NotBlank; 12 | import javax.validation.constraints.Size; 13 | import java.io.Serializable; 14 | 15 | @Data 16 | @TableName("t_dict") 17 | @Excel("字典信息表") 18 | public class Dict implements Serializable { 19 | 20 | private static final long serialVersionUID = 7780820231535870010L; 21 | 22 | @TableId(value = "DICT_ID", type = IdType.AUTO) 23 | private Long dictId; 24 | 25 | @NotBlank(message = "{required}") 26 | @Size(max = 10, message = "{noMoreThan}") 27 | @ExcelField(value = "键") 28 | private String keyy; 29 | 30 | @NotBlank(message = "{required}") 31 | @Size(max = 20, message = "{noMoreThan}") 32 | @ExcelField(value = "值") 33 | private String valuee; 34 | 35 | @NotBlank(message = "{required}") 36 | @Size(max = 20, message = "{noMoreThan}") 37 | @ExcelField(value = "表名") 38 | private String tableName; 39 | 40 | @NotBlank(message = "{required}") 41 | @Size(max = 20, message = "{noMoreThan}") 42 | @ExcelField(value = "字段名") 43 | private String fieldName; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/domain/LoginLog.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.domain; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | import java.util.Date; 8 | 9 | @TableName("t_login_log") 10 | @Data 11 | public class LoginLog { 12 | /** 13 | * 用户 ID 14 | */ 15 | private String username; 16 | 17 | /** 18 | * 登录时间 19 | */ 20 | private Date loginTime; 21 | 22 | /** 23 | * 登录地点 24 | */ 25 | private String location; 26 | 27 | private String ip; 28 | } 29 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/domain/Menu.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.domain; 2 | 3 | import cc.mrbird.febs.common.converter.TimeConverter; 4 | import com.baomidou.mybatisplus.annotation.IdType; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import com.wuwenze.poi.annotation.Excel; 8 | import com.wuwenze.poi.annotation.ExcelField; 9 | import lombok.Data; 10 | 11 | import javax.validation.constraints.NotBlank; 12 | import javax.validation.constraints.Size; 13 | import java.io.Serializable; 14 | import java.util.Date; 15 | 16 | @Data 17 | @TableName("t_menu") 18 | @Excel("菜单信息表") 19 | public class Menu implements Serializable { 20 | 21 | private static final long serialVersionUID = 7187628714679791771L; 22 | 23 | public static final String TYPE_MENU = "0"; 24 | 25 | public static final String TYPE_BUTTON = "1"; 26 | 27 | @TableId(value = "MENU_ID", type = IdType.AUTO) 28 | private Long menuId; 29 | 30 | private Long parentId; 31 | 32 | @NotBlank(message = "{required}") 33 | @Size(max = 10, message = "{noMoreThan}") 34 | @ExcelField(value = "名称") 35 | private String menuName; 36 | 37 | @Size(max = 50, message = "{noMoreThan}") 38 | @ExcelField(value = "地址") 39 | private String path; 40 | 41 | @Size(max = 100, message = "{noMoreThan}") 42 | @ExcelField(value = "对应Vue组件") 43 | private String component; 44 | 45 | @Size(max = 50, message = "{noMoreThan}") 46 | @ExcelField(value = "权限") 47 | private String perms; 48 | 49 | @ExcelField(value = "图标") 50 | private String icon; 51 | 52 | @NotBlank(message = "{required}") 53 | @ExcelField(value = "类型", writeConverterExp = "0=按钮,1=菜单") 54 | private String type; 55 | 56 | private Double orderNum; 57 | 58 | @ExcelField(value = "创建时间", writeConverter = TimeConverter.class) 59 | private Date createTime; 60 | 61 | @ExcelField(value = "修改时间", writeConverter = TimeConverter.class) 62 | private Date modifyTime; 63 | 64 | private transient String createTimeFrom; 65 | private transient String createTimeTo; 66 | 67 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/domain/Role.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.domain; 2 | 3 | import cc.mrbird.febs.common.converter.TimeConverter; 4 | import com.baomidou.mybatisplus.annotation.IdType; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import com.wuwenze.poi.annotation.Excel; 8 | import com.wuwenze.poi.annotation.ExcelField; 9 | import lombok.Data; 10 | 11 | import javax.validation.constraints.NotBlank; 12 | import javax.validation.constraints.Size; 13 | import java.io.Serializable; 14 | import java.util.Date; 15 | 16 | @Data 17 | @TableName("t_role") 18 | @Excel("角色信息表") 19 | public class Role implements Serializable { 20 | 21 | private static final long serialVersionUID = -1714476694755654924L; 22 | 23 | @TableId(value = "ROLE_ID", type = IdType.AUTO) 24 | private Long roleId; 25 | 26 | @NotBlank(message = "{required}") 27 | @Size(max = 10, message = "{noMoreThan}") 28 | @ExcelField(value = "角色名称") 29 | private String roleName; 30 | 31 | @Size(max = 50, message = "{noMoreThan}") 32 | @ExcelField(value = "角色描述") 33 | private String remark; 34 | 35 | @ExcelField(value = "创建时间", writeConverter = TimeConverter.class) 36 | private Date createTime; 37 | 38 | @ExcelField(value = "修改时间", writeConverter = TimeConverter.class) 39 | private Date modifyTime; 40 | 41 | private transient String createTimeFrom; 42 | private transient String createTimeTo; 43 | private transient String menuId; 44 | 45 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/domain/RoleMenu.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.domain; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | @TableName("t_role_menu") 9 | @Data 10 | public class RoleMenu implements Serializable { 11 | 12 | private static final long serialVersionUID = -7573904024872252113L; 13 | 14 | private Long roleId; 15 | 16 | private Long menuId; 17 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/domain/SysLog.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.domain; 2 | 3 | import cc.mrbird.febs.common.converter.TimeConverter; 4 | import com.baomidou.mybatisplus.annotation.IdType; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import com.wuwenze.poi.annotation.Excel; 8 | import com.wuwenze.poi.annotation.ExcelField; 9 | import lombok.Data; 10 | 11 | import java.io.Serializable; 12 | import java.util.Date; 13 | 14 | @Data 15 | @TableName("t_log") 16 | @Excel("系统日志表") 17 | public class SysLog implements Serializable { 18 | 19 | private static final long serialVersionUID = -8878596941954995444L; 20 | 21 | @TableId(value = "ID", type = IdType.AUTO) 22 | private Long id; 23 | 24 | @ExcelField(value = "操作人") 25 | private String username; 26 | 27 | @ExcelField(value = "操作描述") 28 | private String operation; 29 | 30 | @ExcelField(value = "耗时(毫秒)") 31 | private Long time; 32 | 33 | @ExcelField(value = "执行方法") 34 | private String method; 35 | 36 | @ExcelField(value = "方法参数") 37 | private String params; 38 | 39 | @ExcelField(value = "IP地址") 40 | private String ip; 41 | 42 | @ExcelField(value = "操作时间", writeConverter = TimeConverter.class) 43 | private Date createTime; 44 | 45 | private transient String createTimeFrom; 46 | private transient String createTimeTo; 47 | 48 | @ExcelField(value = "操作地点") 49 | private String location; 50 | 51 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/domain/Test.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.domain; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.wuwenze.poi.annotation.Excel; 5 | import com.wuwenze.poi.annotation.ExcelField; 6 | import com.wuwenze.poi.validator.EmailValidator; 7 | import lombok.Data; 8 | 9 | import java.util.Date; 10 | 11 | @Data 12 | @TableName("t_test") 13 | @Excel("测试导入导出数据") 14 | public class Test { 15 | 16 | @ExcelField(value = "字段1", required = true, maxLength = 20, 17 | comment = "提示:必填,长度不能超过20个字符") 18 | private String field1; 19 | 20 | @ExcelField(value = "字段2", required = true, maxLength = 11, regularExp = "[0-9]+", 21 | regularExpMessage = "必须是数字", comment = "提示: 必填,只能填写数字,并且长度不能超过11位") 22 | private Integer field2; 23 | 24 | @ExcelField(value = "字段3", required = true, maxLength = 50, 25 | comment = "提示:必填,只能填写邮箱,长度不能超过50个字符", validator = EmailValidator.class) 26 | private String field3; 27 | 28 | private Date createTime; 29 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/domain/UserConfig.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.domain; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import lombok.Data; 6 | 7 | 8 | @TableName("t_user_config") 9 | @Data 10 | public class UserConfig { 11 | 12 | public static final String DEFAULT_THEME = "light"; 13 | public static final String DEFAULT_LAYOUT = "side"; 14 | public static final String DEFAULT_MULTIPAGE = "0"; 15 | public static final String DEFAULT_FIX_SIDERBAR = "1"; 16 | public static final String DEFAULT_FIX_HEADER = "1"; 17 | public static final String DEFAULT_COLOR = "rgb(66, 185, 131)"; 18 | 19 | /** 20 | * 用户 ID 21 | */ 22 | @TableId(value = "USER_ID") 23 | private Long userId; 24 | 25 | /** 26 | * 系统主题 dark暗色风格,light明亮风格 27 | */ 28 | private String theme; 29 | 30 | /** 31 | * 系统布局 side侧边栏,head顶部栏 32 | */ 33 | private String layout; 34 | 35 | /** 36 | * 页面风格 1多标签页 0单页 37 | */ 38 | private String multiPage; 39 | 40 | /** 41 | * 页面滚动是否固定侧边栏 1固定 0不固定 42 | */ 43 | private String fixSiderbar; 44 | 45 | /** 46 | * 页面滚动是否固定顶栏 1固定 0不固定 47 | */ 48 | private String fixHeader; 49 | 50 | /** 51 | * 主题颜色 RGB值 52 | */ 53 | private String color; 54 | 55 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/domain/UserRole.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.domain; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | @TableName("t_user_role") 9 | @Data 10 | public class UserRole implements Serializable{ 11 | 12 | private static final long serialVersionUID = -3166012934498268403L; 13 | 14 | private Long userId; 15 | 16 | private Long roleId; 17 | 18 | } -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/service/DeptService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.service; 2 | 3 | 4 | import cc.mrbird.febs.common.domain.QueryRequest; 5 | import cc.mrbird.febs.system.domain.Dept; 6 | import com.baomidou.mybatisplus.extension.service.IService; 7 | 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | public interface DeptService extends IService { 12 | 13 | Map findDepts(QueryRequest request, Dept dept); 14 | 15 | List findDepts(Dept dept, QueryRequest request); 16 | 17 | void createDept(Dept dept); 18 | 19 | void updateDept(Dept dept); 20 | 21 | void deleteDepts(String[] deptIds); 22 | } 23 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/service/DictService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.service; 2 | 3 | import cc.mrbird.febs.common.domain.QueryRequest; 4 | import cc.mrbird.febs.system.domain.Dict; 5 | import com.baomidou.mybatisplus.core.metadata.IPage; 6 | import com.baomidou.mybatisplus.extension.service.IService; 7 | 8 | 9 | public interface DictService extends IService { 10 | 11 | IPage findDicts(QueryRequest request, Dict dict); 12 | 13 | void createDict(Dict dict); 14 | 15 | void updateDict(Dict dicdt); 16 | 17 | void deleteDicts(String[] dictIds); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/service/LogService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.service; 2 | 3 | import cc.mrbird.febs.common.domain.QueryRequest; 4 | import cc.mrbird.febs.system.domain.SysLog; 5 | import com.baomidou.mybatisplus.core.metadata.IPage; 6 | import com.baomidou.mybatisplus.extension.service.IService; 7 | import com.fasterxml.jackson.core.JsonProcessingException; 8 | import org.aspectj.lang.ProceedingJoinPoint; 9 | import org.springframework.scheduling.annotation.Async; 10 | 11 | 12 | public interface LogService extends IService { 13 | 14 | IPage findLogs(QueryRequest request, SysLog sysLog); 15 | 16 | void deleteLogs(String[] logIds); 17 | 18 | @Async 19 | void saveLog(ProceedingJoinPoint point, SysLog log) throws JsonProcessingException; 20 | } 21 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/service/LoginLogService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.service; 2 | 3 | import cc.mrbird.febs.system.domain.LoginLog; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | public interface LoginLogService extends IService { 7 | 8 | void saveLoginLog (LoginLog loginLog); 9 | } 10 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/service/MenuService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.service; 2 | 3 | import cc.mrbird.febs.system.domain.Menu; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | import java.util.List; 7 | import java.util.Map; 8 | 9 | public interface MenuService extends IService { 10 | 11 | List findUserPermissions(String username); 12 | 13 | List findUserMenus(String username); 14 | 15 | Map findMenus(Menu menu); 16 | 17 | List findMenuList(Menu menu); 18 | 19 | void createMenu(Menu menu); 20 | 21 | void updateMenu(Menu menu) throws Exception; 22 | 23 | /** 24 | * 递归删除菜单/按钮 25 | * 26 | * @param menuIds menuIds 27 | */ 28 | void deleteMeuns(String[] menuIds) throws Exception; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/service/RoleMenuServie.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.service; 2 | 3 | import cc.mrbird.febs.system.domain.RoleMenu; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | import java.util.List; 7 | 8 | public interface RoleMenuServie extends IService { 9 | 10 | void deleteRoleMenusByRoleId(String[] roleIds); 11 | 12 | void deleteRoleMenusByMenuId(String[] menuIds); 13 | 14 | List getRoleMenusByRoleId(String roleId); 15 | } 16 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/service/RoleService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.service; 2 | 3 | import cc.mrbird.febs.common.domain.QueryRequest; 4 | import cc.mrbird.febs.system.domain.Role; 5 | import com.baomidou.mybatisplus.core.metadata.IPage; 6 | import com.baomidou.mybatisplus.extension.service.IService; 7 | 8 | import java.util.List; 9 | 10 | public interface RoleService extends IService { 11 | 12 | IPage findRoles(Role role, QueryRequest request); 13 | 14 | List findUserRole(String userName); 15 | 16 | Role findByName(String roleName); 17 | 18 | void createRole(Role role); 19 | 20 | void deleteRoles(String[] roleIds) throws Exception; 21 | 22 | void updateRole(Role role) throws Exception; 23 | } 24 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/service/TestService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.service; 2 | 3 | import cc.mrbird.febs.system.domain.Test; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | import java.util.List; 7 | 8 | public interface TestService extends IService { 9 | 10 | List findTests(); 11 | 12 | /** 13 | * 批量插入 14 | * @param list List 15 | */ 16 | void batchInsert(List list); 17 | } 18 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/service/UserConfigService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.service; 2 | 3 | import cc.mrbird.febs.system.domain.UserConfig; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | public interface UserConfigService extends IService { 7 | 8 | /** 9 | * 通过用户 ID 获取前端系统个性化配置 10 | * 11 | * @param userId 用户 ID 12 | * @return 前端系统个性化配置 13 | */ 14 | UserConfig findByUserId(String userId); 15 | 16 | /** 17 | * 生成用户默认个性化配置 18 | * 19 | * @param userId 用户 ID 20 | */ 21 | void initDefaultUserConfig(String userId); 22 | 23 | /** 24 | * 通过用户 ID 删除个性化配置 25 | * 26 | * @param userIds 用户 ID 数组 27 | */ 28 | void deleteByUserId(String... userIds); 29 | 30 | /** 31 | * 更新用户个性化配置 32 | * 33 | * @param userConfig 用户个性化配置 34 | */ 35 | void update(UserConfig userConfig) throws Exception; 36 | } 37 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/service/UserRoleService.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.service; 2 | 3 | 4 | import cc.mrbird.febs.system.domain.UserRole; 5 | import com.baomidou.mybatisplus.extension.service.IService; 6 | 7 | import java.util.List; 8 | 9 | public interface UserRoleService extends IService { 10 | 11 | void deleteUserRolesByRoleId(String[] roleIds); 12 | 13 | void deleteUserRolesByUserId(String[] userIds); 14 | 15 | List findUserIdsByRoleId(String[] roleIds); 16 | } 17 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/service/impl/LoginLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.service.impl; 2 | 3 | import cc.mrbird.febs.common.utils.AddressUtil; 4 | import cc.mrbird.febs.common.utils.HttpContextUtil; 5 | import cc.mrbird.febs.common.utils.IPUtil; 6 | import cc.mrbird.febs.system.dao.LoginLogMapper; 7 | import cc.mrbird.febs.system.domain.LoginLog; 8 | import cc.mrbird.febs.system.service.LoginLogService; 9 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 10 | import org.springframework.stereotype.Service; 11 | import org.springframework.transaction.annotation.Propagation; 12 | import org.springframework.transaction.annotation.Transactional; 13 | 14 | import javax.servlet.http.HttpServletRequest; 15 | import java.util.Date; 16 | 17 | @Service("loginLogService") 18 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) 19 | public class LoginLogServiceImpl extends ServiceImpl implements LoginLogService { 20 | 21 | @Override 22 | @Transactional 23 | public void saveLoginLog(LoginLog loginLog) { 24 | loginLog.setLoginTime(new Date()); 25 | HttpServletRequest request = HttpContextUtil.getHttpServletRequest(); 26 | String ip = IPUtil.getIpAddr(request); 27 | loginLog.setIp(ip); 28 | loginLog.setLocation(AddressUtil.getCityInfo(ip)); 29 | this.save(loginLog); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/service/impl/RoleMenuServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.service.impl; 2 | 3 | import cc.mrbird.febs.system.dao.RoleMenuMapper; 4 | import cc.mrbird.febs.system.domain.RoleMenu; 5 | import cc.mrbird.febs.system.service.RoleMenuServie; 6 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 7 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 8 | import org.springframework.stereotype.Service; 9 | import org.springframework.transaction.annotation.Propagation; 10 | import org.springframework.transaction.annotation.Transactional; 11 | 12 | import java.util.Arrays; 13 | import java.util.List; 14 | 15 | @Service("roleMenuService") 16 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) 17 | public class RoleMenuServiceImpl extends ServiceImpl implements RoleMenuServie { 18 | 19 | @Override 20 | @Transactional 21 | public void deleteRoleMenusByRoleId(String[] roleIds) { 22 | List list = Arrays.asList(roleIds); 23 | baseMapper.delete(new LambdaQueryWrapper().in(RoleMenu::getRoleId, list)); 24 | } 25 | 26 | @Override 27 | @Transactional 28 | public void deleteRoleMenusByMenuId(String[] menuIds) { 29 | List list = Arrays.asList(menuIds); 30 | baseMapper.delete(new LambdaQueryWrapper().in(RoleMenu::getMenuId, list)); 31 | } 32 | 33 | @Override 34 | public List getRoleMenusByRoleId(String roleId) { 35 | return baseMapper.selectList(new LambdaQueryWrapper().eq(RoleMenu::getRoleId, roleId)); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/service/impl/TestServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.service.impl; 2 | 3 | import cc.mrbird.febs.system.dao.TestMapper; 4 | import cc.mrbird.febs.system.domain.Test; 5 | import cc.mrbird.febs.system.service.TestService; 6 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 7 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 8 | import lombok.extern.slf4j.Slf4j; 9 | import org.springframework.beans.factory.annotation.Value; 10 | import org.springframework.stereotype.Service; 11 | import org.springframework.transaction.annotation.Propagation; 12 | import org.springframework.transaction.annotation.Transactional; 13 | 14 | import java.util.ArrayList; 15 | import java.util.List; 16 | 17 | @Slf4j 18 | @Service("testService") 19 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) 20 | public class TestServiceImpl extends ServiceImpl implements TestService { 21 | 22 | @Value("${febs.max.batch.insert.num}") 23 | private int batchInsertMaxNum; 24 | 25 | @Override 26 | public List findTests() { 27 | try { 28 | return baseMapper.selectList(new QueryWrapper().orderByDesc("create_time")); 29 | } catch (Exception e) { 30 | log.error("获取信息失败", e); 31 | return new ArrayList<>(); 32 | } 33 | } 34 | 35 | @Override 36 | @Transactional 37 | public void batchInsert(List list) { 38 | int total = list.size(); 39 | int max = batchInsertMaxNum; 40 | int count = total / max; 41 | int left = total % max; 42 | int length; 43 | if (left == 0) length = count; 44 | else length = count + 1; 45 | for (int i = 0; i < length; i++) { 46 | int start = max * i; 47 | int end = max * (i + 1); 48 | if (i != count) { 49 | log.info("正在插入第" + (start + 1) + " ~ " + end + "条记录 ······"); 50 | saveBatch(list, end); 51 | } else { 52 | end = total; 53 | log.info("正在插入第" + (start + 1) + " ~ " + end + "条记录 ······"); 54 | saveBatch(list, end); 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/service/impl/UserConfigServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.service.impl; 2 | 3 | import cc.mrbird.febs.common.service.CacheService; 4 | import cc.mrbird.febs.system.dao.UserConfigMapper; 5 | import cc.mrbird.febs.system.domain.UserConfig; 6 | import cc.mrbird.febs.system.service.UserConfigService; 7 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | import org.springframework.transaction.annotation.Propagation; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import java.util.Arrays; 14 | import java.util.List; 15 | 16 | @Service("userConfigService") 17 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) 18 | public class UserConfigServiceImpl extends ServiceImpl implements UserConfigService { 19 | 20 | @Autowired 21 | private CacheService cacheService; 22 | 23 | @Override 24 | public UserConfig findByUserId(String userId) { 25 | return baseMapper.selectById(userId); 26 | } 27 | 28 | @Override 29 | @Transactional 30 | public void initDefaultUserConfig(String userId) { 31 | UserConfig userConfig = new UserConfig(); 32 | userConfig.setUserId(Long.valueOf(userId)); 33 | userConfig.setColor(UserConfig.DEFAULT_COLOR); 34 | userConfig.setFixHeader(UserConfig.DEFAULT_FIX_HEADER); 35 | userConfig.setFixSiderbar(UserConfig.DEFAULT_FIX_SIDERBAR); 36 | userConfig.setLayout(UserConfig.DEFAULT_LAYOUT); 37 | userConfig.setTheme(UserConfig.DEFAULT_THEME); 38 | userConfig.setMultiPage(UserConfig.DEFAULT_MULTIPAGE); 39 | baseMapper.insert(userConfig); 40 | } 41 | 42 | @Override 43 | @Transactional 44 | public void deleteByUserId(String... userIds) { 45 | List list = Arrays.asList(userIds); 46 | baseMapper.deleteBatchIds(list); 47 | } 48 | 49 | @Override 50 | @Transactional 51 | public void update(UserConfig userConfig) throws Exception { 52 | baseMapper.updateById(userConfig); 53 | cacheService.saveUserConfigs(String.valueOf(userConfig.getUserId())); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/system/service/impl/UserRoleServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.system.service.impl; 2 | 3 | import cc.mrbird.febs.system.dao.UserRoleMapper; 4 | import cc.mrbird.febs.system.domain.UserRole; 5 | import cc.mrbird.febs.system.service.UserRoleService; 6 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 7 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 8 | import org.springframework.stereotype.Service; 9 | import org.springframework.transaction.annotation.Propagation; 10 | import org.springframework.transaction.annotation.Transactional; 11 | 12 | import java.util.Arrays; 13 | import java.util.List; 14 | import java.util.stream.Collectors; 15 | 16 | @Service("userRoleService") 17 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) 18 | public class UserRoleServiceImpl extends ServiceImpl implements UserRoleService { 19 | 20 | @Override 21 | @Transactional 22 | public void deleteUserRolesByRoleId(String[] roleIds) { 23 | Arrays.stream(roleIds).forEach(id -> baseMapper.deleteByRoleId(Long.valueOf(id))); 24 | } 25 | 26 | @Override 27 | @Transactional 28 | public void deleteUserRolesByUserId(String[] userIds) { 29 | Arrays.stream(userIds).forEach(id -> baseMapper.deleteByUserId(Long.valueOf(id))); 30 | } 31 | 32 | @Override 33 | public List findUserIdsByRoleId(String[] roleIds) { 34 | 35 | List list = baseMapper.selectList(new LambdaQueryWrapper().in(UserRole::getRoleId, String.join(",", roleIds))); 36 | return list.stream().map(userRole -> String.valueOf(userRole.getUserId())).collect(Collectors.toList()); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/web/controller/ArticleController.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.web.controller; 2 | 3 | import cc.mrbird.febs.common.domain.FebsConstant; 4 | import cc.mrbird.febs.common.domain.FebsResponse; 5 | import cc.mrbird.febs.common.exception.FebsException; 6 | import cc.mrbird.febs.common.utils.HttpUtil; 7 | import lombok.extern.slf4j.Slf4j; 8 | import org.apache.commons.lang3.StringUtils; 9 | import org.apache.shiro.authz.annotation.RequiresPermissions; 10 | import org.springframework.web.bind.annotation.GetMapping; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RestController; 13 | 14 | @Slf4j 15 | @RestController 16 | @RequestMapping("article") 17 | public class ArticleController { 18 | 19 | @GetMapping 20 | @RequiresPermissions("article:view") 21 | public FebsResponse queryArticle(String date) throws FebsException { 22 | String param; 23 | String data; 24 | try { 25 | if (StringUtils.isNotBlank(date)) { 26 | param = "dev=1&date=" + date; 27 | data = HttpUtil.sendSSLPost(FebsConstant.MRYW_DAY_URL, param); 28 | } else { 29 | param = "dev=1"; 30 | data = HttpUtil.sendSSLPost(FebsConstant.MRYW_TODAY_URL, param); 31 | } 32 | return new FebsResponse().data(data); 33 | } catch (Exception e) { 34 | String message = "获取文章失败"; 35 | log.error(message, e); 36 | throw new FebsException(message); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /backend/src/main/java/cc/mrbird/febs/web/controller/WeatherController.java: -------------------------------------------------------------------------------- 1 | package cc.mrbird.febs.web.controller; 2 | 3 | import cc.mrbird.febs.common.domain.FebsConstant; 4 | import cc.mrbird.febs.common.domain.FebsResponse; 5 | import cc.mrbird.febs.common.exception.FebsException; 6 | import cc.mrbird.febs.common.utils.HttpUtil; 7 | import lombok.extern.slf4j.Slf4j; 8 | import org.apache.shiro.authz.annotation.RequiresPermissions; 9 | import org.springframework.validation.annotation.Validated; 10 | import org.springframework.web.bind.annotation.GetMapping; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RestController; 13 | 14 | import javax.validation.constraints.NotBlank; 15 | 16 | @Slf4j 17 | @Validated 18 | @RestController 19 | @RequestMapping("weather") 20 | public class WeatherController { 21 | 22 | @GetMapping 23 | @RequiresPermissions("weather:view") 24 | public FebsResponse queryWeather(@NotBlank(message = "{required}") String areaId) throws FebsException { 25 | try { 26 | String data = HttpUtil.sendPost(FebsConstant.MEIZU_WEATHER_URL, "cityIds=" + areaId); 27 | return new FebsResponse().data(data); 28 | } catch (Exception e) { 29 | String message = "天气查询失败"; 30 | log.error(message, e); 31 | throw new FebsException(message); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /backend/src/main/resources/ValidationMessages.properties: -------------------------------------------------------------------------------- 1 | required=\u4E0D\u80FD\u4E3A\u7A7A 2 | range=\u6709\u6548\u957f\u5ea6{min}\u5230{max}\u4e2a\u5b57\u7b26 3 | email=\u90ae\u7bb1\u683c\u5f0f\u4e0d\u5408\u6cd5 4 | mobile=\u624b\u673a\u53f7\u4e0d\u5408\u6cd5 5 | noMoreThan=\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc7{max}\u4e2a\u5b57\u7b26 6 | invalid=\u503c\u4e0d\u5408\u6cd5 -------------------------------------------------------------------------------- /backend/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | 2 | ,--. ,--. 3 | ,---,. ,---, ,--.'| ,--/ /| ,---,. 4 | ,' .' | ' .' \ ,--,: : |,---,': / ' ,' .' | 5 | ,---.' | / ; '. ,`--.'`| ' :: : '/ / ,---.' | 6 | | | .': : \ | : : | || ' , | | .' 7 | : : : : | /\ \ : | \ | :' | / : : |-, 8 | : | |-,| : ' ;. : | : ' '; || ; ; : | ;/| 9 | | : ;/|| | ;/ \ \' ' ;. ;: ' \ | : .' 10 | | | .'' : | \ \ ,'| | | \ || | ' | | |-, 11 | ' : ' | | ' '--' ' : | ; .'' : |. \' : ;/| 12 | | | | | : : | | '`--' | | '_\.'| | \ 13 | | : \ | | ,' ' : | ' : | | : .' 14 | | | ,' `--'' ; |.' ; |,' | | ,' 15 | `----' '---' '---' `----' 16 | -------------------------------------------------------------------------------- /backend/src/main/resources/generator/templates/controller.java.ftl: -------------------------------------------------------------------------------- 1 | package ${package.Controller}; 2 | 3 | 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | <#if restControllerStyle> 7 | import org.springframework.web.bind.annotation.RestController; 8 | <#else> 9 | import org.springframework.stereotype.Controller; 10 | 11 | <#if superControllerClassPackage??> 12 | import ${superControllerClassPackage}; 13 | 14 | 15 | /** 16 | * ${table.comment!} 控制层 17 | * 18 | * @author ${author} 19 | */ 20 | <#if restControllerStyle> 21 | @RestController 22 | <#else> 23 | @Controller 24 | 25 | @RequestMapping("<#if package.ModuleName??>/${package.ModuleName}/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}") 26 | <#if kotlin> 27 | class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}() 28 | <#else> 29 | <#if superControllerClass??> 30 | public class ${table.controllerName} extends ${superControllerClass} { 31 | <#else> 32 | public class ${table.controllerName} { 33 | 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /backend/src/main/resources/generator/templates/mapper.java.ftl: -------------------------------------------------------------------------------- 1 | package ${package.Mapper}; 2 | 3 | import ${package.Entity}.${entity}; 4 | import ${superMapperClassPackage}; 5 | 6 | /** 7 | * ${table.comment!} mapper层 8 | * 9 | * @author ${author} 10 | */ 11 | <#if kotlin> 12 | interface ${table.mapperName} : ${superMapperClass}<${entity}> 13 | <#else> 14 | public interface ${table.mapperName} extends ${superMapperClass}<${entity}> { 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /backend/src/main/resources/generator/templates/mapper.xml.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <#if enableCache> 6 | 7 | 8 | 9 | 10 | <#if baseResultMap> 11 | 12 | 13 | <#list table.fields as field> 14 | <#if field.keyFlag><#--生成主键排在第一位--> 15 | 16 | 17 | 18 | <#list table.commonFields as field><#--生成公共字段 --> 19 | 20 | 21 | <#list table.fields as field> 22 | <#if !field.keyFlag><#--生成普通字段 --> 23 | 24 | 25 | 26 | 27 | 28 | 29 | <#if baseColumnList> 30 | 31 | 32 | <#list table.commonFields as field> 33 | ${field.name}, 34 | 35 | ${table.fieldNames} 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /backend/src/main/resources/generator/templates/service.java.ftl: -------------------------------------------------------------------------------- 1 | package ${package.Service}; 2 | 3 | import ${package.Entity}.${entity}; 4 | import ${superServiceClassPackage}; 5 | 6 | /** 7 | * ${table.comment!} service层 8 | * 9 | * @author ${author} 10 | */ 11 | <#if kotlin> 12 | interface ${table.serviceName} : ${superServiceClass}<${entity}> 13 | <#else> 14 | public interface ${table.serviceName} extends ${superServiceClass}<${entity}> { 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /backend/src/main/resources/generator/templates/serviceImpl.java.ftl: -------------------------------------------------------------------------------- 1 | package ${package.ServiceImpl}; 2 | 3 | import ${package.Entity}.${entity}; 4 | import ${package.Mapper}.${table.mapperName}; 5 | import ${package.Service}.${table.serviceName}; 6 | import ${superServiceImplClassPackage}; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * ${table.comment!} 实现层 11 | * 12 | * @author ${author} 13 | */ 14 | @Service 15 | <#if kotlin> 16 | open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} { 17 | 18 | } 19 | <#else> 20 | public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} { 21 | 22 | } 23 | 24 | -------------------------------------------------------------------------------- /backend/src/main/resources/ip2region/ip2region.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/backend/src/main/resources/ip2region/ip2region.db -------------------------------------------------------------------------------- /backend/src/main/resources/logback-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | febs 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | ${log.colorPattern} 13 | 14 | 15 | 16 | 17 | 18 | 19 | ${log.path}/info/info.%d{yyyy-MM-dd}.log 20 | ${log.maxHistory} 21 | 22 | 23 | ${log.pattern} 24 | 25 | 26 | INFO 27 | ACCEPT 28 | DENY 29 | 30 | 31 | 32 | 33 | 34 | ${log.path}/error/error.%d{yyyy-MM-dd}.log 35 | 36 | 37 | ${log.pattern} 38 | 39 | 40 | ERROR 41 | ACCEPT 42 | DENY 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /backend/src/main/resources/mapper/cos/BulletinInfoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 30 | 31 | -------------------------------------------------------------------------------- /backend/src/main/resources/mapper/cos/DeviceAlertInfoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 40 | 41 | -------------------------------------------------------------------------------- /backend/src/main/resources/mapper/cos/DeviceInfoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 49 | 50 | -------------------------------------------------------------------------------- /backend/src/main/resources/mapper/cos/DeviceOfflineRecordMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 45 | 46 | -------------------------------------------------------------------------------- /backend/src/main/resources/mapper/cos/EventDetailMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /backend/src/main/resources/mapper/cos/EventInfoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 38 | 39 | 40 | 62 | 63 | -------------------------------------------------------------------------------- /backend/src/main/resources/mapper/cos/MessageInfoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 30 | 31 | -------------------------------------------------------------------------------- /backend/src/main/resources/mapper/cos/OperateRecordInfoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 46 | 47 | -------------------------------------------------------------------------------- /backend/src/main/resources/mapper/cos/UserInfoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 28 | 29 | -------------------------------------------------------------------------------- /backend/src/main/resources/mapper/system/LoginLogMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 11 | 12 | 15 | 16 | 35 | -------------------------------------------------------------------------------- /backend/src/main/resources/mapper/system/RoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 22 | 23 | -------------------------------------------------------------------------------- /backend/src/main/resources/mapper/system/UserRoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | DELETE FROM t_user_role WHERE user_id = #{userId} 14 | 15 | 16 | 17 | 18 | DELETE FROM t_user_role WHERE role_id = #{roleId} 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /backend/src/main/resources/spy.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/backend/src/main/resources/spy.properties -------------------------------------------------------------------------------- /frontend/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false, 5 | "targets": { 6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 7 | } 8 | }], 9 | "stage-2" 10 | ], 11 | "plugins": ["transform-vue-jsx", "transform-runtime"], 12 | "env": { 13 | "test": { 14 | "presets": ["env", "stage-2"], 15 | "plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /frontend/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /frontend/.eslintignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | /config/ 3 | /dist/ 4 | /*.js 5 | /test/unit/coverage/ 6 | -------------------------------------------------------------------------------- /frontend/.eslintrc.js: -------------------------------------------------------------------------------- 1 | // https://eslint.org/docs/user-guide/configuring 2 | 3 | module.exports = { 4 | root: true, 5 | parserOptions: { 6 | parser: 'babel-eslint' 7 | }, 8 | env: { 9 | browser: true, 10 | }, 11 | extends: [ 12 | // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention 13 | // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules. 14 | 'plugin:vue/essential', 15 | // https://github.com/standard/standard/blob/master/docs/RULES-en.md 16 | 'standard' 17 | ], 18 | // required to lint *.vue files 19 | plugins: [ 20 | 'vue' 21 | ], 22 | // add your custom rules here 23 | rules: { 24 | // allow async-await 25 | 'generator-star-spacing': 'off', 26 | // allow debugger during development 27 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /frontend/.gitattributes: -------------------------------------------------------------------------------- 1 | *.js linguist-language=vue 2 | 3 | *.css linguist-language=vue 4 | 5 | *.html linguist-language=vue 6 | -------------------------------------------------------------------------------- /frontend/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | -------------------------------------------------------------------------------- /frontend/.idea/frontend.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /frontend/.idea/git_toolbox_blame.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /frontend/.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /frontend/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /frontend/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /frontend/.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | "postcss-import": {}, 6 | "postcss-url": {}, 7 | // to edit target browsers: use "browserslist" field in package.json 8 | "autoprefixer": {} 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /frontend/build/build.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | require('./check-versions')() 3 | 4 | process.env.NODE_ENV = 'production' 5 | 6 | const ora = require('ora') 7 | const rm = require('rimraf') 8 | const path = require('path') 9 | const chalk = require('chalk') 10 | const webpack = require('webpack') 11 | const config = require('../config') 12 | const webpackConfig = require('./webpack.prod.conf') 13 | 14 | const spinner = ora('building for production...') 15 | spinner.start() 16 | 17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 18 | if (err) throw err 19 | webpack(webpackConfig, (err, stats) => { 20 | spinner.stop() 21 | if (err) throw err 22 | process.stdout.write(stats.toString({ 23 | colors: true, 24 | modules: false, 25 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. 26 | chunks: false, 27 | chunkModules: false 28 | }) + '\n\n') 29 | 30 | if (stats.hasErrors()) { 31 | console.log(chalk.red(' Build failed with errors.\n')) 32 | process.exit(1) 33 | } 34 | 35 | console.log(chalk.cyan(' Build complete.\n')) 36 | console.log(chalk.yellow( 37 | ' Tip: built files are meant to be served over an HTTP server.\n' + 38 | ' Opening index.html over file:// won\'t work.\n' 39 | )) 40 | }) 41 | }) 42 | -------------------------------------------------------------------------------- /frontend/build/check-versions.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const chalk = require('chalk') 3 | const semver = require('semver') 4 | const packageConfig = require('../package.json') 5 | const shell = require('shelljs') 6 | 7 | function exec (cmd) { 8 | return require('child_process').execSync(cmd).toString().trim() 9 | } 10 | 11 | const versionRequirements = [ 12 | { 13 | name: 'node', 14 | currentVersion: semver.clean(process.version), 15 | versionRequirement: packageConfig.engines.node 16 | } 17 | ] 18 | 19 | if (shell.which('npm')) { 20 | versionRequirements.push({ 21 | name: 'npm', 22 | currentVersion: exec('npm --version'), 23 | versionRequirement: packageConfig.engines.npm 24 | }) 25 | } 26 | 27 | module.exports = function () { 28 | const warnings = [] 29 | 30 | for (let i = 0; i < versionRequirements.length; i++) { 31 | const mod = versionRequirements[i] 32 | 33 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 34 | warnings.push(mod.name + ': ' + 35 | chalk.red(mod.currentVersion) + ' should be ' + 36 | chalk.green(mod.versionRequirement) 37 | ) 38 | } 39 | } 40 | 41 | if (warnings.length) { 42 | console.log('') 43 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 44 | console.log() 45 | 46 | for (let i = 0; i < warnings.length; i++) { 47 | const warning = warnings[i] 48 | console.log(' ' + warning) 49 | } 50 | 51 | console.log() 52 | process.exit(1) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /frontend/build/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/build/logo.png -------------------------------------------------------------------------------- /frontend/build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const config = require('../config') 4 | const isProduction = process.env.NODE_ENV === 'production' 5 | const sourceMapEnabled = isProduction 6 | ? config.build.productionSourceMap 7 | : config.dev.cssSourceMap 8 | 9 | module.exports = { 10 | loaders: utils.cssLoaders({ 11 | sourceMap: sourceMapEnabled, 12 | extract: isProduction 13 | }), 14 | cssSourceMap: sourceMapEnabled, 15 | cacheBusting: config.dev.cacheBusting, 16 | transformToRequire: { 17 | video: ['src', 'poster'], 18 | source: 'src', 19 | img: 'src', 20 | image: 'xlink:href' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /frontend/config/dev.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const prodEnv = require('./prod.env') 4 | 5 | module.exports = merge(prodEnv, { 6 | NODE_ENV: '"development"' 7 | }) 8 | -------------------------------------------------------------------------------- /frontend/config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | NODE_ENV: '"production"' 4 | } 5 | -------------------------------------------------------------------------------- /frontend/config/test.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const devEnv = require('./dev.env') 4 | 5 | module.exports = merge(devEnv, { 6 | NODE_ENV: '"testing"' 7 | }) 8 | -------------------------------------------------------------------------------- /frontend/src/components/datetime/RangeDate.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 26 | -------------------------------------------------------------------------------- /frontend/src/components/exception/ExceptionPage.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 35 | 36 | 72 | -------------------------------------------------------------------------------- /frontend/src/components/exception/typeConfig.js: -------------------------------------------------------------------------------- 1 | const config = { 2 | 403: { 3 | img: 'https://gw.alipayobjects.com/zos/rmsportal/wZcnGqRDyhPOEYFcZDnb.svg', 4 | title: '403', 5 | desc: '抱歉,你无权访问该页面' 6 | }, 7 | 404: { 8 | img: 'https://gw.alipayobjects.com/zos/rmsportal/KpnpchXsobRgLElEozzI.svg', 9 | title: '404', 10 | desc: '抱歉,你访问的页面不存在或仍在开发中' 11 | }, 12 | 500: { 13 | img: 'https://gw.alipayobjects.com/zos/rmsportal/RVRUAYdCGeYNBWoKiIwB.svg', 14 | title: '500', 15 | desc: '抱歉,服务器出错了' 16 | } 17 | } 18 | 19 | export default config 20 | -------------------------------------------------------------------------------- /frontend/src/components/menu/Contextmenu.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 62 | 63 | 72 | -------------------------------------------------------------------------------- /frontend/src/components/setting/SettingItem.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 14 | 15 | 26 | -------------------------------------------------------------------------------- /frontend/src/components/setting/StyleItem.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 16 | 17 | 37 | -------------------------------------------------------------------------------- /frontend/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Febs from './FEBS' 3 | import router from './router' 4 | import Antd from 'ant-design-vue' 5 | import store from './store' 6 | import request from 'utils/request' 7 | import db from 'utils/localstorage' 8 | import VueApexCharts from 'vue-apexcharts' 9 | 10 | import 'ant-design-vue/dist/antd.css' 11 | 12 | import 'utils/install' 13 | 14 | Vue.config.productionTip = false 15 | Vue.use(Antd) 16 | Vue.use(db) 17 | Vue.use(VueApexCharts) 18 | 19 | if (window.jsMind) { 20 | console.log('wind') 21 | Vue.prototype.jsMind = window.jsMind 22 | } 23 | 24 | Vue.component('apexchart', VueApexCharts) 25 | 26 | Vue.use({ 27 | install (Vue) { 28 | Vue.prototype.$db = db 29 | } 30 | }) 31 | 32 | Vue.prototype.$post = request.post 33 | Vue.prototype.$get = request.get 34 | Vue.prototype.$put = request.put 35 | Vue.prototype.$delete = request.delete 36 | Vue.prototype.$export = request.export 37 | Vue.prototype.$download = request.download 38 | Vue.prototype.$upload = request.upload 39 | 40 | /* eslint-disable no-new */ 41 | new Vue({ 42 | router, 43 | store, 44 | render: h => h(Febs) 45 | }).$mount('#febs') 46 | -------------------------------------------------------------------------------- /frontend/src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | import account from './modules/account' 4 | import setting from './modules/setting' 5 | 6 | Vue.use(Vuex) 7 | 8 | export default new Vuex.Store({ 9 | modules: { 10 | account, 11 | setting 12 | } 13 | }) 14 | -------------------------------------------------------------------------------- /frontend/src/store/modules/account.js: -------------------------------------------------------------------------------- 1 | import db from 'utils/localstorage' 2 | 3 | export default { 4 | namespaced: true, 5 | state: { 6 | token: db.get('USER_TOKEN'), 7 | expireTime: db.get('EXPIRE_TIME'), 8 | user: db.get('USER'), 9 | permissions: db.get('PERMISSIONS'), 10 | roles: db.get('ROLES') 11 | }, 12 | mutations: { 13 | setToken (state, val) { 14 | db.save('USER_TOKEN', val) 15 | state.token = val 16 | }, 17 | setExpireTime (state, val) { 18 | db.save('EXPIRE_TIME', val) 19 | state.expireTime = val 20 | }, 21 | setUser (state, val) { 22 | db.save('USER', val) 23 | state.user = val 24 | }, 25 | setPermissions (state, val) { 26 | db.save('PERMISSIONS', val) 27 | state.permissions = val 28 | }, 29 | setRoles (state, val) { 30 | db.save('ROLES', val) 31 | state.roles = val 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /frontend/src/store/modules/setting.js: -------------------------------------------------------------------------------- 1 | import db from 'utils/localstorage' 2 | 3 | export default { 4 | namespaced: true, 5 | state: { 6 | sidebar: { 7 | opened: true 8 | }, 9 | settingBar: { 10 | opened: false 11 | }, 12 | isMobile: false, 13 | theme: db.get('THEME', 'light'), 14 | layout: db.get('LAYOUT', 'side'), 15 | systemName: '智能家居管理系统', 16 | copyright: `${new Date().getFullYear()} fank`, 17 | multipage: getBooleanValue(db.get('MULTIPAGE'), true), 18 | fixSiderbar: getBooleanValue(db.get('FIX_SIDERBAR'), true), 19 | fixHeader: getBooleanValue(db.get('FIX_HEADER'), true), 20 | colorList: [ 21 | 'rgb(245, 34, 45)', 22 | 'rgb(250, 84, 28)', 23 | 'rgb(250, 173, 20)', 24 | 'rgb(66, 185, 131)', 25 | 'rgb(82, 196, 26)', 26 | 'rgb(24, 144, 255)', 27 | 'rgb(47, 84, 235)', 28 | 'rgb(114, 46, 209)' 29 | ], 30 | color: db.get('COLOR', 'rgb(24, 144, 255)') 31 | }, 32 | mutations: { 33 | setDevice (state, isMobile) { 34 | state.isMobile = isMobile 35 | }, 36 | setTheme (state, theme) { 37 | db.save('THEME', theme) 38 | state.theme = theme 39 | }, 40 | setLayout (state, layout) { 41 | db.save('LAYOUT', layout) 42 | state.layout = layout 43 | }, 44 | setMultipage (state, multipage) { 45 | db.save('MULTIPAGE', multipage) 46 | state.multipage = multipage 47 | }, 48 | setSidebar (state, type) { 49 | state.sidebar.opened = type 50 | }, 51 | fixSiderbar (state, flag) { 52 | db.save('FIX_SIDERBAR', flag) 53 | state.fixSiderbar = flag 54 | }, 55 | fixHeader (state, flag) { 56 | db.save('FIX_HEADER', flag) 57 | state.fixHeader = flag 58 | }, 59 | setSettingBar (state, flag) { 60 | state.settingBar.opened = flag 61 | }, 62 | setColor (state, color) { 63 | db.save('COLOR', color) 64 | state.color = color 65 | } 66 | } 67 | } 68 | 69 | function getBooleanValue (value, defaultValue) { 70 | if (Object.is(value, null)) { 71 | return defaultValue 72 | } 73 | if (JSON.stringify(value) !== '{}') { 74 | return value 75 | } else { 76 | return false 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /frontend/src/utils/color.js: -------------------------------------------------------------------------------- 1 | import { message } from 'ant-design-vue/es' 2 | 3 | let lessNodesAppended 4 | 5 | const updateTheme = primaryColor => { 6 | if (!primaryColor) { 7 | return 8 | } 9 | const hideMessage = message.loading('加载主题...', 0) 10 | function buildIt () { 11 | if (!window.less) { 12 | return 13 | } 14 | setTimeout(() => { 15 | window.less 16 | .modifyVars({ 17 | '@primary-color': primaryColor 18 | }) 19 | .then(() => { 20 | hideMessage() 21 | }) 22 | .catch((e) => { 23 | console.log(e) 24 | message.error('Failed to update theme') 25 | hideMessage() 26 | }) 27 | }, 200) 28 | } 29 | if (!lessNodesAppended) { 30 | // insert less.js and color.less 31 | const lessStyleNode = document.createElement('link') 32 | const lessConfigNode = document.createElement('script') 33 | const lessScriptNode = document.createElement('script') 34 | lessStyleNode.setAttribute('rel', 'stylesheet/less') 35 | lessStyleNode.setAttribute('href', '/static/less/Color.less') 36 | lessConfigNode.innerHTML = ` 37 | window.less = { 38 | async: true, 39 | env: 'production', 40 | javascriptEnabled: true 41 | } 42 | ` 43 | lessScriptNode.src = 'https://cdn.bootcss.com/less.js/3.9.0/less.min.js' 44 | lessScriptNode.async = true 45 | lessScriptNode.onload = () => { 46 | buildIt() 47 | lessScriptNode.onload = null 48 | } 49 | document.body.appendChild(lessStyleNode) 50 | document.body.appendChild(lessConfigNode) 51 | document.body.appendChild(lessScriptNode) 52 | lessNodesAppended = true 53 | } else { 54 | buildIt() 55 | } 56 | } 57 | export { updateTheme } 58 | -------------------------------------------------------------------------------- /frontend/src/utils/common.js: -------------------------------------------------------------------------------- 1 | export function triggerWindowResizeEvent () { 2 | let event = document.createEvent('HTMLEvents') 3 | event.initEvent('resize', true, true) 4 | event.eventType = 'message' 5 | window.dispatchEvent(event) 6 | } 7 | -------------------------------------------------------------------------------- /frontend/src/utils/device.js: -------------------------------------------------------------------------------- 1 | import enquireJs from 'enquire.js' 2 | 3 | const enquireScreen = function (call) { 4 | const hanlder = { 5 | match: function () { 6 | call && call(true) 7 | }, 8 | unmatch: function () { 9 | call && call(false) 10 | } 11 | } 12 | enquireJs.register('only screen and (max-width: 767.99px)', hanlder) 13 | } 14 | 15 | export default enquireScreen 16 | -------------------------------------------------------------------------------- /frontend/src/utils/install.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | import {hasPermission, hasNoPermission, hasAnyPermission, hasRole, hasAnyRole} from 'utils/permissionDirect' 4 | 5 | const Plugins = [ 6 | hasPermission, 7 | hasNoPermission, 8 | hasAnyPermission, 9 | hasRole, 10 | hasAnyRole 11 | ] 12 | 13 | Plugins.map((plugin) => { 14 | Vue.use(plugin) 15 | }) 16 | 17 | export default Vue 18 | -------------------------------------------------------------------------------- /frontend/src/utils/localstorage.js: -------------------------------------------------------------------------------- 1 | let db = { 2 | save (key, value) { 3 | localStorage.setItem(key, JSON.stringify(value)) 4 | }, 5 | get (key, defaultValue = {}) { 6 | return JSON.parse(localStorage.getItem(key)) || defaultValue 7 | }, 8 | remove (key) { 9 | localStorage.removeItem(key) 10 | }, 11 | clear () { 12 | localStorage.clear() 13 | } 14 | } 15 | 16 | export default db 17 | -------------------------------------------------------------------------------- /frontend/src/utils/utils.less: -------------------------------------------------------------------------------- 1 | .textOverflow() { 2 | overflow: hidden; 3 | text-overflow: ellipsis; 4 | word-break: break-all; 5 | white-space: nowrap; 6 | } 7 | 8 | .textOverflowMulti(@line: 3, @bg: #fff) { 9 | overflow: hidden; 10 | position: relative; 11 | line-height: 1.5em; 12 | max-height: @line * 1.5em; 13 | text-align: justify; 14 | margin-right: -1em; 15 | padding-right: 1em; 16 | &:before { 17 | background: @bg; 18 | content: '...'; 19 | padding: 0 1px; 20 | position: absolute; 21 | right: 14px; 22 | bottom: 0; 23 | } 24 | &:after { 25 | background: white; 26 | content: ''; 27 | margin-top: 0.2em; 28 | position: absolute; 29 | right: 14px; 30 | width: 1em; 31 | height: 1em; 32 | } 33 | } 34 | 35 | .clearfix() { 36 | zoom: 1; 37 | &:before, 38 | &:after { 39 | content: ' '; 40 | display: table; 41 | } 42 | &:after { 43 | clear: both; 44 | visibility: hidden; 45 | font-size: 0; 46 | height: 0; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /frontend/src/views/common/EmptyPageView.vue: -------------------------------------------------------------------------------- 1 | 4 | 9 | -------------------------------------------------------------------------------- /frontend/src/views/common/GlobalFooter.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 17 | 18 | 37 | -------------------------------------------------------------------------------- /frontend/src/views/common/HeadInfo.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 27 | 28 | 57 | -------------------------------------------------------------------------------- /frontend/src/views/common/PageLayout.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 38 | 39 | 62 | -------------------------------------------------------------------------------- /frontend/src/views/common/PageView.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 38 | 39 | 49 | -------------------------------------------------------------------------------- /frontend/src/views/error/403.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 11 | 12 | 15 | -------------------------------------------------------------------------------- /frontend/src/views/error/404.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 11 | 12 | 15 | -------------------------------------------------------------------------------- /frontend/src/views/error/500.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 11 | 12 | 15 | -------------------------------------------------------------------------------- /frontend/src/views/monitor/RedisTerminal.vue: -------------------------------------------------------------------------------- 1 | 6 | 11 | 14 | -------------------------------------------------------------------------------- /frontend/src/views/system/dept/DeptInputTree.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 36 | -------------------------------------------------------------------------------- /frontend/src/views/system/menu/Icon.less: -------------------------------------------------------------------------------- 1 | @active-color: #4a4a48; 2 | ul { 3 | max-height: 700px; 4 | overflow-y: auto; 5 | padding-left: .5rem; 6 | i { 7 | font-size: 1.5rem; 8 | border: 1px solid #f1f1f1; 9 | padding: .2rem; 10 | margin: .3rem; 11 | cursor: pointer; 12 | &.active, &:hover { 13 | border-radius: 2px; 14 | border-color: @active-color; 15 | background-color: @active-color; 16 | color: #fff; 17 | transition: all .3s; 18 | } 19 | } 20 | li { 21 | list-style: none; 22 | float: left; 23 | width: 5%; 24 | text-align: center; 25 | cursor: pointer; 26 | color: #555; 27 | transition: color .3s ease-in-out,background-color .3s ease-in-out; 28 | position: relative; 29 | margin: 3px 0; 30 | border-radius: 4px; 31 | background-color: #fff; 32 | overflow: hidden; 33 | padding: 10px 0 0; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /frontend/src/views/system/role/RoleInfo.vue: -------------------------------------------------------------------------------- 1 | 27 | 69 | -------------------------------------------------------------------------------- /frontend/src/views/system/user/UserInfo.less: -------------------------------------------------------------------------------- 1 | .user-info { 2 | background: #fff; 3 | padding: 0 10px 10px 10px; 4 | } 5 | .user-info-side { 6 | background: #fff; 7 | } 8 | .user-info-side { 9 | max-width: 10rem !important; 10 | min-width: 10rem !important; 11 | width: 10rem !important; 12 | } 13 | .user-content-one{ 14 | margin-right: 1.2rem; 15 | } 16 | p { 17 | margin-bottom: 1rem; 18 | max-width: 15.5rem; 19 | } 20 | i { 21 | margin-right: .8rem; 22 | } 23 | -------------------------------------------------------------------------------- /frontend/static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/.gitkeep -------------------------------------------------------------------------------- /frontend/static/avatar/17e420c250804efe904a09a33796d5a10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/17e420c250804efe904a09a33796d5a10.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/17e420c250804efe904a09a33796d5a16.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/17e420c250804efe904a09a33796d5a16.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/19034103295190235.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/19034103295190235.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/1d22f3e41d284f50b2c8fc32e0788698.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/1d22f3e41d284f50b2c8fc32e0788698.jpeg -------------------------------------------------------------------------------- /frontend/static/avatar/20180414165754.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/20180414165754.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/20180414165815.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/20180414165815.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/20180414165821.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/20180414165821.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/20180414165827.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/20180414165827.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/20180414165834.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/20180414165834.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/20180414165840.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/20180414165840.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/20180414165846.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/20180414165846.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/20180414165855.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/20180414165855.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/20180414165909.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/20180414165909.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/20180414165914.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/20180414165914.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/20180414165920.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/20180414165920.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/20180414165927.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/20180414165927.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/20180414165936.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/20180414165936.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/20180414165942.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/20180414165942.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/20180414165947.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/20180414165947.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/20180414165955.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/20180414165955.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/20180414170003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/20180414170003.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/2dd7a2d09fa94bf8b5c52e5318868b4d9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/2dd7a2d09fa94bf8b5c52e5318868b4d9.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/2dd7a2d09fa94bf8b5c52e5318868b4df.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/2dd7a2d09fa94bf8b5c52e5318868b4df.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/496b3ace787342f7954b7045b8b06804.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/496b3ace787342f7954b7045b8b06804.jpeg -------------------------------------------------------------------------------- /frontend/static/avatar/595ba7b05f2e485eb50565a50cb6cc3c.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/595ba7b05f2e485eb50565a50cb6cc3c.jpeg -------------------------------------------------------------------------------- /frontend/static/avatar/5997fedcc7bd4cffbd350b40d1b5b9824.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/5997fedcc7bd4cffbd350b40d1b5b9824.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/5997fedcc7bd4cffbd350b40d1b5b987.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/5997fedcc7bd4cffbd350b40d1b5b987.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/87d8194bc9834e9f8f0228e9e530beb1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/87d8194bc9834e9f8f0228e9e530beb1.jpeg -------------------------------------------------------------------------------- /frontend/static/avatar/8f5b60ef00714a399ee544d331231820.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/8f5b60ef00714a399ee544d331231820.jpeg -------------------------------------------------------------------------------- /frontend/static/avatar/964e40b005724165b8cf772355796c8c.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/964e40b005724165b8cf772355796c8c.jpeg -------------------------------------------------------------------------------- /frontend/static/avatar/BiazfanxmamNRoxxVxka.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/BiazfanxmamNRoxxVxka.png -------------------------------------------------------------------------------- /frontend/static/avatar/WhxKECPNujWoWEFNdnJE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/WhxKECPNujWoWEFNdnJE.png -------------------------------------------------------------------------------- /frontend/static/avatar/a3b10296862e40edb811418d64455d00.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/a3b10296862e40edb811418d64455d00.jpeg -------------------------------------------------------------------------------- /frontend/static/avatar/a43456282d684e0b9319cf332f8ac468.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/a43456282d684e0b9319cf332f8ac468.jpeg -------------------------------------------------------------------------------- /frontend/static/avatar/bba284ac05b041a8b8b0d1927868d5c9x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/bba284ac05b041a8b8b0d1927868d5c9x.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/c7c4ee7be3eb4e73a19887dc713505145.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/c7c4ee7be3eb4e73a19887dc713505145.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/cnrhVkzwxjPwAaCfPbdc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/cnrhVkzwxjPwAaCfPbdc.png -------------------------------------------------------------------------------- /frontend/static/avatar/default.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/default.jpg -------------------------------------------------------------------------------- /frontend/static/avatar/ff698bb2d25c4d218b3256b46c706ece.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/ff698bb2d25c4d218b3256b46c706ece.jpeg -------------------------------------------------------------------------------- /frontend/static/avatar/gaOngJwsRYRaVAuXXcmB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/gaOngJwsRYRaVAuXXcmB.png -------------------------------------------------------------------------------- /frontend/static/avatar/jZUIxmJycoymBprLOUbT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/jZUIxmJycoymBprLOUbT.png -------------------------------------------------------------------------------- /frontend/static/avatar/ubnKSIfAJTxIgXOKlciN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/avatar/ubnKSIfAJTxIgXOKlciN.png -------------------------------------------------------------------------------- /frontend/static/img/1work-4997565_1280.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/img/1work-4997565_1280.png -------------------------------------------------------------------------------- /frontend/static/img/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/img/delete.png -------------------------------------------------------------------------------- /frontend/static/img/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/img/download.png -------------------------------------------------------------------------------- /frontend/static/img/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/img/error.png -------------------------------------------------------------------------------- /frontend/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/img/favicon.ico -------------------------------------------------------------------------------- /frontend/static/img/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/img/home.png -------------------------------------------------------------------------------- /frontend/static/img/loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/img/loading.png -------------------------------------------------------------------------------- /frontend/static/img/logo-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/img/logo-blue.png -------------------------------------------------------------------------------- /frontend/static/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/img/logo.png -------------------------------------------------------------------------------- /frontend/static/img/record.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/img/record.png -------------------------------------------------------------------------------- /frontend/static/img/template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/img/template.png -------------------------------------------------------------------------------- /frontend/static/img/total.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/img/total.png -------------------------------------------------------------------------------- /frontend/static/img/work-4997565_1280.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fankekeke/smart_home_cos/155d33955e53b36af3b49fde9f7adb07b3dddcae/frontend/static/img/work-4997565_1280.png -------------------------------------------------------------------------------- /frontend/static/less/Common.less: -------------------------------------------------------------------------------- 1 | .search{ 2 | margin-bottom: 54px; 3 | } 4 | .fold{ 5 | width: calc(100% - 216px); 6 | display: inline-block 7 | } 8 | .operator{ 9 | margin-bottom: 18px; 10 | } 11 | @media screen and (max-width: 900px) { 12 | .fold { 13 | width: 100%; 14 | } 15 | } 16 | .operator button { 17 | margin-right: 5px; 18 | } 19 | i { 20 | cursor: pointer; 21 | } 22 | --------------------------------------------------------------------------------