├── web └── src │ └── main │ ├── resources │ ├── logo │ │ └── logo.png │ ├── static │ │ ├── logo │ │ │ └── logo.png │ │ └── login.html │ ├── application-dev.yml │ ├── authentication.properties │ └── banner.txt │ └── java │ └── com │ └── lvyx │ ├── config │ ├── MybatisConfiguration.java │ └── CORSConfiguration.java │ ├── controller │ ├── ResultErrorController.java │ └── ExceptionController.java │ ├── factory │ └── MyExceptionFactory.java │ └── CommunitySystemApplication.java ├── README.assets ├── image-20220520092400574.png ├── image-20220520092443256.png ├── image-20220520092500386.png ├── image-20220520095827473.png ├── image-20220520095847313.png ├── image-20220520095911506.png ├── image-20220520100032968.png ├── image-20220520100050022.png └── image-20220520100110473.png ├── commons ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── lvyx │ │ │ │ └── commons │ │ │ │ ├── utils │ │ │ │ ├── LQrCodeUtils.java │ │ │ │ ├── ApplicationContextUtils.java │ │ │ │ ├── CaptchaUtils.java │ │ │ │ ├── LSerializeUtils.java │ │ │ │ ├── ShiroUtils.java │ │ │ │ └── BaseEntityUtil.java │ │ │ │ ├── annotation │ │ │ │ ├── service │ │ │ │ │ ├── LogService.java │ │ │ │ │ └── impl │ │ │ │ │ │ └── LogServiceImpl.java │ │ │ │ ├── mapper │ │ │ │ │ └── LogMapper.java │ │ │ │ ├── logger │ │ │ │ │ └── LLogger.java │ │ │ │ └── entity │ │ │ │ │ └── Log.java │ │ │ │ ├── pojo │ │ │ │ ├── RoleVo.java │ │ │ │ ├── QrCodeInfo.java │ │ │ │ └── ShiroUser.java │ │ │ │ ├── encrypt_decrypt │ │ │ │ ├── LEncryptDecrypt.java │ │ │ │ └── factory │ │ │ │ │ ├── service │ │ │ │ │ ├── LEncryptDecryptService.java │ │ │ │ │ └── impl │ │ │ │ │ │ ├── RSAEncryptDecryptServiceImpl.java │ │ │ │ │ │ └── AESEncryptDecryptServiceImpl.java │ │ │ │ │ └── LEncryptDecryptFactory.java │ │ │ │ ├── config │ │ │ │ ├── CommunityProperties.java │ │ │ │ ├── SysRedisProperties.java │ │ │ │ ├── SystemProperties.java │ │ │ │ └── SysRedisConfig.java │ │ │ │ ├── exception │ │ │ │ ├── LException.java │ │ │ │ ├── LMailException.java │ │ │ │ └── LExceException.java │ │ │ │ ├── enums │ │ │ │ ├── CaptchaNameEnum.java │ │ │ │ ├── ResourceTypeEnum.java │ │ │ │ ├── ShiroTokenEnum.java │ │ │ │ ├── ResultEnum.java │ │ │ │ ├── SexTypeEnum.java │ │ │ │ ├── BooleanTypeEnum.java │ │ │ │ ├── ExamineStatusEnum.java │ │ │ │ ├── ExceptionTypeEnum.java │ │ │ │ ├── QrCodeColorEnum.java │ │ │ │ ├── AddressStatusEnum.java │ │ │ │ ├── SystemCacheEnum.java │ │ │ │ ├── ShiroResultEnum.java │ │ │ │ ├── UserTypeEnum.java │ │ │ │ ├── ResultCodeEnum.java │ │ │ │ ├── ShiroEnum.java │ │ │ │ ├── RoleTypeEnum.java │ │ │ │ └── ShiroCacheEnum.java │ │ │ │ ├── QrCodeFactory │ │ │ │ ├── QrCodeBase.java │ │ │ │ ├── GreenQrCode.java │ │ │ │ ├── GrayQrCode.java │ │ │ │ ├── RedQrCode.java │ │ │ │ ├── QrCodeFactory.java │ │ │ │ └── YellowQrCode.java │ │ │ │ ├── result │ │ │ │ ├── impl │ │ │ │ │ ├── ErrorResult.java │ │ │ │ │ └── SuccessResult.java │ │ │ │ └── Result.java │ │ │ │ └── CommonsUrls.java │ │ └── resources │ │ │ └── mapper │ │ │ └── annotation │ │ │ └── LogMapper.xml │ └── test │ │ └── java │ │ └── com │ │ └── lvyx │ │ └── commons │ │ └── AESTest.java └── pom.xml ├── community ├── src │ └── main │ │ ├── resources │ │ └── mapper │ │ │ ├── CommunityLayerMapper.xml │ │ │ ├── CommunityInAndOutMapper.xml │ │ │ ├── CommunityBuildingMapper.xml │ │ │ ├── CommunityTemperatureRegistrationMapper.xml │ │ │ ├── CommunityHouseholdMapper.xml │ │ │ ├── CommunityGreyCodeMapper.xml │ │ │ ├── CommunityRedCodeMapper.xml │ │ │ ├── CommunityGreenCodeMapper.xml │ │ │ ├── CommunityYellowCodeMapper.xml │ │ │ └── CommunityExceptionMapper.xml │ │ └── java │ │ └── com │ │ └── lvyx │ │ └── community │ │ ├── mapper │ │ ├── CommunityLayerMapper.java │ │ ├── CommunityInAndOutMapper.java │ │ ├── CommunityBuildingMapper.java │ │ ├── CommunityTemperatureRegistrationMapper.java │ │ ├── CommunityRedCodeMapper.java │ │ ├── CommunityGreyCodeMapper.java │ │ ├── CommunityYellowCodeMapper.java │ │ ├── CommunityGreenCodeMapper.java │ │ ├── CommunityHouseholdMapper.java │ │ ├── CommunityExceptionMapper.java │ │ ├── CommunityUnitMapper.java │ │ ├── CommunityHouseholdUserMapper.java │ │ └── CommunityPeriodMapper.java │ │ ├── controller │ │ ├── CommunityGreyCodeController.java │ │ ├── CommunityRedCodeController.java │ │ ├── CommunityGreenCodeController.java │ │ ├── CommunityYellowCodeController.java │ │ └── CommunityInAndOutController.java │ │ ├── vo │ │ ├── HouseholdUserVo.java │ │ ├── UserHouseholdVo.java │ │ ├── PeriodVo.java │ │ ├── ComprehensiveVo.java │ │ ├── CascadeVo.java │ │ ├── UnitVo.java │ │ ├── BuildingVo.java │ │ ├── LayerVo.java │ │ ├── HouseholdVo.java │ │ ├── PeriodInfoVo.java │ │ ├── InfoVo.java │ │ ├── AddressVo.java │ │ └── ExceptionVo.java │ │ ├── bo │ │ ├── QueryExceptionBo.java │ │ └── QueryUserHouseholdBo.java │ │ ├── service │ │ ├── CommunityInAndOutService.java │ │ ├── CommunityLayerService.java │ │ ├── CommunityHouseholdService.java │ │ ├── CommunityGreyCodeService.java │ │ ├── CommunityRedCodeService.java │ │ ├── CommunityYellowCodeService.java │ │ ├── CommunityUnitService.java │ │ ├── CommunityExceptionService.java │ │ ├── CommunityBuildingService.java │ │ ├── CommunityTemperatureRegistrationService.java │ │ └── impl │ │ │ └── CommunityLayerServiceImpl.java │ │ └── entity │ │ ├── CommunityPeriod.java │ │ ├── CommunityLayer.java │ │ ├── CommunityUnit.java │ │ ├── CommunityBuilding.java │ │ └── CommunityHousehold.java └── pom.xml ├── author ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ └── lvyx │ │ │ └── author │ │ │ ├── controller │ │ │ ├── ResourceController.java │ │ │ ├── UserRoleController.java │ │ │ └── RoleResourceController.java │ │ │ ├── shiro │ │ │ ├── config │ │ │ │ ├── ShiroProperties.java │ │ │ │ ├── JWTProperties.java │ │ │ │ └── ShiroRedisProperties.java │ │ │ ├── utils │ │ │ │ ├── ShiroUserUtils.java │ │ │ │ └── PropertiesUtil.java │ │ │ ├── pojo │ │ │ │ └── SimpleToken.java │ │ │ ├── core │ │ │ │ ├── ShiroDbRealm.java │ │ │ │ └── impl │ │ │ │ │ └── ShiroSessionManager.java │ │ │ ├── cache │ │ │ │ └── service │ │ │ │ │ └── SimpleMapCacheService.java │ │ │ ├── filter │ │ │ │ ├── JwtRolesFilter.java │ │ │ │ └── JwtPermsFilter.java │ │ │ └── bridge │ │ │ │ └── UserBridgeService.java │ │ │ ├── vo │ │ │ ├── CommunityResourceVo.java │ │ │ ├── LoginInfoVO.java │ │ │ └── CommunityRoleVo.java │ │ │ ├── mapper │ │ │ ├── UserRoleMapper.java │ │ │ ├── UserMapper.java │ │ │ ├── ResourceMapper.java │ │ │ ├── RoleResourceMapper.java │ │ │ └── RoleMapper.java │ │ │ ├── bo │ │ │ ├── AddRoleBo.java │ │ │ ├── QueryUserListBo.java │ │ │ ├── LoginBO.java │ │ │ ├── QueryUserBo.java │ │ │ └── RegisterBO.java │ │ │ ├── service │ │ │ ├── RoleResourceService.java │ │ │ ├── ResourceService.java │ │ │ └── UserRoleService.java │ │ │ └── entity │ │ │ ├── UserRole.java │ │ │ ├── RoleResource.java │ │ │ └── Role.java │ │ └── resources │ │ └── mapper │ │ ├── UserRoleMapper.xml │ │ ├── ResourceMapper.xml │ │ └── RoleResourceMapper.xml └── pom.xml └── mail ├── src └── main │ ├── java │ └── com │ │ └── lvyx │ │ └── mail │ │ ├── controller │ │ └── CommunityMessageEmailController.java │ │ ├── vo │ │ ├── UserMessageVo.java │ │ └── MessageVo.java │ │ ├── mapper │ │ ├── CommunityMessageMapper.java │ │ └── CommunityMessageEmailMapper.java │ │ ├── MailUrls.java │ │ ├── service │ │ ├── CommunityMessageEmailService.java │ │ ├── CommunityMessageService.java │ │ └── impl │ │ │ └── CommunityMessageEmailServiceImpl.java │ │ ├── bo │ │ └── BaseSenderMessageBo.java │ │ └── entity │ │ └── CommunityMessage.java │ └── resources │ └── mapper │ ├── CommunityMessageEmailMapper.xml │ └── CommunityMessageMapper.xml └── pom.xml /web/src/main/resources/logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvyuanx/CommunitySystem/HEAD/web/src/main/resources/logo/logo.png -------------------------------------------------------------------------------- /README.assets/image-20220520092400574.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvyuanx/CommunitySystem/HEAD/README.assets/image-20220520092400574.png -------------------------------------------------------------------------------- /README.assets/image-20220520092443256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvyuanx/CommunitySystem/HEAD/README.assets/image-20220520092443256.png -------------------------------------------------------------------------------- /README.assets/image-20220520092500386.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvyuanx/CommunitySystem/HEAD/README.assets/image-20220520092500386.png -------------------------------------------------------------------------------- /README.assets/image-20220520095827473.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvyuanx/CommunitySystem/HEAD/README.assets/image-20220520095827473.png -------------------------------------------------------------------------------- /README.assets/image-20220520095847313.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvyuanx/CommunitySystem/HEAD/README.assets/image-20220520095847313.png -------------------------------------------------------------------------------- /README.assets/image-20220520095911506.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvyuanx/CommunitySystem/HEAD/README.assets/image-20220520095911506.png -------------------------------------------------------------------------------- /README.assets/image-20220520100032968.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvyuanx/CommunitySystem/HEAD/README.assets/image-20220520100032968.png -------------------------------------------------------------------------------- /README.assets/image-20220520100050022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvyuanx/CommunitySystem/HEAD/README.assets/image-20220520100050022.png -------------------------------------------------------------------------------- /README.assets/image-20220520100110473.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvyuanx/CommunitySystem/HEAD/README.assets/image-20220520100110473.png -------------------------------------------------------------------------------- /web/src/main/resources/static/logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvyuanx/CommunitySystem/HEAD/web/src/main/resources/static/logo/logo.png -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/utils/LQrCodeUtils.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.utils; 2 | 3 | /** 4 | *

5 | * 二维码生成工具类 6 | *

7 | * 8 | * @author lvyx 9 | * @since 2022-04-05 21:27:46 10 | */ 11 | public class LQrCodeUtils { 12 | 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /commons/src/main/resources/mapper/annotation/LogMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /community/src/main/resources/mapper/CommunityLayerMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /community/src/main/resources/mapper/CommunityInAndOutMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /community/src/main/resources/mapper/CommunityBuildingMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /community/src/main/resources/mapper/CommunityTemperatureRegistrationMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /web/src/main/java/com/lvyx/config/MybatisConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | 5 | /** 6 | *

7 | * mybatis配置 8 | *

9 | * 10 | * @author lvyx 11 | * @since 2022-02-07 13:57:13 12 | */ 13 | @Configuration 14 | public class MybatisConfiguration { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/annotation/service/LogService.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.annotation.service; 2 | 3 | import com.lvyx.commons.annotation.entity.Log; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | /** 7 | *

8 | * 日志表 服务类 9 | *

10 | * 11 | * @author lvyx 12 | * @since 2021-12-23 13 | */ 14 | public interface LogService extends IService { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /web/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | lvyx: 2 | system: 3 | active: "test" 4 | file-path: "D:/CommunitySystem" 5 | spring: 6 | datasource: 7 | url: jdbc:mysql://localhost:3306/l_community?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8 8 | username: root 9 | password: root 10 | driver-class-name: com.mysql.cj.jdbc.Driver 11 | type: com.alibaba.druid.pool.DruidDataSource -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/controller/ResourceController.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.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 | *

12 | * 13 | * @author lvyx 14 | * @since 2021-12-23 15 | */ 16 | @RestController 17 | @RequestMapping("/resource") 18 | public class ResourceController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/controller/UserRoleController.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.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 | *

12 | * 13 | * @author lvyx 14 | * @since 2021-12-23 15 | */ 16 | @RestController 17 | @RequestMapping("/user-role") 18 | public class UserRoleController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/annotation/mapper/LogMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.annotation.mapper; 2 | 3 | import com.lvyx.commons.annotation.entity.Log; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | *

9 | * 日志表 Mapper 接口 10 | *

11 | * 12 | * @author lvyx 13 | * @since 2021-12-23 14 | */ 15 | @Mapper 16 | public interface LogMapper extends BaseMapper { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/controller/RoleResourceController.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.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 | *

12 | * 13 | * @author lvyx 14 | * @since 2021-12-23 15 | */ 16 | @RestController 17 | @RequestMapping("/role-resource") 18 | public class RoleResourceController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/mapper/CommunityLayerMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.mapper; 2 | 3 | import com.lvyx.community.entity.CommunityLayer; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | *

9 | * 小区-层 Mapper 接口 10 | *

11 | * 12 | * @author lvyx 13 | * @since 2022-02-01 14 | */ 15 | @Mapper 16 | public interface CommunityLayerMapper extends BaseMapper { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/controller/CommunityGreyCodeController.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.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 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-02-13 15 | */ 16 | @RestController 17 | @RequestMapping("/community-grey-code") 18 | public class CommunityGreyCodeController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/controller/CommunityRedCodeController.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.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 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-02-13 15 | */ 16 | @RestController 17 | @RequestMapping("/community-red-code") 18 | public class CommunityRedCodeController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/mapper/CommunityInAndOutMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.mapper; 2 | 3 | import com.lvyx.community.entity.CommunityInAndOut; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | *

9 | * 小区-进出登记表 Mapper 接口 10 | *

11 | * 12 | * @author lvyx 13 | * @since 2022-02-13 14 | */ 15 | @Mapper 16 | public interface CommunityInAndOutMapper extends BaseMapper { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /mail/src/main/java/com/lvyx/mail/controller/CommunityMessageEmailController.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.mail.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 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-05-01 15 | */ 16 | @RestController 17 | @RequestMapping("/community-message-email") 18 | public class CommunityMessageEmailController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/controller/CommunityGreenCodeController.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.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 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-02-13 15 | */ 16 | @RestController 17 | @RequestMapping("/community-green-code") 18 | public class CommunityGreenCodeController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/controller/CommunityYellowCodeController.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.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 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-03-20 15 | */ 16 | @RestController 17 | @RequestMapping("/community-yellow-code") 18 | public class CommunityYellowCodeController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/mapper/CommunityBuildingMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lvyx.community.entity.CommunityBuilding; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | *

9 | * 小区-栋 Mapper 接口 10 | *

11 | * 12 | * @author lvyx 13 | * @since 2022-02-01 14 | */ 15 | @Mapper 16 | public interface CommunityBuildingMapper extends BaseMapper { 17 | 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/mapper/CommunityTemperatureRegistrationMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.mapper; 2 | 3 | import com.lvyx.community.entity.CommunityTemperatureRegistration; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | *

9 | * 小区-体温登记表 Mapper 接口 10 | *

11 | * 12 | * @author lvyx 13 | * @since 2022-02-13 14 | */ 15 | @Mapper 16 | public interface CommunityTemperatureRegistrationMapper extends BaseMapper { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/mapper/CommunityRedCodeMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.mapper; 2 | 3 | import com.lvyx.community.entity.CommunityRedCode; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | /** 9 | *

10 | * 红码用户关联表 Mapper 接口 11 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-02-13 15 | */ 16 | @Mapper 17 | public interface CommunityRedCodeMapper extends BaseMapper { 18 | int selectCountByUintId(@Param("unitId") String unitId); 19 | } 20 | -------------------------------------------------------------------------------- /mail/src/main/java/com/lvyx/mail/vo/UserMessageVo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.mail.vo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | *

10 | * 用户邮件信息vo 11 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-05-01 15:26:45 15 | */ 16 | @Data 17 | public class UserMessageVo implements Serializable { 18 | 19 | @ApiModelProperty("用户id") 20 | private String userId; 21 | 22 | @ApiModelProperty("用户邮件地址") 23 | private String email; 24 | 25 | @ApiModelProperty("用户真实姓名") 26 | private String realName; 27 | } 28 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/mapper/CommunityGreyCodeMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.mapper; 2 | 3 | import com.lvyx.community.entity.CommunityGreyCode; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | /** 9 | *

10 | * 灰码用户关联表 Mapper 接口 11 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-02-13 15 | */ 16 | @Mapper 17 | public interface CommunityGreyCodeMapper extends BaseMapper { 18 | int selectCountByUintId(@Param("unitId") String unitId); 19 | } 20 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/mapper/CommunityYellowCodeMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.mapper; 2 | 3 | import com.lvyx.community.entity.CommunityYellowCode; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | /** 9 | *

10 | * 黄码用户关联表 Mapper 接口 11 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-03-20 15 | */ 16 | @Mapper 17 | public interface CommunityYellowCodeMapper extends BaseMapper { 18 | int selectCountByUintId(@Param("unitId") String unitId); 19 | } 20 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/shiro/config/ShiroProperties.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.shiro.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | *

9 | * shiro配置类 10 | *

11 | * 12 | * @author lvyx 13 | * @since 2022-01-13 14:22:54 14 | */ 15 | @Data 16 | @Component 17 | @ConfigurationProperties(prefix = "lvyx.shiro") 18 | public class ShiroProperties { 19 | 20 | /** 21 | * 在线人数 22 | * @since 2022/1/13 14:24 23 | **/ 24 | private Integer online = 1; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/vo/CommunityResourceVo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.vo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | *

10 | * 社区资源vo 11 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-05-05 00:49:41 15 | */ 16 | @Data 17 | public class CommunityResourceVo implements Serializable { 18 | 19 | @ApiModelProperty("资源id") 20 | private String resourceId; 21 | 22 | @ApiModelProperty("社区期id") 23 | private String parentId; 24 | 25 | @ApiModelProperty("社区期名称") 26 | private String periodName; 27 | } 28 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/mapper/CommunityGreenCodeMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.mapper; 2 | 3 | import com.lvyx.community.entity.CommunityGreenCode; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | /** 9 | *

10 | * 绿码用户关联表 Mapper 接口 11 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-02-13 15 | */ 16 | @Mapper 17 | public interface CommunityGreenCodeMapper extends BaseMapper { 18 | 19 | int selectCountByUintId(@Param("unitId") String unitId); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/mapper/CommunityHouseholdMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.mapper; 2 | 3 | import com.lvyx.community.entity.CommunityHousehold; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | /** 9 | *

10 | * 小区-户 Mapper 接口 11 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-02-01 15 | */ 16 | @Mapper 17 | public interface CommunityHouseholdMapper extends BaseMapper { 18 | 19 | String findPeriodIByHouseholdId(@Param("householdId") String householdId); 20 | } 21 | -------------------------------------------------------------------------------- /mail/src/main/resources/mapper/CommunityMessageEmailMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | 14 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/mapper/UserRoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.mapper; 2 | 3 | import com.lvyx.author.entity.UserRole; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | *

12 | * 用户角色关联表 Mapper 接口 13 | *

14 | * 15 | * @author lvyx 16 | * @since 2021-12-23 17 | */ 18 | @Mapper 19 | public interface UserRoleMapper extends BaseMapper { 20 | 21 | List findUserRole(@Param("userId") String userId, @Param("label") String label); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/annotation/service/impl/LogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.annotation.service.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.lvyx.commons.annotation.entity.Log; 5 | import com.lvyx.commons.annotation.mapper.LogMapper; 6 | import com.lvyx.commons.annotation.service.LogService; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | *

11 | * 日志表 服务实现类 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2021-12-23 16 | */ 17 | @Service 18 | public class LogServiceImpl extends ServiceImpl implements LogService { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /web/src/main/java/com/lvyx/controller/ResultErrorController.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.controller; 2 | 3 | import com.lvyx.commons.result.Result; 4 | import org.apache.shiro.authz.AuthorizationException; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | *

10 | * 返回异常控制器 11 | *

12 | * 13 | * @author lvyx 14 | * @since 2021-12-28 16:16:08 15 | */ 16 | @RestController 17 | public class ResultErrorController { 18 | 19 | @RequestMapping("/shiroError") 20 | public void error(){ 21 | throw new AuthorizationException(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /web/src/main/resources/static/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 登录 6 | 7 | 8 |
9 |
10 |

14 |

18 | 19 |
20 |
21 | 22 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/bo/AddRoleBo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.bo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | *

10 | * 添加管理角色Bo 11 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-05-04 23:29:33 15 | */ 16 | @Data 17 | public class AddRoleBo { 18 | 19 | @ApiModelProperty("角色id") 20 | private String roleId; 21 | 22 | @ApiModelProperty("角色名称") 23 | private String roleName; 24 | 25 | @ApiModelProperty("角色描述") 26 | private String description; 27 | 28 | @ApiModelProperty("期id") 29 | private List periodIds; 30 | } 31 | -------------------------------------------------------------------------------- /author/src/main/resources/mapper/UserRoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/pojo/RoleVo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.pojo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | *

10 | * 角色vo 11 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-02-06 16:09:04 15 | */ 16 | @Data 17 | public class RoleVo implements Serializable { 18 | 19 | @ApiModelProperty("主键") 20 | private String id; 21 | 22 | @ApiModelProperty("角色名称") 23 | private String roleName; 24 | 25 | @ApiModelProperty("角色标识") 26 | private String label; 27 | 28 | @ApiModelProperty("角色描述") 29 | private String description; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/vo/HouseholdUserVo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.vo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | *

10 | * 居民VO 11 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-02-06 16:09:04 15 | */ 16 | @Data 17 | public class HouseholdUserVo implements Serializable { 18 | 19 | @ApiModelProperty("主键") 20 | private String id; 21 | 22 | @ApiModelProperty("户Id") 23 | private String householdId; 24 | 25 | @ApiModelProperty("用户") 26 | private String userId; 27 | 28 | @ApiModelProperty("排序") 29 | private Integer sortNo; 30 | } 31 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/vo/UserHouseholdVo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.vo; 2 | 3 | import com.lvyx.commons.pojo.ShiroUser; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | 8 | import java.io.Serializable; 9 | 10 | /** 11 | *

12 | * 用户房间信息 13 | *

14 | * 15 | * @author lvyx 16 | * @since 2022-04-25 21:38:17 17 | */ 18 | @EqualsAndHashCode(callSuper = true) 19 | @Data 20 | public class UserHouseholdVo extends AddressVo implements Serializable { 21 | 22 | @ApiModelProperty("用户信息") 23 | private ShiroUser user; 24 | 25 | @ApiModelProperty("人员类型") 26 | private String roleTypeName; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/vo/PeriodVo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.vo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 期VO 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2022-02-06 16:09:04 16 | */ 17 | @Data 18 | public class PeriodVo implements Serializable { 19 | 20 | @ApiModelProperty("主键") 21 | private String id; 22 | 23 | @ApiModelProperty("第几期") 24 | private String periodNumber; 25 | 26 | @ApiModelProperty("排序") 27 | private Integer sortNo; 28 | 29 | @ApiModelProperty("栋") 30 | private List buildingVoList; 31 | } 32 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/vo/LoginInfoVO.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.vo; 2 | 3 | 4 | import com.lvyx.commons.pojo.ShiroUser; 5 | import io.swagger.annotations.ApiModel; 6 | import io.swagger.annotations.ApiModelProperty; 7 | import lombok.Data; 8 | 9 | import java.io.Serializable; 10 | 11 | /** 12 | *

13 | * 登录信息返回结果封装 14 | *

15 | * 16 | * @author lvyx 17 | * @since 2022-01-15 17:40:07 18 | */ 19 | @ApiModel(value="LogInfoVO对象", description="登录用户数据") 20 | @Data 21 | public class LoginInfoVO implements Serializable { 22 | 23 | 24 | @ApiModelProperty("登录token的id") 25 | private String token; 26 | 27 | 28 | @ApiModelProperty("登录的用户信息") 29 | private ShiroUser shiroUser; 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lvyx.author.bo.QueryUserListBo; 5 | import com.lvyx.author.entity.User; 6 | import com.lvyx.community.vo.UserHouseholdVo; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Param; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | *

14 | * 用户表 Mapper 接口 15 | *

16 | * 17 | * @author lvyx 18 | * @since 2021-12-23 19 | */ 20 | @Mapper 21 | public interface UserMapper extends BaseMapper { 22 | 23 | List listByUser(@Param("user") User user); 24 | 25 | List findUserList(QueryUserListBo user); 26 | } 27 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/encrypt_decrypt/LEncryptDecrypt.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.encrypt_decrypt; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * 自动加密解密注解 7 | * @author lvyx 8 | * @since 2021/12/9 19:10 9 | **/ 10 | @Documented 11 | @Inherited 12 | @Target({ ElementType.TYPE,ElementType.FIELD }) 13 | @Retention(RetentionPolicy.RUNTIME) 14 | public @interface LEncryptDecrypt { 15 | 16 | /** 17 | * 加密 18 | * @return boolean 19 | * @author lvyx 20 | * @since 2021/12/9 19:52 21 | **/ 22 | boolean encrypt() default true; 23 | 24 | /** 25 | * 解密 26 | * @return boolean 27 | * @author lvyx 28 | * @since 2021/12/9 19:53 29 | **/ 30 | boolean dencrypt() default true; 31 | } -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/config/CommunityProperties.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | *

9 | * 社区配置类 10 | *

11 | * 12 | * @author lvyx 13 | * @since 2022-04-28 14:23:05 14 | */ 15 | @Component 16 | @ConfigurationProperties( 17 | prefix = "lvyx.community" 18 | ) 19 | @Data 20 | public class CommunityProperties { 21 | 22 | /** 23 | * 异常体温 24 | */ 25 | private String abnormalBodyTemperature = "37.5"; 26 | 27 | /** 28 | * 连续健康天数节点(超过此节点,则认为是健康) 29 | */ 30 | private Integer consecutiveDays = 7; 31 | 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/vo/ComprehensiveVo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.vo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 综合信息VO 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2022-02-06 16:09:04 16 | */ 17 | @Data 18 | public class ComprehensiveVo implements Serializable { 19 | 20 | 21 | @ApiModelProperty("栋id") 22 | private String buildingId; 23 | 24 | @ApiModelProperty("栋名称") 25 | private String buildingNumber; 26 | 27 | @ApiModelProperty("栋名称") 28 | private Integer sortNo; 29 | 30 | @ApiModelProperty("户信息") 31 | private List unitVoList; 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/vo/CascadeVo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.vo; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 级联选择结构 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2022-02-08 06:00:13 16 | */ 17 | @Data 18 | @ApiModel(value = "CascadeVo对象", description = "级联选择对象") 19 | public class CascadeVo { 20 | 21 | @ApiModelProperty("显示内容") 22 | private String text; 23 | 24 | @ApiModelProperty("内容ID") 25 | private String value; 26 | 27 | @ApiModelProperty("排序") 28 | private String sortNo; 29 | 30 | @ApiModelProperty("下级结构") 31 | private List children; 32 | } 33 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/encrypt_decrypt/factory/service/LEncryptDecryptService.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.encrypt_decrypt.factory.service; 2 | 3 | /** 4 | *

5 | * RSA加密解密服务 6 | *

7 | * 8 | * @author lvyx 9 | * @since 2021-12-10 13:20:32 10 | */ 11 | public interface LEncryptDecryptService { 12 | 13 | /** 14 | * 加密 15 | * @param content 被加密字符串 16 | * @return java.lang.String 加密后字符串 17 | * @author lvyx 18 | * @since 2021/12/10 13:24 19 | **/ 20 | String encrypt(String content); 21 | 22 | /** 23 | * 解密 24 | * @param content 加密的字符串 25 | * @return java.lang.String 原字符串 26 | * @author lvyx 27 | * @since 2021/12/10 13:25 28 | **/ 29 | String decrypt(String content); 30 | } 31 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/vo/UnitVo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.vo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 单元VO 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2022-02-06 16:09:04 16 | */ 17 | @Data 18 | public class UnitVo implements Serializable { 19 | 20 | @ApiModelProperty("主键") 21 | private String id; 22 | 23 | @ApiModelProperty("栋Id") 24 | private String buildingId; 25 | 26 | @ApiModelProperty("单元") 27 | private String unitNumber; 28 | 29 | @ApiModelProperty("排序") 30 | private Integer sortNo; 31 | 32 | @ApiModelProperty("层") 33 | private List layerVoList; 34 | } 35 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/bo/QueryExceptionBo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.bo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 查询异常请求参数封装 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2022-05-02 15:03:50 16 | */ 17 | @Data 18 | public class QueryExceptionBo implements Serializable { 19 | 20 | @ApiModelProperty("用户名称") 21 | private String userName; 22 | 23 | @ApiModelProperty("异常状态(0:未开始,1:处理中,2:已结束)") 24 | private Integer status; 25 | 26 | @ApiModelProperty("异常类型(0:体温异常,1:其他异常)") 27 | private Integer exceptionType; 28 | 29 | @ApiModelProperty("期主键") 30 | private List periodIds; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /mail/src/main/java/com/lvyx/mail/mapper/CommunityMessageMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.mail.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lvyx.mail.entity.CommunityMessage; 5 | import com.lvyx.mail.vo.MessageVo; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | *

13 | * 社区消息 Mapper 接口 14 | *

15 | * 16 | * @author lvyx 17 | * @since 2022-04-30 18 | */ 19 | @Mapper 20 | public interface CommunityMessageMapper extends BaseMapper { 21 | 22 | List findListMessageVo(@Param("userId") String userId, @Param("isEmail") Integer isEmail, @Param("isEnable") Integer isEnable, @Param("title") String title); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/vo/BuildingVo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.vo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 栋VO 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2022-02-06 16:09:04 16 | */ 17 | @Data 18 | public class BuildingVo implements Serializable { 19 | 20 | @ApiModelProperty("主键") 21 | private String id; 22 | 23 | @ApiModelProperty("期Id") 24 | private String periodId; 25 | 26 | @ApiModelProperty("第几栋") 27 | private String buildingNumber; 28 | 29 | @ApiModelProperty("排序") 30 | private Integer sortNo; 31 | 32 | @ApiModelProperty("单元") 33 | private List unitVoList; 34 | } 35 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/vo/LayerVo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.vo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 层VO 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2022-02-06 16:09:04 16 | */ 17 | @Data 18 | public class LayerVo implements Serializable { 19 | 20 | @ApiModelProperty("主键") 21 | private String id; 22 | 23 | @ApiModelProperty("单元Id") 24 | private String unitId; 25 | 26 | @ApiModelProperty("层") 27 | private String layerNumber; 28 | 29 | @ApiModelProperty("排序") 30 | private Integer sortNo; 31 | 32 | @ApiModelProperty("户") 33 | private List householdVoList; 34 | } 35 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/service/CommunityInAndOutService.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.lvyx.community.entity.CommunityInAndOut; 5 | import org.springframework.transaction.annotation.Transactional; 6 | 7 | /** 8 | *

9 | * 小区-进出登记表 服务类 10 | *

11 | * 12 | * @author lvyx 13 | * @since 2022-02-13 14 | */ 15 | public interface CommunityInAndOutService extends IService { 16 | 17 | /** 18 | * 添加社区进出登记 19 | * @param communityInAndOut 社区进出登记信息 20 | * @author lvyx 21 | * @since 2022/4/20 10:12 22 | **/ 23 | @Transactional(rollbackFor = Exception.class) 24 | void addCommunityInAndOut(CommunityInAndOut communityInAndOut); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/shiro/config/JWTProperties.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.shiro.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | *

9 | * jwt令牌配置 10 | *

11 | * 12 | * @author lvyx 13 | * @since 2022-01-14 09:25:25 14 | */ 15 | @Data 16 | @Component 17 | @ConfigurationProperties(prefix = "lvyx.shiro.jwt") 18 | public class JWTProperties { 19 | 20 | /** 21 | * 签名密码 22 | * @since 2022/1/14 9:26 23 | **/ 24 | private String hexEncodedSecretKey = "helloworld-community-system"; 25 | 26 | /** 27 | * 是否仅仅使用jwt令牌一种方式登录 28 | * @since 2022/1/14 16:55 29 | **/ 30 | private boolean isOnlyJwt = true; 31 | } 32 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/vo/HouseholdVo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.vo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 户VO 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2022-02-06 16:09:04 16 | */ 17 | @Data 18 | public class HouseholdVo implements Serializable { 19 | 20 | @ApiModelProperty("主键") 21 | private String id; 22 | 23 | @ApiModelProperty("层Id") 24 | private String layerId; 25 | 26 | @ApiModelProperty("户") 27 | private String householdNumber; 28 | 29 | @ApiModelProperty("排序") 30 | private Integer sortNo; 31 | 32 | @ApiModelProperty("用户") 33 | private List householdUserVoList; 34 | } 35 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/mapper/ResourceMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.mapper; 2 | 3 | import com.lvyx.author.entity.Resource; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | *

12 | * 资源表 Mapper 接口 13 | *

14 | * 15 | * @author lvyx 16 | * @since 2021-12-23 17 | */ 18 | @Mapper 19 | public interface ResourceMapper extends BaseMapper { 20 | 21 | /** 22 | * 根据用户id查询用户拥有的资源ids 23 | * @param userId 用户id 24 | * @return java.util.List 25 | * @author lvyx 26 | * @since 2021/12/24 9:37 27 | **/ 28 | List getResourcesByUserId(@Param("userId") String userId); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/exception/LException.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.exception; 2 | 3 | /** 4 | *

5 | * 自定义异常 6 | *

7 | * 8 | * @author lvyx 9 | * @since 2022-05-01 17:39:20 10 | */ 11 | public class LException extends Exception { 12 | 13 | public LException() { 14 | super(); 15 | } 16 | 17 | public LException(String message) { 18 | super(message); 19 | } 20 | 21 | public LException(String message, Throwable cause) { 22 | super(message, cause); 23 | } 24 | 25 | public LException(Throwable cause) { 26 | super(cause); 27 | } 28 | 29 | protected LException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 30 | super(message, cause, enableSuppression, writableStackTrace); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/vo/PeriodInfoVo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.vo; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.io.Serializable; 8 | import java.util.List; 9 | 10 | /** 11 | *

12 | * 社区详情 13 | *

14 | * 15 | * @author lvyx 16 | * @since 2022-02-06 16:22:53 17 | */ 18 | @ApiModel(value = "期详情", description = "期详情") 19 | @Data 20 | public class PeriodInfoVo implements Serializable { 21 | 22 | @ApiModelProperty("栋Id") 23 | private String buildingId; 24 | 25 | @ApiModelProperty("栋") 26 | private String buildingNumber; 27 | 28 | @ApiModelProperty("排序") 29 | private Integer sortNo; 30 | 31 | @ApiModelProperty("单元详情") 32 | private List infoVoList; 33 | } 34 | 35 | -------------------------------------------------------------------------------- /mail/src/main/java/com/lvyx/mail/MailUrls.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.mail; 2 | 3 | /** 4 | *

5 | * 邮件请求地址 6 | *

7 | * 8 | * @author lvyx 9 | * @since 2022-04-30 21:22:22 10 | */ 11 | public class MailUrls { 12 | 13 | /** 14 | * 邮件模块跟请求路径 15 | * @since 2021/12/30 13:56 16 | **/ 17 | public final static String PACKAGE_URL = "/mail"; 18 | 19 | /** 20 | * 社区-期 地址控制 21 | * @author lvyx 22 | * @since 2021/12/30 13:59 23 | **/ 24 | public static class MessageCtrls{ 25 | public static final String BASE_URL = PACKAGE_URL + "/message"; 26 | public static final String SENDER_SIMPLE_MAIL = "/sendSimpleMessage"; 27 | public static final String FIND_MESSAGE = "/findMessage"; 28 | public static final String READ_MESSAGE = "/readMessage"; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/vo/CommunityRoleVo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.vo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 社区角色 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2022-05-05 00:36:36 16 | */ 17 | @Data 18 | public class CommunityRoleVo implements Serializable { 19 | 20 | @ApiModelProperty("角色id") 21 | private String roleId; 22 | 23 | @ApiModelProperty("角色名称") 24 | private String RoleName; 25 | 26 | @ApiModelProperty("角色描述") 27 | private String description; 28 | 29 | @ApiModelProperty("期名称(多个期名称间用,分割)") 30 | private String periodNameStr; 31 | 32 | @ApiModelProperty("资源列表") 33 | private List communityResourceVoList; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/exception/LMailException.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.exception; 2 | 3 | /** 4 | *

5 | * 自定义邮件异常 6 | *

7 | * 8 | * @author lvyx 9 | * @since 2022-05-01 17:39:20 10 | */ 11 | public class LMailException extends Exception { 12 | 13 | public LMailException() { 14 | super(); 15 | } 16 | 17 | public LMailException(String message) { 18 | super(message); 19 | } 20 | 21 | public LMailException(String message, Throwable cause) { 22 | super(message, cause); 23 | } 24 | 25 | public LMailException(Throwable cause) { 26 | super(cause); 27 | } 28 | 29 | protected LMailException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 30 | super(message, cause, enableSuppression, writableStackTrace); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/exception/LExceException.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.exception; 2 | 3 | /** 4 | *

5 | * 自定义社区异常异常 6 | *

7 | * 8 | * @author lvyx 9 | * @since 2022-05-01 17:39:20 10 | */ 11 | public class LExceException extends Exception { 12 | 13 | public LExceException() { 14 | super(); 15 | } 16 | 17 | public LExceException(String message) { 18 | super(message); 19 | } 20 | 21 | public LExceException(String message, Throwable cause) { 22 | super(message, cause); 23 | } 24 | 25 | public LExceException(Throwable cause) { 26 | super(cause); 27 | } 28 | 29 | protected LExceException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 30 | super(message, cause, enableSuppression, writableStackTrace); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /mail/src/main/java/com/lvyx/mail/service/CommunityMessageEmailService.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.mail.service; 2 | 3 | import com.lvyx.mail.entity.CommunityMessageEmail; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | import com.lvyx.mail.vo.UserMessageVo; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 社区邮件信息表 服务类 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2022-05-01 16 | */ 17 | public interface CommunityMessageEmailService extends IService { 18 | 19 | /** 20 | * 查询用户的邮件信息 21 | * @param userIds 用户ids 22 | * @return java.util.List 23 | * @author lvyx 24 | * @since 2022/5/1 15:29 25 | **/ 26 | List findByUserIds(List userIds); 27 | 28 | void updateEmailIsEnable(String emailId, Integer isEnable); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/bo/QueryUserListBo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.bo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 查询用户房间信息实体 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2022-04-25 21:44:43 16 | */ 17 | @Data 18 | public class QueryUserListBo implements Serializable { 19 | 20 | @ApiModelProperty("用户主键") 21 | private String userId; 22 | 23 | @ApiModelProperty("用户名") 24 | private String searchName; 25 | 26 | @ApiModelProperty("页面状态") 27 | private Integer status; 28 | 29 | @ApiModelProperty("是否启用用户信息") 30 | private Integer isEnableUser; 31 | 32 | @ApiModelProperty("是否启用房间信息") 33 | private Integer isEnableHouseHold; 34 | 35 | @ApiModelProperty("期主键") 36 | private List periodIds; 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/mapper/CommunityExceptionMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lvyx.community.bo.QueryExceptionBo; 5 | import com.lvyx.community.entity.CommunityException; 6 | import com.lvyx.community.vo.ExceptionVo; 7 | import org.apache.ibatis.annotations.Mapper; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | *

13 | * 社区异常表 Mapper 接口 14 | *

15 | * 16 | * @author lvyx 17 | * @since 2022-05-02 18 | */ 19 | @Mapper 20 | public interface CommunityExceptionMapper extends BaseMapper { 21 | 22 | /** 23 | * 查询异常信息 24 | * @param queryExceptionBo 查询条件 25 | * @return com.lvyx.community.vo.ExceptionVo 26 | * @author lvyx 27 | * @since 2022/5/2 15:52 28 | **/ 29 | List findList(QueryExceptionBo queryExceptionBo); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/enums/CaptchaNameEnum.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.enums; 2 | 3 | /** 4 | *

5 | * shiro 缓存枚举 6 | *

7 | * 8 | * @author lvyx 9 | * @date 2021-12-31 09:59:24 10 | */ 11 | public enum CaptchaNameEnum { 12 | 13 | /** 14 | * 登录验证码 15 | * @since 2021/12/31 10:08 16 | **/ 17 | LOGIN_CAPTCHA(":login_captcha"), 18 | 19 | ; 20 | 21 | 22 | private final String value; 23 | 24 | CaptchaNameEnum(String value){ 25 | this.value = value; 26 | } 27 | 28 | public static String isSuccessEnum(String value){ 29 | CaptchaNameEnum[] array = values(); 30 | for(CaptchaNameEnum arr: array){ 31 | if(arr.value.equals(value)){ 32 | return arr.value; 33 | } 34 | } 35 | return null; 36 | } 37 | 38 | public String getValue() { 39 | return value; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /mail/src/main/java/com/lvyx/mail/mapper/CommunityMessageEmailMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.mail.mapper; 2 | 3 | import com.lvyx.mail.entity.CommunityMessageEmail; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.lvyx.mail.vo.UserMessageVo; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | *

13 | * 社区邮件信息表 Mapper 接口 14 | *

15 | * 16 | * @author lvyx 17 | * @since 2022-05-01 18 | */ 19 | @Mapper 20 | public interface CommunityMessageEmailMapper extends BaseMapper { 21 | 22 | /** 23 | * 查询用户的邮件信息 24 | * @param userIds 用户ids 25 | * @return java.util.List 26 | * @author lvyx 27 | * @since 2022/5/1 15:29 28 | **/ 29 | List findByUserIds(@Param("userIds") List userIds); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/annotation/logger/LLogger.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.annotation.logger; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | *

7 | * 自定日志注解 8 | * 使用说明: 9 | * 1. 该注解用于Controller层,进行日志的记录与存储 10 | * 2. 请自行创建T_L_LOG数据表用户存储日志内容 11 | * 3. 如果捕获了异常,日志注解将无法记录错误信息 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2021-12-02 13:47:53 16 | */ 17 | @Target(ElementType.METHOD) 18 | @Retention(RetentionPolicy.RUNTIME) 19 | @Documented 20 | public @interface LLogger { 21 | /** 22 | * 方法注释 23 | * @return java.lang.String 24 | * @author lvyx 25 | * @since 2021/12/3 15:34 26 | **/ 27 | String description(); 28 | 29 | /** 30 | * 形参注释 31 | * 注意:形参注释的顺序与个数必须与方法的形参一一对应 32 | * @return java.lang.String[] 33 | * @author lvyx 34 | * @since 2021/12/3 15:34 35 | **/ 36 | String[] params() default {}; 37 | } 38 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/QrCodeFactory/QrCodeBase.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.QrCodeFactory; 2 | 3 | import com.lvyx.commons.config.SystemProperties; 4 | import com.lvyx.commons.utils.ApplicationContextUtils; 5 | 6 | import java.awt.image.BufferedImage; 7 | import java.util.Map; 8 | 9 | /** 10 | *

11 | * QrCode基类 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2022-04-05 21:29:11 16 | */ 17 | public abstract class QrCodeBase { 18 | 19 | protected final SystemProperties systemProperties; 20 | 21 | public QrCodeBase() { 22 | systemProperties = ApplicationContextUtils.getBean(SystemProperties.class); 23 | } 24 | 25 | /** 26 | * 创建二维码 27 | * @param resultMap 二维码携带的信息 28 | * @return java.awt.image.BufferedImage 29 | * @author lvyx 30 | * @since 2022/4/24 19:52 31 | **/ 32 | public abstract BufferedImage createQrCode(Map resultMap); 33 | } 34 | -------------------------------------------------------------------------------- /mail/src/main/java/com/lvyx/mail/bo/BaseSenderMessageBo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.mail.bo; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.io.Serializable; 8 | import java.util.List; 9 | 10 | /** 11 | *

12 | * 邮件发送,请求参数 13 | *

14 | * 15 | * @author lvyx 16 | * @since 2022-05-01 15:13:21 17 | */ 18 | @Data 19 | @ApiModel(value = "BaseSenderMailBo对象", description = "邮件发送,请求参数") 20 | public class BaseSenderMessageBo implements Serializable { 21 | 22 | @ApiModelProperty("消息发送者") 23 | private String from; 24 | 25 | @ApiModelProperty("是否邮件发送") 26 | private Integer isSenderEmail; 27 | 28 | @ApiModelProperty("消息接收者") 29 | private List to; 30 | 31 | @ApiModelProperty("消息内容") 32 | private String content; 33 | 34 | @ApiModelProperty("消息主题") 35 | private String subject; 36 | 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/service/CommunityLayerService.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.lvyx.community.entity.CommunityLayer; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | *

10 | * 小区-层 服务类 11 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-02-01 15 | */ 16 | public interface CommunityLayerService extends IService { 17 | 18 | /** 19 | * 添加层信息 20 | * @param layer 层信息 21 | * @return CommunityBuilding 22 | * @author lvyx 23 | * @since 2022/2/4 15:31 24 | **/ 25 | CommunityLayer add(CommunityLayer layer); 26 | 27 | /** 28 | * 查询层 29 | * @param parentId 父级id 30 | * @return java.util.List 31 | * @author lvyx 32 | * @since 2022/2/4 17:05 33 | **/ 34 | List find(String parentId); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/mapper/CommunityUnitMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lvyx.community.entity.CommunityUnit; 5 | import com.lvyx.community.vo.UnitVo; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | *

13 | * 小区-单元 Mapper 接口 14 | *

15 | * 16 | * @author lvyx 17 | * @since 2022-02-01 18 | */ 19 | @Mapper 20 | public interface CommunityUnitMapper extends BaseMapper { 21 | 22 | /** 23 | * 根据栋id查询社区信息 24 | * @param buildingId 栋Id 25 | * @return java.util.List 26 | * @author lvyx 27 | * @since 2022/2/7 16:10 28 | **/ 29 | List findInfo(@Param("buildingId") String buildingId); 30 | 31 | int selectUnitIdUserCount(@Param("unitId") String unitId); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/bo/LoginBO.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.bo; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | /** 8 | *

9 | * 用户登录参数 10 | *

11 | * 12 | * @author lvyx 13 | * @since 2021-12-28 10:25:23 14 | */ 15 | @Data 16 | @ApiModel("用户登录参数") 17 | public class LoginBO { 18 | 19 | @ApiModelProperty(value = "用户名", required = true) 20 | private String username; 21 | 22 | @ApiModelProperty(value = "密码", required = true) 23 | private String password; 24 | 25 | @ApiModelProperty(value = "验证码", required = true) 26 | private String captcha; 27 | 28 | @ApiModelProperty(value = "是否记住我", required = true) 29 | private Boolean rememberFlag; 30 | 31 | @ApiModelProperty(value = "验证码Id", required = true) 32 | private String captchaId; 33 | 34 | @ApiModelProperty(value = "系统编码") 35 | private String systemCode; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/result/impl/ErrorResult.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.result.impl; 2 | 3 | import com.lvyx.commons.enums.ResultEnum; 4 | import com.lvyx.commons.result.Result; 5 | 6 | /** 7 | *

8 | * 异常结果统一封装类 9 | *

10 | * 11 | * @author lvyx 12 | * @since 2021-12-28 09:40:16 13 | */ 14 | public class ErrorResult extends Result { 15 | public ErrorResult(){ 16 | super(ResultEnum.ERROR.getCode(), ResultEnum.ERROR.getValue()); 17 | } 18 | 19 | public ErrorResult(String message){ 20 | super(ResultEnum.ERROR.getCode(), message); 21 | } 22 | 23 | public ErrorResult(Integer code, String message){ 24 | super(code, message); 25 | } 26 | 27 | public ErrorResult(Integer code, String message, T data){ 28 | super(code, message, data); 29 | } 30 | 31 | public ErrorResult(T data){ 32 | super(ResultEnum.ERROR.getCode(), ResultEnum.ERROR.getValue(), data); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/pojo/QrCodeInfo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.pojo; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | *

11 | * 二维码信息 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2022-04-24 19:38:54 16 | */ 17 | @Data 18 | @ApiModel( value = "二维码信息对象", description = "二维码信息对象" ) 19 | public class QrCodeInfo implements Serializable { 20 | 21 | @ApiModelProperty(value = "主键") 22 | private String id; 23 | 24 | @ApiModelProperty(value = "二维码类型") 25 | private String codeType; 26 | 27 | @ApiModelProperty(value = "二维码类型名称") 28 | private String codeTypeName; 29 | 30 | @ApiModelProperty(value = "用户id") 31 | private String userId; 32 | 33 | @ApiModelProperty(value = "用户名称") 34 | private String userName; 35 | 36 | @ApiModelProperty(value = "联系方式") 37 | private String mobile; 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/shiro/utils/ShiroUserUtils.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.shiro.utils; 2 | 3 | import cn.hutool.core.util.ObjectUtil; 4 | import com.lvyx.commons.pojo.ShiroUser; 5 | import com.lvyx.commons.utils.ShiroUtils; 6 | import org.apache.shiro.SecurityUtils; 7 | import org.apache.shiro.util.ThreadContext; 8 | 9 | /** 10 | *

11 | * shiro用户工具类 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2022-01-13 13:53:46 16 | */ 17 | public class ShiroUserUtils extends ShiroUtils { 18 | 19 | /** 20 | * 得到shiroUser对象 21 | * @return com.lvyx.author.shiro.pojo.ShiroUser 22 | * @author lvyx 23 | * @since 2022/1/13 13:55 24 | **/ 25 | public static ShiroUser getShiroUser(){ 26 | if (ObjectUtil.isNotEmpty(ThreadContext.getSubject()) && ObjectUtil.isNotEmpty(ThreadContext.getSubject().getPrincipal())){ 27 | return (ShiroUser)SecurityUtils.getSubject().getPrincipal(); 28 | } 29 | return null; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/result/Result.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.result; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | import java.io.Serializable; 10 | 11 | /** 12 | *

13 | * 统一返回结果抽象类 14 | *

15 | * 16 | * @author lvyx 17 | * @date 2021-12-28 09:31:50 18 | */ 19 | @ApiModel( 20 | value = "数据返回封装", 21 | description = "数据返回封装" 22 | ) 23 | @Data 24 | @AllArgsConstructor 25 | @NoArgsConstructor 26 | public abstract class Result implements Serializable { 27 | @ApiModelProperty("状态编码") 28 | private Integer code; 29 | 30 | @ApiModelProperty("提示信息") 31 | private String message; 32 | 33 | @ApiModelProperty("返回结果") 34 | private T data; 35 | 36 | public Result(Integer code, String message){ 37 | this.code = code; 38 | this.message = message; 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/enums/ResourceTypeEnum.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.enums; 2 | 3 | /** 4 | *

5 | * 资源类型枚举 6 | *

7 | * 8 | * @author lvyx 9 | * @date 2021-12-31 09:59:24 10 | */ 11 | public enum ResourceTypeEnum { 12 | 13 | /** 14 | * 功能 15 | * @since 2021/12/31 10:08 16 | **/ 17 | FUNCTION("function", "功能"), 18 | 19 | /** 20 | * 社区 21 | * @since 2021/12/31 10:08 22 | **/ 23 | COMMUNITY("community", "社区资源"), 24 | 25 | 26 | ; 27 | 28 | 29 | private final String value; 30 | private final String name; 31 | 32 | ResourceTypeEnum(String value, String name) { 33 | this.value = value; 34 | this.name = name; 35 | } 36 | 37 | ResourceTypeEnum(String value) { 38 | this.value = value; 39 | this.name = null; 40 | } 41 | 42 | public String getValue() { 43 | return value; 44 | } 45 | 46 | public String getName() { 47 | return name; 48 | } 49 | } -------------------------------------------------------------------------------- /community/src/main/resources/mapper/CommunityHouseholdMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/shiro/pojo/SimpleToken.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.shiro.pojo; 2 | 3 | import lombok.Data; 4 | import lombok.EqualsAndHashCode; 5 | import org.apache.shiro.authc.UsernamePasswordToken; 6 | 7 | 8 | /** 9 | * 自定义token 10 | * @author lvyx 11 | * @since 2021/12/23 19:44 12 | **/ 13 | @Data 14 | @EqualsAndHashCode(callSuper = true) 15 | public class SimpleToken extends UsernamePasswordToken { 16 | 17 | /** serialVersionUID */ 18 | private static final long serialVersionUID = -4849823851197352099L; 19 | 20 | private String tokenType; 21 | 22 | private String quickPassword; 23 | 24 | 25 | public SimpleToken(String tokenType, String username,String password) { 26 | super(username,password); 27 | this.tokenType = tokenType; 28 | } 29 | 30 | public SimpleToken(String tokenType, String username,String password,String quickPassword) { 31 | super(username,password); 32 | this.tokenType = tokenType; 33 | this.quickPassword = quickPassword; 34 | } 35 | 36 | 37 | } -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/mapper/RoleResourceMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.mapper; 2 | 3 | import com.lvyx.author.entity.RoleResource; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.lvyx.author.vo.CommunityResourceVo; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | *

13 | * 角色资源关联表 Mapper 接口 14 | *

15 | * 16 | * @author lvyx 17 | * @since 2021-12-23 18 | */ 19 | @Mapper 20 | public interface RoleResourceMapper extends BaseMapper { 21 | 22 | List findUserPeriodId(@Param("userId") String userId); 23 | 24 | /** 25 | * 查询社区角色资源信息,根据角色id查询 26 | * 27 | * @param roleId 角色id 28 | * @return java.util.List 29 | * @author lvyx 30 | * @since 2022/5/13 20:30 31 | **/ 32 | List findCommunityResourceByRoleId(@Param("roleId") String roleId); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/enums/ShiroTokenEnum.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.enums; 2 | 3 | /** 4 | *

5 | * shiro 缓存枚举 6 | *

7 | * 8 | * @author lvyx 9 | * @date 2021-12-31 09:59:24 10 | */ 11 | public enum ShiroTokenEnum { 12 | 13 | /** 14 | * 请求头中携带token的名称 15 | * @since 2021/12/31 10:08 16 | **/ 17 | AUTHORIZATION("L-TOKEN"), 18 | 19 | /** 20 | * 自定义注入资源名称 21 | * @since 2021/12/31 10:08 22 | **/ 23 | REFERENCED_SESSION_ID_SOURCE("Stateless request"), 24 | 25 | ; 26 | 27 | 28 | private final String value; 29 | 30 | ShiroTokenEnum(String value){ 31 | this.value = value; 32 | } 33 | 34 | public static String isSuccessEnum(String value){ 35 | ShiroTokenEnum[] array = values(); 36 | for(ShiroTokenEnum arr: array){ 37 | if(arr.value.equals(value)){ 38 | return arr.value; 39 | } 40 | } 41 | return null; 42 | } 43 | 44 | public String getValue() { 45 | return value; 46 | } 47 | } -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/service/CommunityHouseholdService.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.lvyx.community.entity.CommunityHousehold; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | *

10 | * 小区-户 服务类 11 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-02-01 15 | */ 16 | public interface CommunityHouseholdService extends IService { 17 | 18 | 19 | /** 20 | * 添加层信息 21 | * @param household 层信息 22 | * @return CommunityBuilding 23 | * @author lvyx 24 | * @since 2022/2/4 15:31 25 | **/ 26 | CommunityHousehold add(CommunityHousehold household); 27 | 28 | /** 29 | * 查询层 30 | * @param parentId 父级id 31 | * @return java.util.List 32 | * @author lvyx 33 | * @since 2022/2/4 17:05 34 | **/ 35 | List find(String parentId); 36 | 37 | String findPeriodIByHouseholdId(String householdId); 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/CommonsUrls.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons; 2 | 3 | /** 4 | *

5 | * 公共模块请求地址 6 | *

7 | * 8 | * @author lvyx 9 | * @since 2021-12-30 13:54:57 10 | */ 11 | public class CommonsUrls { 12 | 13 | /** 14 | * 公共模块跟请求路径 15 | * @since 2021/12/30 13:56 16 | **/ 17 | public final static String PACKAGE_URL = "/commons"; 18 | 19 | /** 20 | * 验证码请求地址控制 21 | * @author lvyx 22 | * @since 2021/12/30 13:59 23 | **/ 24 | public static class CaptchaCtrls{ 25 | public static final String BASE_URL = PACKAGE_URL + "/captcha"; 26 | public static final String DEFAULT_CAPTCHA = "/default"; 27 | } 28 | 29 | /** 30 | * 文件流控制器 31 | * @author lvyx 32 | * @since 2021/12/30 13:59 33 | **/ 34 | public static class FileCtrls{ 35 | public static final String BASE_URL = PACKAGE_URL + "/file"; 36 | public static final String GET_IMAGE_FOR_PATH = "/getImageForPath"; 37 | public static final String FILE_UPLOAD = "/fileUpload"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/bo/QueryUserBo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.bo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | *

10 | * 查询用户房间信息实体 11 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-04-25 21:44:43 15 | */ 16 | @Data 17 | public class QueryUserBo implements Serializable { 18 | 19 | @ApiModelProperty("用户主键") 20 | private String userId; 21 | 22 | @ApiModelProperty("用户名") 23 | private String userName; 24 | 25 | @ApiModelProperty("用户电话号码") 26 | private String userMobile; 27 | 28 | @ApiModelProperty("是否启用(未启用表示待审核状态,启用表示审核通过状态)") 29 | private String isEnable; 30 | 31 | @ApiModelProperty("期主键") 32 | private String periodId; 33 | 34 | @ApiModelProperty("栋主键") 35 | private String buildingId; 36 | 37 | @ApiModelProperty("单元主键") 38 | private String unitId; 39 | 40 | @ApiModelProperty("层主键") 41 | private String layerId; 42 | 43 | @ApiModelProperty("房间主键") 44 | private String householdId; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /web/src/main/java/com/lvyx/controller/ExceptionController.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.controller; 2 | 3 | 4 | import com.lvyx.commons.result.Result; 5 | import com.lvyx.factory.MyExceptionFactory; 6 | import org.springframework.web.bind.annotation.ExceptionHandler; 7 | import org.springframework.web.bind.annotation.RestControllerAdvice; 8 | 9 | import javax.servlet.http.HttpServletRequest; 10 | 11 | /** 12 | *

13 | * 全局异常处理器 14 | *

15 | * 16 | * @author lvyx 17 | * @since 2021-12-09 11:00:53 18 | */ 19 | @RestControllerAdvice 20 | public class ExceptionController { 21 | 22 | 23 | /** 24 | * 全局异常处理 25 | * @param request request上下文 26 | * @param e 异常信息 27 | * @return com.lvyx.shiro_boot02.vo.Result 28 | * @author lvyx 29 | * @since 2021/12/9 11:03 30 | **/ 31 | @ExceptionHandler(Exception.class) 32 | public Result defaultExceptionHandler(HttpServletRequest request, Exception e){ 33 | // 异常方法 34 | String requestMethod = request.getMethod(); 35 | return MyExceptionFactory.getResult(e, requestMethod); 36 | } 37 | } -------------------------------------------------------------------------------- /community/src/main/resources/mapper/CommunityGreyCodeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /community/src/main/resources/mapper/CommunityRedCodeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /community/src/main/resources/mapper/CommunityGreenCodeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/vo/InfoVo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.vo; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | *

11 | * 社区详情 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2022-02-06 16:22:53 16 | */ 17 | @ApiModel(value = "详情", description = "详情") 18 | @Data 19 | public class InfoVo implements Serializable { 20 | 21 | @ApiModelProperty("单元id") 22 | private String unitId; 23 | 24 | @ApiModelProperty("单元名称") 25 | private String unitNumber; 26 | 27 | @ApiModelProperty("总户数") 28 | private int allHousehold; 29 | 30 | @ApiModelProperty("总人口") 31 | private int allUser; 32 | 33 | @ApiModelProperty("危险等级") 34 | private int dangerGrade; 35 | 36 | @ApiModelProperty("绿码人数") 37 | private int greenCode; 38 | 39 | @ApiModelProperty("红码人数") 40 | private int redCode; 41 | 42 | @ApiModelProperty("灰码人数") 43 | private int greyCode; 44 | 45 | @ApiModelProperty("黄码人数") 46 | private int yellowCode; 47 | } 48 | -------------------------------------------------------------------------------- /community/src/main/resources/mapper/CommunityYellowCodeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/result/impl/SuccessResult.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.result.impl; 2 | 3 | import com.lvyx.commons.enums.ResultEnum; 4 | import com.lvyx.commons.result.Result; 5 | 6 | /** 7 | *

8 | * 成功结果统一封装类 9 | *

10 | * 11 | * @author lvyx 12 | * @since 2021-12-28 09:40:16 13 | */ 14 | public class SuccessResult extends Result { 15 | public SuccessResult(){ 16 | super(ResultEnum.SUCCESS.getCode(), ResultEnum.SUCCESS.getValue()); 17 | } 18 | 19 | public SuccessResult(String message){ 20 | super(ResultEnum.SUCCESS.getCode(), message); 21 | } 22 | 23 | public SuccessResult(Integer code, String message){ 24 | super(code, message); 25 | } 26 | 27 | public SuccessResult(Integer code, String message, T data){ 28 | super(code, message, data); 29 | } 30 | 31 | public SuccessResult(String message, T data){ 32 | super(ResultEnum.SUCCESS.getCode(), message, data); 33 | } 34 | 35 | public SuccessResult(T data){ 36 | super(ResultEnum.SUCCESS.getCode(), ResultEnum.SUCCESS.getValue(), data); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/enums/ResultEnum.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.enums; 2 | 3 | /** 4 | *

5 | * 返回结果枚举类 6 | *

7 | * 8 | * @author lvyx 9 | * @date 2021-12-28 09:44:23 10 | */ 11 | public enum ResultEnum { 12 | 13 | /** 14 | * 请求成功 15 | * @since 2021/12/28 9:50 16 | **/ 17 | SUCCESS(200,"请求成功"), 18 | 19 | /** 20 | * 请求异常 21 | * @since 2021/12/28 9:51 22 | **/ 23 | ERROR(500,"请求异常"), 24 | 25 | ; 26 | 27 | private Integer code; 28 | private String value; 29 | 30 | ResultEnum(Integer code, String value){ 31 | this.code = code; 32 | this.value = value; 33 | } 34 | 35 | public static String isSuccessEnum(Integer code){ 36 | ResultEnum[] array = values(); 37 | for(ResultEnum arr: array){ 38 | if(arr.code.equals(code)){ 39 | return arr.value; 40 | } 41 | } 42 | return null; 43 | } 44 | 45 | public Integer getCode() { 46 | return code; 47 | } 48 | 49 | public String getValue() { 50 | return value; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/enums/SexTypeEnum.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.enums; 2 | 3 | /** 4 | *

5 | * 数据库boolean类型值 6 | *

7 | * 8 | * @author lvyx 9 | * @date 2021-12-28 09:44:23 10 | */ 11 | public enum SexTypeEnum { 12 | 13 | /** 14 | * 没有登录 15 | * @since 2021/12/28 9:51 16 | **/ 17 | MALE(1,"男"), 18 | 19 | /** 20 | * 没有权限 21 | * @since 2021/12/28 9:51 22 | **/ 23 | FEMALE(0,"女"), 24 | 25 | ; 26 | 27 | private Integer code; 28 | private String value; 29 | 30 | SexTypeEnum(Integer code, String value){ 31 | this.code = code; 32 | this.value = value; 33 | } 34 | 35 | public static String isSuccessEnum(Integer code){ 36 | SexTypeEnum[] array = values(); 37 | for(SexTypeEnum arr: array){ 38 | if(arr.code.equals(code)){ 39 | return arr.value; 40 | } 41 | } 42 | return null; 43 | } 44 | 45 | public Integer getCode() { 46 | return code; 47 | } 48 | 49 | public String getValue() { 50 | return value; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/enums/BooleanTypeEnum.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.enums; 2 | 3 | /** 4 | *

5 | * 数据库boolean类型值 6 | *

7 | * 8 | * @author lvyx 9 | * @date 2021-12-28 09:44:23 10 | */ 11 | public enum BooleanTypeEnum { 12 | 13 | /** 14 | * 没有登录 15 | * @since 2021/12/28 9:51 16 | **/ 17 | YES(1,"是"), 18 | 19 | /** 20 | * 没有权限 21 | * @since 2021/12/28 9:51 22 | **/ 23 | NO(0,"否"), 24 | 25 | ; 26 | 27 | private Integer code; 28 | private String value; 29 | 30 | BooleanTypeEnum(Integer code, String value){ 31 | this.code = code; 32 | this.value = value; 33 | } 34 | 35 | public static String isSuccessEnum(Integer code){ 36 | BooleanTypeEnum[] array = values(); 37 | for(BooleanTypeEnum arr: array){ 38 | if(arr.code.equals(code)){ 39 | return arr.value; 40 | } 41 | } 42 | return null; 43 | } 44 | 45 | public Integer getCode() { 46 | return code; 47 | } 48 | 49 | public String getValue() { 50 | return value; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /web/src/main/java/com/lvyx/config/CORSConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.cors.CorsConfiguration; 6 | import org.springframework.web.cors.UrlBasedCorsConfigurationSource; 7 | import org.springframework.web.filter.CorsFilter; 8 | 9 | /** 10 | *

11 | * TODO(类描述信息) 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2022-03-04 23:14:15 16 | */ 17 | @Configuration 18 | public class CORSConfiguration { 19 | 20 | 21 | public CorsConfiguration addCorsMappings() { 22 | CorsConfiguration registry = new CorsConfiguration(); 23 | registry.addAllowedOrigin("*"); 24 | registry.addAllowedHeader("*"); 25 | registry.addAllowedMethod("*"); 26 | return registry; 27 | } 28 | 29 | @Bean 30 | public CorsFilter corsFilter(){ 31 | UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); 32 | source.registerCorsConfiguration("/**", addCorsMappings()); 33 | return new CorsFilter(source); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/enums/ExamineStatusEnum.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.enums; 2 | 3 | /** 4 | *

5 | * 数据库boolean类型值 6 | *

7 | * 8 | * @author lvyx 9 | * @date 2021-12-28 09:44:23 10 | */ 11 | public enum ExamineStatusEnum { 12 | 13 | /** 14 | * 没有登录 15 | * @since 2021/12/28 9:51 16 | **/ 17 | YES(1,"通过"), 18 | 19 | /** 20 | * 没有权限 21 | * @since 2021/12/28 9:51 22 | **/ 23 | NO(0,"不通过"), 24 | 25 | ; 26 | 27 | private Integer code; 28 | private String value; 29 | 30 | ExamineStatusEnum(Integer code, String value){ 31 | this.code = code; 32 | this.value = value; 33 | } 34 | 35 | public static String isSuccessEnum(Integer code){ 36 | ExamineStatusEnum[] array = values(); 37 | for(ExamineStatusEnum arr: array){ 38 | if(arr.code.equals(code)){ 39 | return arr.value; 40 | } 41 | } 42 | return null; 43 | } 44 | 45 | public Integer getCode() { 46 | return code; 47 | } 48 | 49 | public String getValue() { 50 | return value; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/enums/ExceptionTypeEnum.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.enums; 2 | 3 | /** 4 | *

5 | * 社区异常类型 6 | *

7 | * 8 | * @author lvyx 9 | * @date 2021-12-28 09:44:23 10 | */ 11 | public enum ExceptionTypeEnum { 12 | 13 | /** 14 | * 其他异常 15 | * @since 2021/12/28 9:51 16 | **/ 17 | YES(1,"其他异常"), 18 | 19 | /** 20 | * 体温异常 21 | * @since 2021/12/28 9:51 22 | **/ 23 | NO(0,"体温异常"), 24 | 25 | ; 26 | 27 | private Integer code; 28 | private String value; 29 | 30 | ExceptionTypeEnum(Integer code, String value){ 31 | this.code = code; 32 | this.value = value; 33 | } 34 | 35 | public static String isSuccessEnum(Integer code){ 36 | ExceptionTypeEnum[] array = values(); 37 | for(ExceptionTypeEnum arr: array){ 38 | if(arr.code.equals(code)){ 39 | return arr.value; 40 | } 41 | } 42 | return null; 43 | } 44 | 45 | public Integer getCode() { 46 | return code; 47 | } 48 | 49 | public String getValue() { 50 | return value; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/service/RoleResourceService.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.lvyx.author.entity.RoleResource; 5 | import com.lvyx.author.vo.CommunityResourceVo; 6 | import org.springframework.transaction.annotation.Transactional; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | *

12 | * 角色资源关联表 服务类 13 | *

14 | * 15 | * @author lvyx 16 | * @since 2021-12-23 17 | */ 18 | public interface RoleResourceService extends IService { 19 | 20 | /** 21 | * 根据角色id删除关联关系 22 | * @param roleId 角色id 23 | * @author lvyx 24 | * @since 2022/5/5 2:20 25 | **/ 26 | @Transactional(rollbackFor = Exception.class) 27 | void deleteByRoleId(String roleId); 28 | 29 | List findUserPeriodId(String userId); 30 | 31 | /** 32 | * 查询社区角色资源信息,根据角色id查询 33 | * @param roleId 角色id 34 | * @return java.util.List 35 | * @author lvyx 36 | * @since 2022/5/13 20:30 37 | **/ 38 | List findCommunityResourceByRoleId(String roleId); 39 | } 40 | -------------------------------------------------------------------------------- /commons/src/test/java/com/lvyx/commons/AESTest.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons; 2 | 3 | import cn.hutool.core.codec.Base64; 4 | import cn.hutool.crypto.SecureUtil; 5 | import cn.hutool.crypto.symmetric.SymmetricAlgorithm; 6 | import cn.hutool.crypto.symmetric.SymmetricCrypto; 7 | import org.junit.jupiter.api.Test; 8 | 9 | /** 10 | *

11 | * 测试AES加密 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2021-12-30 10:33:51 16 | */ 17 | public class AESTest { 18 | 19 | @Test 20 | public void generatorTest() { 21 | String k = "dsrHDJUiRxKIMe/YiEhcWQ=="; 22 | 23 | //随机生成密钥 24 | byte[] key = SecureUtil.generateKey(SymmetricAlgorithm.AES.getValue()).getEncoded(); 25 | String encode = Base64.encode(key); 26 | System.out.println(encode); 27 | } 28 | 29 | @Test 30 | public void encrypt(){ 31 | SymmetricCrypto aes = new SymmetricCrypto(SymmetricAlgorithm.AES.getValue(), Base64.decode("dsrHDJUiRxKIMe/YiEhcWQ==")); 32 | String helloworld = aes.encryptHex("helloworld"); 33 | System.out.println(helloworld); 34 | String s = aes.decryptStr(helloworld); 35 | System.out.println(s); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/enums/QrCodeColorEnum.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.enums; 2 | 3 | /** 4 | *

5 | * 二维码颜色枚举 6 | *

7 | * 8 | * @author lvyx 9 | * @date 2021-12-31 09:59:24 10 | */ 11 | public enum QrCodeColorEnum { 12 | 13 | /** 14 | * 黄色二维码 15 | * @since 2021/12/31 10:08 16 | **/ 17 | YELLOW("yellow", "黄码"), 18 | 19 | /** 20 | * 绿色二维码 21 | * @since 2021/12/31 10:08 22 | **/ 23 | GREEN("green", "绿码"), 24 | 25 | /** 26 | * 红色二维码 27 | * @since 2021/12/31 10:08 28 | **/ 29 | RED("red", "红码"), 30 | 31 | /** 32 | * 灰色二维码 33 | * @since 2021/12/31 10:08 34 | **/ 35 | GRAY("gray", "灰码"); 36 | 37 | 38 | ; 39 | 40 | 41 | private final String value; 42 | private final String name; 43 | 44 | QrCodeColorEnum(String value, String name) { 45 | this.value = value; 46 | this.name = name; 47 | } 48 | 49 | QrCodeColorEnum(String value) { 50 | this.value = value; 51 | this.name = null; 52 | } 53 | 54 | public String getValue() { 55 | return value; 56 | } 57 | 58 | public String getName() { 59 | return name; 60 | } 61 | } -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/bo/QueryUserHouseholdBo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.bo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 查询用户房间信息实体 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2022-04-25 21:44:43 16 | */ 17 | @Data 18 | public class QueryUserHouseholdBo implements Serializable { 19 | 20 | @ApiModelProperty("用户主键") 21 | private String userId; 22 | 23 | @ApiModelProperty("用户名") 24 | private String userName; 25 | 26 | @ApiModelProperty("模糊搜索") 27 | private String fuzzySearch; 28 | 29 | @ApiModelProperty("是否启用(未启用表示待审核状态,启用表示审核通过状态)") 30 | private String isEnable; 31 | 32 | @ApiModelProperty("期主键") 33 | private String periodId; 34 | 35 | @ApiModelProperty("栋主键") 36 | private String buildingId; 37 | 38 | @ApiModelProperty("单元主键") 39 | private String unitId; 40 | 41 | @ApiModelProperty("层主键") 42 | private String layerId; 43 | 44 | @ApiModelProperty("房间主键") 45 | private String householdId; 46 | 47 | @ApiModelProperty("期主键") 48 | private List periodIds; 49 | 50 | } 51 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/vo/AddressVo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.vo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | *

10 | * 用户住址 11 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-02-06 16:09:04 15 | */ 16 | @Data 17 | public class AddressVo implements Serializable { 18 | 19 | @ApiModelProperty("期主键") 20 | private String periodId; 21 | 22 | @ApiModelProperty("第几期") 23 | private String periodNumber; 24 | 25 | @ApiModelProperty("栋主键") 26 | private String buildingId; 27 | 28 | @ApiModelProperty("第几栋") 29 | private String buildingNumber; 30 | 31 | @ApiModelProperty("单元主键") 32 | private String unitId; 33 | 34 | @ApiModelProperty("第几单元") 35 | private String unitNumber; 36 | 37 | @ApiModelProperty("层主键") 38 | private String layerId; 39 | 40 | @ApiModelProperty("第几层") 41 | private String layerNumber; 42 | 43 | @ApiModelProperty("房间主键") 44 | private String householdId; 45 | 46 | @ApiModelProperty("房价好") 47 | private String householdNumber; 48 | 49 | @ApiModelProperty("用户Id") 50 | private String userId; 51 | 52 | } 53 | -------------------------------------------------------------------------------- /mail/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | community_sys 7 | com.lvyx.community 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | com.lvyx.community.mail 13 | mail 14 | 15 | 16 | 8 17 | 8 18 | 19 | 20 | 21 | 22 | org.springframework.boot 23 | spring-boot-starter-mail 24 | 25 | 26 | 27 | com.lvyx.community.commons 28 | commons 29 | 0.0.1-SNAPSHOT 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /mail/src/main/java/com/lvyx/mail/service/CommunityMessageService.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.mail.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.github.pagehelper.PageInfo; 5 | import com.lvyx.commons.exception.LMailException; 6 | import com.lvyx.mail.bo.BaseSenderMessageBo; 7 | import com.lvyx.mail.entity.CommunityMessage; 8 | import com.lvyx.mail.vo.MessageVo; 9 | 10 | /** 11 | *

12 | * 社区消息 服务类 13 | *

14 | * 15 | * @author lvyx 16 | * @since 2022-04-30 17 | */ 18 | public interface CommunityMessageService extends IService { 19 | 20 | /** 21 | * 发送普通邮件 22 | * @param baseSenderMessageBo 邮件发送参数 23 | * @author lvyx 24 | * @since 2022/5/1 15:19 25 | **/ 26 | void sendSimpleMessage(BaseSenderMessageBo baseSenderMessageBo) throws LMailException; 27 | 28 | /** 29 | * 查询消息 30 | * @param isEmail 是否邮件提醒 31 | * @param isEnable 是否已读 32 | * @param title 邮件主题 33 | * @return com.github.pagehelper.PageInfo 34 | * @author lvyx 35 | * @since 2022/5/5 23:48 36 | **/ 37 | PageInfo findListMessageVo(Integer pageNum, Integer pageSize, Integer isEmail, Integer isEnable, String title); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/enums/AddressStatusEnum.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.enums; 2 | 3 | /** 4 | *

5 | * 住址信息状态 6 | *

7 | * 8 | * @author lvyx 9 | * @date 2021-12-28 09:44:23 10 | */ 11 | public enum AddressStatusEnum { 12 | 13 | /** 14 | * 没有登录 15 | * @since 2021/12/28 9:51 16 | **/ 17 | INACTIVE(0,"未激活"), 18 | 19 | /** 20 | * 没有权限 21 | * @since 2021/12/28 9:51 22 | **/ 23 | ACTIVE(1,"已激活"), 24 | 25 | /** 26 | * 没有权限 27 | * @since 2021/12/28 9:51 28 | **/ 29 | NO_CREATE(2,"未创建"), 30 | 31 | ; 32 | 33 | private Integer code; 34 | private String value; 35 | 36 | AddressStatusEnum(Integer code, String value){ 37 | this.code = code; 38 | this.value = value; 39 | } 40 | 41 | public static String isSuccessEnum(Integer code){ 42 | AddressStatusEnum[] array = values(); 43 | for(AddressStatusEnum arr: array){ 44 | if(arr.code.equals(code)){ 45 | return arr.value; 46 | } 47 | } 48 | return null; 49 | } 50 | 51 | public Integer getCode() { 52 | return code; 53 | } 54 | 55 | public String getValue() { 56 | return value; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/enums/SystemCacheEnum.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.enums; 2 | 3 | /** 4 | *

5 | * shiro 缓存枚举 6 | *

7 | * 8 | * @author lvyx 9 | * @date 2021-12-31 09:59:24 10 | */ 11 | public enum SystemCacheEnum { 12 | 13 | /** 14 | * 缓存最外层组名称 15 | * @since 2021/12/31 10:08 16 | **/ 17 | COMMUNITY_SYSTEM_CACHE("COMMUNITY_SYSTEM_CACHE:"), 18 | 19 | 20 | /** 21 | * 系统外层层组名 22 | * @since 2021/12/31 10:08 23 | **/ 24 | SYSTEM_GROUP(SystemCacheEnum.COMMUNITY_SYSTEM_CACHE.getValue() + "system_group:"), 25 | 26 | /** 27 | * 验证码 28 | * @since 2021/12/31 10:08 29 | **/ 30 | CAPTCHA(SystemCacheEnum.SYSTEM_GROUP.getValue() + "captcha: "), 31 | 32 | ; 33 | 34 | 35 | private final String value; 36 | 37 | SystemCacheEnum(String value){ 38 | this.value = value; 39 | } 40 | 41 | public static String isSuccessEnum(String value){ 42 | SystemCacheEnum[] array = values(); 43 | for(SystemCacheEnum arr: array){ 44 | if(arr.value.equals(value)){ 45 | return arr.value; 46 | } 47 | } 48 | return null; 49 | } 50 | 51 | public String getValue() { 52 | return value; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/mapper/CommunityHouseholdUserMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lvyx.community.bo.QueryUserHouseholdBo; 5 | import com.lvyx.community.entity.CommunityHouseholdUser; 6 | import com.lvyx.community.vo.UserHouseholdVo; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Param; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | *

14 | * 用户与户关联表 Mapper 接口 15 | *

16 | * 17 | * @author lvyx 18 | * @since 2022-02-01 19 | */ 20 | @Mapper 21 | public interface CommunityHouseholdUserMapper extends BaseMapper { 22 | 23 | /** 24 | * 查询住户信息 25 | * @param queryUserHouseholdBo 查询条件 26 | * @return java.util.List 27 | * @author lvyx 28 | * @since 2022/4/25 21:54 29 | **/ 30 | List findUserHoseholdByQuery(QueryUserHouseholdBo queryUserHouseholdBo); 31 | 32 | String findPeriodIdByUserId(@Param("userId") String userId); 33 | 34 | void updateUserPeriod(@Param("userId") String userId, @Param("periodId") String periodId); 35 | 36 | List findUserPeriodId(String userId); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /commons/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | community_sys 7 | com.lvyx.community 8 | 0.0.1-SNAPSHOT 9 | 10 | 11 | 4.0.0 12 | 13 | com.lvyx.community.commons 14 | commons 15 | 16 | 17 | 18 | 19 | 20 | org.springframework.boot 21 | spring-boot-starter-aop 22 | 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-test 27 | 28 | 29 | 30 | org.redisson 31 | redisson 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/enums/ShiroResultEnum.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.enums; 2 | 3 | /** 4 | *

5 | * 返回结果枚举类 6 | *

7 | * 8 | * @author lvyx 9 | * @date 2021-12-28 09:44:23 10 | */ 11 | public enum ShiroResultEnum { 12 | 13 | /** 14 | * 没有登录 15 | * @since 2021/12/28 9:51 16 | **/ 17 | NO_LOGIN(401,"没有登录"), 18 | 19 | /** 20 | * 没有权限 21 | * @since 2021/12/28 9:51 22 | **/ 23 | NO_AUTHORITY(402,"没有权限"), 24 | 25 | /** 26 | * 资源不存在 27 | * @since 2021/12/28 9:51 28 | **/ 29 | NO_RESSOURCE(403,"资源不存在"), 30 | 31 | ; 32 | 33 | private Integer code; 34 | private String value; 35 | 36 | ShiroResultEnum(Integer code, String value){ 37 | this.code = code; 38 | this.value = value; 39 | } 40 | 41 | public static String isSuccessEnum(Integer code){ 42 | ShiroResultEnum[] array = values(); 43 | for(ShiroResultEnum arr: array){ 44 | if(arr.code.equals(code)){ 45 | return arr.value; 46 | } 47 | } 48 | return null; 49 | } 50 | 51 | public Integer getCode() { 52 | return code; 53 | } 54 | 55 | public String getValue() { 56 | return value; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /author/src/main/resources/mapper/ResourceMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | r.id, r.role_name, r.label, r.description, r.sort_no, r.is_enable, r.create_user, r.create_time, r.update_user, r.update_time, r.is_delete, r.delete_user, r.delete_time 7 | 8 | 9 | 28 | 29 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/shiro/utils/PropertiesUtil.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.shiro.utils; 2 | 3 | import com.mysql.cj.util.StringUtils; 4 | import lombok.extern.slf4j.Slf4j; 5 | 6 | /** 7 | *

8 | * 读取Properties的工具类 9 | *

10 | * 11 | * @author lvyx 12 | * @since 2021/12/27 14:38 13 | **/ 14 | @Slf4j 15 | public class PropertiesUtil { 16 | 17 | public static LinkProperties propertiesShiro = new LinkProperties(); 18 | 19 | 20 | //读取properties配置文件信息 21 | static { 22 | String sysName = System.getProperty("sys.name"); 23 | if (StringUtils.isNullOrEmpty(sysName)) { 24 | sysName = "application.properties"; 25 | } else { 26 | sysName += ".properties"; 27 | } 28 | try { 29 | propertiesShiro.load(PropertiesUtil.class.getClassLoader() 30 | .getResourceAsStream("authentication.properties")); 31 | } catch (Exception e) { 32 | log.warn("资源路径中不存在authentication.properties权限文件,忽略读取!"); 33 | } 34 | } 35 | 36 | /** 37 | * 根据key得到value的值 38 | * @author lvyx 39 | * @since 2021/12/28 16:26 40 | **/ 41 | public static String getShiroValue(String key) { 42 | return propertiesShiro.getProperty(key); 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /web/src/main/resources/authentication.properties: -------------------------------------------------------------------------------- 1 | # \u6D4B\u8BD5\u96F6\u65F6\u653E\u5F00 2 | /community/QrCode/getByUser=anon 3 | # \u9759\u6001\u8D44\u6E90\u4E0D\u8FC7\u6EE4 4 | /static/**=anon 5 | # \u767B\u5F55\u94FE\u63A5\u4E0D\u8FC7\u6EE4 6 | /author/user/login=online,anon 7 | /author/user/test=anon 8 | /author/user/test2=anon 9 | /community/period/test=anon 10 | # \u7528\u6237\u540D\u552F\u4E00\u6027\u6821\u9A8C 11 | /author/user/nameIsRepeat=anon 12 | # \u7528\u6237\u6CE8\u518C\u653E\u884C 13 | /author/user/insertUser=anon 14 | # knife4j\u63A5\u53E3\u6587\u6863\u4E0D\u8FC7\u6EE4 15 | /webjars/**/**=anon 16 | /doc.html=anon 17 | /v2/api-docs=anon 18 | /swagger-resources/**=anon 19 | /swagger-ui.html=anon 20 | # druid\u6570\u636E\u6E90\u4E0D\u8FC7\u6EE4 21 | /druid/**=anon 22 | # \u9A8C\u8BC1\u7801\u4E0D\u8FC7\u6EE4 23 | /commons/captcha/**=anon 24 | # \u767B\u5F55\u624D\u80FD\u9009\u62E9\u623F\u95F4 25 | /community/period/findAllCommunityInfo=jwt-authc 26 | # \u767B\u5F55\u624D\u80FD\u7ED1\u5B9A\u623F\u95F4 27 | /author/user/bindRoleAndHousehold=jwt-authc 28 | # \u9000\u51FA\u767B\u5F55\u9700\u8981\u767B\u5F55\u624D\u884C 29 | /author/user/logout=jwt-authc 30 | # \u5176\u4ED6\u94FE\u63A5\u662F\u9700\u8981\u767B\u5F55\u7684,\u63A7\u5236\u5728\u7EBF\u4EBA\u6570 31 | /**=online,jwt-authc,jwt-role-or[admin,user] -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/config/SysRedisProperties.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | *

11 | * shiro Redis缓存配置 12 | *

13 | * @author lvyx 14 | * @since 2021/12/30 15:59 15 | **/ 16 | @Data 17 | @Component 18 | @ConfigurationProperties(prefix = "lvyx.redis") 19 | public class SysRedisProperties implements Serializable { 20 | 21 | /** 22 | * redis连接地址,(集群环境多个redis连接使用逗号分割) 23 | * @since 2021/12/30 15:59 24 | */ 25 | private String nodes = "redis://127.0.0.1:6379"; 26 | 27 | /** 28 | * 获取连接超时时间 29 | * @since 2021/12/30 15:59 30 | */ 31 | private int connectTimeout = 6000; 32 | 33 | /** 34 | * 连接池大小 35 | * @since 2021/12/30 15:59 36 | */ 37 | private int connectPoolSize = 150; 38 | 39 | /** 40 | * 初始化连接数 41 | * @since 2021/12/30 15:59 42 | */ 43 | private int connectionMinimumidleSize = 30; 44 | 45 | /** 46 | * 等待数据返回超时时间 47 | * @since 2021/12/30 15:59 48 | */ 49 | private int timeout = 6000; 50 | 51 | /** 52 | * 全局超时时间 53 | * @since 2021/12/30 15:59 54 | */ 55 | private long globalSessionTimeout = 360000; 56 | 57 | } -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/service/ResourceService.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.lvyx.author.entity.Resource; 5 | import org.springframework.transaction.annotation.Transactional; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 资源表 服务类 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2021-12-23 16 | */ 17 | public interface ResourceService extends IService { 18 | 19 | /** 20 | * 根据用户id查询用户拥有的资源ids 21 | * @param userId 用户id 22 | * @return java.util.List 23 | * @author lvyx 24 | * @since 2021/12/24 9:37 25 | **/ 26 | List getResourceIdsByUserId(String userId); 27 | 28 | /** 29 | * 根据用户id得到资源信息 30 | * @param userId 用户id 31 | * @return java.util.List 32 | * @author lvyx 33 | * @since 2021/12/31 14:35 34 | **/ 35 | List getResourceByUserId(String userId); 36 | 37 | /** 38 | * 添加社区资源 39 | * @param periodId 期ids 40 | * @author lvyx 41 | * @since 2022/5/5 0:09 42 | **/ 43 | @Transactional(rollbackFor = Exception.class) 44 | void addCommunityResource(String roleId, List periodId); 45 | 46 | 47 | 48 | 49 | 50 | } 51 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/shiro/config/ShiroRedisProperties.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.shiro.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | *

11 | * shiro Redis缓存配置 12 | *

13 | * @author lvyx 14 | * @since 2021/12/30 15:59 15 | **/ 16 | @Data 17 | @Component 18 | @ConfigurationProperties(prefix = "lvyx.shiro.redis") 19 | public class ShiroRedisProperties implements Serializable { 20 | 21 | /** 22 | * redis连接地址,(集群环境多个redis连接使用逗号分割) 23 | * @since 2021/12/30 15:59 24 | */ 25 | private String nodes = "redis://127.0.0.1:6379"; 26 | 27 | /** 28 | * 获取连接超时时间 29 | * @since 2021/12/30 15:59 30 | */ 31 | private int connectTimeout = 6000; 32 | 33 | /** 34 | * 连接池大小 35 | * @since 2021/12/30 15:59 36 | */ 37 | private int connectPoolSize = 150; 38 | 39 | /** 40 | * 初始化连接数 41 | * @since 2021/12/30 15:59 42 | */ 43 | private int connectionMinimumidleSize = 30; 44 | 45 | /** 46 | * 等待数据返回超时时间 47 | * @since 2021/12/30 15:59 48 | */ 49 | private int timeout = 6000; 50 | 51 | /** 52 | * 全局超时时间 53 | * @since 2021/12/30 15:59 54 | */ 55 | private long globalSessionTimeout = 360000; 56 | 57 | } -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/service/CommunityGreyCodeService.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.lvyx.community.entity.CommunityGreyCode; 5 | 6 | /** 7 | *

8 | * 灰码用户关联表 服务类 9 | *

10 | * 11 | * @author lvyx 12 | * @since 2022-02-13 13 | */ 14 | public interface CommunityGreyCodeService extends IService { 15 | 16 | /** 17 | * 根据用户id查询黄码 18 | * @param userId 用户id 19 | * @return com.lvyx.community.entity.CommunityRedCode 20 | * @author lvyx 21 | * @since 2022/4/14 8:40 22 | **/ 23 | CommunityGreyCode findByUserId(String userId); 24 | 25 | /** 26 | * 判断用户是否已经绑定灰码 27 | * @param userId 用户id 28 | * @return java.lang.Boolean 29 | * @author lvyx 30 | * @since 2022/4/28 13:44 31 | **/ 32 | Boolean isExist(String userId); 33 | 34 | /** 35 | * 失效灰码 36 | * @param userId 用户id 37 | * @author lvyx 38 | * @since 2022/4/28 13:56 39 | **/ 40 | void invalidate(String userId); 41 | 42 | /** 43 | * 根据单元id查询数量 44 | * @param unitId 单元id 45 | * @return int 46 | * @author lvyx 47 | * @since 2022/5/5 23:04 48 | **/ 49 | int selectCountByUintId(String unitId); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/service/CommunityRedCodeService.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.service; 2 | 3 | import com.lvyx.community.entity.CommunityRedCode; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | /** 7 | *

8 | * 红码用户关联表 服务类 9 | *

10 | * 11 | * @author lvyx 12 | * @since 2022-02-13 13 | */ 14 | public interface CommunityRedCodeService extends IService { 15 | 16 | /** 17 | * 判断用户是否在红码表中 18 | * @param userId 用户id 19 | * @return java.lang.Boolean 20 | * @author lvyx 21 | * @since 2022/4/14 8:40 22 | **/ 23 | Boolean isExist(String userId); 24 | 25 | 26 | /** 27 | * 根据用户id查询红码 28 | * @param userId 用户id 29 | * @return com.lvyx.community.entity.CommunityRedCode 30 | * @author lvyx 31 | * @since 2022/4/14 8:40 32 | **/ 33 | CommunityRedCode findByUserId(String userId); 34 | 35 | /** 36 | * 失效红码 37 | * @param userId 用户id 38 | * @author lvyx 39 | * @since 2022/4/28 13:56 40 | **/ 41 | void invalidate(String userId); 42 | 43 | /** 44 | * 根据单元id查询数量 45 | * @param unitId 单元id 46 | * @return int 47 | * @author lvyx 48 | * @since 2022/5/5 23:04 49 | **/ 50 | int selectCountByUintId(String unitId); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/QrCodeFactory/GreenQrCode.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.QrCodeFactory; 2 | 3 | import cn.hutool.extra.qrcode.QrCodeUtil; 4 | import cn.hutool.extra.qrcode.QrConfig; 5 | import cn.hutool.json.JSONUtil; 6 | 7 | import java.awt.*; 8 | import java.awt.image.BufferedImage; 9 | import java.io.File; 10 | import java.util.Map; 11 | 12 | /** 13 | *

14 | * 绿色健康码 15 | *

16 | * 17 | * @author lvyx 18 | * @since 2022-04-05 21:32:28 19 | */ 20 | public class GreenQrCode extends QrCodeBase { 21 | 22 | /** 23 | * 创建绿色二维码 24 | * @param resultMap 返回参数 25 | * @return java.awt.image.BufferedImage 26 | * @author lvyx 27 | * @since 2022/4/5 21:37 28 | **/ 29 | @Override 30 | public BufferedImage createQrCode(Map resultMap) { 31 | QrConfig config = new QrConfig(300, 300); 32 | // 设置边距,既二维码和背景之间的边距 33 | config.setMargin(3); 34 | // 设置前景色,既二维码颜色(绿色) 35 | config.setForeColor(new Color(0, 169, 78)); 36 | // 设置背景色(白色) 37 | config.setBackColor(Color.white.getRGB()); 38 | // 设置logo,既二维码中间的图片 39 | config.setImg(new File(systemProperties.getLogoPath())); 40 | // 生成二维码到文件,也可以到流 41 | return QrCodeUtil.generate(JSONUtil.toJsonStr(resultMap), config); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/service/CommunityYellowCodeService.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.lvyx.community.entity.CommunityYellowCode; 5 | 6 | /** 7 | *

8 | * 黄码用户关联表 服务类 9 | *

10 | * 11 | * @author lvyx 12 | * @since 2022-03-20 13 | */ 14 | public interface CommunityYellowCodeService extends IService { 15 | 16 | /** 17 | * 根据用户id查询黄码 18 | * @param userId 用户id 19 | * @return com.lvyx.community.entity.CommunityRedCode 20 | * @author lvyx 21 | * @since 2022/4/14 8:40 22 | **/ 23 | CommunityYellowCode findByUserId(String userId); 24 | 25 | 26 | /** 27 | * 判断用户是否已经绑定黄码 28 | * @param userId 用户id 29 | * @return java.lang.Boolean 30 | * @author lvyx 31 | * @since 2022/4/28 13:44 32 | **/ 33 | Boolean isExist(String userId); 34 | 35 | /** 36 | * 失效黄码 37 | * @param userId 用户id 38 | * @author lvyx 39 | * @since 2022/4/28 13:56 40 | **/ 41 | void invalidate(String userId); 42 | 43 | /** 44 | * 根据单元id查询数量 45 | * @param unitId 单元id 46 | * @return int 47 | * @author lvyx 48 | * @since 2022/5/5 23:04 49 | **/ 50 | int selectCountByUintId(String unitId); 51 | } 52 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/QrCodeFactory/GrayQrCode.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.QrCodeFactory; 2 | 3 | import cn.hutool.extra.qrcode.QrCodeUtil; 4 | import cn.hutool.extra.qrcode.QrConfig; 5 | import cn.hutool.json.JSONUtil; 6 | 7 | import java.awt.*; 8 | import java.awt.image.BufferedImage; 9 | import java.io.File; 10 | import java.util.Map; 11 | 12 | /** 13 | *

14 | * 灰色健康码 15 | *

16 | * 17 | * @author lvyx 18 | * @since 2022-04-05 21:32:28 19 | */ 20 | public class GrayQrCode extends QrCodeBase { 21 | 22 | 23 | /** 24 | * 创建灰色二维码 25 | * @param resultMap 返回参数 26 | * @return java.awt.image.BufferedImage 27 | * @author lvyx 28 | * @since 2022/4/5 21:37 29 | **/ 30 | @Override 31 | public BufferedImage createQrCode(Map resultMap) { 32 | QrConfig config = new QrConfig(300, 300); 33 | // 设置边距,既二维码和背景之间的边距 34 | config.setMargin(3); 35 | // 设置前景色,既二维码颜色(灰色) 36 | config.setForeColor(new Color(226, 227, 229)); 37 | // 设置背景色(白色) 38 | config.setBackColor(Color.white.getRGB()); 39 | // 设置logo,既二维码中间的图片 40 | config.setImg(new File(systemProperties.getLogoPath())); 41 | // 生成二维码到文件,也可以到流 42 | return QrCodeUtil.generate(JSONUtil.toJsonStr(resultMap), config); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/QrCodeFactory/RedQrCode.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.QrCodeFactory; 2 | 3 | import cn.hutool.extra.qrcode.QrCodeUtil; 4 | import cn.hutool.extra.qrcode.QrConfig; 5 | import cn.hutool.json.JSONUtil; 6 | 7 | import java.awt.*; 8 | import java.awt.image.BufferedImage; 9 | import java.io.File; 10 | import java.util.Map; 11 | 12 | /** 13 | *

14 | * 红色健康码 15 | *

16 | * 17 | * @author lvyx 18 | * @since 2022-04-05 21:32:28 19 | */ 20 | public class RedQrCode extends QrCodeBase { 21 | 22 | 23 | /** 24 | * 创建红色二维码 25 | * @param resultMap 返回参数 26 | * @return java.awt.image.BufferedImage 27 | * @author lvyx 28 | * @since 2022/4/5 21:37 29 | **/ 30 | @Override 31 | public BufferedImage createQrCode(Map resultMap) { 32 | QrConfig config = new QrConfig(300, 300); 33 | // 设置边距,既二维码和背景之间的边距 34 | config.setMargin(3); 35 | // 设置前景色,既二维码颜色(红色) 36 | config.setForeColor(new Color(229, 62, 49)); 37 | // 设置背景色(白色) 38 | config.setBackColor(Color.white.getRGB()); 39 | // 设置logo,既二维码中间的图片 40 | config.setImg(new File(systemProperties.getLogoPath())); 41 | // 生成二维码到文件,也可以到流 42 | return QrCodeUtil.generate(JSONUtil.toJsonStr(resultMap), config); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/bo/RegisterBO.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.bo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | *

10 | * 注册请求参数 11 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-01-23 13:28:35 15 | */ 16 | @Data 17 | public class RegisterBO implements Serializable { 18 | 19 | @ApiModelProperty("登录名称") 20 | private String loginName; 21 | 22 | @ApiModelProperty("昵称") 23 | private String nickName; 24 | 25 | @ApiModelProperty("真实姓名") 26 | private String realName; 27 | 28 | @ApiModelProperty("密码") 29 | private String password; 30 | 31 | @ApiModelProperty("性别(0:女,1:男)") 32 | private Integer sex; 33 | 34 | @ApiModelProperty("地址") 35 | private String address; 36 | 37 | @ApiModelProperty("固定电话") 38 | private String tel; 39 | 40 | @ApiModelProperty("电话") 41 | private String mobil; 42 | 43 | @ApiModelProperty("邮箱") 44 | private String email; 45 | 46 | @ApiModelProperty("确认密码") 47 | private String confirmPassword; 48 | 49 | @ApiModelProperty("验证码id") 50 | private String captchaId; 51 | 52 | @ApiModelProperty("验证码用途") 53 | private String purpose; 54 | 55 | @ApiModelProperty("验证码id") 56 | private String captcha; 57 | 58 | } 59 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/config/SystemProperties.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | *

9 | * 系统配置 10 | *

11 | * 12 | * @author lvyx 13 | * @since 2022-01-31 16:59:21 14 | */ 15 | @Component 16 | @ConfigurationProperties( 17 | prefix = "lvyx.system" 18 | ) 19 | @Data 20 | public class SystemProperties { 21 | 22 | /** 23 | * 文件服务器地址 24 | */ 25 | private String filePath = "D:/CommunitySystem"; 26 | 27 | /** 28 | * 上传文件跟目录 29 | */ 30 | private String uploadModule = "UPLOAD"; 31 | 32 | /** 33 | * 静态资源根目录 34 | */ 35 | private String staticPath = "STATIC"; 36 | 37 | /** 38 | * 社区logo路径 39 | **/ 40 | private String logoPath = "D:/CommunitySystem/STATIC/logo/logo.png"; 41 | 42 | /** 43 | * 系统开发环境 44 | **/ 45 | private String active = "test"; 46 | 47 | /** 48 | * 系统测试环境验证码 49 | **/ 50 | private String testCaptchaCode = "0715"; 51 | 52 | /** 53 | * 系统重置默认密码 54 | **/ 55 | private String systemPassword = "Lv@12345"; 56 | 57 | /** 58 | * 是否开启验证码登录 59 | **/ 60 | private Boolean isCaptcha = true; 61 | } 62 | -------------------------------------------------------------------------------- /community/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | community_sys 7 | com.lvyx.community 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | com.lvyx.community.community 13 | community 14 | jar 15 | 0.0.1-SNAPSHOT 16 | 17 | 18 | 8 19 | 8 20 | 21 | 22 | 23 | 24 | 25 | com.lvyx.community.mail 26 | mail 27 | 0.0.1-SNAPSHOT 28 | 29 | 30 | 31 | com.google.zxing 32 | core 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/mapper/RoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lvyx.author.entity.Resource; 5 | import com.lvyx.author.entity.Role; 6 | import com.lvyx.author.entity.User; 7 | import com.lvyx.author.vo.CommunityRoleVo; 8 | import org.apache.ibatis.annotations.Mapper; 9 | import org.apache.ibatis.annotations.Param; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | *

15 | * 用户角色表 Mapper 接口 16 | *

17 | * 18 | * @author lvyx 19 | * @since 2021-12-23 20 | */ 21 | @Mapper 22 | public interface RoleMapper extends BaseMapper { 23 | 24 | /** 25 | * 根据用户信息查询角色权限; 26 | * @param user 用户信息 27 | * @return java.util.List 28 | * @author lvyx 29 | * @since 2021/12/24 10:09 30 | **/ 31 | List getRoleIdsByUser(@Param("user") User user); 32 | 33 | 34 | /** 35 | * 根据角色id查询资源信息 36 | * @param userId 用户id 37 | * @return java.util.List 38 | * @author lvyx 39 | * @since 2022/5/4 17:19 40 | **/ 41 | List findUserResource(@Param("userId") String userId, @Param("resourceType") String resourceType); 42 | 43 | 44 | List findCommunityRole(@Param("label") String label, @Param("name") String name); 45 | } 46 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/shiro/core/ShiroDbRealm.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.shiro.core; 2 | 3 | 4 | import org.apache.shiro.authc.AuthenticationInfo; 5 | import org.apache.shiro.authc.AuthenticationToken; 6 | import org.apache.shiro.authz.AuthorizationInfo; 7 | import org.apache.shiro.realm.AuthorizingRealm; 8 | import org.apache.shiro.subject.PrincipalCollection; 9 | 10 | import javax.annotation.PostConstruct; 11 | 12 | 13 | /** 14 | *

15 | * 自定义shiro认证抽象类 16 | *

17 | * 18 | * @author lvyx 19 | * @since 2021-12-23 20 | */ 21 | public abstract class ShiroDbRealm extends AuthorizingRealm { 22 | 23 | /** 24 | * 认证 25 | * @param authcToken token对象 26 | * @return org.apache.shiro.authc.AuthenticationInfo 认证信息 27 | * @author lvyx 28 | * @since 2021/12/23 19:30 29 | **/ 30 | @Override 31 | public abstract AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authcToken) ; 32 | 33 | /** 34 | * 鉴权 35 | * @param principals 令牌 36 | * @return org.apache.shiro.authz.AuthorizationInfo 认证信息 37 | * @author lvyx 38 | * @since 2021/12/23 19:26 39 | **/ 40 | @Override 41 | public abstract AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals); 42 | 43 | /** 44 | * 密码匹配器 45 | * @author lvyx 46 | * @since 2022/1/10 15:02 47 | **/ 48 | @PostConstruct 49 | public abstract void initCredentialsMatcher(); 50 | 51 | } -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/enums/UserTypeEnum.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.enums; 2 | 3 | /** 4 | *

5 | * 用户类型类型值 6 | *

7 | * 8 | * @author lvyx 9 | * @date 2021-12-28 09:44:23 10 | */ 11 | public enum UserTypeEnum { 12 | 13 | /** 14 | * 社区用户 15 | * @since 2021/12/28 9:51 16 | **/ 17 | COMMUNITY_USER(0,"社区用户"), 18 | 19 | /** 20 | * 管理员 21 | * @since 2021/12/28 9:51 22 | **/ 23 | SYSTEM_USER(1,"管理员"), 24 | 25 | /** 26 | * 其他用户 27 | * @since 2021/12/28 9:51 28 | **/ 29 | OTHER_USER(2,"其他用户"), 30 | 31 | /** 32 | * 其他用户 33 | * @since 2021/12/28 9:51 34 | **/ 35 | SYSTEM_OTHER_USER(3,"管理员和其他用户"), 36 | ; 37 | 38 | private Integer code; 39 | private String value; 40 | 41 | UserTypeEnum(Integer code, String value){ 42 | this.code = code; 43 | this.value = value; 44 | } 45 | 46 | public static String isSuccessEnum(Integer code){ 47 | UserTypeEnum[] array = values(); 48 | for(UserTypeEnum arr: array){ 49 | if(arr.code.equals(code)){ 50 | return arr.value; 51 | } 52 | } 53 | return null; 54 | } 55 | 56 | public Integer getCode() { 57 | return code; 58 | } 59 | 60 | public String getValue() { 61 | return value; 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/utils/ApplicationContextUtils.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.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 | * 10 | *

11 | * sping上下文工具 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2021/12/7 11:05 16 | **/ 17 | @Component 18 | public class ApplicationContextUtils implements ApplicationContextAware { 19 | 20 | private static ApplicationContext context; 21 | 22 | @Override 23 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { 24 | context=applicationContext; 25 | } 26 | 27 | /** 28 | * 根据Bean的名称获取实例对象 29 | * @param beanName Bean的名称 30 | * @return java.lang.Object 31 | * @author lvyx 32 | * @since 2021/12/7 11:06 33 | **/ 34 | public static Object getBean(String beanName){ 35 | return context.getBean(beanName); 36 | } 37 | 38 | /** 39 | * 根据Bean的类型得到实例对象 40 | * @param clazz Bean的类型 41 | * @return java.lang.Object 42 | * @author lvyx 43 | * @since 2021/12/10 9:40 44 | **/ 45 | public static T getBean(Class clazz){ 46 | return (T) context.getBean(clazz); 47 | } 48 | } -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/enums/ResultCodeEnum.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.enums; 2 | 3 | /** 4 | *

5 | * 返回结果枚举类 6 | *

7 | * 8 | * @author lvyx 9 | * @date 2021-12-28 09:44:23 10 | */ 11 | public enum ResultCodeEnum { 12 | 13 | /** 14 | * 没有登录 15 | * @since 2021/12/28 9:51 16 | **/ 17 | NO_LOGIN(401,"没有登录"), 18 | 19 | /** 20 | * 没有权限 21 | * @since 2021/12/28 9:51 22 | **/ 23 | NO_AUTHORITY(403,"没有权限"), 24 | 25 | /** 26 | * 资源不存在 27 | * @since 2021/12/28 9:51 28 | **/ 29 | NO_RESSOURCE(404,"资源不存在"), 30 | 31 | /** 32 | * 资源不存在 33 | * @since 2021/12/28 9:51 34 | **/ 35 | OTHER(500,"服务器错误"), 36 | 37 | ; 38 | 39 | private Integer code; 40 | private String value; 41 | 42 | ResultCodeEnum(Integer code, String value){ 43 | this.code = code; 44 | this.value = value; 45 | } 46 | 47 | public static String isSuccessEnum(Integer code){ 48 | ResultCodeEnum[] array = values(); 49 | for(ResultCodeEnum arr: array){ 50 | if(arr.code.equals(code)){ 51 | return arr.value; 52 | } 53 | } 54 | return null; 55 | } 56 | 57 | public Integer getCode() { 58 | return code; 59 | } 60 | 61 | public String getValue() { 62 | return value; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/QrCodeFactory/QrCodeFactory.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.QrCodeFactory; 2 | 3 | import com.lvyx.commons.enums.QrCodeColorEnum; 4 | 5 | import java.awt.image.BufferedImage; 6 | import java.util.Map; 7 | 8 | /** 9 | *

10 | * 二维码工厂类 11 | *

12 | * 13 | * @author lvyx 14 | * @since 2022-04-05 21:41:17 15 | */ 16 | public class QrCodeFactory { 17 | 18 | /** 19 | * 构建二维码 20 | * @param qrCodeColorEnum 二维码类型 21 | * @param resultMap 携带参数 22 | * @return java.awt.image.BufferedImage 23 | * @author lvyx 24 | * @since 2022/4/5 21:54 25 | **/ 26 | public static BufferedImage getQrCode(QrCodeColorEnum qrCodeColorEnum, Map resultMap){ 27 | QrCodeBase qrCodeBase = null; 28 | if (qrCodeColorEnum.getValue().equals(QrCodeColorEnum.GREEN.getValue())){ 29 | qrCodeBase = new GreenQrCode(); 30 | }else if (qrCodeColorEnum.getValue().equals(QrCodeColorEnum.RED.getValue())){ 31 | qrCodeBase = new RedQrCode(); 32 | }else if (qrCodeColorEnum.getValue().equals(QrCodeColorEnum.YELLOW.getValue())){ 33 | qrCodeBase = new YellowQrCode(); 34 | }else if (qrCodeColorEnum.getValue().equals(QrCodeColorEnum.GRAY.getValue())){ 35 | qrCodeBase = new GrayQrCode(); 36 | } 37 | return qrCodeBase.createQrCode(resultMap); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/service/CommunityUnitService.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.lvyx.community.entity.CommunityUnit; 5 | import com.lvyx.community.vo.InfoVo; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 小区-单元 服务类 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2022-02-01 16 | */ 17 | public interface CommunityUnitService extends IService { 18 | 19 | /** 20 | * 添加栋信息 21 | * @param unit 栋信息 22 | * @return CommunityUnit 23 | * @author lvyx 24 | * @since 2022/2/4 15:31 25 | **/ 26 | CommunityUnit add(CommunityUnit unit); 27 | 28 | /** 29 | * 查询栋 30 | * @param parentId 父级id 31 | * @return List 32 | * @author lvyx 33 | * @since 2022/2/4 17:05 34 | **/ 35 | List find(String parentId); 36 | 37 | /** 38 | * 根据栋id查询单元详情 39 | * @param buindingId 栋id 40 | * @return java.util.List 41 | * @author lvyx 42 | * @since 2022/2/7 15:51 43 | **/ 44 | List findInfo(String buindingId); 45 | 46 | /** 47 | * 查询单元内人口 48 | * @param unitId 单元id 49 | * @return int 50 | * @author lvyx 51 | * @since 2022/5/5 22:55 52 | **/ 53 | int selectBuildingUserCount(String unitId); 54 | 55 | 56 | 57 | } 58 | -------------------------------------------------------------------------------- /mail/src/main/resources/mapper/CommunityMessageMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 29 | 30 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/QrCodeFactory/YellowQrCode.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.QrCodeFactory; 2 | 3 | import cn.hutool.extra.qrcode.QrCodeUtil; 4 | import cn.hutool.extra.qrcode.QrConfig; 5 | import cn.hutool.json.JSONUtil; 6 | import lombok.extern.slf4j.Slf4j; 7 | 8 | import java.awt.*; 9 | import java.awt.image.BufferedImage; 10 | import java.io.File; 11 | import java.util.Map; 12 | 13 | /** 14 | *

15 | * 黄色健康码 16 | *

17 | * 18 | * @author lvyx 19 | * @since 2022-04-05 21:32:28 20 | */ 21 | @Slf4j 22 | public class YellowQrCode extends QrCodeBase { 23 | 24 | 25 | /** 26 | * 创建黄色二维码 27 | * @param resultMap 返回参数 28 | * @return java.awt.image.BufferedImage 29 | * @author lvyx 30 | * @since 2022/4/5 21:37 31 | **/ 32 | @Override 33 | public BufferedImage createQrCode(Map resultMap) { 34 | QrConfig config = new QrConfig(300, 300); 35 | // 设置边距,既二维码和背景之间的边距 36 | config.setMargin(3); 37 | // 设置前景色,既二维码颜色(黄色) 38 | config.setForeColor(new Color(248, 192, 33)); 39 | // 设置背景色(白色) 40 | config.setBackColor(Color.white.getRGB()); 41 | // 设置logo,既二维码中间的图片 42 | log.info("二维码中间的图片:{}", systemProperties.getLogoPath()); 43 | config.setImg(new File(systemProperties.getLogoPath())); 44 | // 生成二维码到文件,也可以到流 45 | return QrCodeUtil.generate(JSONUtil.toJsonStr(resultMap), config); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /web/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | Spring Boot Version: ${spring-boot.version} 2 | 3 | // _ooOoo_ // 4 | // o8888888o // 5 | // 88" . "88 // 6 | // (| ^_^ |) // 7 | // O\ = /O // 8 | // ____/`---'\____ // 9 | // .' \\| |// `. // 10 | // / \\||| : |||// \ // 11 | // / _||||| -:- |||||- \ // 12 | // | | \\\ - /// | | // 13 | // | \_| ''\---/'' | | // 14 | // \ .-\__ `-` ___/-. / // 15 | // ___`. .' /--.--\ `. . ___ // 16 | // ."" '< `.___\_<|>_/___.' >'"". // 17 | // | | : `- \`.;`\ _ /`;.`/ - ` : | | // 18 | // \ \ `-. \_ __\ /__ _/ .-` / / // 19 | // ========`-.____`-.___\_____/___.-`____.-'======== // 20 | // `=---=' // 21 | // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // 22 | // 佛祖保佑 永不宕机 永无BUG // 23 | 24 | -------------------------------------------------------------------------------- /web/src/main/java/com/lvyx/factory/MyExceptionFactory.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.factory; 2 | 3 | import com.lvyx.commons.enums.ResultCodeEnum; 4 | import com.lvyx.commons.result.Result; 5 | import com.lvyx.commons.result.impl.ErrorResult; 6 | import lombok.extern.slf4j.Slf4j; 7 | import org.apache.shiro.authc.IncorrectCredentialsException; 8 | import org.apache.shiro.authc.UnknownAccountException; 9 | import org.apache.shiro.authz.AuthorizationException; 10 | import org.apache.shiro.session.UnknownSessionException; 11 | 12 | /** 13 | *

14 | * 异常简易处理工厂 15 | *

16 | * 17 | * @author lvyx 18 | * @since 2021-12-06 16:31:31 19 | */ 20 | @Slf4j 21 | public class MyExceptionFactory { 22 | 23 | public static Result getResult(Exception e, String methodName){ 24 | log.error(e.getMessage(), e); 25 | if (e instanceof UnknownAccountException){ 26 | return new ErrorResult<>(ResultCodeEnum.NO_LOGIN.getCode(), "用户不存在"); 27 | }else if (e instanceof IncorrectCredentialsException){ 28 | return new ErrorResult<>(ResultCodeEnum.NO_LOGIN.getCode(), "用户名或密码错误"); 29 | }else if (e instanceof AuthorizationException){ 30 | return new ErrorResult<>(ResultCodeEnum.NO_AUTHORITY.getCode(), "权限不足"); 31 | }else if (e instanceof UnknownSessionException) { 32 | return new ErrorResult<>(ResultCodeEnum.NO_LOGIN.getCode(), "请重新登录!"); 33 | } else{ 34 | return new ErrorResult<>(ResultCodeEnum.OTHER.getCode(), e.getMessage(), e); 35 | } 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /author/src/main/resources/mapper/RoleResourceMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 30 | 31 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/service/CommunityExceptionService.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.github.pagehelper.PageInfo; 5 | import com.lvyx.commons.exception.LExceException; 6 | import com.lvyx.community.bo.QueryExceptionBo; 7 | import com.lvyx.community.entity.CommunityException; 8 | import com.lvyx.community.vo.ExceptionVo; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | /** 12 | *

13 | * 社区异常表 服务类 14 | *

15 | * 16 | * @author lvyx 17 | * @since 2022-05-02 18 | */ 19 | public interface CommunityExceptionService extends IService { 20 | 21 | /** 22 | * 查询异常列表 23 | * @param pageNum 页码 24 | * @param pageSize 页大小 25 | * @param queryExceptionBo 异常查询条件 26 | * @return com.github.pagehelper.PageInfo 27 | * @author lvyx 28 | * @since 2022/5/2 15:18 29 | **/ 30 | PageInfo findByQuery(Integer pageNum, Integer pageSize, QueryExceptionBo queryExceptionBo); 31 | 32 | /** 33 | * 修改异常状态 34 | * @param id 异常id 35 | * @param status 异常状态 36 | * @param result 处理结果 37 | * @param isTransferredCode 是否转码 38 | * @author lvyx 39 | * @since 2022/5/3 12:50 40 | **/ 41 | @Transactional(rollbackFor = Exception.class) 42 | void updateStatus(String id, Integer status, String result, String isTransferredCode) throws LExceException; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/enums/ShiroEnum.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.enums; 2 | 3 | /** 4 | *

5 | * 返回结果枚举类 6 | *

7 | * 8 | * @author lvyx 9 | * @date 2021-12-28 09:44:23 10 | */ 11 | public enum ShiroEnum { 12 | 13 | /** 14 | * 系统后台 15 | * @since 2021/12/28 9:50 16 | **/ 17 | PLATFORM_MGT(1,"platform_mgt"), 18 | 19 | /** 20 | * 系统前台 21 | * @since 2021/12/28 10:43 22 | **/ 23 | OPEN_API(2, "open_api"), 24 | 25 | /** 26 | * 密码登录 27 | * @since 2021/12/28 10:43 28 | **/ 29 | LOGIN_TYPE_PASSWORD(3, "login_type_password"), 30 | 31 | /** 32 | * 快速登录 33 | * @since 2021/12/28 10:44 34 | **/ 35 | LOGIN_TYPE_QUICK(4, "login_type_quick"), 36 | 37 | /** 38 | * pc密码登录 39 | * @since 2021/12/28 10:45 40 | **/ 41 | LOGIN_TYPE_PASSWORD_PC(5, "login_type_password_pc") 42 | 43 | ; 44 | 45 | private Integer code; 46 | private String value; 47 | 48 | ShiroEnum(Integer code, String value){ 49 | this.code = code; 50 | this.value = value; 51 | } 52 | 53 | public static String isSuccessEnum(Integer code){ 54 | ShiroEnum[] array = values(); 55 | for(ShiroEnum arr: array){ 56 | if(arr.code.equals(code)){ 57 | return arr.value; 58 | } 59 | } 60 | return null; 61 | } 62 | 63 | public Integer getCode() { 64 | return code; 65 | } 66 | 67 | public String getValue() { 68 | return value; 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/service/UserRoleService.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.lvyx.author.entity.UserRole; 5 | import org.springframework.transaction.annotation.Transactional; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 用户角色关联表 服务类 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2021-12-23 16 | */ 17 | public interface UserRoleService extends IService { 18 | 19 | /** 20 | * 角色绑定 21 | * @param userId 用户id 22 | * @param roleIds 角色id 23 | * @author lvyx 24 | * @since 2022/2/8 19:20 25 | **/ 26 | @Transactional(rollbackFor = Exception.class) 27 | void bind(String userId, List roleIds); 28 | 29 | /** 30 | * 激活角色 31 | * @param userId 用户id 32 | * @param label 角色标签 33 | * @author lvyx 34 | * @since 2022/5/4 18:01 35 | **/ 36 | void activeRole(String userId, String... label); 37 | 38 | /** 39 | * 根据角色id删除关联关系 40 | * @param roleId 角色id 41 | * @author lvyx 42 | * @since 2022/5/5 2:15 43 | **/ 44 | @Transactional(rollbackFor = Exception.class) 45 | void deleteByRoleId(String roleId); 46 | 47 | 48 | /** 49 | * 查询用户角色信息 50 | * @param userId userId 51 | * @param label 角色标签 52 | * @return java.util.List 53 | * @author lvyx 54 | * @since 2022/5/5 15:17 55 | **/ 56 | List findUserRole(String userId, String label); 57 | 58 | 59 | 60 | 61 | } 62 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/encrypt_decrypt/factory/LEncryptDecryptFactory.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.encrypt_decrypt.factory; 2 | 3 | import com.lvyx.commons.config.EncryptDencryptProperties; 4 | import com.lvyx.commons.encrypt_decrypt.factory.service.LEncryptDecryptService; 5 | import org.springframework.stereotype.Component; 6 | 7 | import javax.annotation.Resource; 8 | import java.util.Map; 9 | import java.util.concurrent.ConcurrentHashMap; 10 | 11 | /** 12 | *

13 | * 自定义加密解密工厂 14 | * 目前系统支持的对称加密有:AES 15 | * 目前系统支持的非对称加密有:RSA 16 | *

17 | * 18 | * @author lvyx 19 | * @since 2021-12-10 13:17:34 20 | */ 21 | @Component 22 | public class LEncryptDecryptFactory { 23 | 24 | @Resource 25 | private EncryptDencryptProperties encryptDencryptProperties; 26 | 27 | @Resource 28 | private Map strategys = new ConcurrentHashMap(2); 29 | 30 | public LEncryptDecryptFactory() { 31 | } 32 | 33 | /** 34 | * 得到自定义加密解密服务 35 | * @return com.lvyx.shiro_boot02.annotation.encrypt_decrype.factory.service.LEncryptDecryptService 36 | * @author lvyx 37 | * @since 2021/12/10 13:43 38 | **/ 39 | public LEncryptDecryptService getEncryptDecryptService(){ 40 | String strategy = encryptDencryptProperties.getEncryptType(); 41 | LEncryptDecryptService lEncryptDecryptService = this.strategys.get(strategy); 42 | if (lEncryptDecryptService == null){ 43 | throw new RuntimeException("加密方式不存在!"); 44 | } 45 | return lEncryptDecryptService; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /mail/src/main/java/com/lvyx/mail/service/impl/CommunityMessageEmailServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.mail.service.impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; 4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 5 | import com.lvyx.mail.entity.CommunityMessageEmail; 6 | import com.lvyx.mail.mapper.CommunityMessageEmailMapper; 7 | import com.lvyx.mail.service.CommunityMessageEmailService; 8 | import com.lvyx.mail.vo.UserMessageVo; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | *

15 | * 社区邮件信息表 服务实现类 16 | *

17 | * 18 | * @author lvyx 19 | * @since 2022-05-01 20 | */ 21 | @Service 22 | public class CommunityMessageEmailServiceImpl extends ServiceImpl implements CommunityMessageEmailService { 23 | 24 | /** 25 | * 查询用户的邮件信息 26 | * 27 | * @param userIds 用户ids 28 | * @return java.util.List 29 | * @author lvyx 30 | * @since 2022/5/1 15:29 31 | **/ 32 | @Override 33 | public List findByUserIds(List userIds) { 34 | return this.baseMapper.findByUserIds(userIds); 35 | } 36 | 37 | @Override 38 | public void updateEmailIsEnable(String emailId, Integer isEnable) { 39 | LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper<>(); 40 | wrapper.eq(CommunityMessageEmail::getId, emailId) 41 | .set(CommunityMessageEmail::getIsEnable, isEnable); 42 | this.update(wrapper); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/enums/RoleTypeEnum.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.enums; 2 | 3 | /** 4 | *

5 | * 角色类型枚举 6 | *

7 | * 8 | * @author lvyx 9 | * @date 2021-12-31 09:59:24 10 | */ 11 | public enum RoleTypeEnum { 12 | 13 | /** 14 | * 社区居民 15 | * @since 2021/12/31 10:08 16 | **/ 17 | USER("user", "社区居民"), 18 | 19 | 20 | /** 21 | * 系统管理员 22 | * @since 2021/12/31 10:08 23 | **/ 24 | ADMIN("admin", "系统管理员"), 25 | 26 | /** 27 | * 系统管理员 28 | * @since 2021/12/31 10:08 29 | **/ 30 | COMMUNITY_ADMIN("communityAdmin", "社区管理员"), 31 | 32 | /** 33 | * 用户功能 34 | * @since 2021/12/31 10:08 35 | **/ 36 | USER_FUNCTION("userFunction", "用户功能"), 37 | 38 | /** 39 | * 社区管理员功能 40 | * @since 2021/12/31 10:08 41 | **/ 42 | COMMUNITY_FUNCTION("communityFunction", "社区管理员功能"), 43 | 44 | /** 45 | * 系统管理员功能 46 | * @since 2021/12/31 10:08 47 | **/ 48 | ADMIN_FUNCTION("adminFunction", "系统管理员功能"), 49 | 50 | /** 51 | * 社区管理角色 52 | * @since 2021/12/31 10:08 53 | **/ 54 | COMMUNITY("community", "社区管理角色"), 55 | 56 | ; 57 | 58 | 59 | private final String value; 60 | private final String name; 61 | 62 | RoleTypeEnum(String value, String name) { 63 | this.value = value; 64 | this.name = name; 65 | } 66 | 67 | RoleTypeEnum(String value) { 68 | this.value = value; 69 | this.name = null; 70 | } 71 | 72 | public String getValue() { 73 | return value; 74 | } 75 | 76 | public String getName() { 77 | return name; 78 | } 79 | } -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/service/CommunityBuildingService.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.github.pagehelper.PageInfo; 5 | import com.lvyx.community.entity.CommunityBuilding; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 小区-栋 服务类 12 | *

13 | * 14 | * @author lvyx 15 | * @since 2022-02-01 16 | */ 17 | public interface CommunityBuildingService extends IService { 18 | 19 | /** 20 | * 添加栋信息 21 | * @param building 栋信息 22 | * @return CommunityBuilding 23 | * @author lvyx 24 | * @since 2022/2/4 15:31 25 | **/ 26 | CommunityBuilding add(CommunityBuilding building); 27 | 28 | /** 29 | * 查询栋 30 | * @param parentId 父级id 31 | * @return java.util.List 32 | * @author lvyx 33 | * @since 2022/2/4 17:05 34 | **/ 35 | List find(String parentId); 36 | 37 | /** 38 | * 查询所有栋 39 | * @return java.util.List 40 | * @author lvyx 41 | * @since 2022/2/5 19:43 42 | **/ 43 | List findAll(); 44 | 45 | /** 46 | * 分页查询期下的所有栋 47 | * @param periodId 期id 48 | * @param pageNum 起始页 49 | * @param pageSize 页面大小 50 | * @return java.util.List 51 | * @author lvyx 52 | * @since 2022/2/7 15:14 53 | **/ 54 | PageInfo findAllByPeriodId(String periodId, Integer pageNum, Integer pageSize); 55 | 56 | 57 | 58 | 59 | } 60 | -------------------------------------------------------------------------------- /author/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | community_sys 7 | com.lvyx.community 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | com.lvyx.community.author 13 | author 14 | jar 15 | 16 | 17 | 8 18 | 8 19 | 20 | 21 | 22 | 23 | commons-lang 24 | commons-lang 25 | 2.6 26 | 27 | 28 | 29 | com.lvyx.community.community 30 | community 31 | 0.0.1-SNAPSHOT 32 | 33 | 34 | 35 | com.auth0 36 | java-jwt 37 | ${jwt.version} 38 | 39 | 40 | io.jsonwebtoken 41 | jjwt 42 | 0.9.1 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/encrypt_decrypt/factory/service/impl/RSAEncryptDecryptServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.encrypt_decrypt.factory.service.impl; 2 | 3 | import cn.hutool.crypto.asymmetric.KeyType; 4 | import cn.hutool.crypto.asymmetric.RSA; 5 | import com.lvyx.commons.config.EncryptDencryptProperties; 6 | import com.lvyx.commons.encrypt_decrypt.factory.service.LEncryptDecryptService; 7 | import org.springframework.stereotype.Component; 8 | 9 | import javax.annotation.Resource; 10 | import java.nio.charset.StandardCharsets; 11 | 12 | /** 13 | *

14 | * RSA加密解密 15 | *

16 | * 17 | * @author lvyx 18 | * @since 2021-12-10 13:26:42 19 | */ 20 | @Component("RSA") 21 | public class RSAEncryptDecryptServiceImpl implements LEncryptDecryptService { 22 | 23 | @Resource 24 | private EncryptDencryptProperties.RsaKey rsaKey; 25 | 26 | 27 | /** 28 | * 加密 29 | * @param content 被加密字符串 30 | * @return java.lang.String 加密后字符串 31 | * @author lvyx 32 | * @since 2021/12/10 13:24 33 | **/ 34 | @Override 35 | public String encrypt(String content) { 36 | // 使用公钥加密 37 | RSA rsa = new RSA(null, rsaKey.getPublicKeyByBase64()); 38 | return rsa.encryptBase64(content, StandardCharsets.UTF_8, KeyType.PublicKey); 39 | } 40 | 41 | /** 42 | * 解密 43 | * @param content 加密的字符串 44 | * @return java.lang.String 原字符串 45 | * @author lvyx 46 | * @since 2021/12/10 13:25 47 | **/ 48 | @Override 49 | public String decrypt(String content) { 50 | // 使用私钥解密 51 | RSA rsa = new RSA(rsaKey.getParivateKeyByBase64(), null); 52 | return rsa.decryptStr(content, KeyType.PrivateKey); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /mail/src/main/java/com/lvyx/mail/vo/MessageVo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.mail.vo; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.fasterxml.jackson.annotation.JsonFormat; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import java.io.Serializable; 10 | import java.util.Date; 11 | 12 | /** 13 | *

14 | * 邮件信息vo 15 | *

16 | * 17 | * @author lvyx 18 | * @since 2022-05-01 15:26:45 19 | */ 20 | @Data 21 | public class MessageVo implements Serializable { 22 | 23 | @ApiModelProperty("消息主键") 24 | private String messageId; 25 | 26 | @ApiModelProperty("邮件主键") 27 | private String emailId; 28 | 29 | @ApiModelProperty("消息主题") 30 | private String subject; 31 | 32 | @ApiModelProperty("消息内容") 33 | private String content; 34 | 35 | @ApiModelProperty("是否发送邮件(0:发送,1:不发送)") 36 | private Integer isEmail; 37 | 38 | 39 | @ApiModelProperty("是否有效(0:无效(未读),1:有效(已读))") 40 | private Integer isEnable; 41 | 42 | @ApiModelProperty("发送邮箱") 43 | @TableField("FROM_EMAIL") 44 | private String fromEmail; 45 | 46 | @ApiModelProperty("发送者") 47 | private String fromUser; 48 | 49 | @ApiModelProperty("发送者名称") 50 | private String fromUserName; 51 | 52 | @ApiModelProperty("接收邮箱") 53 | private String toEmail; 54 | 55 | @ApiModelProperty("接收者") 56 | private String toUser; 57 | 58 | @ApiModelProperty("接收者名称") 59 | private String toUserName; 60 | 61 | @ApiModelProperty("创建时间") 62 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") 63 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 64 | private Date emailCreateDate; 65 | 66 | 67 | } 68 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/utils/CaptchaUtils.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.utils; 2 | 3 | import cn.hutool.core.util.ObjectUtil; 4 | import com.lvyx.commons.cache.service.SysSimpleMapCacheService; 5 | import com.lvyx.commons.enums.SystemCacheEnum; 6 | import com.mysql.cj.util.StringUtils; 7 | import javassist.NotFoundException; 8 | import org.apache.shiro.cache.Cache; 9 | 10 | /** 11 | *

12 | * 验证码校验工具类 13 | *

14 | * 15 | * @author lvyx 16 | * @since 2022-01-23 16:45:28 17 | */ 18 | public class CaptchaUtils { 19 | 20 | private static SysSimpleMapCacheService sysSimpleMapCacheService; 21 | 22 | static { 23 | sysSimpleMapCacheService = ApplicationContextUtils.getBean(SysSimpleMapCacheService.class); 24 | } 25 | 26 | /** 27 | * 校验验证码 28 | * @param purpose 用途 29 | * @param captchaId 验证码id 30 | * @param code 验证码字符 31 | * @return java.lang.Boolean 32 | * @author lvyx 33 | * @since 2022/1/23 16:48 34 | **/ 35 | public static Boolean verifyCaptcha(String purpose, String captchaId, String code) throws Exception{ 36 | if (StringUtils.isNullOrEmpty(code)) { 37 | throw new NotFoundException("验证码不能未空!"); 38 | }else { 39 | String captchaKey = SystemCacheEnum.CAPTCHA.getValue() + captchaId + ":" + purpose; 40 | Cache cache = sysSimpleMapCacheService.getCache(captchaKey); 41 | if (ObjectUtil.isNull(cache)) { 42 | throw new NotFoundException("验证码已经过期"); 43 | } 44 | String realCode = (String)cache.get(captchaKey); 45 | String upperCaseCode = realCode.toUpperCase(); 46 | return upperCaseCode.equals(code.toUpperCase()); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /web/src/main/java/com/lvyx/CommunitySystemApplication.java: -------------------------------------------------------------------------------- 1 | package com.lvyx; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.web.servlet.ServletComponentScan; 6 | import org.springframework.context.ApplicationContext; 7 | import org.springframework.context.ConfigurableApplicationContext; 8 | import org.springframework.context.annotation.EnableAspectJAutoProxy; 9 | import org.springframework.core.env.Environment; 10 | import org.springframework.transaction.annotation.EnableTransactionManagement; 11 | 12 | /** 13 | *

14 | * 社区疫情健康管理系统启动类 15 | *

16 | * 17 | * @author lvyx 18 | * @since 2021-12-23 11:15:02 19 | */ 20 | @SpringBootApplication 21 | @EnableTransactionManagement 22 | @ServletComponentScan 23 | @EnableAspectJAutoProxy(proxyTargetClass = true) 24 | public class CommunitySystemApplication { 25 | 26 | public static void main(String[] args) { 27 | ConfigurableApplicationContext run = SpringApplication.run(CommunitySystemApplication.class, args); 28 | printSystemInfo(run); 29 | } 30 | 31 | 32 | private static void printSystemInfo(ApplicationContext applicationContext) { 33 | Environment environment = applicationContext.getEnvironment(); 34 | String port = environment.getProperty("server.port"); 35 | String context = environment.getProperty("server.servlet.context-path"); 36 | String ip = "localhost"; 37 | String systemIndexUrl = "http://" + ip + ":" + port + context; 38 | String swaggerBootStrapApiUrl = systemIndexUrl + "doc.html"; 39 | System.out.printf(">>>>>>>>>>>>>>>>>>>>接口文档地址(bootstrap美化过,推荐使用):%s >>>>>>>>>\n", swaggerBootStrapApiUrl); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/encrypt_decrypt/factory/service/impl/AESEncryptDecryptServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.encrypt_decrypt.factory.service.impl; 2 | 3 | import cn.hutool.core.codec.Base64; 4 | import cn.hutool.crypto.symmetric.SymmetricAlgorithm; 5 | import cn.hutool.crypto.symmetric.SymmetricCrypto; 6 | import com.lvyx.commons.config.EncryptDencryptProperties; 7 | import com.lvyx.commons.encrypt_decrypt.factory.service.LEncryptDecryptService; 8 | import org.springframework.stereotype.Component; 9 | 10 | import javax.annotation.Resource; 11 | 12 | /** 13 | *

14 | * AES加密解密 15 | *

16 | * 17 | * @author lvyx 18 | * @since 2021-12-30 13:34:23 19 | */ 20 | @Component("AES") 21 | public class AESEncryptDecryptServiceImpl implements LEncryptDecryptService { 22 | 23 | @Resource 24 | private EncryptDencryptProperties.AesKey aesKey; 25 | 26 | 27 | 28 | /** 29 | * 加密 30 | * @param content 被加密字符串 31 | * @return java.lang.String 加密后字符串 32 | * @author lvyx 33 | * @since 2021/12/10 13:24 34 | **/ 35 | @Override 36 | public String encrypt(String content) { 37 | SymmetricCrypto symmetriccrypto = new SymmetricCrypto(SymmetricAlgorithm.AES.getValue(), Base64.decode(aesKey.getKey())); 38 | return symmetriccrypto.encryptHex(content); 39 | } 40 | 41 | /** 42 | * 解密 43 | * @param content 加密的字符串 44 | * @return java.lang.String 原字符串 45 | * @author lvyx 46 | * @since 2021/12/10 13:25 47 | **/ 48 | @Override 49 | public String decrypt(String content) { 50 | SymmetricCrypto symmetriccrypto = new SymmetricCrypto(SymmetricAlgorithm.AES.getValue(), Base64.decode(aesKey.getKey())); 51 | return symmetriccrypto.decryptStr(content); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/shiro/cache/service/SimpleMapCacheService.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.shiro.cache.service; 2 | 3 | import org.apache.shiro.cache.Cache; 4 | import org.apache.shiro.cache.CacheException; 5 | 6 | /** 7 | *

8 | * 自定义简单缓存管理接口 9 | *

10 | * 11 | * @author lvyx 12 | * @date 2021-12-31 09:38:27 13 | */ 14 | public interface SimpleMapCacheService { 15 | 16 | /** 17 | * 功能说明::新增缓存堆到管理器
18 | * @param cacheName 缓存名称 19 | * @param cache 缓存对象 20 | * @exception CacheException 缓存异常 21 | * @author lvyx 22 | * @since 2021/12/31 9:40 23 | **/ 24 | void createCache(String cacheName, Cache cache) throws CacheException; 25 | 26 | /** 27 | * 方法名::getCache
28 | * 功能说明::获取缓存堆
29 | * @param cacheName 缓存名称 30 | * @exception CacheException 缓存异常 31 | * @return org.apache.shiro.cache.Cache 32 | * @author lvyx 33 | * @since 2021/12/31 9:44 34 | **/ 35 | Cache getCache(String cacheName) throws CacheException; 36 | 37 | /** 38 | * 方法名::removeCache
39 | * 功能说明::移除缓存堆
40 | * @param cacheName 缓存名称 41 | * @exception CacheException 缓存异常 42 | * @author lvyx 43 | * @since 2021/12/31 9:46 44 | **/ 45 | void removeCache(String cacheName) throws CacheException; 46 | 47 | /** 48 | * 方法名::updateCahce
49 | * 功能说明::更新缓存堆
50 | * @param cacheName 缓存名称 51 | * @param cache 缓存对象 52 | * @exception CacheException 缓存异常 53 | * @author lvyx 54 | * @since 2021/12/31 9:47 55 | **/ 56 | void updateCahce(String cacheName, Cache cache) throws CacheException; 57 | } 58 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/service/CommunityTemperatureRegistrationService.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.github.pagehelper.PageInfo; 5 | import com.lvyx.community.entity.CommunityTemperatureRegistration; 6 | import org.springframework.transaction.annotation.Transactional; 7 | 8 | import java.awt.image.BufferedImage; 9 | 10 | /** 11 | *

12 | * 小区-体温登记表 服务类 13 | *

14 | * 15 | * @author lvyx 16 | * @since 2022-02-13 17 | */ 18 | public interface CommunityTemperatureRegistrationService extends IService { 19 | 20 | /** 21 | * 添加一条体温记录信息 22 | * @param communityTemperatureRegistration 体温登记信息 23 | * @author lvyx 24 | * @since 2022/3/12 15:59 25 | **/ 26 | @Transactional(rollbackFor = Exception.class) 27 | void add(CommunityTemperatureRegistration communityTemperatureRegistration); 28 | 29 | /** 30 | * 查看当前登陆人连续打卡天数 31 | * @return java.lang.Integer 32 | * @author lvyx 33 | * @since 2022/3/20 22:03 34 | **/ 35 | Integer continuousDay(); 36 | 37 | /** 38 | * 获得当前登录人的二维码 39 | * @return java.awt.image.BufferedImage 40 | * @author lvyx 41 | * @since 2022/4/5 22:06 42 | **/ 43 | BufferedImage getQrcode(); 44 | 45 | /** 46 | * 查询打卡记录 47 | * @param pageNum 页码 48 | * @param pageSize 页码大小 49 | * @param isEnable 是否作废 50 | * @param isHealth 是否健康 51 | * @return com.github.pagehelper.PageInfo 52 | * @author lvyx 53 | * @since 2022/5/6 2:39 54 | **/ 55 | PageInfo findList(Integer pageNum, Integer pageSize, Integer isEnable, Integer isHealth); 56 | 57 | } 58 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/entity/UserRole.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | 9 | import java.io.Serializable; 10 | import java.time.LocalDateTime; 11 | 12 | /** 13 | *

14 | * 用户角色关联表 15 | *

16 | * 17 | * @author lvyx 18 | * @since 2021-12-23 19 | */ 20 | @Getter 21 | @Setter 22 | @TableName("l_user_role") 23 | @ApiModel(value = "UserRole对象", description = "用户角色关联表") 24 | public class UserRole implements Serializable { 25 | 26 | @ApiModelProperty("主键") 27 | @TableId(value = "ID", type = IdType.ASSIGN_UUID) 28 | private String id; 29 | 30 | @ApiModelProperty("用户主键") 31 | @TableField("USER_ID") 32 | private String userId; 33 | 34 | @ApiModelProperty("角色主键") 35 | @TableField("ROLE_ID") 36 | private String roleId; 37 | 38 | @ApiModelProperty("是否有效(0:无效,1:有效)") 39 | @TableField("IS_ENABLE") 40 | private Integer isEnable; 41 | 42 | @ApiModelProperty("创建用户") 43 | @TableField("CREATE_USER") 44 | private String createUser; 45 | 46 | @ApiModelProperty("创建时间") 47 | @TableField("CREATE_TIME") 48 | private LocalDateTime createTime; 49 | 50 | @ApiModelProperty("修改者") 51 | @TableField("UPDATE_USER") 52 | private String updateUser; 53 | 54 | @ApiModelProperty("修改时间") 55 | @TableField("UPDATE_TIME") 56 | private LocalDateTime updateTime; 57 | 58 | @ApiModelProperty("是否删除(0:未删除,1:删除)") 59 | @TableField("IS_DELETE") 60 | @TableLogic 61 | private Integer isDelete; 62 | 63 | @ApiModelProperty("删除者") 64 | @TableField("DELETE_USER") 65 | private String deleteUser; 66 | 67 | @ApiModelProperty("删除时间") 68 | @TableField("DELETE_TIME") 69 | private LocalDateTime deleteTime; 70 | 71 | 72 | } 73 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/utils/LSerializeUtils.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.utils; 2 | 3 | import cn.hutool.core.util.ObjectUtil; 4 | import com.mysql.cj.util.StringUtils; 5 | import lombok.extern.slf4j.Slf4j; 6 | 7 | import java.io.*; 8 | import java.util.Base64; 9 | 10 | /** 11 | *

12 | * 自定义序列化工具类 13 | *

14 | * 15 | * @author lvyx 16 | * @since 2021-12-31 09:26:42 17 | */ 18 | @Slf4j 19 | public class LSerializeUtils { 20 | 21 | /** 22 | * 反序列化方法 23 | * @param str 序列化的字符串 24 | * @return java.lang.Object 25 | * @author lvyx 26 | * @since 2021/12/31 9:27 27 | **/ 28 | public static Object deserialize(String str) { 29 | if (StringUtils.isNullOrEmpty(str)) { 30 | return null; 31 | } 32 | Object object=null; 33 | try(ByteArrayInputStream bis = new ByteArrayInputStream(Base64.getDecoder().decode(str)); 34 | ObjectInputStream ois = new ObjectInputStream(bis);) { 35 | object = ois.readObject(); 36 | } catch (IOException |ClassNotFoundException e) { 37 | log.error("流读取异常",e); 38 | } 39 | return object; 40 | } 41 | 42 | /** 43 | * 序列化方法 44 | * @param obj 被序列化的对象 45 | * @return java.lang.String 46 | * @author lvyx 47 | * @since 2021/12/31 9:32 48 | **/ 49 | public static String serialize(Object obj) { 50 | if (ObjectUtil.isEmpty(obj)) { 51 | return null; 52 | } 53 | String base64String = null; 54 | try(ByteArrayOutputStream bos = new ByteArrayOutputStream(); 55 | ObjectOutputStream oos = new ObjectOutputStream(bos);) { 56 | oos.writeObject(obj); 57 | base64String = Base64.getEncoder().encodeToString(bos.toByteArray()); 58 | } catch (IOException e) { 59 | log.error("流写入异常",e); 60 | } 61 | return base64String; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/entity/RoleResource.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | 9 | import java.io.Serializable; 10 | import java.time.LocalDateTime; 11 | 12 | /** 13 | *

14 | * 角色资源关联表 15 | *

16 | * 17 | * @author lvyx 18 | * @since 2021-12-23 19 | */ 20 | @Getter 21 | @Setter 22 | @TableName("l_role_resource") 23 | @ApiModel(value = "RoleResource对象", description = "角色资源关联表") 24 | public class RoleResource implements Serializable { 25 | 26 | @ApiModelProperty("主键") 27 | @TableId(value = "ID", type = IdType.ASSIGN_UUID) 28 | private String id; 29 | 30 | @ApiModelProperty("角色主键") 31 | @TableField("ROLE_ID") 32 | private String roleId; 33 | 34 | @ApiModelProperty("资源主键") 35 | @TableField("RESOURCE_ID") 36 | private String resourceId; 37 | 38 | @ApiModelProperty("创建者") 39 | @TableField("CREATE_USER") 40 | private String createUser; 41 | 42 | @ApiModelProperty("是否有效(0:无效,1:有效)") 43 | @TableField("IS_ENABLE") 44 | private Integer isEnable; 45 | 46 | @ApiModelProperty("创建时间") 47 | @TableField("CREATE_TIME") 48 | private LocalDateTime createTime; 49 | 50 | @ApiModelProperty("修改者") 51 | @TableField("UPDATE_USER") 52 | private String updateUser; 53 | 54 | @ApiModelProperty("修改时间") 55 | @TableField("UPDATE_TIME") 56 | private LocalDateTime updateTime; 57 | 58 | @ApiModelProperty("是否删除(0:未删除,1:删除)") 59 | @TableField("IS_DELETE") 60 | @TableLogic 61 | private Integer isDelete; 62 | 63 | @ApiModelProperty("删除者") 64 | @TableField("DELETE_USER") 65 | private String deleteUser; 66 | 67 | @ApiModelProperty("删除时间") 68 | @TableField("DELETE_TIME") 69 | private LocalDateTime deleteTime; 70 | 71 | 72 | } 73 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/entity/CommunityPeriod.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | import java.time.LocalDateTime; 10 | 11 | /** 12 | *

13 | * 小区-期 14 | *

15 | * 16 | * @author lvyx 17 | * @since 2022-02-04 18 | */ 19 | @Data 20 | @TableName("l_community_period") 21 | @ApiModel(value = "CommunityPeriod对象", description = "小区-期") 22 | public class CommunityPeriod implements Serializable { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | @ApiModelProperty("主键") 27 | @TableId(value = "ID", type = IdType.ASSIGN_UUID) 28 | private String id; 29 | 30 | @ApiModelProperty("第几期") 31 | @TableField("PERIOD_NUMBER") 32 | private String periodNumber; 33 | 34 | @ApiModelProperty("排序") 35 | @TableField("SORT_NO") 36 | private Integer sortNo; 37 | 38 | @ApiModelProperty("是否有效(0:无效,1:有效)") 39 | @TableField("IS_ENABLE") 40 | private Integer isEnable; 41 | 42 | @ApiModelProperty("创建者") 43 | @TableField("CREATE_USER") 44 | private String createUser; 45 | 46 | @ApiModelProperty("创建时间") 47 | @TableField("CREATE_TIME") 48 | private LocalDateTime createTime; 49 | 50 | @ApiModelProperty("修改者") 51 | @TableField("UPDATE_USER") 52 | private String updateUser; 53 | 54 | @ApiModelProperty("修改时间") 55 | @TableField("UPDATE_TIME") 56 | private LocalDateTime updateTime; 57 | 58 | @ApiModelProperty("是否删除(0:未删除,1:删除)") 59 | @TableField("IS_DELETE") 60 | @TableLogic 61 | private Integer isDelete; 62 | 63 | @ApiModelProperty("删除者") 64 | @TableField("DELETE_USER") 65 | private String deleteUser; 66 | 67 | @ApiModelProperty("删除时间") 68 | @TableField("DELETE_TIME") 69 | private LocalDateTime deleteTime; 70 | 71 | 72 | } 73 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/vo/ExceptionVo.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.vo; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import com.fasterxml.jackson.annotation.JsonFormat; 6 | import io.swagger.annotations.ApiModelProperty; 7 | import lombok.Data; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | 10 | import java.io.Serializable; 11 | import java.util.Date; 12 | 13 | /** 14 | *

15 | * 异常信息返回实体 16 | *

17 | * 18 | * @author lvyx 19 | * @since 2022-05-02 15:13:16 20 | */ 21 | @Data 22 | public class ExceptionVo implements Serializable { 23 | 24 | @ApiModelProperty("用户主键") 25 | private String userId; 26 | 27 | @ApiModelProperty("用户名") 28 | private String userName; 29 | 30 | @ApiModelProperty("用户头像") 31 | private String userAvatar; 32 | 33 | @ApiModelProperty("用户联系电话") 34 | private String userMobile; 35 | 36 | @ApiModelProperty("处理人") 37 | private String updateUserName; 38 | 39 | @ApiModelProperty("处理人联系电话") 40 | private String updateUserMobile; 41 | 42 | @ApiModelProperty("主键") 43 | @TableId(value = "ID", type = IdType.ASSIGN_UUID) 44 | private String id; 45 | 46 | @ApiModelProperty("异常类型(0:体温异常,1:其它异常)") 47 | private Integer exceptionType; 48 | 49 | @ApiModelProperty("异常描述") 50 | private String exceptionDescription; 51 | 52 | @ApiModelProperty("是否处理中(0:未开始,1:处理中,2:已结束)") 53 | private Integer isDealWith; 54 | 55 | @ApiModelProperty("处理结果") 56 | private String result; 57 | 58 | @ApiModelProperty("创建时间") 59 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") 60 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 61 | private Date createTime; 62 | 63 | @ApiModelProperty("修改时间") 64 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") 65 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 66 | private Date updateTime; 67 | 68 | } 69 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/mapper/CommunityPeriodMapper.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lvyx.community.entity.CommunityPeriod; 5 | import com.lvyx.community.vo.AddressVo; 6 | import com.lvyx.community.vo.CascadeVo; 7 | import com.lvyx.community.vo.ComprehensiveVo; 8 | import com.lvyx.community.vo.PeriodVo; 9 | import org.apache.ibatis.annotations.Mapper; 10 | import org.apache.ibatis.annotations.Param; 11 | 12 | import java.util.List; 13 | 14 | /** 15 | *

16 | * 小区-期 Mapper 接口 17 | *

18 | * 19 | * @author lvyx 20 | * @since 2022-02-01 21 | */ 22 | @Mapper 23 | public interface CommunityPeriodMapper extends BaseMapper { 24 | 25 | /** 26 | * 根据期id得到小区信息 27 | * @param id 期Id 28 | * @return java.util.List 29 | * @author lvyx 30 | * @since 2022/2/6 18:34 31 | **/ 32 | List findCommunityByPeriodId(@Param("id") String id); 33 | 34 | /** 35 | * 根据期id得到小区信息 36 | * @return java.util.List 37 | * @author lvyx 38 | * @since 2022/2/6 18:34 39 | **/ 40 | List findCommunityAllInfo(); 41 | 42 | /** 43 | * 根据期id得到小区户信息 44 | * @param id 期id 45 | * @return java.util.List 46 | * @author lvyx 47 | * @since 2022/2/6 19:12 48 | **/ 49 | List findComprehensiveByPeriodId(@Param("id") String id); 50 | 51 | 52 | /** 53 | * 获取当前登录人的住址信息 54 | * @param userId 用户id 55 | * @return AddressVo 56 | * @author lvyx 57 | * @since 2022/2/9 21:24 58 | **/ 59 | AddressVo findInfoByUser(@Param("userId") String userId); 60 | 61 | /** 62 | * 查询登录用户是否含有住址信息 63 | * @return 房间状态 64 | * @author lvyx 65 | * @since 2022/5/22 16:12 66 | **/ 67 | Integer checkUserHasAddress(@Param("userId") String userId); 68 | 69 | 70 | } 71 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/shiro/filter/JwtRolesFilter.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.shiro.filter; 2 | 3 | 4 | import cn.hutool.core.util.ObjectUtil; 5 | import cn.hutool.json.JSONUtil; 6 | import com.lvyx.author.shiro.config.JWTProperties; 7 | import com.lvyx.commons.enums.ResultCodeEnum; 8 | import com.lvyx.commons.result.impl.ErrorResult; 9 | import com.lvyx.commons.utils.ApplicationContextUtils; 10 | import org.apache.shiro.web.filter.authz.RolesAuthorizationFilter; 11 | import org.apache.shiro.web.util.WebUtils; 12 | 13 | import javax.annotation.Resource; 14 | import javax.servlet.ServletRequest; 15 | import javax.servlet.ServletResponse; 16 | import java.io.IOException; 17 | 18 | /** 19 | * 自定义jwt角色校验 20 | * @author lvyx 21 | * @since 2022/1/14 14:10 22 | **/ 23 | public class JwtRolesFilter extends RolesAuthorizationFilter { 24 | 25 | @Resource 26 | private JWTProperties jWTProperties; 27 | 28 | /** 29 | * 访问拒绝时调用 30 | * @param request request 31 | * @param response response 32 | * @return boolean 33 | * @author lvyx 34 | * @since 2022/1/14 14:12 35 | **/ 36 | @Override 37 | protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws IOException { 38 | //判断当前请求头中是否带有jwtToken的字符串 39 | String jwtToken = WebUtils.toHttp(request).getHeader("jwtToken"); 40 | if (ObjectUtil.isNull(jWTProperties)){ 41 | jWTProperties = ApplicationContextUtils.getBean(JWTProperties.class); 42 | } 43 | //如果有:返回json的应答 44 | if (!ObjectUtil.isEmpty(jwtToken) || jWTProperties.isOnlyJwt()){ 45 | response.setCharacterEncoding("UTF-8"); 46 | response.setContentType("application/json; charset=utf-8"); 47 | response.getWriter().write(JSONUtil.toJsonStr(new ErrorResult<>(ResultCodeEnum.NO_AUTHORITY.getCode(), "权限不足"))); 48 | return false; 49 | } 50 | //如果没有:走原始方式 51 | return super.onAccessDenied(request, response); 52 | } 53 | } -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/enums/ShiroCacheEnum.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.enums; 2 | 3 | /** 4 | *

5 | * shiro 缓存枚举 6 | *

7 | * 8 | * @author lvyx 9 | * @date 2021-12-31 09:59:24 10 | */ 11 | public enum ShiroCacheEnum { 12 | 13 | /** 14 | * shiro缓存外层组名称 15 | * @since 2021/12/31 10:08 16 | **/ 17 | GROUP_CAS(SystemCacheEnum.COMMUNITY_SYSTEM_CACHE.getValue() + "group_shiro:"), 18 | 19 | /** 20 | * 角色的键 21 | * @since 2021/12/31 10:11 22 | **/ 23 | ROLE_KEY("role_key:"), 24 | 25 | /** 26 | * 资源的键 27 | * @since 2021/12/31 10:12 28 | **/ 29 | RESOURCES_KEY("resources_key:"), 30 | 31 | /** 32 | * 角色ids的键 33 | * @since 2021/12/31 10:12 34 | **/ 35 | RESOURCES_KEY_IDS("resources_key_ids:"), 36 | 37 | /** 38 | * 用户登录名 39 | * @since 2021/12/31 10:12 40 | **/ 41 | FIND_USER_BY_LOGINNAME("findUserByLoginName:"), 42 | 43 | /** 44 | * token 45 | * @since 2022/1/14 18:02 46 | **/ 47 | JWT_TOKEN("jwtToken:"), 48 | 49 | /** 50 | * 密码重试次数 51 | * @since 2022/1/10 16:31 52 | **/ 53 | PWD_RETRY_COUNT(GROUP_CAS.getValue() + "pwdRetryCount:"), 54 | 55 | /** 56 | * 会话id 57 | * @since 2022/1/12 15:50 58 | **/ 59 | SESSION_DAO(GROUP_CAS.getValue() + "sessionDao:"), 60 | 61 | /** 62 | * 用户队列 63 | * @since 2022/1/12 15:50 64 | **/ 65 | USER_QUEUE(GROUP_CAS.getValue() + "userQueue:"), 66 | 67 | 68 | ; 69 | 70 | 71 | private final String value; 72 | 73 | ShiroCacheEnum(String value){ 74 | this.value = value; 75 | } 76 | 77 | public static String isSuccessEnum(String value){ 78 | ShiroCacheEnum[] array = values(); 79 | for(ShiroCacheEnum arr: array){ 80 | if(arr.value.equals(value)){ 81 | return arr.value; 82 | } 83 | } 84 | return null; 85 | } 86 | 87 | public String getValue() { 88 | return value; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/shiro/bridge/UserBridgeService.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.shiro.bridge; 2 | 3 | import com.lvyx.author.entity.User; 4 | import com.lvyx.commons.pojo.ShiroUser; 5 | import org.apache.shiro.authz.AuthorizationInfo; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 用户信息桥接 12 | *

13 | * 14 | * @author lvyx 15 | * @date 2021-12-24 09:19:54 16 | */ 17 | public interface UserBridgeService { 18 | 19 | /** 20 | * 根据用户登录名查找用户 21 | * @param loginName 登录名称 22 | * @return com.lvyx.author.entity.User 23 | * @author lvyx 24 | * @since 2021/12/24 9:21 25 | **/ 26 | User findUserByLoginName(String loginName); 27 | 28 | /** 29 | * 根据用户id得到用户拥有的资源id 30 | * @param userId 用户id 31 | * @return java.util.List 32 | * @author lvyx 33 | * @since 2021/12/24 9:30 34 | **/ 35 | List findResourceIds(String userId); 36 | 37 | 38 | /** 39 | * 根据用户id的到用户角色信息 40 | * @param userId 用户id 41 | * @return java.util.List 42 | * @author lvyx 43 | * @since 2021/12/31 14:00 44 | **/ 45 | List findRoleIds(String userId); 46 | 47 | 48 | /** 49 | * 得到鉴权信息 50 | * @param shiroUser shiro用户对象 51 | * @return org.apache.shiro.authz.AuthorizationInfo 鉴权信息 52 | * @author lvyx 53 | * @since 2021/12/24 10:01 54 | **/ 55 | AuthorizationInfo getAuthorizationInfo(ShiroUser shiroUser); 56 | 57 | /** 58 | * 登录成后加载缓存信息 59 | * @param shiroUser 登录信息 60 | * @author lvyx 61 | * @since 2022/1/14 15:39 62 | **/ 63 | void loadUserAuthorityToCache(ShiroUser shiroUser); 64 | 65 | /** 66 | * 查询用户对应角色标识list 67 | * @param userId 用户id 68 | * @return 角色标识集合 69 | */ 70 | List findRoleList(String key,String userId); 71 | 72 | /** 73 | * 查询用户对应资源标识list 74 | * @param userId 用户id 75 | * @return 资源标识集合 76 | */ 77 | List findResourcesList(String key,String userId); 78 | 79 | } 80 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/pojo/ShiroUser.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.pojo; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | import java.io.Serializable; 9 | import java.util.List; 10 | 11 | 12 | /** 13 | * 自定义Authentication对象,使得Subject除了携带用户的登录名外还可以携带更多信息 14 | * @author lvyx 15 | */ 16 | @Data 17 | @NoArgsConstructor 18 | @ApiModel( value = "ShiroUser对象", description = "用户权限性相关信息") 19 | public class ShiroUser implements Serializable { 20 | 21 | 22 | @ApiModelProperty(value = "主键") 23 | private String id; 24 | 25 | @ApiModelProperty(value = "登录名称") 26 | private String loginName; 27 | 28 | @ApiModelProperty(value = "真实姓名") 29 | private String realName; 30 | 31 | @ApiModelProperty(value = "昵称") 32 | private String nickName; 33 | 34 | @ApiModelProperty(value = "密码") 35 | private String password; 36 | 37 | @ApiModelProperty(value = "性别") 38 | private Integer sex; 39 | 40 | @ApiModelProperty(value = "邮箱") 41 | private String zipcode; 42 | 43 | @ApiModelProperty(value = "地址") 44 | private String address; 45 | 46 | @ApiModelProperty(value = "固定电话") 47 | private String tel; 48 | 49 | @ApiModelProperty(value = "电话") 50 | private String mobil; 51 | 52 | @ApiModelProperty(value = "邮箱") 53 | private String email; 54 | 55 | @ApiModelProperty(value = "职务") 56 | private String duties; 57 | 58 | @ApiModelProperty("头像") 59 | private String avatar; 60 | 61 | @ApiModelProperty(value = "排序") 62 | private Integer sortNo; 63 | 64 | @ApiModelProperty(value = "是否有效") 65 | private Integer isEnable; 66 | 67 | @ApiModelProperty(value = "资源ids") 68 | private List resourceIds; 69 | 70 | @ApiModelProperty(value = "角色名称") 71 | private List roleName; 72 | 73 | @ApiModelProperty(value = "角色信息") 74 | private List roleVoList; 75 | 76 | 77 | 78 | 79 | public ShiroUser(String id, String loginName) { 80 | super(); 81 | this.id = id; 82 | this.loginName = loginName; 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/controller/CommunityInAndOutController.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.controller; 2 | 3 | 4 | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 5 | import com.github.xiaoymin.knife4j.annotations.ApiSupport; 6 | import com.lvyx.commons.annotation.logger.LLogger; 7 | import com.lvyx.commons.result.Result; 8 | import com.lvyx.commons.result.impl.ErrorResult; 9 | import com.lvyx.commons.result.impl.SuccessResult; 10 | import com.lvyx.community.CommunityUrls; 11 | import com.lvyx.community.entity.CommunityInAndOut; 12 | import com.lvyx.community.service.CommunityInAndOutService; 13 | import io.swagger.annotations.Api; 14 | import io.swagger.annotations.ApiOperation; 15 | import lombok.extern.slf4j.Slf4j; 16 | import org.springframework.web.bind.annotation.PostMapping; 17 | import org.springframework.web.bind.annotation.RequestBody; 18 | import org.springframework.web.bind.annotation.RequestMapping; 19 | import org.springframework.web.bind.annotation.RestController; 20 | 21 | import javax.annotation.Resource; 22 | 23 | /** 24 | *

25 | * 小区-进出登记表 前端控制器 26 | *

27 | * 28 | * @author lvyx 29 | * @since 2022-02-13 30 | */ 31 | @RestController 32 | @Api(tags = "社区-进出登记表") 33 | @ApiSupport(order = 8) 34 | @Slf4j 35 | @RequestMapping(CommunityUrls.InAndOutCtrls.BASE_URL) 36 | public class CommunityInAndOutController { 37 | 38 | @Resource 39 | private CommunityInAndOutService communityInAndOutService; 40 | 41 | @LLogger(description = "添加进出信息", params = {"添加进出信息"}) 42 | @ApiOperation("添加进出信息") 43 | @ApiOperationSupport(order = 1) 44 | @PostMapping(CommunityUrls.InAndOutCtrls.ADD) 45 | public Result add(@RequestBody CommunityInAndOut communityInAndOut){ 46 | try { 47 | communityInAndOutService.addCommunityInAndOut(communityInAndOut); 48 | } catch (Exception e){ 49 | log.error(e.getMessage(), e); 50 | return new ErrorResult<>("添加出入登记异常"); 51 | } 52 | return new SuccessResult<>("添加出入登记信息成功"); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/entity/CommunityLayer.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | import java.time.LocalDateTime; 10 | 11 | /** 12 | *

13 | * 小区-层 14 | *

15 | * 16 | * @author lvyx 17 | * @since 2022-02-04 18 | */ 19 | @Data 20 | @TableName("l_community_layer") 21 | @ApiModel(value = "CommunityLayer对象", description = "小区-层") 22 | public class CommunityLayer implements Serializable { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | @ApiModelProperty("主键") 27 | @TableId(value = "ID", type = IdType.ASSIGN_UUID) 28 | private String id; 29 | 30 | @ApiModelProperty("单元Id") 31 | @TableField("UNIT_ID") 32 | private String unitId; 33 | 34 | @ApiModelProperty("层") 35 | @TableField("LAYER_NUMBER") 36 | private String layerNumber; 37 | 38 | @ApiModelProperty("排序") 39 | @TableField("SORT_NO") 40 | private Integer sortNo; 41 | 42 | @ApiModelProperty("是否有效(0:无效,1:有效)") 43 | @TableField("IS_ENABLE") 44 | private Integer isEnable; 45 | 46 | @ApiModelProperty("创建者") 47 | @TableField("CREATE_USER") 48 | private String createUser; 49 | 50 | @ApiModelProperty("创建时间") 51 | @TableField("CREATE_TIME") 52 | private LocalDateTime createTime; 53 | 54 | @ApiModelProperty("修改者") 55 | @TableField("UPDATE_USER") 56 | private String updateUser; 57 | 58 | @ApiModelProperty("修改时间") 59 | @TableField("UPDATE_TIME") 60 | private LocalDateTime updateTime; 61 | 62 | @ApiModelProperty("是否删除(0:未删除,1:删除)") 63 | @TableField("IS_DELETE") 64 | @TableLogic 65 | private Integer isDelete; 66 | 67 | @ApiModelProperty("删除者") 68 | @TableField("DELETE_USER") 69 | private String deleteUser; 70 | 71 | @ApiModelProperty("删除时间") 72 | @TableField("DELETE_TIME") 73 | private LocalDateTime deleteTime; 74 | 75 | 76 | } 77 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/entity/CommunityUnit.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | import java.time.LocalDateTime; 10 | 11 | /** 12 | *

13 | * 小区-单元 14 | *

15 | * 16 | * @author lvyx 17 | * @since 2022-02-04 18 | */ 19 | @Data 20 | @TableName("l_community_unit") 21 | @ApiModel(value = "CommunityUnit对象", description = "小区-单元") 22 | public class CommunityUnit implements Serializable { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | @ApiModelProperty("主键") 27 | @TableId(value = "ID", type = IdType.ASSIGN_UUID) 28 | private String id; 29 | 30 | @ApiModelProperty("栋Id") 31 | @TableField("BUILDING_ID") 32 | private String buildingId; 33 | 34 | @ApiModelProperty("单元") 35 | @TableField("UNIT_NUMBER") 36 | private String unitNumber; 37 | 38 | @ApiModelProperty("排序") 39 | @TableField("SORT_NO") 40 | private Integer sortNo; 41 | 42 | @ApiModelProperty("是否有效(0:无效,1:有效)") 43 | @TableField("IS_ENABLE") 44 | private Integer isEnable; 45 | 46 | @ApiModelProperty("创建者") 47 | @TableField("CREATE_USER") 48 | private String createUser; 49 | 50 | @ApiModelProperty("创建时间") 51 | @TableField("CREATE_TIME") 52 | private LocalDateTime createTime; 53 | 54 | @ApiModelProperty("修改者") 55 | @TableField("UPDATE_USER") 56 | private String updateUser; 57 | 58 | @ApiModelProperty("修改时间") 59 | @TableField("UPDATE_TIME") 60 | private LocalDateTime updateTime; 61 | 62 | @ApiModelProperty("是否删除(0:未删除,1:删除)") 63 | @TableField("IS_DELETE") 64 | @TableLogic 65 | private Integer isDelete; 66 | 67 | @ApiModelProperty("删除者") 68 | @TableField("DELETE_USER") 69 | private String deleteUser; 70 | 71 | @ApiModelProperty("删除时间") 72 | @TableField("DELETE_TIME") 73 | private LocalDateTime deleteTime; 74 | 75 | 76 | } 77 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/shiro/filter/JwtPermsFilter.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.shiro.filter; 2 | 3 | import cn.hutool.core.util.ObjectUtil; 4 | import cn.hutool.json.JSONUtil; 5 | import com.lvyx.author.shiro.config.JWTProperties; 6 | import com.lvyx.commons.enums.ResultCodeEnum; 7 | import com.lvyx.commons.enums.ShiroTokenEnum; 8 | import com.lvyx.commons.result.impl.ErrorResult; 9 | import com.lvyx.commons.utils.ApplicationContextUtils; 10 | import org.apache.shiro.web.filter.authz.PermissionsAuthorizationFilter; 11 | import org.apache.shiro.web.util.WebUtils; 12 | 13 | import javax.annotation.Resource; 14 | import javax.servlet.ServletRequest; 15 | import javax.servlet.ServletResponse; 16 | import java.io.IOException; 17 | 18 | /** 19 | * 自定义jwt的资源校验 20 | * @author lvyx 21 | * @since 2022/1/14 14:05 22 | **/ 23 | public class JwtPermsFilter extends PermissionsAuthorizationFilter { 24 | 25 | @Resource 26 | private JWTProperties jWTProperties; 27 | 28 | /** 29 | * 资源访问被拒绝时 30 | * @param request request 31 | * @param response response 32 | * @return boolean 33 | * @author lvyx 34 | * @since 2022/1/14 14:07 35 | **/ 36 | @Override 37 | protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws IOException { 38 | //判断当前请求头中是否带有jwtToken的字符串 39 | String jwtToken = WebUtils.toHttp(request).getHeader(ShiroTokenEnum.AUTHORIZATION.getValue()); 40 | if (ObjectUtil.isNull(jWTProperties)){ 41 | jWTProperties = ApplicationContextUtils.getBean(JWTProperties.class); 42 | } 43 | //如果有:返回json的应答 44 | if (!ObjectUtil.isEmpty(jwtToken) | jWTProperties.isOnlyJwt()){ 45 | response.setCharacterEncoding("UTF-8"); 46 | response.setContentType("application/json; charset=utf-8"); 47 | response.getWriter().write(JSONUtil.toJsonStr(new ErrorResult<>(ResultCodeEnum.NO_AUTHORITY.getCode(), "权限不足!"))); 48 | return false; 49 | } 50 | //如果没有:走原始方式 51 | return super.onAccessDenied(request, response); 52 | } 53 | } -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/entity/CommunityBuilding.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | import java.time.LocalDateTime; 10 | 11 | /** 12 | *

13 | * 小区-栋 14 | *

15 | * 16 | * @author lvyx 17 | * @since 2022-02-04 18 | */ 19 | @Data 20 | @TableName("l_community_building") 21 | @ApiModel(value = "CommunityBuilding对象", description = "小区-栋") 22 | public class CommunityBuilding implements Serializable { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | @ApiModelProperty("主键") 27 | @TableId(value = "ID", type = IdType.ASSIGN_UUID) 28 | private String id; 29 | 30 | @ApiModelProperty("期Id") 31 | @TableField("PERIOD_ID") 32 | private String periodId; 33 | 34 | @ApiModelProperty("第几栋") 35 | @TableField("BUILDING_NUMBER") 36 | private String buildingNumber; 37 | 38 | @ApiModelProperty("排序") 39 | @TableField("SORT_NO") 40 | private Integer sortNo; 41 | 42 | @ApiModelProperty("是否有效(0:无效,1:有效)") 43 | @TableField("IS_ENABLE") 44 | private Integer isEnable; 45 | 46 | @ApiModelProperty("创建者") 47 | @TableField("CREATE_USER") 48 | private String createUser; 49 | 50 | @ApiModelProperty("创建时间") 51 | @TableField("CREATE_TIME") 52 | private LocalDateTime createTime; 53 | 54 | @ApiModelProperty("修改者") 55 | @TableField("UPDATE_USER") 56 | private String updateUser; 57 | 58 | @ApiModelProperty("修改时间") 59 | @TableField("UPDATE_TIME") 60 | private LocalDateTime updateTime; 61 | 62 | @ApiModelProperty("是否删除(0:未删除,1:删除)") 63 | @TableField("IS_DELETE") 64 | @TableLogic 65 | private Integer isDelete; 66 | 67 | @ApiModelProperty("删除者") 68 | @TableField("DELETE_USER") 69 | private String deleteUser; 70 | 71 | @ApiModelProperty("删除时间") 72 | @TableField("DELETE_TIME") 73 | private LocalDateTime deleteTime; 74 | 75 | 76 | } 77 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/entity/CommunityHousehold.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | import java.time.LocalDateTime; 10 | 11 | /** 12 | *

13 | * 小区-户 14 | *

15 | * 16 | * @author lvyx 17 | * @since 2022-02-04 18 | */ 19 | @Data 20 | @TableName("l_community_household") 21 | @ApiModel(value = "CommunityHousehold对象", description = "小区-户") 22 | public class CommunityHousehold implements Serializable { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | @ApiModelProperty("主键") 27 | @TableId(value = "ID", type = IdType.ASSIGN_UUID) 28 | private String id; 29 | 30 | @ApiModelProperty("层Id") 31 | @TableField("LAYER_ID") 32 | private String layerId; 33 | 34 | @ApiModelProperty("户") 35 | @TableField("HOUSEHOLD_NUMBER") 36 | private String householdNumber; 37 | 38 | @ApiModelProperty("排序") 39 | @TableField("SORT_NO") 40 | private Integer sortNo; 41 | 42 | @ApiModelProperty("是否有效(0:无效,1:有效)") 43 | @TableField("IS_ENABLE") 44 | private Integer isEnable; 45 | 46 | @ApiModelProperty("创建者") 47 | @TableField("CREATE_USER") 48 | private String createUser; 49 | 50 | @ApiModelProperty("创建时间") 51 | @TableField("CREATE_TIME") 52 | private LocalDateTime createTime; 53 | 54 | @ApiModelProperty("修改者") 55 | @TableField("UPDATE_USER") 56 | private String updateUser; 57 | 58 | @ApiModelProperty("修改时间") 59 | @TableField("UPDATE_TIME") 60 | private LocalDateTime updateTime; 61 | 62 | @ApiModelProperty("是否删除(0:未删除,1:删除)") 63 | @TableField("IS_DELETE") 64 | @TableLogic 65 | private Integer isDelete; 66 | 67 | @ApiModelProperty("删除者") 68 | @TableField("DELETE_USER") 69 | private String deleteUser; 70 | 71 | @ApiModelProperty("删除时间") 72 | @TableField("DELETE_TIME") 73 | private LocalDateTime deleteTime; 74 | 75 | 76 | } 77 | -------------------------------------------------------------------------------- /community/src/main/java/com/lvyx/community/service/impl/CommunityLayerServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.community.service.impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 4 | import com.lvyx.commons.enums.BooleanTypeEnum; 5 | import com.lvyx.commons.utils.BaseEntityUtil; 6 | import com.lvyx.commons.utils.ShiroUtils; 7 | import com.lvyx.community.entity.CommunityLayer; 8 | import com.lvyx.community.mapper.CommunityLayerMapper; 9 | import com.lvyx.community.service.CommunityLayerService; 10 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 11 | import org.springframework.stereotype.Service; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | *

17 | * 小区-层 服务实现类 18 | *

19 | * 20 | * @author lvyx 21 | * @since 2022-02-01 22 | */ 23 | @Service 24 | public class CommunityLayerServiceImpl extends ServiceImpl implements CommunityLayerService { 25 | 26 | /** 27 | * 添加层信息 28 | * 29 | * @param layer 层信息 30 | * @return CommunityBuilding 31 | * @author lvyx 32 | * @since 2022/2/4 15:31 33 | **/ 34 | @Override 35 | public CommunityLayer add(CommunityLayer layer) { 36 | BaseEntityUtil.add(ShiroUtils.getShiroUser().getId(), layer); 37 | this.baseMapper.insert(layer); 38 | return layer; 39 | } 40 | 41 | /** 42 | * 查询层 43 | * 44 | * @param parentId 父级id 45 | * @return java.util.List 46 | * @author lvyx 47 | * @since 2022/2/4 17:05 48 | **/ 49 | @Override 50 | public List find(String parentId) { 51 | LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); 52 | wrapper.eq(CommunityLayer::getCreateUser, ShiroUtils.getShiroUser().getId()) 53 | .eq(CommunityLayer::getUnitId, parentId) 54 | .eq(CommunityLayer::getIsEnable, BooleanTypeEnum.YES.getCode()) 55 | .orderByAsc(CommunityLayer::getSortNo); 56 | return this.baseMapper.selectList(wrapper); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/annotation/entity/Log.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.annotation.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import io.swagger.annotations.ApiModel; 8 | import io.swagger.annotations.ApiModelProperty; 9 | import lombok.Getter; 10 | import lombok.Setter; 11 | 12 | import java.time.LocalDateTime; 13 | 14 | /** 15 | *

16 | * 日志表 17 | *

18 | * 19 | * @author lvyx 20 | * @since 2021-12-23 21 | */ 22 | @Getter 23 | @Setter 24 | @TableName("l_log") 25 | @ApiModel(value = "Log对象", description = "日志表") 26 | public class Log { 27 | 28 | @ApiModelProperty("日志id") 29 | @TableId(value = "id", type = IdType.ASSIGN_UUID) 30 | private String id; 31 | 32 | @ApiModelProperty("方法注释") 33 | @TableField("method_doc") 34 | private String methodDoc; 35 | 36 | @ApiModelProperty("方法名称") 37 | @TableField("method_name") 38 | private String methodName; 39 | 40 | @ApiModelProperty("运行时间(ms)") 41 | @TableField("run_time") 42 | private Long runTime; 43 | 44 | @ApiModelProperty("请求ip") 45 | @TableField("ip") 46 | private String ip; 47 | 48 | @ApiModelProperty("请求地址") 49 | @TableField("url") 50 | private String url; 51 | 52 | @ApiModelProperty("请求类型(GET,PUT,POST,DELETE)") 53 | @TableField("request_type") 54 | private String requestType; 55 | 56 | @ApiModelProperty("类路径") 57 | @TableField("class_path") 58 | private String classPath; 59 | 60 | @ApiModelProperty("方法入参") 61 | @TableField("method_param") 62 | private String methodParam; 63 | 64 | @ApiModelProperty("方法返回值") 65 | @TableField("method_return") 66 | private String methodReturn; 67 | 68 | @ApiModelProperty("错误信息") 69 | @TableField("error_message") 70 | private String errorMessage; 71 | 72 | @ApiModelProperty("创建时间") 73 | @TableField("create_time") 74 | private LocalDateTime createTime; 75 | 76 | 77 | } 78 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/entity/Role.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | 9 | import java.io.Serializable; 10 | import java.time.LocalDateTime; 11 | 12 | /** 13 | *

14 | * 用户角色表 15 | *

16 | * 17 | * @author lvyx 18 | * @since 2021-12-23 19 | */ 20 | @Getter 21 | @Setter 22 | @TableName("l_role") 23 | @ApiModel(value = "Role对象", description = "用户角色表") 24 | public class Role implements Serializable { 25 | 26 | @ApiModelProperty("主键") 27 | @TableId(value = "ID", type = IdType.ASSIGN_UUID) 28 | private String id; 29 | 30 | @ApiModelProperty("角色名称") 31 | @TableField("ROLE_NAME") 32 | private String roleName; 33 | 34 | @ApiModelProperty("角色标识") 35 | @TableField("LABEL") 36 | private String label; 37 | 38 | @ApiModelProperty("角色描述") 39 | @TableField("DESCRIPTION") 40 | private String description; 41 | 42 | @ApiModelProperty("排序") 43 | @TableField("SORT_NO") 44 | private Integer sortNo; 45 | 46 | @ApiModelProperty("是否有效(0:无效,1:有效)") 47 | @TableField("IS_ENABLE") 48 | private Integer isEnable; 49 | 50 | @ApiModelProperty("创建者") 51 | @TableField("CREATE_USER") 52 | private String createUser; 53 | 54 | @ApiModelProperty("创建时间") 55 | @TableField("CREATE_TIME") 56 | private LocalDateTime createTime; 57 | 58 | @ApiModelProperty("修改者") 59 | @TableField("UPDATE_USER") 60 | private String updateUser; 61 | 62 | @ApiModelProperty("修改时间") 63 | @TableField("UPDATE_TIME") 64 | private LocalDateTime updateTime; 65 | 66 | @ApiModelProperty("是否删除(0:未删除,1:删除)") 67 | @TableField("IS_DELETE") 68 | @TableLogic 69 | private Integer isDelete; 70 | 71 | @ApiModelProperty("删除者") 72 | @TableField("DELETE_USER") 73 | private String deleteUser; 74 | 75 | @ApiModelProperty("删除时间") 76 | @TableField("DELETE_TIME") 77 | private LocalDateTime deleteTime; 78 | 79 | 80 | } 81 | -------------------------------------------------------------------------------- /community/src/main/resources/mapper/CommunityExceptionMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 50 | 51 | -------------------------------------------------------------------------------- /author/src/main/java/com/lvyx/author/shiro/core/impl/ShiroSessionManager.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.author.shiro.core.impl; 2 | 3 | import cn.hutool.core.util.ObjectUtil; 4 | import com.lvyx.commons.enums.ShiroTokenEnum; 5 | import io.jsonwebtoken.Claims; 6 | import org.apache.shiro.web.servlet.ShiroHttpServletRequest; 7 | import org.apache.shiro.web.session.mgt.DefaultWebSessionManager; 8 | import org.apache.shiro.web.util.WebUtils; 9 | 10 | import javax.annotation.Resource; 11 | import javax.servlet.ServletRequest; 12 | import javax.servlet.ServletResponse; 13 | import java.io.Serializable; 14 | 15 | /** 16 | *

17 | * Jwt会话管理 18 | *

19 | * 20 | * @author lvyx 21 | * @since 2022-01-14 11:32:02 22 | */ 23 | public class ShiroSessionManager extends DefaultWebSessionManager { 24 | 25 | 26 | @Resource 27 | private JwtTokenManager jwtTokenManager; 28 | 29 | @Override 30 | protected Serializable getSessionId(ServletRequest request, ServletResponse response) { 31 | // 判断request请求中是否带有jwtToken的key 32 | String jwtToken = WebUtils.toHttp(request).getHeader(ShiroTokenEnum.AUTHORIZATION.getValue()); 33 | if (ObjectUtil.isEmpty(jwtToken)){ 34 | // 如果没有走默认的cook获得sessionId的方式 35 | return super.getSessionId(request, response); 36 | }else { 37 | // 如果有走jwtToken获得sessionI的的方式 38 | Claims claims = null; 39 | String id = null; 40 | try { 41 | claims = jwtTokenManager.decodeToken(jwtToken); 42 | // 创建token的时候SessionId赋给了jti 43 | id = (String) claims.get("jti"); 44 | request.setAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID_SOURCE, 45 | ShiroTokenEnum.REFERENCED_SESSION_ID_SOURCE.getValue()); 46 | request.setAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID, id); 47 | request.setAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID_IS_VALID, Boolean.TRUE); 48 | } catch (Exception e) { 49 | // 无法获取sessionId 50 | return null; 51 | } 52 | return id; 53 | } 54 | 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /mail/src/main/java/com/lvyx/mail/entity/CommunityMessage.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.mail.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | import java.time.LocalDateTime; 10 | 11 | /** 12 | *

13 | * 社区消息 14 | *

15 | * 16 | * @author lvyx 17 | * @since 2022-04-30 18 | */ 19 | @Data 20 | @TableName("l_community_message") 21 | @ApiModel(value = "CommunityMessage对象", description = "社区消息") 22 | public class CommunityMessage implements Serializable { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | @ApiModelProperty("主键") 27 | @TableId(value = "ID", type = IdType.ASSIGN_UUID) 28 | private String id; 29 | 30 | @ApiModelProperty("消息主题") 31 | @TableField("SUBJECT") 32 | private String subject; 33 | 34 | @ApiModelProperty("消息内容") 35 | @TableField("CONTENT") 36 | private String content; 37 | 38 | @ApiModelProperty("是否发送邮件(0:发送,1:不发送)") 39 | @TableField("IS_EMAIL") 40 | private Integer isEmail; 41 | 42 | @ApiModelProperty("排序") 43 | @TableField("SORT_NO") 44 | private Integer sortNo; 45 | 46 | @ApiModelProperty("是否有效(0:无效,1:有效)") 47 | @TableField("IS_ENABLE") 48 | private Integer isEnable; 49 | 50 | @ApiModelProperty("创建者") 51 | @TableField("CREATE_USER") 52 | private String createUser; 53 | 54 | @ApiModelProperty("创建时间") 55 | @TableField("CREATE_TIME") 56 | private LocalDateTime createTime; 57 | 58 | @ApiModelProperty("修改者") 59 | @TableField("UPDATE_USER") 60 | private String updateUser; 61 | 62 | @ApiModelProperty("修改时间") 63 | @TableField("UPDATE_TIME") 64 | private LocalDateTime updateTime; 65 | 66 | @ApiModelProperty("是否删除(0:未删除,1:删除)") 67 | @TableField("IS_DELETE") 68 | @TableLogic 69 | private Integer isDelete; 70 | 71 | @ApiModelProperty("删除者") 72 | @TableField("DELETE_USER") 73 | private String deleteUser; 74 | 75 | @ApiModelProperty("删除时间") 76 | @TableField("DELETE_TIME") 77 | private LocalDateTime deleteTime; 78 | 79 | 80 | } 81 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/config/SysRedisConfig.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.config; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.redisson.Redisson; 5 | import org.redisson.api.RedissonClient; 6 | import org.redisson.config.Config; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.context.annotation.Configuration; 9 | 10 | import javax.annotation.Resource; 11 | 12 | /** 13 | *

14 | * 系统缓存客户端配置类 15 | *

16 | * 17 | * @author lvyx 18 | * @since 2022-01-17 09:43:11 19 | */ 20 | @Slf4j 21 | @Configuration 22 | public class SysRedisConfig { 23 | 24 | @Resource 25 | private SysRedisProperties sysRedisProperties; 26 | 27 | /** 28 | * 创建Redis客户供系统使用 29 | * @return org.redisson.api.RedissonClient 30 | * @author lvyx 31 | * @since 2021/12/31 8:50 32 | **/ 33 | @Bean("redissonClientSystem") 34 | public RedissonClient redissonClient() { 35 | log.info("=====初始化redissonClientForSystem开始======"); 36 | String[] nodeList = sysRedisProperties.getNodes().split(","); 37 | Config config = new Config(); 38 | if (nodeList.length == 1) { 39 | // 单一节点 40 | config.useSingleServer().setAddress(nodeList[0]) 41 | .setConnectTimeout(sysRedisProperties.getConnectTimeout()) 42 | .setConnectionMinimumIdleSize(sysRedisProperties.getConnectionMinimumidleSize()) 43 | .setConnectionPoolSize(sysRedisProperties.getConnectPoolSize()).setTimeout(sysRedisProperties.getTimeout()); 44 | } else { 45 | // 集群环境 46 | config.useClusterServers().addNodeAddress(nodeList) 47 | .setConnectTimeout(sysRedisProperties.getConnectTimeout()) 48 | .setMasterConnectionMinimumIdleSize(sysRedisProperties.getConnectionMinimumidleSize()) 49 | .setMasterConnectionPoolSize(sysRedisProperties.getConnectPoolSize()).setTimeout(sysRedisProperties.getTimeout()); 50 | } 51 | RedissonClient redissonClient = Redisson.create(config); 52 | log.info("=====初始化redissonClientForSystem完成======"); 53 | return redissonClient; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/utils/ShiroUtils.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.utils; 2 | 3 | import cn.hutool.core.util.ObjectUtil; 4 | import com.lvyx.commons.pojo.ShiroUser; 5 | import org.apache.shiro.SecurityUtils; 6 | import org.apache.shiro.session.Session; 7 | import org.apache.shiro.util.ThreadContext; 8 | 9 | import java.util.Objects; 10 | 11 | /** 12 | *

13 | * shiro工具类 14 | *

15 | * 16 | * @author lvyx 17 | * @since 2021-12-31 13:41:04 18 | */ 19 | public class ShiroUtils { 20 | 21 | /** 22 | * 得到shiro session对象 23 | * @return org.apache.shiro.session.Session 24 | * @author lvyx 25 | * @since 2021/12/31 13:44 26 | **/ 27 | public static Session getSession(){ 28 | return SecurityUtils.getSubject().getSession(); 29 | } 30 | 31 | /** 32 | * 得到shiro的sessionId 33 | * @return java.lang.String 34 | * @author lvyx 35 | * @since 2021/12/31 13:45 36 | **/ 37 | public static String getSessionId(){ 38 | return getSession().getId().toString(); 39 | } 40 | 41 | 42 | /** 43 | * 判断是否登录 44 | * @return boolean 45 | * @author lvyx 46 | * @since 2021/12/31 13:46 47 | **/ 48 | public static boolean isAuthenticated(){ 49 | return SecurityUtils.getSubject().isAuthenticated(); 50 | } 51 | 52 | /** 53 | * 得到shiroUser对象 54 | * @return com.lvyx.author.shiro.pojo.ShiroUser 55 | * @author lvyx 56 | * @since 2022/1/13 13:55 57 | **/ 58 | public static ShiroUser getShiroUser(){ 59 | if (ObjectUtil.isNotEmpty(ThreadContext.getSubject()) && ObjectUtil.isNotEmpty(ThreadContext.getSubject().getPrincipal())){ 60 | return (ShiroUser)SecurityUtils.getSubject().getPrincipal(); 61 | } 62 | return null; 63 | } 64 | 65 | 66 | /** 67 | * 得到UserId 68 | * @return com.lvyx.author.shiro.pojo.ShiroUser 69 | * @author lvyx 70 | * @since 2022/1/13 13:55 71 | **/ 72 | public static String getUserId(){ 73 | ShiroUser shiroUser = getShiroUser(); 74 | if (! Objects.isNull(shiroUser)){ 75 | return shiroUser.getId(); 76 | } 77 | return null; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /commons/src/main/java/com/lvyx/commons/utils/BaseEntityUtil.java: -------------------------------------------------------------------------------- 1 | package com.lvyx.commons.utils; 2 | 3 | import com.lvyx.commons.enums.BooleanTypeEnum; 4 | import lombok.extern.slf4j.Slf4j; 5 | 6 | import java.time.LocalDateTime; 7 | import java.util.UUID; 8 | 9 | 10 | /** 11 | * 操作数据工具类 12 | * 13 | * @author lvyx 14 | * @since 2022/2/4 15:58 15 | **/ 16 | @Slf4j 17 | public class BaseEntityUtil { 18 | 19 | public static Object add(String userId, Object object){ 20 | Class objectClass = object.getClass(); 21 | try{ 22 | objectClass.getDeclaredMethod("setId",String.class).invoke(object, UUID.randomUUID().toString()); 23 | objectClass.getDeclaredMethod("setCreateUser",String.class).invoke(object,userId); 24 | objectClass.getDeclaredMethod("setCreateTime", LocalDateTime.class).invoke(object,LocalDateTime.now()); 25 | objectClass.getDeclaredMethod("setIsEnable", Integer.class).invoke(object, BooleanTypeEnum.YES.getCode()); 26 | objectClass.getDeclaredMethod("setIsDelete", Integer.class).invoke(object, BooleanTypeEnum.NO.getCode()); 27 | }catch (Exception e){ 28 | log.error(e.toString(),e); 29 | } 30 | return object; 31 | } 32 | 33 | public static Object edit(String userId, Object object){ 34 | Class objectClass = object.getClass(); 35 | try{ 36 | objectClass.getDeclaredMethod("setUpdateUser",String.class).invoke(object,userId); 37 | objectClass.getDeclaredMethod("setUpdateTime", LocalDateTime.class).invoke(object,LocalDateTime.now()); 38 | }catch (Exception e){ 39 | log.error(e.toString(),e); 40 | } 41 | return object; 42 | } 43 | 44 | public static Object delete(String userId, Object object){ 45 | Class objectClass = object.getClass(); 46 | try{ 47 | objectClass.getDeclaredMethod("setDeleteUser",String.class).invoke(object,userId); 48 | objectClass.getDeclaredMethod("setDeleteTime", LocalDateTime.class).invoke(object,LocalDateTime.now()); 49 | }catch (Exception e){ 50 | log.error(e.toString(),e); 51 | } 52 | return object; 53 | } 54 | 55 | } 56 | --------------------------------------------------------------------------------