├── .idea ├── .gitignore ├── compiler.xml ├── dataSources.xml ├── encodings.xml ├── jarRepositories.xml ├── misc.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── logs ├── logs.2023-04-10.0.log ├── logs.2023-04-11.0.log ├── logs.2023-04-12.0.log └── logs.log ├── platform-api-web ├── pom.xml └── src │ └── main │ ├── java │ └── cn │ │ └── common │ │ ├── AnimalAppWebApplication.java │ │ └── api │ │ ├── BaseApiController.java │ │ ├── biz │ │ ├── AdoptApplyController.java │ │ ├── AdoptionDataController.java │ │ ├── AuthUserController.java │ │ ├── FeedingStrategyController.java │ │ ├── MainSwiperController.java │ │ ├── MessageWordController.java │ │ └── RescueStationController.java │ │ └── platform │ │ ├── PlatformApiLogController.java │ │ ├── PlatformController.java │ │ ├── PlatformDictController.java │ │ └── PlatformFileController.java │ └── resources │ ├── application.yml │ ├── bootstrap.yml │ ├── logback-spring.xml │ └── spy.properties ├── platform-common ├── pom.xml └── src │ └── main │ ├── java │ └── cn │ │ └── common │ │ ├── constants │ │ └── BizConstants.java │ │ └── enums │ │ ├── AdoptStatusEnum.java │ │ ├── AuditStatusEnum.java │ │ ├── BizErrorCode.java │ │ ├── ErrorCode.java │ │ └── GenderEnum.java │ └── resources │ └── lib │ ├── platform-common-0.0.1.PRO-sources.jar │ ├── platform-common-0.0.1.PRO.jar │ ├── platform-interaction-0.0.1.PRO-sources.jar │ └── platform-interaction-0.0.1.PRO.jar ├── platform-interaction ├── pom.xml └── src │ └── main │ └── java │ └── cn │ └── common │ ├── internal │ ├── AuthUserLoginReq.java │ └── ViewRecordMeta.java │ ├── req │ ├── AdoptApplyAddReq.java │ ├── AdoptPetLimitReq.java │ ├── AdoptionApplyReq.java │ ├── AdoptionDataAddReq.java │ ├── AdoptionDataReq.java │ ├── AppUpdatePwdReq.java │ ├── AppUserRegReq.java │ ├── FeedingStrategyReq.java │ ├── MainSwiperReq.java │ ├── MessageWordAddReq.java │ ├── MessageWordReq.java │ ├── RescueStationAddReq.java │ └── RescueStationReq.java │ └── resp │ ├── AdoptApplyResp.java │ ├── AdoptionDataResp.java │ ├── AppLoginResp.java │ ├── FeedingStrategyResp.java │ ├── LoginResp.java │ ├── MainSwiperResp.java │ ├── MessageWordResp.java │ ├── RescueStationResp.java │ └── TokenVerifyResp.java ├── platform-repository ├── pom.xml └── src │ └── main │ └── java │ └── cn │ └── common │ └── repository │ ├── entity │ ├── biz │ │ ├── AccountingRecord.java │ │ ├── AdoptApply.java │ │ ├── AdoptionData.java │ │ ├── AppUser.java │ │ ├── FeedingStrategy.java │ │ ├── MainSwiper.java │ │ ├── MessageWord.java │ │ └── RescueStation.java │ └── platform │ │ ├── AuthPermission.java │ │ ├── AuthRole.java │ │ ├── AuthRolePermission.java │ │ ├── AuthUser.java │ │ ├── AuthUserRole.java │ │ ├── PlatformApiLog.java │ │ └── PlatformDict.java │ └── repository │ ├── biz │ ├── AccountingRecordRepository.java │ ├── AdoptionApplyRepository.java │ ├── AdoptionDataRepository.java │ ├── AppUserRepository.java │ ├── FeedingStrategyRepository.java │ ├── MainSwiperRepository.java │ ├── MessageWordRepository.java │ └── RescueStationRepository.java │ ├── platform │ ├── AuthPermissionRepository.java │ ├── AuthRolePermissionRepository.java │ ├── AuthRoleRepository.java │ ├── AuthUserRepository.java │ ├── AuthUserRoleRepository.java │ ├── PlatformApiLogRepository.java │ └── PlatformDictRepository.java │ └── result │ ├── AuthPermissionResult.java │ ├── AuthUserRoleResult.java │ ├── BaseResult.java │ └── NodeResult.java ├── platform-service ├── pom.xml └── src │ └── main │ └── java │ └── cn │ └── common │ └── service │ ├── aspect │ └── LogRecordAspect.java │ ├── biz │ ├── AdoptApplyService.java │ ├── AdoptionDataService.java │ ├── FeedingStrategyService.java │ ├── MainSwiperService.java │ ├── MessageWordService.java │ └── RescueStationService.java │ ├── data │ └── ItemCriteriaBuilder.java │ ├── impl │ ├── biz │ │ ├── FeedingStrategyServiceImpl.java │ │ ├── MainSwiperServiceImpl.java │ │ ├── MessageWordServiceImpl.java │ │ └── RescueStationServiceImpl.java │ └── platform │ │ ├── AdoptApplyServiceImpl.java │ │ ├── AdoptionDataServiceImpl.java │ │ ├── AsyncHandlerServiceImpl.java │ │ ├── AuthUserServiceImpl.java │ │ ├── PlatformApiLogServiceImpl.java │ │ ├── PlatformBizServiceImpl.java │ │ ├── PlatformDictServiceImpl.java │ │ ├── PlatformFileServiceImpl.java │ │ └── PlatformServiceImpl.java │ ├── netty │ ├── NettyBootstrapRunner.java │ ├── NettyChannelService.java │ └── WebSocketMessageHandler.java │ └── platform │ ├── AsyncHandlerService.java │ ├── AuthUserService.java │ ├── PlatformApiLogService.java │ ├── PlatformBizService.java │ ├── PlatformDictService.java │ ├── PlatformFileService.java │ └── PlatformService.java └── pom.xml /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | # Zeppelin ignored files 10 | /ZeppelinRemoteNotebooks/ 11 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 26 | 27 | -------------------------------------------------------------------------------- /.idea/dataSources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mysql.8 6 | true 7 | com.mysql.cj.jdbc.Driver 8 | jdbc:mysql://localhost:3306/animal-platform 9 | $ProjectFileDir$ 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | 29 | 30 | 34 | 35 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # animal-app-api 2 | 本系统分为后台管理系统端和微信小程序端。是基于SSM框架的流浪猫狗领养救助平台管理系统,平台用户可以在浏览器登录系统后进行一系列操作。 同时系统具备微信小程序端,用户也可以在微信小程序端进行一系列的操作。本系统使用了SpringBoot2.X VUE2.6 Antd1.7.2 MyBatisPlus Shiro1.5.0 Java1.8等一系列技术。** 3 | 4 | ** 后台管理系统具备的功能: 1.实现了系统管理,包括了,系统用户管理,权限管理,角色管理 2.实现宠物救助站的账务记录,宠物领养申请,小程序轮播图,小程序用户信息功能。 3.实现了宠物养殖攻略发布功能,待领养宠物查看功能,浏览消息功能,救助站列表功能等。** 5 | -------------------------------------------------------------------------------- /logs/logs.2023-04-12.0.log: -------------------------------------------------------------------------------- 1 | 2023-04-12 13:09:16.885 DESKTOP-LI9S9CR [SpringApplicationShutdownHook] DEBUG o.s.boot.availability.ApplicationAvailabilityBean - 2023-04-12 13:09:16,885 DEBUG (ApplicationAvailabilityBean.java:77- Application availability state ReadinessState changed from ACCEPTING_TRAFFIC to REFUSING_TRAFFIC 2 | 2023-04-12 13:09:16.943 DESKTOP-LI9S9CR [SpringApplicationShutdownHook] DEBUG o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - 2023-04-12 13:09:16,943 DEBUG (AbstractApplicationContext.java:1049- Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@11968dd, started on Tue Apr 11 22:01:51 CST 2023, parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@13c4f79 3 | 2023-04-12 13:09:16.988 DESKTOP-LI9S9CR [SpringApplicationShutdownHook] DEBUG o.s.context.support.DefaultLifecycleProcessor - 2023-04-12 13:09:16,988 DEBUG (DefaultLifecycleProcessor.java:365- Stopping beans in phase 2147483647 4 | 2023-04-12 13:09:16.999 DESKTOP-LI9S9CR [SpringApplicationShutdownHook] DEBUG o.s.context.support.DefaultLifecycleProcessor - 2023-04-12 13:09:16,999 DEBUG (DefaultLifecycleProcessor.java:238- Bean 'webServerGracefulShutdown' completed its stop procedure 5 | 2023-04-12 13:09:17.000 DESKTOP-LI9S9CR [SpringApplicationShutdownHook] DEBUG o.s.context.support.DefaultLifecycleProcessor - 2023-04-12 13:09:17,000 DEBUG (DefaultLifecycleProcessor.java:365- Stopping beans in phase 2147483646 6 | 2023-04-12 13:09:17.640 DESKTOP-LI9S9CR [SpringApplicationShutdownHook] DEBUG o.s.context.support.DefaultLifecycleProcessor - 2023-04-12 13:09:17,640 DEBUG (DefaultLifecycleProcessor.java:238- Bean 'webServerStartStop' completed its stop procedure 7 | 2023-04-12 13:09:17.673 DESKTOP-LI9S9CR [SpringApplicationShutdownHook] DEBUG o.s.scheduling.concurrent.ThreadPoolTaskScheduler - 2023-04-12 13:09:17,673 DEBUG (ExecutorConfigurationSupport.java:218- Shutting down ExecutorService 'taskScheduler' 8 | 2023-04-12 13:09:17.680 DESKTOP-LI9S9CR [SpringApplicationShutdownHook] DEBUG o.s.data.redis.listener.RedisMessageListenerContainer - 2023-04-12 13:09:17,680 DEBUG (RedisMessageListenerContainer.java:242- Stopped RedisMessageListenerContainer 9 | 2023-04-12 13:09:17.688 DESKTOP-LI9S9CR [SpringApplicationShutdownHook] DEBUG o.s.jmx.export.annotation.AnnotationMBeanExporter - 2023-04-12 13:09:17,688 DEBUG (MBeanExporter.java:452- Unregistering JMX-exposed beans on shutdown 10 | 2023-04-12 13:09:17.691 DESKTOP-LI9S9CR [SpringApplicationShutdownHook] DEBUG o.s.jmx.export.annotation.AnnotationMBeanExporter - 2023-04-12 13:09:17,691 DEBUG (MBeanRegistrationSupport.java:186- Unregistering JMX-exposed beans 11 | 2023-04-12 13:09:17.704 DESKTOP-LI9S9CR [SpringApplicationShutdownHook] INFO com.alibaba.druid.pool.DruidDataSource - 2023-04-12 13:09:17,704 INFO (DruidDataSource.java:2071- {dataSource-1} closing ... 12 | 2023-04-12 13:09:17.722 DESKTOP-LI9S9CR [SpringApplicationShutdownHook] INFO com.alibaba.druid.pool.DruidDataSource - 2023-04-12 13:09:17,722 INFO (DruidDataSource.java:2144- {dataSource-1} closed 13 | -------------------------------------------------------------------------------- /platform-api-web/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | animal-app-api 7 | com.animal-app-api 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | platform-api-web 12 | ${project.build.version} 13 | 14 | cn.common.AnimalAppWebApplication 15 | 16 | animal-app-api 17 | 18 | 19 | 20 | central 21 | AliYunMaven 22 | ${repository.url} 23 | default 24 | 25 | 26 | true 27 | 28 | 29 | 30 | false 31 | 32 | 33 | 34 | 35 | 36 | public 37 | groups 38 | ${repository.url} 39 | 40 | true 41 | 42 | 43 | true 44 | 45 | 46 | 47 | 48 | 53 | 54 | 55 | 56 | com.animal-app-api 57 | platform-service 58 | 0.0.1-SNAPSHOT 59 | 60 | 61 | cn.common 62 | platform-common 63 | 0.0.1-SNAPSHOT 64 | 65 | 66 | com.animal-app-api 67 | platform-repository 68 | 0.0.1-SNAPSHOT 69 | 70 | 71 | com.animal-app-api 72 | platform-interaction 73 | 0.0.1-SNAPSHOT 74 | 75 | 76 | 77 | org.springframework.boot 78 | spring-boot-starter-test 79 | test 80 | 81 | 82 | junit 83 | junit 84 | test 85 | 86 | 87 | 88 | 89 | ${deploy.package.name} 90 | 91 | 92 | org.springframework.boot 93 | spring-boot-maven-plugin 94 | 2.6.3 95 | 96 | true 97 | 500 98 | true 99 | ${project.main.class} 100 | ../ 101 | 102 | 103 | 104 | org.springframework 105 | springloaded 106 | 1.2.5.RELEASE 107 | 108 | 109 | 110 | 111 | org.apache.maven.plugins 112 | maven-surefire-plugin 113 | 2.18.1 114 | 115 | 116 | true 117 | 118 | 119 | 120 | maven-assembly-plugin 121 | 122 | 123 | false 124 | 125 | ${deploy.package.name} 126 | ../ 127 | 128 | src/assembly/package.xml 129 | 130 | 131 | 132 | 133 | make-assembly 134 | package 135 | 136 | single 137 | 138 | 139 | 140 | 141 | 142 | org.apache.maven.plugins 143 | maven-resources-plugin 144 | ${maven-resources-plugin.version} 145 | 146 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /platform-api-web/src/main/java/cn/common/AnimalAppWebApplication.java: -------------------------------------------------------------------------------- 1 | package cn.common; 2 | import lombok.extern.slf4j.Slf4j; 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.boot.web.servlet.FilterRegistrationBean; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.context.annotation.Configuration; 9 | import org.springframework.context.annotation.EnableAspectJAutoProxy; 10 | import org.springframework.scheduling.annotation.EnableScheduling; 11 | import org.springframework.transaction.annotation.EnableTransactionManagement; 12 | import org.springframework.web.cors.CorsConfiguration; 13 | import org.springframework.web.cors.UrlBasedCorsConfigurationSource; 14 | import org.springframework.web.filter.CorsFilter; 15 | 16 | /** 17 | * @packageName cn.common 18 | * @Description: 启动类 19 | */ 20 | 21 | //启动类 22 | @SpringBootApplication(scanBasePackages = { 23 | "pro.skywalking", 24 | "cn.common" 25 | }) 26 | @MapperScan({"cn.common.repository.repository"}) 27 | @EnableScheduling 28 | @EnableAspectJAutoProxy(exposeProxy = true) 29 | @Configuration 30 | @EnableTransactionManagement 31 | @Slf4j 32 | public class AnimalAppWebApplication { 33 | 34 | public static void main(String[] args) { 35 | SpringApplication.run(AnimalAppWebApplication.class, args); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /platform-api-web/src/main/java/cn/common/api/biz/AdoptApplyController.java: -------------------------------------------------------------------------------- 1 | package cn.common.api.biz; 2 | 3 | import cn.common.api.BaseApiController; 4 | import cn.common.req.AdoptApplyAddReq; 5 | import cn.common.req.AdoptionApplyReq; 6 | import cn.common.resp.AdoptApplyResp; 7 | import cn.common.service.biz.AdoptApplyService; 8 | import lombok.extern.slf4j.Slf4j; 9 | import org.springframework.web.bind.annotation.PostMapping; 10 | import org.springframework.web.bind.annotation.RequestBody; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RestController; 13 | import pro.skywalking.anon.ApiLog; 14 | import pro.skywalking.interceptor.NeedLogin; 15 | import pro.skywalking.resp.base.ApiResponse; 16 | import pro.skywalking.resp.page.Pagination; 17 | 18 | import javax.annotation.Resource; 19 | import javax.servlet.http.HttpServletResponse; 20 | import javax.validation.Valid; 21 | 22 | /** 23 | * @Description: 前端控制器 24 | */ 25 | @RestController 26 | @RequestMapping(value = "api/v1/adoptionApply") 27 | @Slf4j 28 | public class AdoptApplyController extends BaseApiController { 29 | 30 | @Resource 31 | private AdoptApplyService adoptApplyService; 32 | 33 | @Resource 34 | private HttpServletResponse response; 35 | 36 | /** 37 | * 新增领养信息 38 | * @param addReq 新增Req 39 | */ 40 | @PostMapping(value = "/addItem") 41 | @ApiLog(value = "新增领养信息信息") 42 | @NeedLogin 43 | public ApiResponse addItem(@RequestBody @Valid AdoptApplyAddReq addReq){ 44 | adoptApplyService.addItem(addReq); 45 | return apiResponse(); 46 | } 47 | 48 | /** 49 | * 分页查询领养申请信息 50 | * @param pageReq 分页查询Req 51 | * @return Pagination 52 | */ 53 | @PostMapping(value = "/queryByPage") 54 | @ApiLog(value = "分页查询领养申请信息") 55 | @NeedLogin(value = false) 56 | public ApiResponse> queryByPage( 57 | @RequestBody @Valid AdoptionApplyReq pageReq){ 58 | return apiResponse(adoptApplyService.queryByPage(pageReq)); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /platform-api-web/src/main/java/cn/common/api/biz/AdoptionDataController.java: -------------------------------------------------------------------------------- 1 | package cn.common.api.biz; 2 | 3 | import cn.common.api.BaseApiController; 4 | import cn.common.internal.ViewRecordMeta; 5 | import cn.common.req.AdoptPetLimitReq; 6 | import cn.common.req.AdoptionDataAddReq; 7 | import cn.common.req.AdoptionDataReq; 8 | import cn.common.resp.AdoptionDataResp; 9 | import cn.common.service.biz.AdoptionDataService; 10 | import lombok.extern.slf4j.Slf4j; 11 | import org.springframework.web.bind.annotation.GetMapping; 12 | import org.springframework.web.bind.annotation.PostMapping; 13 | import org.springframework.web.bind.annotation.RequestBody; 14 | import org.springframework.web.bind.annotation.RequestMapping; 15 | import org.springframework.web.bind.annotation.RequestParam; 16 | import org.springframework.web.bind.annotation.RestController; 17 | import pro.skywalking.anon.ApiLog; 18 | import pro.skywalking.interceptor.NeedLogin; 19 | import pro.skywalking.resp.base.ApiResponse; 20 | import pro.skywalking.resp.page.Pagination; 21 | 22 | import javax.annotation.Resource; 23 | import javax.servlet.http.HttpServletResponse; 24 | import javax.validation.Valid; 25 | import java.util.List; 26 | 27 | /** 28 | * @Description: 前端控制器 29 | */ 30 | @RestController 31 | @RequestMapping(value = "api/v1/adoptionData") 32 | @Slf4j 33 | //采用数据控制器 34 | public class AdoptionDataController extends BaseApiController { 35 | 36 | @Resource 37 | private AdoptionDataService adoptionDataService; 38 | 39 | @Resource 40 | private HttpServletResponse response; 41 | 42 | /** 43 | * 新增待领养 44 | * @param addReq 新增Req 45 | */ 46 | @PostMapping(value = "/addItem") 47 | @ApiLog(value = "新增待领养信息") 48 | public ApiResponse addItem(@RequestBody @Valid AdoptionDataAddReq addReq){ 49 | adoptionDataService.addItem(addReq); 50 | return apiResponse(); 51 | } 52 | 53 | /** 54 | * 分页查询待领养 55 | * @param pageReq 分页查询Req 56 | * @return Pagination 57 | */ 58 | @PostMapping(value = "/queryByPage") 59 | @ApiLog(value = "分页查询待领养信息") 60 | @NeedLogin(value = false) 61 | public ApiResponse> queryByPage( 62 | @RequestBody @Valid AdoptionDataReq pageReq){ 63 | return apiResponse(adoptionDataService.queryByPage(pageReq)); 64 | } 65 | 66 | /** 67 | * 查询指定数量的动物 68 | * @param req 查询请求参数 69 | * @return java.util.List 70 | */ 71 | @PostMapping(value = "/queryTopLimit") 72 | @ApiLog(value = "查询指定数量的动物") 73 | @NeedLogin(value = false) 74 | public ApiResponse> queryTopLimit(@RequestBody @Valid AdoptPetLimitReq req){ 75 | return apiResponse(adoptionDataService.queryTopLimit(req)); 76 | } 77 | /** 78 | * 查询宠物详情 79 | * @param mainId 宠物信息ID 80 | * @return 81 | */ 82 | @GetMapping(value = "/queryParticulars") 83 | @ApiLog(value = "查询宠物详情") 84 | @NeedLogin 85 | public ApiResponse queryParticulars(@RequestParam(name = "mainId") 86 | String mainId){ 87 | return apiResponse(adoptionDataService.queryParticulars(mainId)); 88 | } 89 | 90 | /** 91 | * 查询所有待领养信息 92 | * @return java.util.List 93 | */ 94 | @GetMapping(value = "/allAdoptionData") 95 | @ApiLog(value = "查询所有待领养信息") 96 | @NeedLogin(value = false) 97 | public ApiResponse> allAdoptionData(){ 98 | return apiResponse(adoptionDataService.allAdoptionData()); 99 | } 100 | 101 | /** 102 | * 设置宠物查看记录 103 | * @param mainId 宠物ID 104 | * @return 105 | */ 106 | @GetMapping(value = "/setViewPetData") 107 | @ApiLog(value = "设置宠物查看记录") 108 | @NeedLogin 109 | public ApiResponse setViewPetData(@RequestParam(name = "mainId") 110 | String mainId){ 111 | adoptionDataService.setViewPetData(mainId); 112 | return apiResponse(); 113 | } 114 | 115 | /** 116 | * 查询当前用户的查看记录 117 | * @param 118 | * @return java.util.List 119 | */ 120 | @GetMapping(value = "/queryViewRecord") 121 | @ApiLog(value = "设置宠物查看记录") 122 | @NeedLogin 123 | public ApiResponse> queryViewRecord(){ 124 | return apiResponse(adoptionDataService.queryViewRecord()); 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /platform-api-web/src/main/java/cn/common/api/biz/AuthUserController.java: -------------------------------------------------------------------------------- 1 | package cn.common.api.biz; 2 | 3 | import cn.common.api.BaseApiController; 4 | import cn.common.internal.AuthUserLoginReq; 5 | import cn.common.req.AppUpdatePwdReq; 6 | import cn.common.req.AppUserRegReq; 7 | import cn.common.resp.AppLoginResp; 8 | import cn.common.resp.TokenVerifyResp; 9 | import cn.common.service.platform.AuthUserService; 10 | import lombok.extern.slf4j.Slf4j; 11 | import org.springframework.web.bind.annotation.*; 12 | import pro.skywalking.anon.ApiLog; 13 | import pro.skywalking.interceptor.NeedLogin; 14 | import pro.skywalking.resp.base.ApiResponse; 15 | 16 | import javax.annotation.Resource; 17 | import javax.validation.Valid; 18 | 19 | /** 20 | * @Description: 前端控制器 21 | */ 22 | @RestController 23 | @RequestMapping(value = "api/v1/authUser") 24 | @Slf4j 25 | public class AuthUserController extends BaseApiController { 26 | 27 | @Resource 28 | private AuthUserService authUserService; 29 | 30 | /** 31 | * 系统登录 32 | * 登录后返回该用户角色 33 | * @param req 34 | */ 35 | @PostMapping("/authUserLogin") 36 | @ApiLog(value = "APP用户登录") 37 | @NeedLogin(value = false) 38 | public ApiResponse authUserLogin(@RequestBody AuthUserLoginReq req){ 39 | return apiResponse(authUserService.authUserLogin(req)); 40 | } 41 | 42 | /** 43 | * 用户注册 44 | * @description: 45 | * @param req 请求参数 46 | * */ 47 | @PostMapping("/userRegister") 48 | @ApiLog(value = "用户注册") 49 | @NeedLogin(value = false) 50 | public ApiResponse userRegister(@RequestBody @Valid AppUserRegReq req){ 51 | return apiResponse(authUserService.userRegister(req)); 52 | } 53 | 54 | /** 55 | * 退出登录 56 | */ 57 | @PostMapping("/logOut") 58 | @ApiLog(value = "退出登录") 59 | @NeedLogin 60 | public ApiResponse logOut(){ 61 | authUserService.logOut(); 62 | return apiResponse(); 63 | } 64 | 65 | /** 66 | * 验证Token 67 | */ 68 | @GetMapping("/verifyToken") 69 | @ApiLog(value = "验证Token") 70 | @NeedLogin(value = false) 71 | public ApiResponse verifyToken(){ 72 | return apiResponse(authUserService.verifyToken()); 73 | } 74 | 75 | /** 76 | * 拿到登录后的用户信息 77 | */ 78 | @GetMapping("/queryLoginUserMeta") 79 | @ApiLog(value = "拿到登录后的用户信息") 80 | @NeedLogin 81 | public ApiResponse queryLoginUserMeta(){ 82 | return apiResponse(authUserService.queryLoginUserMeta()); 83 | } 84 | 85 | /** 86 | * 更新密码 87 | * @param req 请求参数 88 | */ 89 | @PostMapping("/updatePassword") 90 | @ApiLog(value = "更新密码") 91 | @NeedLogin 92 | public ApiResponse updatePassword(@RequestBody AppUpdatePwdReq req){ 93 | authUserService.updatePassword(req); 94 | return apiResponse(); 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /platform-api-web/src/main/java/cn/common/api/biz/FeedingStrategyController.java: -------------------------------------------------------------------------------- 1 | package cn.common.api.biz; 2 | 3 | import cn.common.api.BaseApiController; 4 | import cn.common.req.FeedingStrategyReq; 5 | import cn.common.resp.FeedingStrategyResp; 6 | import cn.common.service.biz.FeedingStrategyService; 7 | import lombok.extern.slf4j.Slf4j; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.PostMapping; 10 | import org.springframework.web.bind.annotation.RequestBody; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RestController; 13 | import pro.skywalking.anon.ApiLog; 14 | import pro.skywalking.interceptor.NeedLogin; 15 | import pro.skywalking.req.base.BaseDeleteReq; 16 | import pro.skywalking.resp.base.ApiResponse; 17 | import pro.skywalking.resp.page.Pagination; 18 | 19 | import javax.annotation.Resource; 20 | import javax.servlet.http.HttpServletResponse; 21 | import javax.validation.Valid; 22 | import java.util.List; 23 | 24 | /** 25 | * @Description: 养宠攻略前端控制器 26 | */ 27 | @RestController 28 | @RequestMapping(value = "api/v1/feedingStrategy") 29 | @Slf4j 30 | public class FeedingStrategyController extends BaseApiController { 31 | 32 | @Resource 33 | private FeedingStrategyService feedingStrategyService; 34 | 35 | @Resource 36 | private HttpServletResponse response; 37 | 38 | /** 39 | * 主键ID集合批量删除养宠攻略2 40 | * @param req 需要被删除的信息 41 | */ 42 | @PostMapping(value = "/batchDeleteItem") 43 | @ApiLog(value = "根据主键ID集合批量删除") 44 | @NeedLogin(value = true) 45 | public ApiResponse batchDeleteItem(@RequestBody BaseDeleteReq req){ 46 | feedingStrategyService.batchDeleteItem(req); 47 | return apiResponse(); 48 | } 49 | 50 | /** 51 | * 查询所有养宠攻略信息 52 | * @param 53 | * @return java.util.List 54 | */ 55 | @GetMapping(value = "/queryAllFeedingStrategy") 56 | @ApiLog(value = "查询所有信息") 57 | @NeedLogin(value = false) 58 | public ApiResponse> queryAllFeedingStrategy(){ 59 | return apiResponse(feedingStrategyService.queryAllFeedingStrategy()); 60 | } 61 | 62 | /** 63 | * 分页查询养宠攻略 64 | * @param pageReq 分页查询Req 65 | * @return Pagination 66 | */ 67 | @PostMapping(value = "/queryByPage") 68 | @ApiLog(value = "分页查询信息") 69 | @NeedLogin(value = false) 70 | public ApiResponse> queryByPage( 71 | @RequestBody @Valid FeedingStrategyReq pageReq){ 72 | return apiResponse(feedingStrategyService.queryByPage(pageReq)); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /platform-api-web/src/main/java/cn/common/api/biz/MainSwiperController.java: -------------------------------------------------------------------------------- 1 | package cn.common.api.biz; 2 | 3 | import cn.common.api.BaseApiController; 4 | import cn.common.req.MainSwiperReq; 5 | import cn.common.resp.MainSwiperResp; 6 | import cn.common.service.biz.MainSwiperService; 7 | import lombok.extern.slf4j.Slf4j; 8 | import org.springframework.web.bind.annotation.*; 9 | import pro.skywalking.anon.ApiLog; 10 | import pro.skywalking.req.base.BaseDeleteReq; 11 | import pro.skywalking.resp.base.ApiResponse; 12 | import pro.skywalking.resp.page.Pagination; 13 | 14 | import javax.annotation.Resource; 15 | import javax.servlet.http.HttpServletResponse; 16 | import javax.validation.Valid; 17 | import java.util.List; 18 | 19 | /*** @packageName cn.common.api.controller 20 | * @Description: APP首页轮播图信息前端控制器 21 | */ 22 | @RestController 23 | @RequestMapping(value = "api/v1/mainSwiper") 24 | @Slf4j 25 | public class MainSwiperController extends BaseApiController { 26 | 27 | @Resource 28 | private MainSwiperService mainSwiperService; 29 | 30 | @Resource 31 | private HttpServletResponse response; 32 | 33 | /** 34 | * 主键ID集合批量删除APP首页轮播图信息 35 | * @param req 需要被删除的信息 36 | */ 37 | @PostMapping(value = "/batchDeleteItem") 38 | @ApiLog(value = "根据主键ID集合批量删除") 39 | public ApiResponse batchDeleteItem(@RequestBody BaseDeleteReq req){ 40 | mainSwiperService.batchDeleteItem(req); 41 | return apiResponse(); 42 | } 43 | 44 | /** 45 | * 查询所有APP首页轮播图信息信息 46 | * @param 47 | * @return java.util.List 48 | */ 49 | @GetMapping(value = "/queryAllMainSwiper") 50 | @ApiLog(value = "查询所有信息") 51 | public ApiResponse> queryAllMainSwiper(){ 52 | return apiResponse(mainSwiperService.queryAllMainSwiper()); 53 | } 54 | 55 | /** 56 | * 分页查询APP首页轮播图信息 57 | * @param pageReq 分页查询Req 58 | * @return Pagination 59 | */ 60 | @PostMapping(value = "/queryByPage") 61 | @ApiLog(value = "分页查询信息") 62 | public ApiResponse> queryByPage( 63 | @RequestBody @Valid MainSwiperReq pageReq){ 64 | return apiResponse(mainSwiperService.queryByPage(pageReq)); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /platform-api-web/src/main/java/cn/common/api/biz/MessageWordController.java: -------------------------------------------------------------------------------- 1 | package cn.common.api.biz; 2 | 3 | import cn.common.api.BaseApiController; 4 | import cn.common.req.MessageWordAddReq; 5 | import cn.common.req.MessageWordReq; 6 | import cn.common.resp.MessageWordResp; 7 | import cn.common.service.biz.MessageWordService; 8 | import lombok.extern.slf4j.Slf4j; 9 | import org.springframework.web.bind.annotation.PostMapping; 10 | import org.springframework.web.bind.annotation.RequestBody; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RestController; 13 | import pro.skywalking.anon.ApiLog; 14 | import pro.skywalking.interceptor.NeedLogin; 15 | import pro.skywalking.req.base.BaseDeleteReq; 16 | import pro.skywalking.resp.base.ApiResponse; 17 | import pro.skywalking.resp.page.Pagination; 18 | 19 | import javax.annotation.Resource; 20 | import javax.servlet.http.HttpServletResponse; 21 | import javax.validation.Valid; 22 | 23 | /** 24 | * @Description: 前端控制器 25 | */ 26 | @RestController 27 | @RequestMapping(value = "api/v1/messageWord") 28 | @Slf4j 29 | public class MessageWordController extends BaseApiController { 30 | 31 | @Resource 32 | private MessageWordService messageWordService; 33 | 34 | @Resource 35 | private HttpServletResponse response; 36 | 37 | /** 38 | * 新增交流消息 39 | * @param addReq 新增交流消息Req 40 | */ 41 | @PostMapping(value = "/addItem") 42 | @ApiLog(value = "新增交流消息信息") 43 | @NeedLogin 44 | public ApiResponse addItem(@RequestBody @Valid MessageWordAddReq addReq){ 45 | messageWordService.addItem(addReq); 46 | return apiResponse(); 47 | } 48 | 49 | /** 50 | * 主键ID集合批量交流消息 51 | * @param req 需要被删除的交流消息信息 52 | */ 53 | @PostMapping(value = "/batchDeleteItem") 54 | @ApiLog(value = "根据主键ID集合批量删除交流消息") 55 | @NeedLogin 56 | public ApiResponse batchDeleteItem(@RequestBody BaseDeleteReq req){ 57 | messageWordService.batchDeleteItem(req); 58 | return apiResponse(); 59 | } 60 | 61 | /** 62 | * 分页查询交流消息 63 | * @param pageReq 分页查询交流消息Req 64 | * @return Pagination 65 | */ 66 | @PostMapping(value = "/queryByPage") 67 | @ApiLog(value = "分页查询交流消息信息") 68 | @NeedLogin 69 | public ApiResponse> queryByPage( 70 | @RequestBody @Valid MessageWordReq pageReq){ 71 | return apiResponse(messageWordService.queryByPage(pageReq)); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /platform-api-web/src/main/java/cn/common/api/biz/RescueStationController.java: -------------------------------------------------------------------------------- 1 | package cn.common.api.biz; 2 | 3 | import cn.common.api.BaseApiController; 4 | import cn.common.req.RescueStationAddReq; 5 | import cn.common.req.RescueStationReq; 6 | import cn.common.resp.RescueStationResp; 7 | import cn.common.service.biz.RescueStationService; 8 | import lombok.extern.slf4j.Slf4j; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.PostMapping; 11 | import org.springframework.web.bind.annotation.RequestBody; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RestController; 14 | import pro.skywalking.anon.ApiLog; 15 | import pro.skywalking.interceptor.NeedLogin; 16 | import pro.skywalking.req.base.BaseDeleteReq; 17 | import pro.skywalking.resp.base.ApiResponse; 18 | import pro.skywalking.resp.page.Pagination; 19 | 20 | import javax.annotation.Resource; 21 | import javax.servlet.http.HttpServletResponse; 22 | import javax.validation.Valid; 23 | import java.util.List; 24 | 25 | /** 26 | * @Description: 前端控制器*/ 27 | @RestController 28 | @RequestMapping(value = "api/v1/rescueStation") 29 | @Slf4j 30 | public class RescueStationController extends BaseApiController { 31 | 32 | @Resource 33 | private RescueStationService rescueStationService; 34 | 35 | @Resource 36 | private HttpServletResponse response; 37 | 38 | /** 39 | * 新增救助站 40 | * @param addReq 新增救助站Req 41 | */ 42 | @PostMapping(value = "/addItem") 43 | @ApiLog(value = "新增救助站信息") 44 | @NeedLogin 45 | public ApiResponse addItem(@RequestBody @Valid RescueStationAddReq addReq){ 46 | rescueStationService.addItem(addReq); 47 | return apiResponse(); 48 | } 49 | 50 | /** 51 | * 主键ID集合批量救助站 52 | * @param req 需要被删除的救助站信息 53 | */ 54 | @PostMapping(value = "/batchDeleteItem") 55 | @ApiLog(value = "根据主键ID集合批量删除救助站") 56 | @NeedLogin 57 | public ApiResponse batchDeleteItem(@RequestBody BaseDeleteReq req){ 58 | rescueStationService.batchDeleteItem(req); 59 | return apiResponse(); 60 | } 61 | 62 | /** 63 | * 分页查询救助站 64 | * @param pageReq 分页查询Req 65 | * @return Pagination 66 | */ 67 | @PostMapping(value = "/queryByPage") 68 | @ApiLog(value = "分页查询救助站信息") 69 | @NeedLogin(value = false) 70 | public ApiResponse> queryByPage( 71 | @RequestBody @Valid RescueStationReq pageReq){ 72 | return apiResponse(rescueStationService.queryByPage(pageReq)); 73 | } 74 | 75 | /** 76 | * 查询所有救助站信息 77 | */ 78 | @GetMapping(value = "/queryAllStation") 79 | @ApiLog(value = "查询所有救助站信息") 80 | @NeedLogin(value = false) 81 | public ApiResponse> queryAllStation(){ 82 | return apiResponse(rescueStationService.queryAllStation()); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /platform-api-web/src/main/java/cn/common/api/platform/PlatformApiLogController.java: -------------------------------------------------------------------------------- 1 | package cn.common.api.platform; 2 | 3 | import cn.common.api.BaseApiController; 4 | import cn.common.service.platform.PlatformApiLogService; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | import javax.annotation.Resource; 10 | 11 | /** 12 | * @Description: 前端控制器 13 | */ 14 | @RestController 15 | @RequestMapping(value = "api/v1/platformApiLog") 16 | @Slf4j 17 | public class PlatformApiLogController extends BaseApiController { 18 | 19 | @Resource 20 | private PlatformApiLogService platformApiLogService; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /platform-api-web/src/main/java/cn/common/api/platform/PlatformController.java: -------------------------------------------------------------------------------- 1 | package cn.common.api.platform; 2 | 3 | import cn.common.api.BaseApiController; 4 | import cn.common.service.platform.PlatformService; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RequestParam; 9 | import org.springframework.web.bind.annotation.RestController; 10 | import pro.skywalking.anon.ApiLog; 11 | import pro.skywalking.interceptor.NeedLogin; 12 | import pro.skywalking.resp.base.ApiResponse; 13 | import pro.skywalking.resp.platform.dict.PlatformDictResp; 14 | import pro.skywalking.resp.platform.other.AuthUserSketchResp; 15 | 16 | import javax.annotation.Resource; 17 | import java.util.List; 18 | 19 | /** 20 | * @Description: 平台前端控制器 21 | */ 22 | @RestController 23 | @RequestMapping(value = "api/v1/platform") 24 | @Slf4j 25 | public class PlatformController extends BaseApiController { 26 | 27 | @Resource 28 | private PlatformService platformService; 29 | 30 | /** 31 | * PlatformController 32 | * @param dictType 字典类型 33 | * @return java.util.List 34 | */ 35 | @GetMapping(value = "/queryDictByType") 36 | @NeedLogin(value = false) 37 | public ApiResponse> queryDictByType(@RequestParam(name = "dictType") 38 | String dictType){ 39 | return apiResponse(platformService.queryDictByType(dictType)); 40 | } 41 | 42 | /** 43 | * 查询所有用户信息 44 | * @return java.util.List 45 | */ 46 | @GetMapping("/queryAllAuthUser") 47 | @ApiLog(value = "查询所有用户信息") 48 | public ApiResponse> queryAllAuthUser(){ 49 | return apiResponse(platformService.queryAllAuthUser()); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /platform-api-web/src/main/java/cn/common/api/platform/PlatformDictController.java: -------------------------------------------------------------------------------- 1 | package cn.common.api.platform; 2 | 3 | import cn.common.api.BaseApiController; 4 | import cn.common.service.platform.PlatformDictService; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | import javax.annotation.Resource; 10 | 11 | /** 12 | * @Description: 系统字典前端控制器 13 | */ 14 | @RestController 15 | @RequestMapping(value = "api/v1/platformDict") 16 | @Slf4j 17 | public class PlatformDictController extends BaseApiController { 18 | 19 | @Resource 20 | private PlatformDictService platformDictService; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /platform-api-web/src/main/java/cn/common/api/platform/PlatformFileController.java: -------------------------------------------------------------------------------- 1 | package cn.common.api.platform; 2 | 3 | import cn.common.api.BaseApiController; 4 | import cn.common.service.platform.PlatformFileService; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.web.bind.annotation.*; 7 | import org.springframework.web.multipart.MultipartFile; 8 | import pro.skywalking.anon.ApiLog; 9 | import pro.skywalking.configuration.oss.AliOssService; 10 | import pro.skywalking.configuration.oss.meta.AppFileUrlMeta; 11 | import pro.skywalking.configuration.oss.meta.MultipartFileUrlMeta; 12 | import pro.skywalking.configuration.oss.meta.MultipleFileAccessUrlMeta; 13 | import pro.skywalking.interceptor.NeedLogin; 14 | import pro.skywalking.resp.base.ApiResponse; 15 | 16 | 17 | import javax.annotation.Resource; 18 | import javax.validation.Valid; 19 | import java.util.Arrays; 20 | import java.util.List; 21 | 22 | /** 23 | 24 | * @Description: 系统文件相关前端控制器 25 | */ 26 | @RestController 27 | @RequestMapping("api/platformFile") 28 | @Slf4j 29 | public class PlatformFileController extends BaseApiController { 30 | 31 | 32 | @Resource 33 | private AliOssService aliOssService; 34 | 35 | 36 | @Resource 37 | private PlatformFileService platformFileService; 38 | 39 | /** 40 | * 拿到文件直接访问路径 41 | */ 42 | @GetMapping("/appFileAccessUrl") 43 | @ApiLog(value = "拿到文件直接访问路径") 44 | public ApiResponse> appFileAccessUrl(@RequestParam(name = "fileNames") String fileNames){ 45 | return apiResponse(aliOssService.getObjectAccessUrlList(Arrays.asList(fileNames.split(",")))); 46 | } 47 | 48 | 49 | /** 50 | * 拿到单个文件名称的地址 51 | */ 52 | @GetMapping("/singleFileAccessUrl") 53 | @ApiLog(value = "拿到单个文件名称的地址") 54 | public ApiResponse singleFileAccessUrl(@RequestParam(name = "fileName")String fileName){ 55 | return apiResponse(aliOssService.getObjectAccessUrl(fileName)); 56 | } 57 | 58 | /** 59 | * 拿到多个文件名称的地址 60 | * @param meta 文件名称集合 61 | * @return String 62 | */ 63 | @PostMapping("/multipleFileAccessUrl") 64 | @ApiLog(value = "拿到多个文件名称的地址") 65 | public ApiResponse> multipleFileAccessUrl(@RequestBody @Valid MultipleFileAccessUrlMeta meta){ 66 | return apiResponse(aliOssService.getObjectAccessUrlList(meta.getFileNameList())); 67 | } 68 | 69 | /** 70 | * 拿到多个文件名称的地址 71 | * @param meta 文件名称集合 72 | * @return List 73 | */ 74 | @PostMapping("/queryMultipleFileAccessUrl") 75 | @ApiLog(value = "拿到多个文件名称的地址") 76 | public ApiResponse> queryMultipleFileAccessUrl(@RequestBody @Valid MultipleFileAccessUrlMeta meta){ 77 | return apiResponse(aliOssService.getObjectAccessUrlList(meta.getFileNameList())); 78 | } 79 | 80 | /** 81 | * 删除文件 82 | * @param name 删除OSS的文件 83 | */ 84 | @DeleteMapping("/deleteFileByFileName") 85 | @ApiLog(value = "删除文件") 86 | @NeedLogin(value = false) 87 | public ApiResponse deleteFileByFileName(@RequestParam(name = "name") String name){ 88 | aliOssService.deleteObject(name); 89 | return apiResponse(); 90 | } 91 | 92 | /** 93 | * 上传文件 94 | * @param file 95 | * @return String 96 | */ 97 | @PostMapping(value = "/uploadFile") 98 | @ApiLog(value = "上传文件") 99 | @NeedLogin(value = false) 100 | public ApiResponse uploadFile(@RequestParam(name = "file") MultipartFile file){ 101 | return apiResponse(platformFileService.uploadFile(file)); 102 | } 103 | 104 | /** 105 | * 上传文件(混淆) 106 | * @param file 107 | * @return String 108 | */ 109 | @PostMapping(value = "/uploadFileMixed") 110 | @ApiLog(value = "上传文件(混淆)") 111 | public ApiResponse uploadFileMixed(@RequestParam(name = "file") MultipartFile file){ 112 | return apiResponse(platformFileService.uploadFileMixed(file)); 113 | } 114 | 115 | } 116 | -------------------------------------------------------------------------------- /platform-api-web/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | name: animal-app-api 2 | spring: 3 | profiles: 4 | active: dev 5 | --- 6 | spring: 7 | profiles: dev 8 | datasource: 9 | url: jdbc:mysql://localhost:3306/animal-platform?useUnicode=true&characterEncoding=utf-8&useSSL=false&tcpRcvBuf=1024000&autoReconnect=true&failOverReadOnly=false&connectTimeout=0&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai 10 | username: root 11 | password: yxym 12 | locationTemp: /Users/singer/data #上传文件的临时目录 13 | 14 | -------------------------------------------------------------------------------- /platform-api-web/src/main/resources/bootstrap.yml: -------------------------------------------------------------------------------- 1 | server: 2 | type: app 3 | port: 9015 4 | max-http-header-size: 102400 5 | tomcat: 6 | max-swallow-size: 500MB #配置tomcat级别的文件上传大小限制 7 | spring: 8 | servlet: 9 | context-path: 10 | multipart: 11 | enabled: true 12 | max-file-size: 500MB #最大文件大小 13 | max-request-size: 500MB #最大请求大小 14 | http: 15 | servlet: 16 | multipart: 17 | max-file-size: 500MB 18 | max-request-size: 500MB 19 | jackson: 20 | date-format: yyyy-MM-dd HH:mm:ss 21 | time-zone: GMT+8 22 | aop: 23 | auto: false 24 | datasource: 25 | # driver-class-name: com..cj.jdbc.Driver 26 | driver-class-name: com.mysql.cj.jdbc.Driver 27 | 28 | platform: mysql 29 | type: com.alibaba.druid.pool.DruidDataSource 30 | # 下面为连接池的补充设置,应用到上面所有数据源中 31 | # 初始化大小,最小,最大 32 | initialSize: 1 33 | minIdle: 3 34 | maxActive: 20 35 | # 配置拿到连接等待超时的时间 36 | maxWait: 60000 37 | # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 38 | timeBetweenEvictionRunsMillis: 60000 39 | # 配置一个连接在池中最小生存的时间,单位是毫秒 40 | minEvictableIdleTimeMillis: 30000 41 | validationQuery: select 'x' 42 | testWhileIdle: true 43 | testOnBorrow: false 44 | testOnReturn: false 45 | # 打开PSCache,并且指定每个连接上PSCache的大小 46 | poolPreparedStatements: true 47 | maxPoolPreparedStatementPerConnectionSize: 20 48 | # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 49 | filters: stat,wall,slf4j 50 | # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 51 | connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 52 | # 合并多个DruidDataSource的监控数据 53 | #useGlobalDataSourceStat: true 54 | druidMonitorUserName: admin 55 | druidMonitorPassword: 123456 56 | connectionInitSQLs: 57 | - set names utf8mb4 #初始化SQL 58 | redis: 59 | enable: true 60 | host: 127.0.0.1 61 | # port: 6301 62 | port: 6379 63 | password: 64 | timeout: 120000 65 | readTimeout: 120000 66 | database: 3 67 | lettuce: 68 | pool: 69 | min-idle: 8 70 | max-idle: 500 71 | max-active: 2000 72 | max-wait: 60000 73 | mybatis-plus: 74 | typeAliasesPackage: cn.common.repository.entity 75 | mapper-locations: classpath*:/mapper/*.xml 76 | global-config: 77 | db-config: 78 | id-type: auto 79 | field-strategy: not_empty 80 | #驼峰下划线转换 81 | column-underline: true 82 | #逻辑删除配置 83 | logic-delete-value: 1 #删除配置 84 | logic-not-delete-value: 2 #未删除配置 85 | db-type: mysql 86 | table-prefix: t_ 87 | refresh: false 88 | configuration: 89 | map-underscore-to-camel-case: true 90 | cache-enabled: false 91 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #开启sql日志 92 | pagehelper: 93 | helperDialect: mysql 94 | reasonable: false #打开此配置,分页查询查询到页数大于最后一页的时候,默认返回最后一页的数据 95 | supportMethodsArguments: true 96 | params: count=countSql 97 | aliyun: 98 | oss: 99 | # secretId: LTAI5tF8EjmXr6jLyXkDXX9R 100 | # secretKey: kg4OsKKWl14Kpfcr9RxM2cOqlXONUe 101 | # endPoint: oss-cn-chengdu.aliyuncs.com 102 | # bucketName: 103 | # prefix: https://.oss-cn-chengdu.aliyuncs.com/ #文件固定前缀 104 | # folder-prefix: animal-platform #文件夹前缀 105 | secretId: LTAI5tN92VAWNTd5HyMuSFta 106 | secretKey: IoGTCQYELmvkl69hdZAQNRuny6y9XL 107 | endPoint: oss-cn-qingdao.aliyuncs.com 108 | bucketName: petservice-dy 109 | prefix: https://petservice-dy.oss-cn-qingdao.aliyuncs.com/ #文件固定前缀 110 | folder-prefix: animal-platform #文件夹前缀 111 | logging: 112 | level: 113 | org.springframework.web: debug 114 | com: debug 115 | management: 116 | endpoints: 117 | web: 118 | exposure: 119 | include: ['httptrace', 'metrics'] 120 | baseConstant: 121 | constant: 122 | tokenValidTime: 1 #TOKEN缓存有效时间 123 | -------------------------------------------------------------------------------- /platform-api-web/src/main/resources/logback-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | %logbackColorConfiguration(%d{yyyy-MM-dd HH:mm:ss.SSS} ${HostName} [%thread] %-5level %logger{56} - %d %p (%file:%line\)- %m%n) 21 | 22 | UTF-8 23 | 24 | 25 | 26 | 27 | 28 | 30 | ${log.path}.log 31 | 32 | 33 | 34 | 35 | 36 | ${log.path}.%d.%i.log 37 | 38 | 5 39 | 40 | 41 | 20480KB 42 | 43 | 44 | 45 | 46 | 47 | ${log.pattern} 48 | 49 | 50 | UTF-8 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /platform-api-web/src/main/resources/spy.properties: -------------------------------------------------------------------------------- 1 | #MODULE p6spy提供了两种模块进行日志记录:log和outage,两者有不同的功能,配置参数也有专属,但是它们也共享一些配置参数,如哪些表被记录,日志文件名称和地址,是否显示sql执行轨迹等。 2 | #log用来拦截和记录任何使用jdbc的应用的数据库声明日志,默认为开启。 3 | #outage主要是用来最低化log所带来的性能问题,只记录超过一定时间的执行语句,默认为关闭。 4 | module.log=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory 5 | module.outage=com.p6spy.engine.outage.P6OutageFactory 6 | logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger 7 | #实际的数据库驱动,真正的数据库驱动 8 | #realdriver=com.mysql.cj.jdbc.Driver 9 | #实际的数据库驱动备份,当前面的数据库驱动不对时,顺序查找下一驱动,直到找到合适为止,默认为空。 10 | #realdriver2= 11 | #realdriver3= 12 | #无效化已注册的驱动,如果在其他地方已经定义好了真正的数据库驱动,那么p6spy driver就不会生效,也就不能起到作用,所以需#要把此选项置为true。 13 | deregisterdrivers=true 14 | #log模块专属的参数,当log模块开启时,如果执行语句超出这个时间(单位为毫秒),才能被记录在文件中,可以重新被载入,默认为0。 15 | executionthreshold= 16 | #outage专属的参数,当outage模块开启时,outagedetection为true时,会根据outagedetectioninterval(单位为秒)的大小, 间隔的去捕获执行语句,一般用来捕获长时间执行的语句。。 17 | outagedetection=true 18 | outagedetectioninterval=2 19 | #以下参数是公共的属性,log和outage都可以公用的参数过滤器开关,是否根据参数过滤一些记录内容 20 | filter=true 21 | #当过滤器开启时,需要记录的表,默认为都记录 22 | #include= 23 | #当过滤器开启时,不需要记录的表,默认为都记录 24 | exclude= foreign_key_checks,variable_name,GET_LOCK,RELEASE_LOCK,flyway_schema_history,information_schema,@,SELECT DATABASE(),SELECT version(),ACT_,QRTZ_ 25 | # 过滤 Log 时的 SQL 正则表达式名称 默认为空 26 | #当过滤器开启时,根据sql表达式过滤 27 | #sqlexpression = 28 | #是否自动刷新 29 | autoflush = true 30 | #输出的日志文件的日期格式,也就是用Java的SimpleDateFormat程序。 31 | dateformat= yyyy-MM-dd HH:mm:ss 32 | #定义包含的日志级别,当日志级别属于此类型时,才能被记录,属性值有error, info, batch, debug, statement, commit, rollback 和result 33 | #includecategories=statement 34 | #定义不包含的日志级别,当日志级别属于此类型时,不会被记录; 35 | #可去掉的结果集有error,info,batch,debug,statement,commit,rollback,result,resultset. 36 | excludecategories=info,debug,result,commit,resultset 37 | #使用正则表达式来过滤 Log,匹配时才会被记录,例如: #stringmatcher=com.p6spy.engine.common.GnuRegexMatcher #stringmatcher=com.p6spy.engine.common.JakartaRegexMatcher 38 | #stringmatcher= 39 | #是否对每一SQL的执行语句进行打印堆栈跟踪信息,通常在进行长时间执行SQL的情况下打开进行监控。 40 | stacktrace=false 41 | #当上一轨迹开关打开时,可以指定具体的类名来进行过滤。 42 | stacktraceclass = 43 | #监测属性配置文件是否进行重新加载,一般应用服务器在启动时进行加载一次就够了。 44 | reloadproperties=false 45 | #当是否重新加载开关打开时,定义重新加载时间周期。 46 | reloadpropertiesinterval = 60 47 | #是否加上前缀,设置为 true,会加上 p6spy: 作为前缀 48 | useprefix=false 49 | #指定 Log 的 appender,与 Log4J 有点同义,取值:com.p6spy.engine.logging.appender.Log4jLogger com.p6spy.engine.logging.appender.StdoutLogger com.p6spy.engine.logging.appender.FileLogger 50 | # 日志只输出到控制台,不会记录到日志文件 51 | appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger 52 | # 使用日志系统记录 sqlR 53 | #appender=com.p6spy.engine.spy.appender.Slf4JLogger 54 | 55 | #指定记录的日志文件名称和地址,根目录在应用服务器的发布端.如tomcat在%TOMCAT_HOME%/bin目录下。 56 | logfile = ./logs/logs.log 57 | #文件续载标识,在log的appender类型为FileLogger时,才生效,如果为true,则在生成的日志文件后面继续进行记录,否则删除之前的内容。 58 | #append=true 59 | #类似与log4j的记录器的布局: 60 | #log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender 61 | #log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout 62 | #log4j.appender.STDOUT.layout.ConversionPattern=p6spy - #%m%n 63 | -------------------------------------------------------------------------------- /platform-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | animal-app-api 6 | com.animal-app-api 7 | 1.0-SNAPSHOT 8 | 9 | platform-common 10 | cn.common 11 | platform-common 12 | ${project.build.version} 13 | jar 14 | 4.0.0 15 | 后端系统-common模块 16 | 17 | 1.8 18 | 1.8 19 | 20 | 21 | 22 | central 23 | AliYunMaven 24 | ${repository.url} 25 | default 26 | 27 | 28 | true 29 | 30 | 31 | 32 | false 33 | 34 | 35 | 36 | 37 | 38 | public 39 | groups 40 | ${repository.url} 41 | 42 | true 43 | 44 | 45 | true 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.projectlombok 54 | lombok 55 | ${lombok.version} 56 | 57 | 58 | com.google.guava 59 | guava 60 | ${guava.version} 61 | 62 | 63 | cn.hutool 64 | hutool-all 65 | ${hutool.version} 66 | 67 | 68 | com.github.wechatpay-apiv3 69 | wechatpay-apache-httpclient 70 | 71 | 72 | org.freemarker 73 | freemarker 74 | ${freemarker.version} 75 | 76 | 77 | com.aliyun.oss 78 | aliyun-sdk-oss 79 | ${aliyun-sdk-oss.version} 80 | 81 | 82 | platform-interaction 83 | pro.skywalking 84 | 0.0.1.PRO 85 | system 86 | ${project.basedir}/src/main/resources/lib/platform-interaction-0.0.1.PRO.jar 87 | 88 | 89 | platform-common 90 | pro.skywalking 91 | 0.0.1.PRO 92 | system 93 | ${project.basedir}/src/main/resources/lib/platform-common-0.0.1.PRO.jar 94 | 95 | 96 | 97 | 98 | 99 | org.apache.maven.plugins 100 | maven-compiler-plugin 101 | 3.6.0 102 | 103 | 1.8 104 | 1.8 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /platform-common/src/main/java/cn/common/constants/BizConstants.java: -------------------------------------------------------------------------------- 1 | package cn.common.constants; 2 | 3 | /** 4 | * @packageName cn.common.common.enums 5 | * @Description: 业务常量 6 | */ 7 | public class BizConstants { 8 | 9 | /** 10 | * 查看记录 11 | */ 12 | public static final String VIEW_RECORD_CACHE_PREFIX = "view_record_cache_prefix:"; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /platform-common/src/main/java/cn/common/enums/AdoptStatusEnum.java: -------------------------------------------------------------------------------- 1 | package cn.common.enums; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | /** 7 | * @Description: 领养状态的枚举 8 | */ 9 | @Getter 10 | @AllArgsConstructor 11 | public enum AdoptStatusEnum { 12 | 13 | /** 14 | * 待领养 15 | */ 16 | WAIT_ADOPT(1,"待领养"), 17 | 18 | /** 19 | * 已领养 20 | */ 21 | ADOPTED(2,"已领养"), 22 | 23 | /** 24 | * 领养审核中 25 | */ 26 | AUDITING(3,"领养审核中"); 27 | 28 | 29 | /** 30 | * 状态码 31 | */ 32 | private Integer code; 33 | 34 | /** 35 | * 描述 36 | */ 37 | private String description; 38 | 39 | 40 | public Integer getCode() { 41 | return code; 42 | } 43 | 44 | public String getDescription() { 45 | return description; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /platform-common/src/main/java/cn/common/enums/AuditStatusEnum.java: -------------------------------------------------------------------------------- 1 | package cn.common.enums; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | /** 7 | * @Description: 审核状态的枚举 8 | */ 9 | @Getter 10 | @AllArgsConstructor 11 | public enum AuditStatusEnum { 12 | 13 | /** 14 | * 通过 15 | */ 16 | APPROVED ("APPROVED","通过"), 17 | 18 | /** 19 | * 驳回 20 | */ 21 | REJECT("REJECT","驳回"), 22 | 23 | /** 24 | * 待处理 25 | */ 26 | WAIT_AUDIT("WAIT_AUDIT","待审核"); 27 | 28 | 29 | /** 30 | * 状态码 31 | */ 32 | private String code; 33 | 34 | /** 35 | * 描述 36 | */ 37 | private String description; 38 | 39 | 40 | public String getCode() { 41 | return code; 42 | } 43 | 44 | public String getDescription() { 45 | return description; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /platform-common/src/main/java/cn/common/enums/BizErrorCode.java: -------------------------------------------------------------------------------- 1 | package cn.common.enums; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | /** 7 | * @Description: 业务系统错误码枚举 8 | */ 9 | @Getter 10 | @AllArgsConstructor 11 | public enum BizErrorCode { 12 | 13 | /** 14 | * 领养信息不存在 15 | */ 16 | ADOPTION_DATA_NOT_EXIST("200001","领养信息不存在"), 17 | 18 | /** 19 | * 已经领养过该宠物 20 | */ 21 | ALREADY_ADOPTED_ERROR("0000021","已经领养过该宠物"), 22 | 23 | 24 | ; 25 | 26 | /** 27 | * 错误码code 28 | */ 29 | private String code; 30 | 31 | /** 32 | * 错误信息 33 | */ 34 | private String message; 35 | 36 | public String getCode() { 37 | return code; 38 | } 39 | 40 | public String getMessage() { 41 | return message; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /platform-common/src/main/java/cn/common/enums/ErrorCode.java: -------------------------------------------------------------------------------- 1 | package cn.common.enums; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | /** 7 | * @Description: 系统错误码枚举 8 | */ 9 | @Getter 10 | @AllArgsConstructor 11 | public enum ErrorCode { 12 | 13 | 14 | /** 15 | * 成功 16 | */ 17 | SUCCESS("200","成功"), 18 | 19 | /** 20 | * 参数格式错误 21 | */ 22 | PARAM_ERROR("000004","参数格式错误"), 23 | 24 | /** 25 | * 业务流程异常,拒绝处理 26 | */ 27 | BUSINESS_REFUSE("403", "业务流程异常,拒绝处理"), 28 | 29 | /** 30 | * 业务处理异常 31 | */ 32 | ERROR("500","网络异常"), 33 | 34 | 35 | /** 36 | * 用户名或密码错误 37 | */ 38 | PASSWORD_OR_USER_ERROR("1080","用户名或密码错误"), 39 | 40 | /** 41 | * 登录失效,需要验证登录 42 | */ 43 | LOGIN_ERROR_CODE("501","登录失效,需要验证登录"), 44 | 45 | /** 46 | * 参数缺失 47 | */ 48 | NO_REQUIRED_PARAM_ERROR("0000005","参数缺失"), 49 | 50 | /** 51 | * 用户认证信息丢失 52 | */ 53 | NO_AUTH_INFO_ERROR("0000006","用户认证信息丢失"), 54 | 55 | /** 56 | * 认证错误 57 | */ 58 | AUTH__ERROR("0000007","认证错误"), 59 | 60 | /** 61 | * 没有权限 62 | */ 63 | E_502("0000008","没有权限"), 64 | 65 | /** 66 | * 旧密码输入错误 67 | */ 68 | ERROR_OLD_PASSWORD("0000009","旧密码输入错误"), 69 | 70 | /** 71 | * 修改密码失败 72 | */ 73 | ERROR_UPDATE_PASSWORD("0000010","修改密码失败"), 74 | 75 | /** 76 | * token过期,需要重新登陆 77 | */ 78 | ERROR_NEED_RE_LOGIN("0000011","token过期,需要重新登陆"), 79 | 80 | /** 81 | * 需要token 82 | */ 83 | ERROR_NO_TOKEN("0000012","需要token"), 84 | 85 | /** 86 | * token无效,需要重新登陆 87 | */ 88 | ERROR_TOKEN_INVALID("0000013","token无效,需要重新登陆"), 89 | 90 | /** 91 | * 图形验证码错误 92 | */ 93 | ERROR_KAPTCHA_CODE_INVALID("0000014","图形验证码错误"), 94 | 95 | /** 96 | * 成功 97 | */ 98 | ERROR_USER_EXISTED("0000015","用户已经存在"), 99 | 100 | /** 101 | * 短信验证码错误 102 | */ 103 | ERROR_MESSAGE_INVALID("0000016","短信验证码错误"), 104 | 105 | /** 106 | * 该用户不存在 107 | */ 108 | ERROR_APP_USER_NOT_EXISTED("0000017","该用户不存在"), 109 | 110 | /** 111 | * 重复密码不相等 112 | */ 113 | ERROR_APP_REPEAT_PWD_NOT_EQUAL_ERROR("0000018","重复密码不相等"), 114 | 115 | /** 116 | * 超级管理员无法删除 117 | */ 118 | AN_NOT_DELETE_SUPER("0000019","超级管理员无法删除"), 119 | 120 | /** 121 | * 验证码无效 122 | */ 123 | VERIFY_CODE_ERROR("0000020","验证码无效"), 124 | 125 | /** 126 | * 用户被封禁,请联系管理员 127 | */ 128 | APP_USER_LOCKED("0000021","用户被封禁,请联系管理员"), 129 | 130 | /** 131 | * 数学计算错误 132 | */ 133 | MATHEMATICAL_CAL_ERROR("0000024","数学计算错误"), 134 | 135 | /** 136 | * 宠物不存在 137 | */ 138 | ADOPTION_DATA_NOT_EXIST("0000020","宠物不存在"), 139 | 140 | /** 141 | * 已经领养过该宠物 142 | */ 143 | ALREADY_ADOPTED_ERROR("0000021","已经领养过该宠物"), 144 | 145 | /** 146 | * 设置为空的属性为空 147 | */ 148 | SET_EMPTY_FIELD_ERROR("0000026","设置为空的属性为出现异常"), 149 | 150 | 151 | 152 | ; 153 | 154 | /** 155 | * 错误码code 156 | */ 157 | private String code; 158 | 159 | /** 160 | * 错误信息 161 | */ 162 | private String message; 163 | 164 | public String getCode() { 165 | return code; 166 | } 167 | 168 | public String getMessage() { 169 | return message; 170 | } 171 | 172 | } 173 | -------------------------------------------------------------------------------- /platform-common/src/main/java/cn/common/enums/GenderEnum.java: -------------------------------------------------------------------------------- 1 | package cn.common.enums; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | /** 7 | * @Description: 性别 8 | */ 9 | @Getter 10 | @AllArgsConstructor 11 | public enum GenderEnum { 12 | 13 | /** 14 | * 男性 15 | */ 16 | MALE ("male","男性"), 17 | 18 | /** 19 | * 女生 20 | */ 21 | FEMALE("female","女生"), 22 | 23 | /** 24 | * 未知 25 | */ 26 | UNKNOWN("unknown","未知") 27 | 28 | ; 29 | 30 | /** 31 | * 状态码 32 | */ 33 | private String code; 34 | 35 | /** 36 | * 描述 37 | */ 38 | private String description; 39 | 40 | 41 | public String getCode() { 42 | return code; 43 | } 44 | 45 | public String getDescription() { 46 | return description; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /platform-common/src/main/resources/lib/platform-common-0.0.1.PRO-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yacoding4325/animal-app-api/d2e0d024a5235c62a208791d3d157036baffe3e7/platform-common/src/main/resources/lib/platform-common-0.0.1.PRO-sources.jar -------------------------------------------------------------------------------- /platform-common/src/main/resources/lib/platform-common-0.0.1.PRO.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yacoding4325/animal-app-api/d2e0d024a5235c62a208791d3d157036baffe3e7/platform-common/src/main/resources/lib/platform-common-0.0.1.PRO.jar -------------------------------------------------------------------------------- /platform-common/src/main/resources/lib/platform-interaction-0.0.1.PRO-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yacoding4325/animal-app-api/d2e0d024a5235c62a208791d3d157036baffe3e7/platform-common/src/main/resources/lib/platform-interaction-0.0.1.PRO-sources.jar -------------------------------------------------------------------------------- /platform-common/src/main/resources/lib/platform-interaction-0.0.1.PRO.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yacoding4325/animal-app-api/d2e0d024a5235c62a208791d3d157036baffe3e7/platform-common/src/main/resources/lib/platform-interaction-0.0.1.PRO.jar -------------------------------------------------------------------------------- /platform-interaction/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | animal-app-api 7 | com.animal-app-api 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | platform-interaction 12 | ${project.build.version} 13 | 后端系统-交互平台 14 | 15 | 8 16 | 8 17 | 18 | 19 | 20 | central 21 | AliYunMaven 22 | ${repository.url} 23 | default 24 | 25 | 26 | true 27 | 28 | 29 | 30 | false 31 | 32 | 33 | 34 | 35 | 36 | public 37 | groups 38 | ${repository.url} 39 | 40 | true 41 | 42 | 43 | true 44 | 45 | 46 | 47 | 48 | 53 | 54 | 55 | 56 | cn.common 57 | platform-common 58 | ${project.build.version} 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/internal/AuthUserLoginReq.java: -------------------------------------------------------------------------------- 1 | package cn.common.internal; 2 | 3 | import pro.skywalking.validation.NotEmpty; 4 | import lombok.Data; 5 | 6 | import java.io.*; 7 | 8 | /** 9 | * 系统用户交互参数封装 10 | */ 11 | @Data 12 | public class AuthUserLoginReq implements Serializable { 13 | 14 | private static final long serialVersionUID = 4445428827414406099L; 15 | 16 | /** 17 | * 用户名 18 | */ 19 | @NotEmpty(message = "用户名->不可为空") 20 | private String userName; 21 | 22 | /** 23 | * 手机号 24 | */ 25 | //@NotEmpty(message = "手机号->不可为空") 26 | private String mobileNumber; 27 | 28 | /** 29 | * 密码 30 | */ 31 | @NotEmpty(message = "用户名->密码") 32 | private String password; 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/internal/ViewRecordMeta.java: -------------------------------------------------------------------------------- 1 | package cn.common.internal; 2 | 3 | import cn.common.resp.AdoptionDataResp; 4 | import com.alibaba.fastjson.annotation.JSONField; 5 | import lombok.Data; 6 | import org.springframework.format.annotation.DateTimeFormat; 7 | 8 | import java.io.*; 9 | import java.time.Clock; 10 | import java.time.Instant; 11 | import java.time.LocalDateTime; 12 | 13 | /** 14 | * @Description: 查看记录 15 | */ 16 | @Data 17 | public class ViewRecordMeta implements Serializable { 18 | 19 | private static final long serialVersionUID = -619385333547777597L; 20 | 21 | /** 22 | * 查看记录 23 | */ 24 | private AdoptionDataResp data; 25 | 26 | /** 27 | * 创建时间 28 | */ 29 | @JSONField(format="yyyy-MM-dd HH:mm:ss") 30 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 31 | private LocalDateTime createTime = LocalDateTime.ofInstant(Instant.now(), Clock.systemDefaultZone().getZone()); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/req/AdoptApplyAddReq.java: -------------------------------------------------------------------------------- 1 | package cn.common.req; 2 | 3 | import pro.skywalking.validation.NotEmpty; 4 | import lombok.Data; 5 | 6 | import java.io.*; 7 | 8 | /** 9 | * 领养信息实体 10 | */ 11 | @Data 12 | public class AdoptApplyAddReq implements Serializable { 13 | 14 | 15 | private static final long serialVersionUID = 338744437534904163L; 16 | 17 | /** 18 | * 宠物ID 19 | */ 20 | @NotEmpty(message = "宠物ID->不可为空") 21 | private String adoptionDataId; 22 | 23 | /** 24 | * 领养备注 25 | */ 26 | private String adoptionRemark; 27 | } 28 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/req/AdoptPetLimitReq.java: -------------------------------------------------------------------------------- 1 | package cn.common.req; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.*; 6 | import java.math.BigInteger; 7 | 8 | /** 9 | * 待领养信息实体 10 | * @title: AdoptionData.java 11 | */ 12 | @Data 13 | public class AdoptPetLimitReq implements Serializable { 14 | 15 | private static final long serialVersionUID = 1709142379870557658L; 16 | 17 | /** 18 | * 业务主键ID->"adoptionDataId" 19 | */ 20 | private String adoptionDataId; 21 | 22 | /** 23 | * 宠物名称 24 | */ 25 | private String adoptionName; 26 | 27 | 28 | /** 29 | * 领养状态 1 待领养 2 已领养 3 领养审核中 30 | */ 31 | private Integer adoptionStatus; 32 | 33 | /** 34 | * 查询限制的数量 35 | */ 36 | private Integer topLimitCount = BigInteger.ZERO.intValue(); 37 | } 38 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/req/AdoptionApplyReq.java: -------------------------------------------------------------------------------- 1 | package cn.common.req; 2 | 3 | import lombok.Data; 4 | import pro.skywalking.req.base.BasePageReq; 5 | 6 | import java.io.*; 7 | 8 | /** 9 | * 领养信息实体 10 | */ 11 | @Data 12 | public class AdoptionApplyReq extends BasePageReq implements Serializable { 13 | 14 | private static final long serialVersionUID = -5436304126556357899L; 15 | 16 | /** 17 | * 业务主键ID->"adoptApplyId" 18 | */ 19 | private String adoptApplyId; 20 | 21 | /** 22 | * 宠物ID 23 | */ 24 | private String adoptionDataId; 25 | 26 | /** 27 | * 申请人 28 | */ 29 | private String petitioner; 30 | 31 | /** 32 | * 领养备注 33 | */ 34 | private String adoptionRemark; 35 | 36 | /** 37 | * 审核状态 审核状态 通过 APPROVED 驳回 REJECT 38 | */ 39 | private String auditStatus; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/req/AdoptionDataAddReq.java: -------------------------------------------------------------------------------- 1 | package cn.common.req; 2 | 3 | import pro.skywalking.validation.NotEmpty; 4 | import lombok.Data; 5 | 6 | import java.io.*; 7 | 8 | /** 9 | * 待领养信息实体 10 | */ 11 | @Data 12 | public class AdoptionDataAddReq implements Serializable { 13 | 14 | private static final long serialVersionUID = 2667927684123638714L; 15 | 16 | /** 17 | * 宠物类型 18 | */ 19 | @NotEmpty(message = "宠物类型->不可为空") 20 | private String adoptionType; 21 | 22 | /** 23 | * 宠物名称 24 | */ 25 | @NotEmpty(message = "宠物名称->不可为空") 26 | private String adoptionName; 27 | 28 | /** 29 | * 宠物图片 30 | */ 31 | @NotEmpty(message = "宠物图片->不可为空") 32 | private String adoptionUrl; 33 | 34 | /** 35 | * 宠物性别 36 | */ 37 | @NotEmpty(message = "宠物性别->不可为空") 38 | private String gender; 39 | 40 | /** 41 | * 宠物年龄 42 | */ 43 | @NotEmpty(message = "宠物年龄->不可为空") 44 | private Integer age; 45 | 46 | /** 47 | * 所属救助站 48 | */ 49 | @NotEmpty(message = "所属救助站->不可为空") 50 | private String rescueStationId; 51 | 52 | /** 53 | * 物种 54 | */ 55 | @NotEmpty(message = "物种->不可为空") 56 | private String species; 57 | 58 | /** 59 | * 品种 60 | */ 61 | @NotEmpty(message = "品种->不可为空") 62 | private String breed; 63 | 64 | /** 65 | * 是否绝育 66 | */ 67 | @NotEmpty(message = "是否绝育->不可为空") 68 | private Boolean neuterStatus = Boolean.FALSE; 69 | 70 | /** 71 | * 介绍 72 | */ 73 | @NotEmpty(message = "介绍->不可为空") 74 | private String presentation; 75 | 76 | /** 77 | * 是否驱虫 78 | */ 79 | @NotEmpty(message = "是否驱虫->不可为空") 80 | private Boolean repellentStatus = Boolean.FALSE; 81 | 82 | /** 83 | * 是否接种 84 | */ 85 | @NotEmpty(message = "是否接种->不可为空") 86 | private Boolean immuneStatus = Boolean.FALSE; 87 | 88 | } 89 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/req/AdoptionDataReq.java: -------------------------------------------------------------------------------- 1 | package cn.common.req; 2 | 3 | import lombok.Data; 4 | import pro.skywalking.req.base.BasePageReq; 5 | 6 | import java.io.*; 7 | import java.math.BigInteger; 8 | 9 | /** 10 | * 待领养信息实体 11 | */ 12 | @Data 13 | public class AdoptionDataReq extends BasePageReq implements Serializable { 14 | 15 | 16 | private static final long serialVersionUID = 1709142379870557658L; 17 | 18 | /** 19 | * 业务主键ID->"adoptionDataId" 20 | */ 21 | private String adoptionDataId; 22 | 23 | /** 24 | * 宠物类型 25 | */ 26 | private String adoptionType; 27 | 28 | /** 29 | * 宠物名称 30 | */ 31 | private String adoptionName; 32 | 33 | /** 34 | * 宠物图片 35 | */ 36 | private String adoptionUrl; 37 | 38 | /** 39 | * 领养状态 1 待领养 2 已领养 3 领养审核中 40 | */ 41 | private Integer adoptionStatus; 42 | 43 | /** 44 | * 领养人 45 | */ 46 | private String adopter; 47 | 48 | /** 49 | * 宠物性别 50 | */ 51 | private String gender; 52 | 53 | /** 54 | * 宠物年龄 55 | */ 56 | private Integer age; 57 | 58 | /** 59 | * 所属救助站ID 60 | */ 61 | private String rescueStationId; 62 | 63 | /** 64 | * 物种 65 | */ 66 | private String species; 67 | 68 | /** 69 | * 品种 70 | */ 71 | private String breed; 72 | 73 | /** 74 | * 是否绝育 75 | */ 76 | private Boolean neuterStatus; 77 | 78 | /** 79 | * 介绍 80 | */ 81 | private String presentation; 82 | 83 | /** 84 | * 是否驱虫 85 | */ 86 | private Boolean repellentStatus; 87 | 88 | /** 89 | * 是否接种 90 | */ 91 | private Boolean immuneStatus; 92 | 93 | /** 94 | * 查询限制的数量 95 | */ 96 | private Integer topLimitCount = BigInteger.ZERO.intValue(); 97 | 98 | } 99 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/req/AppUpdatePwdReq.java: -------------------------------------------------------------------------------- 1 | package cn.common.req; 2 | 3 | import lombok.Data; 4 | import pro.skywalking.validation.NotEmpty; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * @Description: App更新密码请求参数封装 10 | */ 11 | @Data 12 | public class AppUpdatePwdReq implements Serializable { 13 | 14 | private static final long serialVersionUID = 8946943706219089648L; 15 | 16 | /** 17 | * 新密码 18 | */ 19 | @NotEmpty(message = "新密码->不可为空") 20 | String newPassword; 21 | 22 | /** 23 | * 原始密码 24 | */ 25 | @NotEmpty(message = "原始密码->不可为空") 26 | String originalPassword; 27 | } 28 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/req/AppUserRegReq.java: -------------------------------------------------------------------------------- 1 | package cn.common.req; 2 | 3 | 4 | import lombok.Data; 5 | import pro.skywalking.validation.NotEmpty; 6 | import java.io.*; 7 | 8 | /** 9 | * APP用户注册Req 10 | */ 11 | @Data 12 | public class AppUserRegReq implements Serializable { 13 | 14 | private static final long serialVersionUID = -2487801540835616975L; 15 | 16 | /** 17 | * 用户名 18 | */ 19 | @NotEmpty(message = "用户名->不可为空") 20 | private String userName; 21 | 22 | /** 23 | * 手机号码 24 | 25 | @NotEmpty(message = "手机号码->不可为空") 26 | private String phoneNumber;*/ 27 | 28 | /** 29 | * 密码 30 | */ 31 | @NotEmpty(message = "密码->不可为空") 32 | private String password; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/req/FeedingStrategyReq.java: -------------------------------------------------------------------------------- 1 | package cn.common.req; 2 | 3 | 4 | import lombok.Data; 5 | import pro.skywalking.req.base.BasePageReq; 6 | 7 | import java.io.*; 8 | 9 | /** 10 | * 攻略实体 11 | */ 12 | @Data 13 | public class FeedingStrategyReq extends BasePageReq implements Serializable { 14 | 15 | private static final long serialVersionUID = 5190506131540089590L; 16 | 17 | /** 18 | * 业务主键ID->"feedingStrategyId" 19 | */ 20 | private String feedingStrategyId; 21 | 22 | /** 23 | * 发布人ID 24 | */ 25 | private String publisherId; 26 | 27 | /** 28 | * 发布人 29 | */ 30 | private String publisherName; 31 | 32 | /** 33 | * 攻略标题 34 | */ 35 | private String strategyTitle; 36 | 37 | /** 38 | * 攻略内容 39 | */ 40 | private String strategyContent; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/req/MainSwiperReq.java: -------------------------------------------------------------------------------- 1 | package cn.common.req; 2 | 3 | import pro.skywalking.req.base.BasePageReq; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * APP首页轮播图信息分页查询请求封装类 10 | */ 11 | @Data 12 | public class MainSwiperReq extends BasePageReq implements Serializable { 13 | 14 | private static final long serialVersionUID = -6316530432218310436L; 15 | 16 | /** 17 | * 业务主键ID->"mainSwiperId" 18 | */ 19 | private String mainSwiperId; 20 | 21 | /** 22 | * 图片地址 23 | */ 24 | private String mainUrl; 25 | 26 | /** 27 | * 标题 28 | */ 29 | private String mainTitle; 30 | 31 | /** 32 | * 跳转地址 33 | */ 34 | private String routerUrl; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/req/MessageWordAddReq.java: -------------------------------------------------------------------------------- 1 | package cn.common.req; 2 | 3 | import pro.skywalking.validation.NotEmpty; 4 | import lombok.Data; 5 | 6 | import java.io.*; 7 | 8 | /** 9 | * 交流消息实体 10 | 11 | */ 12 | @Data 13 | public class MessageWordAddReq implements Serializable { 14 | 15 | private static final long serialVersionUID = -5140572779659372610L; 16 | 17 | /** 18 | * 接收人ID 19 | */ 20 | @NotEmpty(message = "接收人ID->不可为空") 21 | private String recipientId; 22 | 23 | /** 24 | * 消息内容 25 | */ 26 | @NotEmpty(message = "消息内容->不可为空") 27 | private String messageContent; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/req/MessageWordReq.java: -------------------------------------------------------------------------------- 1 | package cn.common.req; 2 | 3 | import pro.skywalking.req.base.BasePageReq; 4 | import lombok.Data; 5 | 6 | import java.io.*; 7 | 8 | /** 9 | * 交流消息实体 10 | */ 11 | @Data 12 | public class MessageWordReq extends BasePageReq implements Serializable { 13 | 14 | private static final long serialVersionUID = -8091019161504989910L; 15 | 16 | /** 17 | * 业务主键ID->"messageWordId" 18 | */ 19 | private String messageWordId; 20 | 21 | /** 22 | * 发送人ID 23 | */ 24 | private String senderId; 25 | 26 | /** 27 | * 接收人ID 28 | */ 29 | private String recipientId; 30 | 31 | /** 32 | * 消息内容 33 | */ 34 | private String messageContent; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/req/RescueStationAddReq.java: -------------------------------------------------------------------------------- 1 | package cn.common.req; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.*; 6 | 7 | /** 8 | * 救助站实体 9 | */ 10 | @Data 11 | public class RescueStationAddReq implements Serializable { 12 | 13 | private static final long serialVersionUID = 187843102457255097L; 14 | 15 | /** 16 | * 救助站名称 17 | */ 18 | private String stationName; 19 | 20 | /** 21 | * 救助站容量 22 | */ 23 | private String capacity; 24 | 25 | /** 26 | * 救助站联系方式 27 | */ 28 | private String phoneNumber; 29 | 30 | /** 31 | * 救助站地区 32 | */ 33 | private String rescueRegion; 34 | 35 | /** 36 | * 救助站地址 37 | */ 38 | private String stationAddress; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/req/RescueStationReq.java: -------------------------------------------------------------------------------- 1 | package cn.common.req; 2 | 3 | import pro.skywalking.req.base.BasePageReq; 4 | import lombok.Data; 5 | 6 | import java.io.*; 7 | 8 | /** 9 | * 救助站实体 10 | 11 | */ 12 | @Data 13 | public class RescueStationReq extends BasePageReq implements Serializable { 14 | 15 | private static final long serialVersionUID = 8530080230623079383L; 16 | 17 | /** 18 | * 业务主键ID->"rescueStationId" 19 | */ 20 | private String rescueStationId; 21 | 22 | /** 23 | * 救助站名称 24 | */ 25 | private String stationName; 26 | 27 | /** 28 | * 救助站容量 29 | */ 30 | private String capacity; 31 | 32 | /** 33 | * 救助站联系方式 34 | */ 35 | private String phoneNumber; 36 | 37 | /** 38 | * 救助站地区 39 | */ 40 | private String rescueRegion; 41 | 42 | /** 43 | * 救助站地址 44 | */ 45 | private String stationAddress; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/resp/AdoptApplyResp.java: -------------------------------------------------------------------------------- 1 | package cn.common.resp; 2 | 3 | 4 | import lombok.Data; 5 | import pro.skywalking.req.platform.base.BaseResp; 6 | 7 | import java.io.*; 8 | 9 | /** 10 | * 领养信息实体 11 | */ 12 | @Data 13 | public class AdoptApplyResp extends BaseResp implements Serializable { 14 | 15 | private static final long serialVersionUID = -4610181594365823581L; 16 | 17 | /** 18 | * 业务主键ID->"adoptApplyId" 19 | */ 20 | private String adoptApplyId; 21 | 22 | /** 23 | * 宠物ID 24 | */ 25 | private String adoptionDataId; 26 | 27 | /** 28 | * 申请人 29 | */ 30 | private String petitioner; 31 | 32 | /** 33 | * 领养备注 34 | */ 35 | private String adoptionRemark; 36 | 37 | /** 38 | * 审核状态 审核状态 通过 APPROVED 驳回 REJECT 39 | */ 40 | private String auditStatus; 41 | 42 | /** 43 | * 宠物信息 44 | */ 45 | private AdoptionDataResp petData; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/resp/AdoptionDataResp.java: -------------------------------------------------------------------------------- 1 | package cn.common.resp; 2 | 3 | import pro.skywalking.req.platform.base.BaseResp; 4 | import lombok.Data; 5 | 6 | import java.io.*; 7 | 8 | /** 9 | * 待领养信息实体 10 | */ 11 | @Data 12 | public class AdoptionDataResp extends BaseResp implements Serializable { 13 | 14 | private static final long serialVersionUID = -1574785687160611343L; 15 | 16 | /** 17 | * 业务主键ID->"adoptionDataId" 18 | */ 19 | private String adoptionDataId; 20 | 21 | /** 22 | * 宠物类型 23 | */ 24 | private String adoptionType; 25 | 26 | /** 27 | * 宠物名称 28 | */ 29 | private String adoptionName; 30 | 31 | /** 32 | * 宠物图片 33 | */ 34 | private String adoptionUrl; 35 | 36 | /** 37 | * 领养状态 1 待领养 2 已领养 3 领养审核中 38 | */ 39 | private Integer adoptionStatus; 40 | 41 | /** 42 | * 领养人 43 | */ 44 | private String adopter; 45 | 46 | /** 47 | * 宠物性别 48 | */ 49 | private String gender; 50 | 51 | /** 52 | * 所属救助站ID 53 | */ 54 | private String rescueStationId; 55 | 56 | /** 57 | * 宠物年龄 58 | */ 59 | private Integer age; 60 | 61 | /** 62 | * 物种 63 | */ 64 | private String species; 65 | 66 | /** 67 | * 品种 68 | */ 69 | private String breed; 70 | 71 | /** 72 | * 是否绝育 73 | */ 74 | private Boolean neuterStatus = Boolean.FALSE; 75 | 76 | /** 77 | * 介绍 78 | */ 79 | private String presentation; 80 | 81 | /** 82 | * 是否驱虫 83 | */ 84 | private Boolean repellentStatus = Boolean.FALSE; 85 | 86 | /** 87 | * 是否接种 88 | */ 89 | private Boolean immuneStatus = Boolean.FALSE; 90 | 91 | } 92 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/resp/AppLoginResp.java: -------------------------------------------------------------------------------- 1 | package cn.common.resp; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @Description: 登录返回Resp01 9 | */ 10 | @Data 11 | public class AppLoginResp implements Serializable { 12 | 13 | private static final long serialVersionUID = -6135855997336996720L; 14 | 15 | /** 16 | * token 17 | */ 18 | private String token; 19 | 20 | 21 | /** 22 | * 用户信息 23 | */ 24 | private LoginResp userData; 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/resp/FeedingStrategyResp.java: -------------------------------------------------------------------------------- 1 | package cn.common.resp; 2 | 3 | import pro.skywalking.req.platform.base.BaseResp; 4 | import lombok.Data; 5 | 6 | import java.io.*; 7 | 8 | /** 9 | * 攻略实体 10 | 11 | */ 12 | @Data 13 | public class FeedingStrategyResp extends BaseResp implements Serializable { 14 | 15 | private static final long serialVersionUID = -8073718508895105768L; 16 | 17 | /** 18 | * 业务主键ID->"feedingStrategyId" 19 | */ 20 | private String feedingStrategyId; 21 | 22 | /** 23 | * 发布人ID 24 | */ 25 | private String publisherId; 26 | 27 | /** 28 | * 发布人 29 | */ 30 | private String publisherName; 31 | 32 | /** 33 | * 攻略标题 34 | */ 35 | private String strategyTitle; 36 | 37 | /** 38 | * 攻略内容 39 | */ 40 | private String strategyContent; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/resp/LoginResp.java: -------------------------------------------------------------------------------- 1 | package cn.common.resp; 2 | 3 | import lombok.Data; 4 | import pro.skywalking.req.platform.base.BaseResp; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 系统用户实体 10 | 11 | */ 12 | @Data 13 | public class LoginResp extends BaseResp implements Serializable { 14 | 15 | private static final long serialVersionUID = -678298128571145347L; 16 | 17 | /** 18 | * 业务主键ID 19 | */ 20 | private String appUserId; 21 | 22 | /** 23 | * 用户名 24 | */ 25 | private String userName; 26 | 27 | /** 28 | * 用户编号 29 | */ 30 | private String userNumber; 31 | 32 | /** 33 | * 手机号码 34 | */ 35 | private String phoneNumber; 36 | 37 | /** 38 | * 明文密码 39 | */ 40 | private String decryptionPassword; 41 | 42 | /** 43 | * 密码(MD5) 44 | */ 45 | private String password; 46 | 47 | /** 48 | * 昵称 49 | */ 50 | private String nickName; 51 | 52 | /** 53 | * 头像 54 | */ 55 | private String avatarUrl; 56 | 57 | /** 58 | * 真实姓名 59 | */ 60 | private String realName; 61 | 62 | /** 63 | * 性别 64 | */ 65 | private String gender; 66 | 67 | /** 68 | * 用户状态 跟随枚举 69 | */ 70 | private Integer authStatus; 71 | 72 | } 73 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/resp/MainSwiperResp.java: -------------------------------------------------------------------------------- 1 | package cn.common.resp; 2 | 3 | import pro.skywalking.req.platform.base.BaseResp; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * APP首页轮播图信息返回数据封装类 10 | */ 11 | @Data 12 | public class MainSwiperResp extends BaseResp implements Serializable { 13 | 14 | private static final long serialVersionUID = 6656805994631923881L; 15 | 16 | /** 17 | * 业务主键ID->"mainSwiperId" 18 | */ 19 | private String mainSwiperId; 20 | 21 | /** 22 | * 图片地址 23 | */ 24 | private String mainUrl; 25 | 26 | /** 27 | * 标题 28 | */ 29 | private String mainTitle; 30 | 31 | /** 32 | * 跳转地址 33 | */ 34 | private String routerUrl; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/resp/MessageWordResp.java: -------------------------------------------------------------------------------- 1 | package cn.common.resp; 2 | 3 | import pro.skywalking.req.platform.base.BaseResp; 4 | import lombok.Data; 5 | 6 | import java.io.*; 7 | 8 | /** 9 | * 交流消息实体 10 | */ 11 | @Data 12 | public class MessageWordResp extends BaseResp implements Serializable { 13 | 14 | private static final long serialVersionUID = 6041024411929296910L; 15 | 16 | /** 17 | * 业务主键ID->"messageWordId" 18 | */ 19 | private String messageWordId; 20 | 21 | /** 22 | * 发送人ID 23 | */ 24 | private String senderId; 25 | 26 | /** 27 | * 接收人ID 28 | */ 29 | private String recipientId; 30 | 31 | /** 32 | * 消息内容 33 | */ 34 | private String messageContent; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/resp/RescueStationResp.java: -------------------------------------------------------------------------------- 1 | package cn.common.resp; 2 | 3 | import pro.skywalking.req.platform.base.BaseResp; 4 | import lombok.Data; 5 | 6 | import java.io.*; 7 | 8 | /** 9 | * 救助站实体 10 | */ 11 | @Data 12 | public class RescueStationResp extends BaseResp implements Serializable { 13 | 14 | private static final long serialVersionUID = -5713369697353162441L; 15 | 16 | /** 17 | * 业务主键ID->"rescueStationId" 18 | */ 19 | private String rescueStationId; 20 | 21 | /** 22 | * 救助站名称 23 | */ 24 | private String stationName; 25 | 26 | /** 27 | * 救助站容量 28 | */ 29 | private String capacity; 30 | 31 | /** 32 | * 救助站联系方式 33 | */ 34 | private String phoneNumber; 35 | 36 | /** 37 | * 救助站地区 38 | */ 39 | private String rescueRegion; 40 | 41 | /** 42 | * 救助站地址 43 | */ 44 | private String stationAddress; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /platform-interaction/src/main/java/cn/common/resp/TokenVerifyResp.java: -------------------------------------------------------------------------------- 1 | package cn.common.resp; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @Description: Token校验结果 9 | */ 10 | @Data 11 | public class TokenVerifyResp implements Serializable { 12 | 13 | private static final long serialVersionUID = -2911654423895568625L; 14 | 15 | 16 | /** 17 | * 是否校验成功 18 | */ 19 | private Boolean verifyStatus = Boolean.FALSE; 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /platform-repository/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | animal-app-api 7 | com.animal-app-api 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | platform-repository 12 | ${project.build.version} 13 | jar 14 | 15 | 16 | central 17 | AliYunMaven 18 | ${repository.url} 19 | default 20 | 21 | 22 | true 23 | 24 | 25 | 26 | false 27 | 28 | 29 | 30 | 31 | 32 | public 33 | groups 34 | ${repository.url} 35 | 36 | true 37 | 38 | 39 | true 40 | 41 | 42 | 43 | 44 | 49 | 50 | 51 | 52 | cn.common 53 | platform-common 54 | ${project.build.version} 55 | 56 | 57 | com.animal-app-api 58 | platform-interaction 59 | 0.0.1-SNAPSHOT 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/entity/biz/AccountingRecord.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.entity.biz; 2 | 3 | import pro.skywalking.entity.BaseEntity; 4 | import pro.skywalking.utils.SnowflakeIdWorker; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | import java.math.BigDecimal; 10 | 11 | 12 | /** 13 | * 账务实体 14 | */ 15 | @Data 16 | @TableName("accounting_record") 17 | public class AccountingRecord extends BaseEntity implements Serializable { 18 | 19 | 20 | private static final long serialVersionUID = -2347050356295435856L; 21 | 22 | /** 23 | * 业务主键ID 24 | */ 25 | private String accountingRecordId = SnowflakeIdWorker.uniqueMainId(); 26 | 27 | /** 28 | * 救助站ID 29 | */ 30 | private String rescueStationId; 31 | 32 | /** 33 | * 救助站名称 34 | */ 35 | private String rescueStationName; 36 | 37 | /** 38 | * 账务金额 39 | */ 40 | private BigDecimal accountingAmount; 41 | 42 | /** 43 | * 行为类型 44 | */ 45 | private String recordType; 46 | 47 | /** 48 | * 备注信息 49 | */ 50 | private String recordRemark; 51 | 52 | } 53 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/entity/biz/AdoptApply.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.entity.biz; 2 | 3 | import pro.skywalking.entity.BaseEntity; 4 | import pro.skywalking.utils.SnowflakeIdWorker; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | 10 | 11 | /** 12 | * 领养信息实体 13 | * @title: AdoptApply.java 14 | 15 | */ 16 | @Data 17 | @TableName("adopt_apply") 18 | public class AdoptApply extends BaseEntity implements Serializable { 19 | 20 | private static final long serialVersionUID = 4409006398576119549L; 21 | 22 | /** 23 | * 业务主键ID 24 | */ 25 | private String adoptApplyId = SnowflakeIdWorker.uniqueMainId(); 26 | 27 | /** 28 | * 宠物ID 29 | */ 30 | private String adoptionDataId; 31 | 32 | /** 33 | * 申请人 34 | */ 35 | private String petitioner; 36 | 37 | /** 38 | * 领养备注 39 | */ 40 | private String adoptionRemark; 41 | 42 | /** 43 | * 审核状态 通过 APPROVED 驳回 REJECT 44 | */ 45 | private String auditStatus; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/entity/biz/AdoptionData.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.entity.biz; 2 | 3 | import pro.skywalking.entity.BaseEntity; 4 | import pro.skywalking.utils.SnowflakeIdWorker; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | 10 | 11 | /** 12 | * 待领养信息实体 13 | */ 14 | @Data 15 | @TableName("adoption_data") 16 | public class AdoptionData extends BaseEntity implements Serializable { 17 | 18 | 19 | private static final long serialVersionUID = 3007272426493110451L; 20 | 21 | /** 22 | * 业务主键ID 23 | */ 24 | private String adoptionDataId = SnowflakeIdWorker.uniqueMainId(); 25 | 26 | /** 27 | * 宠物类型 28 | */ 29 | private String adoptionType; 30 | 31 | /** 32 | * 宠物名称 33 | */ 34 | private String adoptionName; 35 | 36 | /** 37 | * 宠物图片 38 | */ 39 | private String adoptionUrl; 40 | 41 | /** 42 | * 领养状态 1 待领养 2 已领养 3 领养审核中 3 领养审核中 43 | */ 44 | private Integer adoptionStatus; 45 | 46 | /** 47 | * 领养人 48 | */ 49 | private String adopter; 50 | 51 | 52 | /** 53 | * 宠物性别 54 | */ 55 | private String gender; 56 | 57 | /** 58 | * 宠物年龄 59 | */ 60 | private Integer age; 61 | 62 | /** 63 | * 所属救助站ID 64 | */ 65 | private String rescueStationId; 66 | 67 | /** 68 | * 物种 69 | */ 70 | private String species; 71 | 72 | /** 73 | * 品种 74 | */ 75 | private String breed; 76 | 77 | /** 78 | * 是否绝育 79 | */ 80 | private Boolean neuterStatus = Boolean.FALSE; 81 | 82 | /** 83 | * 介绍 84 | */ 85 | private String presentation; 86 | 87 | /** 88 | * 是否驱虫 89 | */ 90 | private Boolean repellentStatus = Boolean.FALSE; 91 | 92 | /** 93 | * 是否接种 94 | */ 95 | private Boolean immuneStatus = Boolean.FALSE; 96 | 97 | } 98 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/entity/biz/AppUser.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.entity.biz; 2 | 3 | import pro.skywalking.entity.BaseEntity; 4 | import pro.skywalking.utils.SnowflakeIdWorker; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | 10 | 11 | /** 12 | * APP用户实体 13 | * @title: AppUser.java 14 | */ 15 | @Data 16 | @TableName("app_user") 17 | public class AppUser extends BaseEntity implements Serializable { 18 | 19 | private static final long serialVersionUID = 413941069216448527L; 20 | 21 | /** 22 | * 业务主键ID 23 | */ 24 | private String appUserId = SnowflakeIdWorker.uniqueMainId(); 25 | 26 | /** 27 | * 用户名 28 | */ 29 | private String userName; 30 | 31 | /** 32 | * 用户编号 33 | */ 34 | private String userNumber; 35 | 36 | /** 37 | * 手机号码 38 | */ 39 | private String phoneNumber; 40 | 41 | /** 42 | * 明文密码 43 | */ 44 | private String decryptionPassword; 45 | 46 | /** 47 | * 密码(MD5) 48 | */ 49 | private String password; 50 | 51 | /** 52 | * 昵称 53 | */ 54 | private String nickName; 55 | 56 | /** 57 | * 头像 58 | */ 59 | private String avatarUrl; 60 | 61 | /** 62 | * 真实姓名 63 | */ 64 | private String realName; 65 | 66 | /** 67 | * 性别 68 | */ 69 | private String gender; 70 | 71 | /** 72 | * 用户状态 跟随枚举 73 | */ 74 | private Integer authStatus; 75 | } 76 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/entity/biz/FeedingStrategy.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.entity.biz; 2 | 3 | import pro.skywalking.entity.BaseEntity; 4 | import pro.skywalking.utils.SnowflakeIdWorker; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | 10 | 11 | /** 12 | * 攻略实体 13 | */ 14 | @Data 15 | @TableName("feeding_strategy") 16 | public class FeedingStrategy extends BaseEntity implements Serializable { 17 | 18 | 19 | private static final long serialVersionUID = -2476536266016868498L; 20 | 21 | /** 22 | * 业务主键ID 23 | */ 24 | private String feedingStrategyId = SnowflakeIdWorker.uniqueMainId(); 25 | 26 | /** 27 | * 发布人ID 28 | */ 29 | private String publisherId; 30 | 31 | /** 32 | * 发布人 33 | */ 34 | private String publisherName; 35 | 36 | /** 37 | * 攻略标题 38 | */ 39 | private String strategyTitle; 40 | 41 | /** 42 | * 攻略内容 43 | */ 44 | private String strategyContent; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/entity/biz/MainSwiper.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.entity.biz; 2 | 3 | import pro.skywalking.entity.BaseEntity; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import lombok.Data; 6 | 7 | import java.io.Serializable; 8 | 9 | 10 | /** 11 | * APP首页轮播图信息实体 12 | */ 13 | @Data 14 | @TableName("main_swiper") 15 | public class MainSwiper extends BaseEntity implements Serializable { 16 | 17 | private static final long serialVersionUID = -3430758838943184083L; 18 | 19 | /** 20 | * 业务主键ID 21 | */ 22 | private String mainSwiperId; 23 | 24 | /** 25 | * 图片地址 26 | */ 27 | private String mainUrl; 28 | 29 | /** 30 | * 标题 31 | */ 32 | private String mainTitle; 33 | 34 | /** 35 | * 跳转地址 36 | */ 37 | private String routerUrl; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/entity/biz/MessageWord.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.entity.biz; 2 | 3 | import pro.skywalking.entity.BaseEntity; 4 | import pro.skywalking.utils.SnowflakeIdWorker; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | 10 | 11 | /** 12 | * 交流消息实体 13 | * @title: MessageWord.java 14 | * @author create by Singer - Singer email:singer-coder@qq.com 15 | * @date 2019/4/24 11:13 16 | */ 17 | @Data 18 | @TableName("message_word") 19 | public class MessageWord extends BaseEntity implements Serializable { 20 | 21 | 22 | private static final long serialVersionUID = -4968865262400251624L; 23 | 24 | /** 25 | * 业务主键ID 26 | */ 27 | private String messageWordId; 28 | 29 | /** 30 | * 发送人ID 31 | */ 32 | private String senderId; 33 | 34 | /** 35 | * 接收人ID 36 | */ 37 | private String recipientId; 38 | 39 | /** 40 | * 消息内容 41 | */ 42 | private String messageContent; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/entity/biz/RescueStation.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.entity.biz; 2 | 3 | import pro.skywalking.entity.BaseEntity; 4 | import pro.skywalking.utils.SnowflakeIdWorker; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | 10 | 11 | /** 12 | * 救助站实体 13 | */ 14 | @Data 15 | @TableName("rescue_station") 16 | public class RescueStation extends BaseEntity implements Serializable { 17 | 18 | 19 | private static final long serialVersionUID = 4959491863882149656L; 20 | 21 | /** 22 | * 业务主键ID 23 | */ 24 | private String RescueStationId = SnowflakeIdWorker.uniqueMainId(); 25 | 26 | /** 27 | * 救助站名称 28 | */ 29 | private String stationName; 30 | 31 | /** 32 | * 救助站容量 33 | */ 34 | private String capacity; 35 | 36 | /** 37 | * 救助站联系方式 38 | */ 39 | private String phoneNumber; 40 | 41 | /** 42 | * 救助站地区 43 | */ 44 | private String rescueRegion; 45 | 46 | /** 47 | * 救助站地址 48 | */ 49 | private String stationAddress; 50 | 51 | } 52 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/entity/platform/AuthPermission.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.entity.platform; 2 | 3 | import pro.skywalking.entity.BaseEntity; 4 | import pro.skywalking.utils.SnowflakeIdWorker; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | 10 | 11 | /** 12 | * 系统权限实体 13 | * @title: AuthPermission.java 14 | */ 15 | @Data 16 | @TableName("auth_permission") 17 | public class AuthPermission extends BaseEntity implements Serializable { 18 | 19 | 20 | private static final long serialVersionUID = -4949515392142373130L; 21 | 22 | /** 23 | * 业务主键ID 24 | */ 25 | private String authPermissionId = SnowflakeIdWorker.uniqueMainId(); 26 | 27 | /** 28 | * 上级权限id 29 | */ 30 | private String parentId; 31 | 32 | /** 33 | * 1 页面 2 按钮 3 其他资源 34 | */ 35 | private Integer permissionType; 36 | 37 | /** 38 | * 排序 39 | */ 40 | private Integer sortIndex; 41 | 42 | /** 43 | * 权限名称 44 | */ 45 | private String permissionName; 46 | 47 | /** 48 | * 前端路径 49 | */ 50 | private String permissionPath; 51 | 52 | /** 53 | * 权限编码 54 | */ 55 | private String permissionCode; 56 | 57 | /** 58 | * 权限图标 59 | */ 60 | private String permissionIcon; 61 | 62 | /** 63 | * 备注 64 | */ 65 | private String permissionRemark; 66 | 67 | 68 | } 69 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/entity/platform/AuthRole.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.entity.platform; 2 | 3 | import pro.skywalking.entity.BaseEntity; 4 | import pro.skywalking.utils.SnowflakeIdWorker; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | 10 | 11 | /** 12 | * 系统角色实体 13 | */ 14 | @Data 15 | @TableName("auth_role") 16 | public class AuthRole extends BaseEntity implements Serializable { 17 | 18 | private static final long serialVersionUID = -3430644136167481629L; 19 | 20 | /** 21 | * 业务主键ID 22 | */ 23 | private String authRoleId = SnowflakeIdWorker.uniqueMainId(); 24 | 25 | 26 | /** 27 | * 角色名称 28 | */ 29 | private String roleName; 30 | 31 | /** 32 | * 角色编码 33 | */ 34 | private String roleCode; 35 | 36 | /** 37 | * 描述信息 38 | */ 39 | private String roleRemark; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/entity/platform/AuthRolePermission.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.entity.platform; 2 | 3 | import pro.skywalking.entity.BaseEntity; 4 | import pro.skywalking.utils.SnowflakeIdWorker; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | 10 | 11 | /** 12 | * 角色权限实体 13 | 14 | */ 15 | @Data 16 | @TableName("auth_role_permission") 17 | public class AuthRolePermission extends BaseEntity implements Serializable { 18 | 19 | 20 | private static final long serialVersionUID = 5867103270447284159L; 21 | 22 | /** 23 | * 业务主键ID 24 | */ 25 | private String authRolePermissionId = SnowflakeIdWorker.uniqueMainId(); 26 | 27 | 28 | /** 29 | * 角色ID 30 | */ 31 | private String authRoleId; 32 | 33 | /** 34 | * 权限ID 35 | */ 36 | private String authPermissionId; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/entity/platform/AuthUser.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.entity.platform; 2 | 3 | import pro.skywalking.entity.BaseEntity; 4 | import pro.skywalking.utils.SnowflakeIdWorker; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | 10 | 11 | /** 12 | * 系统用户实体 13 | */ 14 | @Data 15 | @TableName("auth_user") 16 | public class AuthUser extends BaseEntity implements Serializable { 17 | 18 | 19 | private static final long serialVersionUID = -4161211307007064956L; 20 | 21 | /** 22 | * 业务主键ID 23 | */ 24 | private String authUserId = SnowflakeIdWorker.uniqueMainId(); 25 | 26 | /** 27 | * 用户名 28 | */ 29 | private String userName; 30 | 31 | /** 32 | * 用户编号 33 | */ 34 | private String userNumber; 35 | 36 | /** 37 | * 手机号码 38 | */ 39 | private String phoneNumber; 40 | 41 | /** 42 | * 明文密码 43 | */ 44 | private String decryptionPassword; 45 | 46 | /** 47 | * 密码(MD5) 48 | */ 49 | private String password; 50 | 51 | /** 52 | * 真实姓名 53 | */ 54 | private String realName; 55 | 56 | /** 57 | * 性别 58 | */ 59 | private String gender; 60 | 61 | /** 62 | * 用户状态 63 | */ 64 | private Integer authStatus; 65 | 66 | /** 67 | * 头像 68 | */ 69 | private String avatarUrl; 70 | 71 | /** 72 | * 昵称 73 | */ 74 | private String nickName; 75 | 76 | } 77 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/entity/platform/AuthUserRole.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.entity.platform; 2 | 3 | import pro.skywalking.entity.BaseEntity; 4 | import pro.skywalking.utils.SnowflakeIdWorker; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | 10 | 11 | /** 12 | * 用户角色实体 13 | 3 14 | */ 15 | @Data 16 | @TableName("auth_user_role") 17 | public class AuthUserRole extends BaseEntity implements Serializable { 18 | 19 | 20 | private static final long serialVersionUID = 2749458880903906040L; 21 | 22 | /** 23 | * 业务主键ID 24 | */ 25 | private String authUserRoleId = SnowflakeIdWorker.uniqueMainId(); 26 | 27 | 28 | /** 29 | * 系统角色ID 30 | */ 31 | private String authRoleId; 32 | 33 | /** 34 | * 系统用户ID 35 | */ 36 | private String authUserId; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/entity/platform/PlatformApiLog.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.entity.platform; 2 | 3 | import pro.skywalking.entity.BaseEntity; 4 | import pro.skywalking.utils.SnowflakeIdWorker; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | 10 | 11 | /** 12 | * 系统日志实体 13 | */ 14 | @Data 15 | @TableName("platform_api_log") 16 | public class PlatformApiLog extends BaseEntity implements Serializable { 17 | 18 | 19 | private static final long serialVersionUID = -4006243363645794849L; 20 | 21 | /** 22 | * 业务主键ID 23 | */ 24 | private String platformApiLogId = SnowflakeIdWorker.uniqueMainId(); 25 | 26 | 27 | /** 28 | * 操作者用户名 29 | */ 30 | private String userName; 31 | 32 | /** 33 | * 操作内容 34 | */ 35 | private String operation; 36 | 37 | /** 38 | * 耗费时间 39 | */ 40 | private String operationTime; 41 | 42 | /** 43 | * 操作方法 44 | */ 45 | private String method; 46 | 47 | /** 48 | * 方法参数 49 | */ 50 | private String params; 51 | 52 | /** 53 | * 操作地点 54 | */ 55 | private String location; 56 | 57 | /** 58 | * IP地址 59 | */ 60 | private String requestIp; 61 | 62 | } 63 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/entity/platform/PlatformDict.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.entity.platform; 2 | 3 | import pro.skywalking.entity.BaseEntity; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import lombok.Data; 6 | 7 | import java.io.Serializable; 8 | 9 | 10 | /** 11 | * 字典信息实体 12 | * @title: PlatformDict.java 13 | */ 14 | @Data 15 | @TableName("platform_dict") 16 | public class PlatformDict extends BaseEntity implements Serializable { 17 | 18 | private static final long serialVersionUID = 2513084942873169004L; 19 | 20 | /** 21 | * 业务主键ID 22 | */ 23 | private String platformDictId; 24 | 25 | 26 | /** 27 | * 业务字典类型 28 | */ 29 | private String dictType; 30 | 31 | /** 32 | * 键 33 | */ 34 | private String dictKey; 35 | 36 | /** 37 | * 值 38 | */ 39 | private String dictValue; 40 | 41 | /** 42 | * 排序字段 43 | */ 44 | private Integer sortIndex; 45 | 46 | /** 47 | * 字典备注 48 | */ 49 | private String dictRemark; 50 | 51 | } 52 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/repository/biz/AccountingRecordRepository.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.repository.biz; 2 | 3 | import cn.common.repository.entity.biz.AccountingRecord; 4 | import org.apache.ibatis.annotations.Delete; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | import pro.skywalking.repository.BaseRepository; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @Description: 账务->Repository 13 | */ 14 | @Mapper 15 | public interface AccountingRecordRepository extends BaseRepository { 16 | 17 | 18 | /** 19 | * 根据业务主键批量删除 20 | * @param mainIdList 业务主键ID集合 21 | * @return List 22 | */ 23 | @Delete( 24 | " " 31 | ) 32 | void batchDeleteItem(@Param("mainIdList") List mainIdList); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/repository/biz/AdoptionApplyRepository.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.repository.biz; 2 | 3 | import pro.skywalking.repository.BaseRepository; 4 | import cn.common.repository.entity.biz.AdoptApply; 5 | import org.apache.ibatis.annotations.Delete; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @Description: 领养信息->Repository2 13 | */ 14 | @Mapper 15 | public interface AdoptionApplyRepository extends BaseRepository { 16 | 17 | /** 18 | * 根据业务主键批量删除 19 | * @param mainIdList 业务主键ID集合 20 | * @return List 21 | */ 22 | @Delete( 23 | "" 30 | ) 31 | void batchDeleteItem(@Param("mainIdList") List mainIdList); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/repository/biz/AdoptionDataRepository.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.repository.biz; 2 | 3 | import pro.skywalking.repository.BaseRepository; 4 | import cn.common.repository.entity.biz.AdoptionData; 5 | import org.apache.ibatis.annotations.Delete; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @Description: 待领养信息->Repository 13 | */ 14 | @Mapper 15 | public interface AdoptionDataRepository extends BaseRepository { 16 | 17 | 18 | 19 | /** 20 | * 根据业务主键批量删除 21 | * @param mainIdList 业务主键ID集合 22 | * @return List 23 | */ 24 | @Delete( 25 | "" 32 | ) 33 | void batchDeleteItem(@Param("mainIdList") List mainIdList); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/repository/biz/AppUserRepository.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.repository.biz; 2 | 3 | import pro.skywalking.repository.BaseRepository; 4 | import cn.common.repository.entity.biz.AppUser; 5 | import org.apache.ibatis.annotations.Delete; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Param; 8 | import org.apache.ibatis.annotations.Select; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * @Description: APP用户->Repository 14 | */ 15 | @Mapper 16 | public interface AppUserRepository extends BaseRepository { 17 | 18 | 19 | /** 20 | * 根据业务主键批量删除 21 | * @param mainIdList 业务主键ID集合 22 | * @return List 23 | */ 24 | @Delete( 25 | " DELETE FROM app_user WHERE 1=1 AND " + 26 | " app_user_id IN " + 27 | " " + 28 | " #{item} " + 29 | " " 30 | ) 31 | void batchDeleteItem(@Param("mainIdList") List mainIdList); 32 | 33 | @Select("SELECT * FROM app_user WHERE unique_no = #{inviteCode}") 34 | AppUser findByInviteCode(@Param("inviteCode") String inviteCode); 35 | 36 | @Select("SELECT * FROM app_user WHERE app_user_id = #{appUserId}") 37 | AppUser findByAppUserId(@Param("appUserId") String appUserId); 38 | } 39 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/repository/biz/FeedingStrategyRepository.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.repository.biz; 2 | 3 | import pro.skywalking.repository.BaseRepository; 4 | import cn.common.repository.entity.biz.FeedingStrategy; 5 | import org.apache.ibatis.annotations.Delete; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author Singer create by singer email:singer-coder@qq.com 13 | * @packageName cn.singer.repository.entity 14 | * @Description: 攻略->Repository 15 | * @date 2019-08-12 16 | */ 17 | @Mapper 18 | public interface FeedingStrategyRepository extends BaseRepository { 19 | 20 | /** 21 | * 根据业务主键批量删除 22 | * @title: AuthRoleRepository.java 23 | * @author create by Singer - Singer email:singer-coder@qq.com 24 | * @date 2019/4/28 11:05 25 | * @param mainIdList 业务主键ID集合 26 | * @return List 27 | */ 28 | @Delete( 29 | "" 36 | ) 37 | void batchDeleteItem(@Param("mainIdList") List mainIdList); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/repository/biz/MainSwiperRepository.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.repository.biz; 2 | 3 | import pro.skywalking.repository.BaseRepository; 4 | import cn.common.repository.entity.biz.MainSwiper; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * @Description: APP首页轮播图信息->Repository 9 | */ 10 | @Mapper 11 | public interface MainSwiperRepository extends BaseRepository { 12 | 13 | /** 14 | * 根据业务主键批量删除 15 | * @param mainIdList 业务主键ID集合 16 | * @return List 17 | 18 | @Delete( 19 | "" 26 | ) 27 | void batchDeleteItem(@Param("mainIdList") List mainIdList);*/ 28 | 29 | } 30 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/repository/biz/MessageWordRepository.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.repository.biz; 2 | 3 | import pro.skywalking.repository.BaseRepository; 4 | import cn.common.repository.entity.biz.MessageWord; 5 | import org.apache.ibatis.annotations.Delete; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author Singer create by singer email:singer-coder@qq.com 13 | * @packageName cn.singer.repository.entity 14 | * @Description: 交流消息->Repository 15 | * @date 2019-08-12 16 | */ 17 | @Mapper 18 | public interface MessageWordRepository extends BaseRepository { 19 | 20 | /** 21 | * 根据业务主键批量删除 22 | * @title: AuthRoleRepository.java 23 | * @author create by Singer - Singer email:singer-coder@qq.com 24 | * @date 2019/4/28 11:05 25 | * @param mainIdList 业务主键ID集合 26 | * @return List 27 | */ 28 | @Delete( 29 | "" 36 | ) 37 | void batchDeleteItem(@Param("mainIdList") List mainIdList); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/repository/biz/RescueStationRepository.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.repository.biz; 2 | 3 | import pro.skywalking.repository.BaseRepository; 4 | import cn.common.repository.entity.biz.RescueStation; 5 | import org.apache.ibatis.annotations.Delete; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @Description: 救助站->Repository 13 | */ 14 | @Mapper 15 | public interface RescueStationRepository extends BaseRepository { 16 | 17 | 18 | 19 | /** 20 | * 根据业务主键批量删除 21 | * @param mainIdList 业务主键ID集合 22 | * @return List 23 | */ 24 | @Delete( 25 | "" 32 | ) 33 | void batchDeleteItem(@Param("mainIdList") List mainIdList); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/repository/platform/AuthPermissionRepository.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.repository.platform; 2 | 3 | import pro.skywalking.repository.BaseRepository; 4 | import cn.common.repository.entity.platform.AuthPermission; 5 | import cn.common.repository.repository.result.AuthPermissionResult; 6 | import org.apache.ibatis.annotations.Delete; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Param; 9 | import org.apache.ibatis.annotations.Select; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * @Description: 系统权限->Repository 15 | 16 | */ 17 | @Mapper 18 | public interface AuthPermissionRepository extends BaseRepository { 19 | 20 | /** 21 | * 根据业务主键批量删除 22 | * @title: AuthRoleRepository.java05 23 | * @param mainIdList 业务主键ID集合 24 | * @return List 25 | */ 26 | @Delete( 27 | "" 34 | ) 35 | void batchDeleteItem(@Param("mainIdList") List mainIdList); 36 | 37 | /** 38 | * 查询角色具备的权限 39 | * @param authRoleId 角色ID 40 | * @return List 41 | */ 42 | @Select("") 62 | List queryAuthRolePermission(@Param("authRoleId") String authRoleId); 63 | 64 | /** 65 | * 查询用户具备的权限 66 | * @param authUserId 用户ID 67 | * @return List 68 | */ 69 | @Select("") 97 | List queryAuthUserPermission(@Param("authUserId") String authUserId); 98 | 99 | 100 | /** 101 | * 查询用户具备的权限 102 | * @param authUserIdList 用户ID 103 | * @return List 104 | */ 105 | @Select("") 135 | List queryPermissionByAuthUserList(@Param("authUserIdList") List authUserIdList); 136 | 137 | } 138 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/repository/platform/AuthRolePermissionRepository.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.repository.platform; 2 | 3 | import pro.skywalking.repository.BaseRepository; 4 | import cn.common.repository.entity.platform.AuthRolePermission; 5 | import org.apache.ibatis.annotations.Delete; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | 13 | * @Description: 角色权限->Repository 14 | */ 15 | @Mapper 16 | public interface AuthRolePermissionRepository extends BaseRepository { 17 | 18 | /** 19 | * 根据业务主键批量删除 20 | * @param mainIdList 业务主键ID集合 21 | * @return List 22 | */ 23 | @Delete( 24 | "" 31 | ) 32 | void batchDeleteItem(@Param("mainIdList") List mainIdList); 33 | 34 | /** 35 | * 根据权限ID批量删除指定权限 36 | * @param authPermissionIdList 权限ID集合 37 | */ 38 | @Delete( 39 | "" 46 | ) 47 | void batchDeleteByAuthPermissionIdList(@Param("authPermissionIdList") List authPermissionIdList); 48 | 49 | /** 50 | * 根据角色ID批量删除指定权限 51 | * @param authRoleIdList 角色ID集合 52 | */ 53 | @Delete( 54 | "" 61 | ) 62 | void batchDeleteByRoleIdList(@Param("authRoleIdList") List authRoleIdList); 63 | 64 | /** 65 | * 根据角色ID删除指定权限 66 | * @param authRoleId 角色ID 67 | */ 68 | @Delete("") 71 | void deleteByRoleId(@Param("authRoleId") String authRoleId); 72 | 73 | } 74 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/repository/platform/AuthRoleRepository.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.repository.platform; 2 | 3 | import pro.skywalking.repository.BaseRepository; 4 | import cn.common.repository.entity.platform.AuthRole; 5 | import org.apache.ibatis.annotations.Delete; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | 13 | * @Description: 系统角色->Repository 14 | */ 15 | @Mapper 16 | public interface AuthRoleRepository extends BaseRepository { 17 | 18 | /** 19 | * 根据业务主键批量删除 20 | * @param mainIdList 业务主键ID集合 21 | * @return List 22 | */ 23 | @Delete( 24 | "" 31 | ) 32 | void batchDeleteItem(@Param("mainIdList") List mainIdList); 33 | } 34 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/repository/platform/AuthUserRepository.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.repository.platform; 2 | 3 | import pro.skywalking.repository.BaseRepository; 4 | import cn.common.repository.entity.platform.AuthUser; 5 | import org.apache.ibatis.annotations.Delete; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @packageName cn.singer.repository.entity 13 | * @Description: 系统用户->Repository 14 | */ 15 | @Mapper 16 | public interface AuthUserRepository extends BaseRepository { 17 | 18 | /** 19 | * 根据业务主键批量删除 20 | * @title: AuthRoleRepository.java 21 | * @param mainIdList 业务主键ID集合 22 | * @return List 23 | */ 24 | @Delete( 25 | "" 32 | ) 33 | void batchDeleteItem(@Param("mainIdList") List mainIdList); 34 | } 35 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/repository/platform/AuthUserRoleRepository.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.repository.platform; 2 | 3 | import pro.skywalking.repository.BaseRepository; 4 | import cn.common.repository.entity.platform.AuthUserRole; 5 | import cn.common.repository.repository.result.AuthUserRoleResult; 6 | import org.apache.ibatis.annotations.Delete; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Param; 9 | import org.apache.ibatis.annotations.Select; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * @Description: 用户角色->Repository 15 | 16 | */ 17 | @Mapper 18 | public interface AuthUserRoleRepository extends BaseRepository { 19 | 20 | /** 21 | * 根据业务主键批量删除 22 | * @param mainIdList 业务主键ID集合 23 | * @return List 24 | */ 25 | @Delete( 26 | "" 33 | ) 34 | void batchDeleteItem(@Param("mainIdList") List mainIdList); 35 | 36 | /** 37 | * 根据删除指定用户所有角色 38 | 39 | * @param authUserIdList 用户ID集合 40 | */ 41 | @Delete( 42 | "" 49 | ) 50 | void batchDeleteByAuthUserId(@Param("authUserIdList") List authUserIdList); 51 | 52 | /** 53 | * 根据删除指定用户所有角色 54 | * @param authUserId 用户ID 55 | */ 56 | @Delete("") 59 | void deleteByAuthUserId(@Param("authUserId") String authUserId); 60 | 61 | 62 | /** 63 | * 查询用户具备的角色 64 | * @title: AuthMenuRepository.java 65 | * @param authUserIdList 用户ID 66 | * @return List 67 | */ 68 | @Select("") 87 | List queryRoleListByUserIdList(@Param("authUserIdList") List authUserIdList); 88 | 89 | /** 90 | * 查询用户具备的角色 91 | * @param authUserId 用户ID 92 | * @return List 93 | */ 94 | @Select("") 110 | List queryUserRoleList(@Param("authUserId") String authUserId); 111 | 112 | } 113 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/repository/platform/PlatformApiLogRepository.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.repository.platform; 2 | 3 | import pro.skywalking.repository.BaseRepository; 4 | import cn.common.repository.entity.platform.PlatformApiLog; 5 | import org.apache.ibatis.annotations.Delete; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @Description: 系统日志->Repository 13 | */ 14 | @Mapper 15 | public interface PlatformApiLogRepository extends BaseRepository { 16 | 17 | /** 18 | * 根据业务主键批量删除 19 | * @param mainIdList 业务主键ID集合 20 | * @return List 21 | */ 22 | @Delete( 23 | "" 30 | ) 31 | void batchDeleteItem(@Param("mainIdList") List mainIdList); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/repository/platform/PlatformDictRepository.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.repository.platform; 2 | 3 | import pro.skywalking.repository.BaseRepository; 4 | import cn.common.repository.entity.platform.PlatformDict; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * @packageName cn.singer.repository.entity 9 | * @Description: 字典信息->Repository 10 | */ 11 | @Mapper 12 | public interface PlatformDictRepository extends BaseRepository { 13 | 14 | 15 | 16 | /** 17 | * 根据业务主键批量删除 18 | * @title: AuthRoleRepository.java 19 | * @param mainIdList 业务主键ID集合 20 | * @return List 21 | 22 | @Delete( 23 | " DELETE FROM platform_dict WHERE 1=1 AND " + 24 | " platform_dict_id IN " + 25 | " " + 26 | " #{item} " + 27 | " " 28 | ) 29 | void batchDeleteItem(@Param("mainIdList") List mainIdList);*/ 30 | 31 | } 32 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/repository/result/AuthPermissionResult.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.repository.result; 2 | 3 | import com.alibaba.fastjson.annotation.JSONField; 4 | import lombok.Data; 5 | import org.springframework.format.annotation.DateTimeFormat; 6 | 7 | import java.io.Serializable; 8 | import java.time.Clock; 9 | import java.time.Instant; 10 | import java.time.LocalDateTime; 11 | 12 | 13 | /** 14 | * 系统权限实体 15 | 16 | */ 17 | @Data 18 | public class AuthPermissionResult implements Serializable { 19 | 20 | 21 | private static final long serialVersionUID = 1091286725554756565L; 22 | 23 | /** 24 | * 主键ID 25 | */ 26 | private String id; 27 | 28 | /** 29 | * 业务主键ID 30 | */ 31 | private String authPermissionId; 32 | 33 | /** 34 | * 上级权限id 35 | */ 36 | private String parentId; 37 | 38 | /** 39 | * 1 页面 2 按钮 3 其他资源 40 | */ 41 | private Integer permissionType; 42 | 43 | /** 44 | * 排序 45 | */ 46 | private Integer sortIndex; 47 | 48 | /** 49 | * 权限名称 50 | */ 51 | private String permissionName; 52 | 53 | /** 54 | * 前端路径 55 | */ 56 | private String permissionPath; 57 | 58 | /** 59 | * 权限编码 60 | */ 61 | private String permissionCode; 62 | 63 | /** 64 | * 权限图标 65 | */ 66 | private String permissionIcon; 67 | 68 | /** 69 | * 备注 70 | */ 71 | private String permissionRemark; 72 | 73 | /** 74 | * 创建时间 75 | */ 76 | @JSONField(format="yyyy-MM-dd HH:mm:ss") 77 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 78 | private LocalDateTime createTime = LocalDateTime.ofInstant(Instant.now(), Clock.systemDefaultZone().getZone()); 79 | 80 | /** 81 | * 修改时间 82 | */ 83 | @JSONField(format="yyyy-MM-dd HH:mm:ss") 84 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 85 | private LocalDateTime updateTime = LocalDateTime.ofInstant(Instant.now(), Clock.systemDefaultZone().getZone()); 86 | 87 | /** 88 | * 创建人 89 | */ 90 | private String operatorId; 91 | } 92 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/repository/result/AuthUserRoleResult.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.repository.result; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @Description: 用户角色关联查询结果 9 | */ 10 | @Data 11 | public class AuthUserRoleResult extends BaseResult implements Serializable { 12 | 13 | private static final long serialVersionUID = -264643901500292816L; 14 | 15 | /** 16 | * 用户ID 17 | */ 18 | private String authUserId; 19 | 20 | /** 21 | * 角色名称 22 | */ 23 | private String roleName; 24 | 25 | /** 26 | * 角色编码 27 | */ 28 | private String roleCode; 29 | 30 | /** 31 | * 描述信息 32 | */ 33 | private String roleRemark; 34 | 35 | /** 36 | * 角色ID 37 | */ 38 | private String authRoleId; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/repository/result/BaseResult.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.repository.result; 2 | 3 | import com.alibaba.fastjson.annotation.JSONField; 4 | import lombok.Data; 5 | import org.springframework.format.annotation.DateTimeFormat; 6 | 7 | import java.io.Serializable; 8 | import java.time.Clock; 9 | import java.time.Instant; 10 | import java.time.LocalDateTime; 11 | 12 | /** 13 | * 此类是基础的实体类 14 | * MappedSuperclass 此标签会把父类的字段映射到子类上面 15 | */ 16 | //@MappedSuperclass 17 | @Data 18 | public class BaseResult implements Serializable { 19 | 20 | private static final long serialVersionUID = -279378218553793536L; 21 | 22 | /** 23 | * 主键ID 24 | */ 25 | private Long id; 26 | 27 | /** 28 | * 创建时间 29 | */ 30 | @JSONField(format="yyyy-MM-dd HH:mm:ss") 31 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 32 | private LocalDateTime createTime = LocalDateTime.ofInstant(Instant.now(), Clock.systemDefaultZone().getZone()); 33 | 34 | /** 35 | * 修改时间 36 | */ 37 | @JSONField(format="yyyy-MM-dd HH:mm:ss") 38 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 39 | private LocalDateTime updateTime = LocalDateTime.ofInstant(Instant.now(), Clock.systemDefaultZone().getZone()); 40 | 41 | /** 42 | * 创建人 43 | */ 44 | private String operatorId; 45 | } 46 | -------------------------------------------------------------------------------- /platform-repository/src/main/java/cn/common/repository/repository/result/NodeResult.java: -------------------------------------------------------------------------------- 1 | package cn.common.repository.repository.result; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | 8 | /** 9 | 10 | * @Description: 节点查询返回参数封装 11 | */ 12 | @Data 13 | public class NodeResult implements Serializable { 14 | 15 | 16 | private static final long serialVersionUID = -735815717696444704L; 17 | 18 | 19 | private Long id;//当前节点的ID 20 | 21 | private String name; 22 | 23 | private Boolean leaf; 24 | 25 | private Integer level; 26 | 27 | private String parentId; 28 | 29 | private Date expireTime; 30 | 31 | private Integer maxPeopleNum; 32 | 33 | private Integer jxMobileProject; 34 | 35 | private Integer jxMobileCode; 36 | 37 | /** 38 | * 只有校区级别才有的字段 是否开启 支付 默认为 0需要支付 1 不需要支付 39 | */ 40 | private Integer openCheckPay; 41 | 42 | 43 | private Integer onlyCheckDeposit; 44 | 45 | /** 46 | * 是否驱逐套餐 47 | */ 48 | private Boolean payPackageEvicted; 49 | 50 | private Long projectId; 51 | 52 | //维度 53 | private String latitude; 54 | 55 | //经度 56 | private String longitude; 57 | 58 | //卡片权限 59 | private Integer openCardPermission; 60 | 61 | private String code = ""; 62 | 63 | private Long storeyId = 0L; 64 | 65 | private Long buildingId = 0L; 66 | 67 | private Long campusId = 0L; 68 | 69 | private Long roomId = 0L; 70 | 71 | private String nodeKey; 72 | 73 | private Long userId; 74 | 75 | private Long userType; 76 | 77 | private String macId; 78 | 79 | public String getNodeKey(){ 80 | String res=projectId+""+campusId+""+buildingId+""+storeyId+""+roomId+""+id; 81 | return res.replaceAll("HOUQINBAO","").replaceAll("-",""); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /platform-service/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | animal-app-api 7 | com.animal-app-api 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | platform-service 12 | ${project.build.version} 13 | jar 14 | 15 | 16 | central 17 | AliYunMaven 18 | ${repository.url} 19 | default 20 | 21 | 22 | true 23 | 24 | 25 | 26 | false 27 | 28 | 29 | 30 | 31 | 32 | public 33 | groups 34 | ${repository.url} 35 | 36 | true 37 | 38 | 39 | true 40 | 41 | 42 | 43 | 44 | 49 | 50 | 51 | 52 | com.animal-app-api 53 | platform-repository 54 | 0.0.1-SNAPSHOT 55 | 56 | 57 | cn.common 58 | platform-common 59 | ${project.build.version} 60 | 61 | 62 | cn.hutool 63 | hutool-all 64 | ${hutool.version} 65 | 66 | 67 | com.google.guava 68 | guava 69 | ${guava.version} 70 | 71 | 72 | com.animal-app-api 73 | platform-interaction 74 | 0.0.1-SNAPSHOT 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/aspect/LogRecordAspect.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.aspect; 2 | 3 | 4 | import cn.common.repository.entity.platform.PlatformApiLog; 5 | import cn.common.resp.AppLoginResp; 6 | import cn.common.resp.LoginResp; 7 | import cn.common.service.platform.AuthUserService; 8 | import pro.skywalking.anon.ApiLog; 9 | import pro.skywalking.utils.BaseUtil; 10 | import pro.skywalking.utils.CheckParam; 11 | import cn.common.repository.repository.platform.PlatformApiLogRepository; 12 | import com.alibaba.fastjson.JSON; 13 | import com.fasterxml.jackson.core.JsonProcessingException; 14 | import lombok.extern.slf4j.Slf4j; 15 | import org.aspectj.lang.ProceedingJoinPoint; 16 | import org.aspectj.lang.annotation.Around; 17 | import org.aspectj.lang.annotation.Aspect; 18 | import org.aspectj.lang.annotation.Pointcut; 19 | import org.aspectj.lang.reflect.MethodSignature; 20 | import org.springframework.core.LocalVariableTableParameterNameDiscoverer; 21 | import org.springframework.stereotype.Component; 22 | import org.springframework.web.context.request.RequestContextHolder; 23 | import org.springframework.web.context.request.ServletRequestAttributes; 24 | import org.springframework.web.multipart.MultipartFile; 25 | 26 | import javax.annotation.Resource; 27 | import javax.servlet.http.HttpServletRequest; 28 | import java.io.*; 29 | import java.lang.reflect.Method; 30 | import java.util.ArrayList; 31 | import java.util.Arrays; 32 | import java.util.List; 33 | import java.util.Map; 34 | import java.util.Set; 35 | 36 | /** 37 | * @packageName cn.common.service.aspect; 38 | * @Description: 日志记录切面 39 | */ 40 | @Slf4j 41 | @Aspect 42 | @Component 43 | public class LogRecordAspect { 44 | 45 | @Resource 46 | private PlatformApiLogRepository platformApiLogRepository; 47 | 48 | @Resource 49 | private AuthUserService authUserService; 50 | 51 | /** 52 | * 定义切点 53 | */ 54 | @Pointcut("@annotation(pro.skywalking.anon.ApiLog)") 55 | public void pointcut() { 56 | } 57 | 58 | /** 59 | * 环绕通知,处理切点里面的数据 60 | * @param point 环绕通知对象主要用于处理切点里面的数据 61 | * @return Object 62 | */ 63 | @Around("pointcut()") 64 | public Object around(ProceedingJoinPoint point) throws Throwable { 65 | Object result = null; 66 | long beginTime = System.currentTimeMillis(); 67 | // 执行方法 68 | result = point.proceed(); 69 | ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); 70 | HttpServletRequest request = attributes.getRequest(); 71 | // 设置 IP 地址 72 | String ipAddress = BaseUtil.getIpAddress(request); 73 | // 执行时长(毫秒) 74 | long time = System.currentTimeMillis() - beginTime; 75 | AppLoginResp authUserMeta = authUserService.queryLoginUserMetaNoThrow(); 76 | PlatformApiLog log = new PlatformApiLog(); 77 | if(!CheckParam.isNull(authUserMeta)){ 78 | LoginResp userData = authUserMeta.getUserData(); 79 | if(!CheckParam.isNull(userData)){ 80 | log.setUserName(userData.getUserName()); 81 | } 82 | }else{ 83 | log.setUserName(""); 84 | } 85 | log.setRequestIp(ipAddress); 86 | log.setOperationTime(String.valueOf(time)); 87 | MethodSignature signature = (MethodSignature) point.getSignature(); 88 | Method method = signature.getMethod(); 89 | ApiLog logAnnotation = method.getAnnotation(ApiLog.class); 90 | if (logAnnotation != null) { 91 | // 注解上的描述 92 | log.setOperation(logAnnotation.value()); 93 | } 94 | // 请求的类名 95 | String className = point.getTarget().getClass().getName(); 96 | // 请求的方法名 97 | String methodName = signature.getName(); 98 | log.setMethod(className + "." + methodName + "()"); 99 | // 请求的方法参数值 100 | Object[] args = point.getArgs(); 101 | // 请求的方法参数名称 102 | LocalVariableTableParameterNameDiscoverer u = new LocalVariableTableParameterNameDiscoverer(); 103 | String[] paramNames = u.getParameterNames(method); 104 | if (args != null && paramNames != null) { 105 | StringBuilder params = new StringBuilder(); 106 | params = handleParams(params, args, Arrays.asList(paramNames)); 107 | log.setParams(params.toString()); 108 | } 109 | log.setLocation(ipAddress); 110 | platformApiLogRepository.insert(log); 111 | return result; 112 | } 113 | 114 | /** 115 | * 拿到请求参数 116 | * @param params 要返回的参数 117 | * @param args 请求参数列表 118 | * @param paramNames 请求参数名称列表 119 | * @return StringBuilder 120 | */ 121 | private StringBuilder handleParams(StringBuilder params, Object[] args, List paramNames) throws JsonProcessingException { 122 | for (int n1 = 0; n1 < args.length; n1++) { 123 | if (args[n1] instanceof Map) { 124 | Set set = ((Map) args[n1]).keySet(); 125 | List list = new ArrayList<>(); 126 | List paramList = new ArrayList<>(); 127 | for (Object key : set) { 128 | list.add(((Map) args[n1]).get(key)); 129 | paramList.add(key); 130 | } 131 | return handleParams(params, list.toArray(), paramList); 132 | } else { 133 | if (args[n1] instanceof MultipartFile) { 134 | MultipartFile file = (MultipartFile) args[n1]; 135 | params.append(" ").append(paramNames.get(n1)).append(": ").append(file.getName()); 136 | } else if (args[n1] instanceof Serializable) { 137 | Class aClass = args[n1].getClass(); 138 | try { 139 | aClass.getDeclaredMethod("toString", new Class[]{null}); 140 | // 如果不抛出 NoSuchMethodException 异常则存在 toString 方法 ,安全的 writeValueAsString ,否则 走 Object的 toString方法 141 | 142 | params.append(" ").append(paramNames.get(n1)).append(": ").append(JSON.toJSONString(args[n1])); 143 | } catch (NoSuchMethodException e) { 144 | params.append(" ").append(paramNames.get(n1)).append(": ").append(JSON.toJSONString(args[n1])); 145 | } 146 | } else { 147 | params.append(" ").append(paramNames.get(n1)).append(": ").append(args[n1]); 148 | } 149 | } 150 | } 151 | return params; 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/biz/AdoptApplyService.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.biz; 2 | 3 | 4 | import cn.common.req.AdoptApplyAddReq; 5 | import cn.common.req.AdoptionApplyReq; 6 | import cn.common.resp.AdoptApplyResp; 7 | import pro.skywalking.resp.page.Pagination; 8 | 9 | /** 10 | *领养信息相关服务 11 | */ 12 | public interface AdoptApplyService { 13 | 14 | /** 15 | * 新增 16 | * @param addReq 新增Req 17 | */ 18 | void addItem(AdoptApplyAddReq addReq); 19 | 20 | 21 | /** 22 | * 分页查询领养申请信息 23 | * @param pageReq 分页查询Req 24 | * @return Pagination 25 | */ 26 | Pagination queryByPage( 27 | AdoptionApplyReq pageReq); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/biz/AdoptionDataService.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.biz; 2 | 3 | 4 | import cn.common.internal.ViewRecordMeta; 5 | import cn.common.req.AdoptPetLimitReq; 6 | import cn.common.req.AdoptionDataAddReq; 7 | import cn.common.req.AdoptionDataReq; 8 | import cn.common.resp.AdoptionDataResp; 9 | import pro.skywalking.resp.page.Pagination; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * @Description: 待领养信息相关服务 15 | */ 16 | public interface AdoptionDataService { 17 | 18 | /** 19 | * 新增 20 | * @param addReq 新增Req 21 | */ 22 | void addItem(AdoptionDataAddReq addReq); 23 | 24 | /** 25 | * 所有待领养信息 26 | */ 27 | List allAdoptionData(); 28 | 29 | /** 30 | * 提交宠物查看记录 31 | * @param mainId 宠物ID 32 | * @return 33 | */ 34 | void setViewPetData(String mainId); 35 | 36 | /** 37 | * 查询当前用户的查看记录 38 | * @param 39 | * @return java.util.List 40 | */ 41 | List queryViewRecord(); 42 | 43 | /** 44 | * 查询指定数量的动物 45 | * @param pageReq 46 | * @return java.util.List 47 | */ 48 | List queryTopLimit(AdoptPetLimitReq pageReq); 49 | 50 | /** 51 | * 查询宠物详情 52 | * @param mainId 宠物信息ID 53 | * @return 54 | */ 55 | AdoptionDataResp queryParticulars(String mainId); 56 | 57 | /** 58 | * 分页查询 59 | * @param pageReq 分页查询Req 60 | * @return Pagination 61 | */ 62 | Pagination queryByPage( 63 | AdoptionDataReq pageReq); 64 | 65 | } 66 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/biz/FeedingStrategyService.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.biz; 2 | 3 | 4 | import cn.common.req.FeedingStrategyReq; 5 | import cn.common.resp.FeedingStrategyResp; 6 | import pro.skywalking.req.base.BaseDeleteReq; 7 | import pro.skywalking.resp.page.Pagination; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @Description: 养宠攻略相关服务 13 | */ 14 | public interface FeedingStrategyService { 15 | 16 | /** 17 | * 批量删除信息 18 | * @param req 需要被删除的信息 19 | */ 20 | void batchDeleteItem(BaseDeleteReq req); 21 | 22 | /** 23 | * 查询所有信息 24 | * @param 25 | * @return java.util.List 26 | */ 27 | List queryAllFeedingStrategy(); 28 | 29 | /** 30 | * 分页查询 31 | * @param pageReq 分页查询Req 32 | * @return Pagination 33 | */ 34 | Pagination queryByPage( 35 | FeedingStrategyReq pageReq); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/biz/MainSwiperService.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.biz; 2 | 3 | 4 | import cn.common.req.MainSwiperReq; 5 | import cn.common.resp.MainSwiperResp; 6 | import pro.skywalking.req.base.BaseDeleteReq; 7 | import pro.skywalking.resp.page.Pagination; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | 13 | * @Description: APP首页轮播图信息相关服务 14 | */ 15 | public interface MainSwiperService { 16 | 17 | /** 18 | * 批量删除信息 19 | * @param req 需要被删除的信息 20 | */ 21 | void batchDeleteItem(BaseDeleteReq req); 22 | 23 | /** 24 | * 查询所有信息 25 | * @param 26 | * @return java.util.List 27 | */ 28 | List queryAllMainSwiper(); 29 | 30 | /** 31 | * 分页查询 32 | * @param pageReq 分页查询Req 33 | * @return Pagination 34 | */ 35 | Pagination queryByPage( 36 | MainSwiperReq pageReq); 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/biz/MessageWordService.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.biz; 2 | 3 | 4 | import cn.common.req.MessageWordAddReq; 5 | import cn.common.req.MessageWordReq; 6 | import cn.common.resp.MessageWordResp; 7 | import pro.skywalking.req.base.BaseDeleteReq; 8 | import pro.skywalking.resp.page.Pagination; 9 | 10 | /** 11 | 12 | * @Description: 交流消息相关服务 13 | */ 14 | public interface MessageWordService { 15 | 16 | /** 17 | * 新增 18 | * @param addReq 新增Req 19 | */ 20 | void addItem(MessageWordAddReq addReq); 21 | 22 | 23 | /** 24 | * 批量删除信息 25 | * @param req 需要被删除的信息 26 | */ 27 | void batchDeleteItem(BaseDeleteReq req); 28 | 29 | /** 30 | * 分页查询 31 | * @param pageReq 分页查询Req 32 | * @return Pagination 33 | */ 34 | Pagination queryByPage( 35 | MessageWordReq pageReq); 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/biz/RescueStationService.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.biz; 2 | 3 | 4 | import cn.common.req.RescueStationAddReq; 5 | import cn.common.req.RescueStationReq; 6 | import cn.common.resp.RescueStationResp; 7 | import pro.skywalking.req.base.BaseDeleteReq; 8 | import pro.skywalking.resp.page.Pagination; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * @Description: 救助站相关服务 14 | */ 15 | public interface RescueStationService { 16 | 17 | /** 18 | * 新增 19 | * @param addReq 新增Req 20 | */ 21 | void addItem(RescueStationAddReq addReq); 22 | 23 | /** 24 | * 批量删除信息 25 | * @param req 需要被删除的信息 26 | */ 27 | void batchDeleteItem(BaseDeleteReq req); 28 | 29 | /** 30 | * 查询所有救助站信息 31 | * @return java.util.List 32 | */ 33 | List queryAllStation(); 34 | 35 | /** 36 | * 分页查询 37 | * @param pageReq 分页查询Req 38 | * @return Pagination 39 | */ 40 | Pagination queryByPage( 41 | RescueStationReq pageReq); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/data/ItemCriteriaBuilder.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.data; 2 | 3 | 4 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * @Title: CriteriaBuilder 9 | * @ProjectName animal-app-api 10 | * @Description: 数据权限查询条件构建器 11 | */ 12 | @Component("itemCriteriaBuilder") 13 | public class ItemCriteriaBuilder { 14 | 15 | /** 16 | * 设置基础数据查询条件 17 | * @param wrapper 查询条件 18 | * @param needSetDataAuth 是否需要设置数据权限 19 | */ 20 | public void rigidCriteria(LambdaQueryWrapper wrapper,Boolean needSetDataAuth){ 21 | if(!needSetDataAuth){ 22 | return; 23 | } 24 | //setAuthDataCriteria(wrapper,authUserId); 25 | } 26 | 27 | /** 28 | * 设置数据隔离查询条件 29 | * @param wrapper 查询条件 30 | * @param authUserId 用户缓存信息 31 | */ 32 | public void setAuthDataCriteria(LambdaQueryWrapper wrapper, 33 | String authUserId){ 34 | 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/impl/biz/FeedingStrategyServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.impl.biz; 2 | 3 | import cn.common.repository.entity.biz.FeedingStrategy; 4 | import cn.common.repository.repository.biz.FeedingStrategyRepository; 5 | import cn.common.req.FeedingStrategyReq; 6 | import cn.common.resp.FeedingStrategyResp; 7 | import cn.common.service.platform.AuthUserService; 8 | import cn.common.service.biz.FeedingStrategyService; 9 | import cn.common.service.data.ItemCriteriaBuilder; 10 | import com.alibaba.fastjson.JSON; 11 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 12 | import com.github.pagehelper.Page; 13 | import com.github.pagehelper.PageHelper; 14 | import com.google.common.collect.Lists; 15 | import lombok.extern.slf4j.Slf4j; 16 | import ma.glasnost.orika.MapperFacade; 17 | import org.springframework.stereotype.Service; 18 | import pro.skywalking.collection.CollectionUtils; 19 | import pro.skywalking.constants.BaseConstant; 20 | import pro.skywalking.helper.PageBuilder; 21 | import pro.skywalking.req.base.BaseDeleteReq; 22 | import pro.skywalking.resp.page.Pagination; 23 | import pro.skywalking.utils.CheckParam; 24 | 25 | import javax.annotation.Resource; 26 | import javax.servlet.http.HttpServletRequest; 27 | import javax.servlet.http.HttpServletResponse; 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | import java.util.concurrent.atomic.AtomicInteger; 31 | 32 | /** 33 | * @Description: 养宠攻略相关服务方法实现 34 | */ 35 | @Service("feedingStrategyService") 36 | @Slf4j 37 | public class FeedingStrategyServiceImpl implements FeedingStrategyService { 38 | 39 | @Resource 40 | private FeedingStrategyRepository feedingStrategyRepository; 41 | 42 | @Resource 43 | private MapperFacade mapperFacade; 44 | 45 | @Resource 46 | private BaseConstant baseConstant; 47 | 48 | @Resource 49 | private AuthUserService authUserService; 50 | 51 | @Resource 52 | private ItemCriteriaBuilder itemCriteriaBuilder; 53 | 54 | @Resource 55 | private HttpServletResponse response; 56 | 57 | @Resource 58 | private HttpServletRequest request; 59 | 60 | 61 | /** 62 | * 批量删除信息 63 | * @author: create by singer - Singer email:singer-coder@qq.com 64 | * @param req 需要被删除的信息 65 | */ 66 | @Override 67 | public void batchDeleteItem(BaseDeleteReq req){ 68 | List mainIdList = req.getMainIdList(); 69 | if(CollectionUtils.isEmpty(mainIdList)) { 70 | return; 71 | } 72 | List entityList = feedingStrategyRepository.selectList( 73 | new LambdaQueryWrapper().in(FeedingStrategy::getFeedingStrategyId,mainIdList)); 74 | entityList.stream().forEach(item -> { 75 | feedingStrategyRepository.deleteById(item); 76 | }); 77 | } 78 | 79 | /** 80 | * 查询所有信息 81 | * @param 82 | * @return java.util.List 83 | */ 84 | @Override 85 | public List queryAllFeedingStrategy(){ 86 | List entityList = feedingStrategyRepository.selectList(new LambdaQueryWrapper<>()); 87 | if(CollectionUtils.isEmpty(entityList)){ 88 | return Lists.newArrayList(); 89 | } 90 | return mapperFacade.mapAsList(entityList,FeedingStrategyResp.class); 91 | } 92 | 93 | /** 94 | * 分页查询 95 | * @param pageReq 分页查询Req 96 | * @return Pagination 97 | */ 98 | @Override 99 | public Pagination queryByPage( 100 | FeedingStrategyReq pageReq){ 101 | log.info(">>>>>>>>>>>>>>>>>分页查询Req {} <<<<<<<<<<<<<<<<", JSON.toJSONString(pageReq)); 102 | //构建查询条件 103 | LambdaQueryWrapper pageWrapper = new LambdaQueryWrapper<>(); 104 | itemCriteriaBuilder.rigidCriteria(pageWrapper,true); 105 | setPageCriteria(pageWrapper,pageReq); 106 | pageWrapper.orderBy(true,false,FeedingStrategy::getCreateTime); 107 | //开始分页 108 | Page page = PageHelper.startPage(pageReq.getCurrentPage(), pageReq.getItemsPerPage()); 109 | List pageList = feedingStrategyRepository.selectList(pageWrapper); 110 | if (CollectionUtils.isEmpty(pageList)) { 111 | return PageBuilder.buildPageResult(page,new ArrayList<>()); 112 | } 113 | List respList = 114 | mapperFacade.mapAsList(pageList, FeedingStrategyResp.class); 115 | Integer startIndex = (pageReq.getItemsPerPage() * pageReq.getCurrentPage()) - pageReq.getItemsPerPage() + 1; 116 | AtomicInteger idBeginIndex = new AtomicInteger(startIndex); 117 | respList.stream().forEach(item -> { 118 | item.setId(Integer.valueOf(idBeginIndex.getAndIncrement()).longValue()); 119 | }); 120 | return PageBuilder.buildPageResult(page,respList); 121 | } 122 | 123 | /** 124 | * 设置分页条件 125 | * @param pageWrapper 查询条件 126 | * @param pageReq 分页插件 127 | * @return 128 | */ 129 | private void setPageCriteria(LambdaQueryWrapper pageWrapper, FeedingStrategyReq pageReq){ 130 | 131 | if(!CheckParam.isNull(pageReq.getPublisherId())){ 132 | pageWrapper.like(FeedingStrategy::getPublisherId,"%"+pageReq.getPublisherId()); 133 | } 134 | 135 | if(!CheckParam.isNull(pageReq.getPublisherName())){ 136 | pageWrapper.like(FeedingStrategy::getPublisherName,"%"+pageReq.getPublisherName()); 137 | } 138 | 139 | if(!CheckParam.isNull(pageReq.getStrategyTitle())){ 140 | pageWrapper.like(FeedingStrategy::getStrategyTitle,"%"+pageReq.getStrategyTitle()); 141 | } 142 | 143 | if(!CheckParam.isNull(pageReq.getStrategyContent())){ 144 | pageWrapper.like(FeedingStrategy::getStrategyContent,"%"+pageReq.getStrategyContent()); 145 | } 146 | } 147 | 148 | } 149 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/impl/biz/MainSwiperServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.impl.biz; 2 | 3 | import cn.common.repository.entity.biz.MainSwiper; 4 | import cn.common.repository.repository.biz.MainSwiperRepository; 5 | import cn.common.req.MainSwiperReq; 6 | import cn.common.resp.MainSwiperResp; 7 | import cn.common.service.biz.MainSwiperService; 8 | import cn.common.service.data.ItemCriteriaBuilder; 9 | import com.alibaba.fastjson.JSON; 10 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 11 | import com.github.pagehelper.Page; 12 | import com.github.pagehelper.PageHelper; 13 | import com.google.common.collect.Lists; 14 | import lombok.extern.slf4j.Slf4j; 15 | import ma.glasnost.orika.MapperFacade; 16 | import org.springframework.stereotype.Service; 17 | import pro.skywalking.collection.CollectionUtils; 18 | import pro.skywalking.helper.PageBuilder; 19 | import pro.skywalking.req.base.BaseDeleteReq; 20 | import pro.skywalking.resp.page.Pagination; 21 | import pro.skywalking.utils.CheckParam; 22 | 23 | import javax.annotation.Resource; 24 | import java.util.ArrayList; 25 | import java.util.List; 26 | import java.util.concurrent.atomic.AtomicInteger; 27 | 28 | /** 29 | 30 | * @Description: APP首页轮播图信息相关服务方法实现 31 | */ 32 | @Service("mainSwiperService") 33 | @Slf4j 34 | public class MainSwiperServiceImpl implements MainSwiperService { 35 | 36 | @Resource 37 | private MainSwiperRepository mainSwiperRepository; 38 | 39 | @Resource 40 | private MapperFacade mapperFacade; 41 | 42 | @Resource 43 | private ItemCriteriaBuilder itemCriteriaBuilder; 44 | 45 | 46 | /** 47 | * 批量删除信息 48 | * @param req 需要被删除的信息 49 | */ 50 | @Override 51 | public void batchDeleteItem(BaseDeleteReq req){ 52 | List mainIdList = req.getMainIdList(); 53 | if(CollectionUtils.isEmpty(mainIdList)) { 54 | return; 55 | } 56 | List entityList = mainSwiperRepository.selectList( 57 | new LambdaQueryWrapper().in(MainSwiper::getMainSwiperId,mainIdList)); 58 | entityList.stream().forEach(item -> { 59 | mainSwiperRepository.deleteById(item); 60 | }); 61 | } 62 | 63 | /** 64 | * 查询所有信息 65 | * @param 66 | * @return java.util.List 67 | */ 68 | @Override 69 | public List queryAllMainSwiper(){ 70 | List entityList = mainSwiperRepository.selectList(new LambdaQueryWrapper<>()); 71 | if(CollectionUtils.isEmpty(entityList)){ 72 | return Lists.newArrayList(); 73 | } 74 | return mapperFacade.mapAsList(entityList,MainSwiperResp.class); 75 | } 76 | 77 | /** 78 | * 分页查询 79 | * @param pageReq 分页查询Req 80 | * @return Pagination 81 | */ 82 | @Override 83 | public Pagination queryByPage( 84 | MainSwiperReq pageReq){ 85 | log.info(">>>>>>>>>>>>>>>>>分页查询Req {} <<<<<<<<<<<<<<<<", JSON.toJSONString(pageReq)); 86 | //构建查询条件 87 | LambdaQueryWrapper pageWrapper = new LambdaQueryWrapper<>(); 88 | itemCriteriaBuilder.rigidCriteria(pageWrapper,true); 89 | setPageCriteria(pageWrapper,pageReq); 90 | pageWrapper.orderBy(true,false,MainSwiper::getCreateTime); 91 | //开始分页 92 | Page page = PageHelper.startPage(pageReq.getCurrentPage(), pageReq.getItemsPerPage()); 93 | List pageList = mainSwiperRepository.selectList(pageWrapper); 94 | if (CollectionUtils.isEmpty(pageList)) { 95 | return PageBuilder.buildPageResult(page,new ArrayList<>()); 96 | } 97 | List respList = 98 | mapperFacade.mapAsList(pageList, MainSwiperResp.class); 99 | Integer startIndex = (pageReq.getItemsPerPage() * pageReq.getCurrentPage()) - pageReq.getItemsPerPage() + 1; 100 | AtomicInteger idBeginIndex = new AtomicInteger(startIndex); 101 | respList.stream().forEach(item -> { 102 | item.setId(Integer.valueOf(idBeginIndex.getAndIncrement()).longValue()); 103 | }); 104 | return PageBuilder.buildPageResult(page,respList); 105 | } 106 | 107 | /** 108 | * 设置分页条件 109 | * @param pageWrapper 查询条件 110 | * @param pageReq 分页插件 111 | * @return 112 | */ 113 | private void setPageCriteria(LambdaQueryWrapper pageWrapper, MainSwiperReq pageReq){ 114 | 115 | if(!CheckParam.isNull(pageReq.getMainUrl())){ 116 | pageWrapper.like(MainSwiper::getMainUrl,"%"+pageReq.getMainUrl()); 117 | } 118 | 119 | if(!CheckParam.isNull(pageReq.getMainTitle())){ 120 | pageWrapper.like(MainSwiper::getMainTitle,"%"+pageReq.getMainTitle()); 121 | } 122 | 123 | if(!CheckParam.isNull(pageReq.getRouterUrl())){ 124 | pageWrapper.like(MainSwiper::getRouterUrl,"%"+pageReq.getRouterUrl()); 125 | } 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/impl/biz/MessageWordServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.impl.biz; 2 | 3 | import pro.skywalking.collection.CollectionUtils; 4 | import pro.skywalking.helper.PageBuilder; 5 | import pro.skywalking.req.base.BaseDeleteReq; 6 | import pro.skywalking.resp.page.Pagination; 7 | import pro.skywalking.utils.BaseUtil; 8 | import pro.skywalking.utils.CheckParam; 9 | import pro.skywalking.utils.SnowflakeIdWorker; 10 | import cn.common.repository.entity.biz.MessageWord; 11 | import cn.common.repository.repository.biz.MessageWordRepository; 12 | import cn.common.req.MessageWordReq; 13 | import cn.common.req.MessageWordAddReq; 14 | import cn.common.resp.MessageWordResp; 15 | import cn.common.service.platform.AuthUserService; 16 | import cn.common.service.biz.MessageWordService; 17 | import cn.common.service.data.ItemCriteriaBuilder; 18 | import com.alibaba.fastjson.JSON; 19 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 20 | import com.github.pagehelper.Page; 21 | import com.github.pagehelper.PageHelper; 22 | import lombok.extern.slf4j.Slf4j; 23 | import ma.glasnost.orika.MapperFacade; 24 | import org.springframework.stereotype.Service; 25 | import org.springframework.transaction.annotation.Propagation; 26 | import org.springframework.transaction.annotation.Transactional; 27 | 28 | import javax.annotation.Resource; 29 | import java.util.ArrayList; 30 | import java.util.List; 31 | import java.util.concurrent.atomic.AtomicInteger; 32 | 33 | /** 34 | * @Description: 留言信息相关服务方法实现 35 | */ 36 | @Service("messageWordService") 37 | @Slf4j 38 | public class MessageWordServiceImpl implements MessageWordService { 39 | 40 | @Resource 41 | private MessageWordRepository messageWordRepository; 42 | 43 | @Resource 44 | private MapperFacade mapperFacade; 45 | 46 | @Resource 47 | private AuthUserService authUserService; 48 | 49 | @Resource 50 | private ItemCriteriaBuilder itemCriteriaBuilder; 51 | 52 | /** 53 | * 新增 54 | * @param addReq 新增Req 55 | */ 56 | @Override 57 | @Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class) 58 | public void addItem(MessageWordAddReq addReq){ 59 | log.info(">>>>>>>>>>>>>>>>>新增Req {} <<<<<<<<<<<<<<<<", JSON.toJSONString(addReq)); 60 | MessageWord entity = mapperFacade.map(addReq, MessageWord.class); 61 | try { 62 | String currentAppUserId = authUserService.currentAppUserId(); 63 | BaseUtil.setFieldValueNotNull(entity); 64 | entity.setMessageWordId(SnowflakeIdWorker.uniqueMainId()); 65 | entity.setSenderId(currentAppUserId); 66 | entity.setOperatorId(currentAppUserId); 67 | } catch (Exception e) { 68 | log.error("新增->设置为空的属性失败 {} , {} ",e.getMessage(),e); 69 | } 70 | messageWordRepository.insert(entity); 71 | } 72 | 73 | /** 74 | * 批量删除信息 75 | * @param req 需要被删除的信息 76 | */ 77 | @Override 78 | public void batchDeleteItem(BaseDeleteReq req){ 79 | List mainIdList = req.getMainIdList(); 80 | if(CollectionUtils.isEmpty(mainIdList)) { 81 | return; 82 | } 83 | List messageWordList = messageWordRepository.selectList( 84 | new LambdaQueryWrapper().in(MessageWord::getMessageWordId, mainIdList)); 85 | if(CollectionUtils.isEmpty(messageWordList)){ 86 | return; 87 | } 88 | messageWordList.stream().forEach(item -> { 89 | messageWordRepository.deleteById(item); 90 | }); 91 | } 92 | 93 | /** 94 | * 分页查询 95 | * @param pageReq 分页查询Req 96 | * @return Pagination 97 | */ 98 | @Override 99 | public Pagination queryByPage( 100 | MessageWordReq pageReq){ 101 | log.info(">>>>>>>>>>>>>>>>>分页查询Req {} <<<<<<<<<<<<<<<<", JSON.toJSONString(pageReq)); 102 | //构建查询条件 103 | LambdaQueryWrapper pageWrapper = new LambdaQueryWrapper<>(); 104 | itemCriteriaBuilder.rigidCriteria(pageWrapper,true); 105 | setPageCriteria(pageWrapper,pageReq); 106 | pageWrapper.orderBy(true,false, MessageWord::getCreateTime); 107 | //开始分页 108 | Page page = PageHelper.startPage(pageReq.getCurrentPage(), pageReq.getItemsPerPage()); 109 | List pageList = messageWordRepository.selectList(pageWrapper); 110 | if (CollectionUtils.isEmpty(pageList)) { 111 | return PageBuilder.buildPageResult(page,new ArrayList<>()); 112 | } 113 | List respList = 114 | mapperFacade.mapAsList(pageList, MessageWordResp.class); 115 | Integer startIndex = (pageReq.getItemsPerPage() * pageReq.getCurrentPage()) - pageReq.getItemsPerPage() + 1; 116 | AtomicInteger idBeginIndex = new AtomicInteger(startIndex); 117 | respList.stream().forEach(item -> { 118 | item.setId(Integer.valueOf(idBeginIndex.getAndIncrement()).longValue()); 119 | }); 120 | return PageBuilder.buildPageResult(page,respList); 121 | } 122 | 123 | /** 124 | * 设置分页条件 125 | * @param pageWrapper 查询条件 126 | * @param pageReq 分页插件 127 | * @return 128 | */ 129 | private void setPageCriteria(LambdaQueryWrapper pageWrapper, MessageWordReq pageReq){ 130 | 131 | if(!CheckParam.isNull(pageReq.getSenderId())){ 132 | pageWrapper.eq(MessageWord::getSenderId,pageReq.getSenderId()); 133 | } 134 | 135 | if(!CheckParam.isNull(pageReq.getRecipientId())){ 136 | pageWrapper.eq(MessageWord::getRecipientId,pageReq.getRecipientId()); 137 | } 138 | 139 | if(!CheckParam.isNull(pageReq.getMessageContent())){ 140 | pageWrapper.like(MessageWord::getMessageContent,pageReq.getMessageContent()); 141 | } 142 | } 143 | 144 | } 145 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/impl/biz/RescueStationServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.impl.biz; 2 | 3 | import pro.skywalking.collection.CollectionUtils; 4 | import pro.skywalking.helper.PageBuilder; 5 | import pro.skywalking.req.base.BaseDeleteReq; 6 | import pro.skywalking.resp.page.Pagination; 7 | import pro.skywalking.utils.BaseUtil; 8 | import pro.skywalking.utils.CheckParam; 9 | import pro.skywalking.utils.SnowflakeIdWorker; 10 | import cn.common.repository.entity.biz.RescueStation; 11 | import cn.common.repository.repository.biz.RescueStationRepository; 12 | import cn.common.req.RescueStationAddReq; 13 | import cn.common.req.RescueStationReq; 14 | import cn.common.resp.RescueStationResp; 15 | import cn.common.service.platform.AuthUserService; 16 | import cn.common.service.biz.RescueStationService; 17 | import cn.common.service.data.ItemCriteriaBuilder; 18 | import com.alibaba.fastjson.JSON; 19 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 20 | import com.github.pagehelper.Page; 21 | import com.github.pagehelper.PageHelper; 22 | import com.google.common.collect.Lists; 23 | import lombok.extern.slf4j.Slf4j; 24 | import ma.glasnost.orika.MapperFacade; 25 | import org.springframework.stereotype.Service; 26 | import org.springframework.transaction.annotation.Propagation; 27 | import org.springframework.transaction.annotation.Transactional; 28 | 29 | import javax.annotation.Resource; 30 | import java.util.ArrayList; 31 | import java.util.List; 32 | import java.util.concurrent.atomic.AtomicInteger; 33 | 34 | /** 35 | * @Description: 首页分类相关服务方法实现 36 | */ 37 | 38 | @Service("rescueStationService") 39 | @Slf4j 40 | public class RescueStationServiceImpl implements RescueStationService { 41 | 42 | @Resource 43 | private RescueStationRepository rescueStationRepository; 44 | 45 | @Resource 46 | private MapperFacade mapperFacade; 47 | 48 | @Resource 49 | private AuthUserService authUserService; 50 | 51 | @Resource 52 | private ItemCriteriaBuilder itemCriteriaBuilder; 53 | 54 | /** 55 | * 新增 56 | * @author: create by singer - Singer email:singer-coder@qq.com 57 | * @date 2021/2/15 58 | * @param addReq 新增Req 59 | */ 60 | @Override 61 | @Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class) 62 | public void addItem(RescueStationAddReq addReq){ 63 | log.info(">>>>>>>>>>>>>>>>>新增Req {} <<<<<<<<<<<<<<<<", JSON.toJSONString(addReq)); 64 | RescueStation entity = mapperFacade.map(addReq, RescueStation.class); 65 | try { 66 | String appUserId = authUserService.currentAppUserId(); 67 | BaseUtil.setFieldValueNotNull(entity); 68 | entity.setRescueStationId(SnowflakeIdWorker.uniqueMainId()); 69 | entity.setOperatorId(appUserId); 70 | } catch (Exception e) { 71 | log.error("新增->设置为空的属性失败 {} , {} ",e.getMessage(),e); 72 | } 73 | rescueStationRepository.insert(entity); 74 | } 75 | 76 | /** 77 | * 批量删除信息 78 | * @author: create by singer - Singer email:singer-coder@qq.com 79 | * @date 2021/2/2 80 | * @param req 需要被删除的信息 81 | */ 82 | @Override 83 | public void batchDeleteItem(BaseDeleteReq req){ 84 | List mainIdList = req.getMainIdList(); 85 | if(CollectionUtils.isEmpty(mainIdList)) { 86 | return; 87 | } 88 | rescueStationRepository.batchDeleteItem(mainIdList); 89 | } 90 | 91 | 92 | /** 93 | * 查询所有救助站信息 94 | * @author: create by singer - Singer email:singer-coder@qq.com 95 | * @date 2021/12/18 96 | * @return java.util.List 97 | */ 98 | @Override 99 | public List queryAllStation(){ 100 | List rescueStationList = rescueStationRepository.selectList(new LambdaQueryWrapper<>()); 101 | if(CollectionUtils.isEmpty(rescueStationList)){ 102 | return Lists.newArrayList(); 103 | } 104 | return mapperFacade.mapAsList(rescueStationList,RescueStationResp.class); 105 | } 106 | 107 | /** 108 | * 分页查询 109 | * @author: create by singer - Singer email:singer-coder@qq.com 110 | * @date 2021/2/15 111 | * @param pageReq 分页查询Req 112 | * @return Pagination 113 | */ 114 | @Override 115 | public Pagination queryByPage( 116 | RescueStationReq pageReq){ 117 | log.info(">>>>>>>>>>>>>>>>>分页查询Req {} <<<<<<<<<<<<<<<<", JSON.toJSONString(pageReq)); 118 | //构建查询条件 119 | LambdaQueryWrapper pageWrapper = new LambdaQueryWrapper<>(); 120 | itemCriteriaBuilder.rigidCriteria(pageWrapper,true); 121 | setPageCriteria(pageWrapper,pageReq); 122 | pageWrapper.orderBy(true,false, RescueStation::getCreateTime); 123 | //开始分页 124 | Page page = PageHelper.startPage(pageReq.getCurrentPage(), pageReq.getItemsPerPage()); 125 | List pageList = rescueStationRepository.selectList(pageWrapper); 126 | if (CollectionUtils.isEmpty(pageList)) { 127 | return PageBuilder.buildPageResult(page,new ArrayList<>()); 128 | } 129 | List respList = 130 | mapperFacade.mapAsList(pageList, RescueStationResp.class); 131 | Integer startIndex = (pageReq.getItemsPerPage() * pageReq.getCurrentPage()) - pageReq.getItemsPerPage() + 1; 132 | AtomicInteger idBeginIndex = new AtomicInteger(startIndex); 133 | respList.stream().forEach(item -> { 134 | item.setId(Integer.valueOf(idBeginIndex.getAndIncrement()).longValue()); 135 | }); 136 | return PageBuilder.buildPageResult(page,respList); 137 | } 138 | 139 | /** 140 | * 设置分页条件 141 | * @author: create by singer - Singer email:singer-coder@qq.com 142 | * @date 2021/5/31 143 | * @param pageWrapper 查询条件 144 | * @param pageReq 分页插件 145 | * @return 146 | */ 147 | private void setPageCriteria(LambdaQueryWrapper pageWrapper, RescueStationReq pageReq){ 148 | 149 | if(!CheckParam.isNull(pageReq.getStationName())){ 150 | pageWrapper.like(RescueStation::getStationName,"%"+pageReq.getStationName()); 151 | } 152 | 153 | if(!CheckParam.isNull(pageReq.getCapacity())){ 154 | pageWrapper.like(RescueStation::getCapacity,"%"+pageReq.getCapacity()); 155 | } 156 | 157 | if(!CheckParam.isNull(pageReq.getStationAddress())){ 158 | pageWrapper.like(RescueStation::getStationAddress,"%"+pageReq.getStationAddress()); 159 | } 160 | 161 | if(!CheckParam.isNull(pageReq.getRescueRegion())){ 162 | pageWrapper.like(RescueStation::getRescueRegion,"%"+pageReq.getRescueRegion()); 163 | } 164 | 165 | if(!CheckParam.isNull(pageReq.getPhoneNumber())){ 166 | pageWrapper.like(RescueStation::getPhoneNumber,"%"+pageReq.getPhoneNumber()); 167 | } 168 | } 169 | 170 | } 171 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/impl/platform/AsyncHandlerServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.impl.platform; 2 | 3 | import cn.common.service.platform.AsyncHandlerService; 4 | import cn.common.service.platform.PlatformBizService; 5 | import cn.common.service.platform.PlatformDictService; 6 | import lombok.extern.slf4j.Slf4j; 7 | import org.springframework.stereotype.Service; 8 | import pro.skywalking.configuration.redis.RedisRepository; 9 | import pro.skywalking.constants.BaseConstant; 10 | 11 | import javax.annotation.Resource; 12 | import javax.servlet.http.HttpServletRequest; 13 | 14 | /** 15 | 16 | * @Description: 异步处理服务方法实现 17 | */ 18 | @Service(value = "asyncHandlerService") 19 | @Slf4j 20 | public class AsyncHandlerServiceImpl implements AsyncHandlerService { 21 | 22 | @Resource 23 | private HttpServletRequest request; 24 | 25 | @Resource 26 | private RedisRepository redisRepository; 27 | 28 | @Resource 29 | private PlatformBizService platformBizService; 30 | 31 | @Resource 32 | private BaseConstant baseConstant; 33 | 34 | @Resource 35 | private PlatformDictService platformDictService; 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/impl/platform/PlatformApiLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.impl.platform; 2 | 3 | import cn.common.repository.repository.platform.PlatformApiLogRepository; 4 | import cn.common.service.platform.AuthUserService; 5 | import cn.common.service.platform.PlatformApiLogService; 6 | import cn.common.service.data.ItemCriteriaBuilder; 7 | import lombok.extern.slf4j.Slf4j; 8 | import ma.glasnost.orika.MapperFacade; 9 | import org.springframework.stereotype.Service; 10 | 11 | import javax.annotation.Resource; 12 | 13 | /** 14 | 15 | * @Description: 首页分类相关服务方法实现 16 | */ 17 | @Service("platformApiLogService") 18 | @Slf4j 19 | public class PlatformApiLogServiceImpl implements PlatformApiLogService { 20 | 21 | @Resource 22 | private PlatformApiLogRepository platformApiLogRepository; 23 | 24 | @Resource 25 | private MapperFacade mapperFacade; 26 | 27 | @Resource 28 | private AuthUserService authUserService; 29 | 30 | @Resource 31 | private ItemCriteriaBuilder itemCriteriaBuilder; 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/impl/platform/PlatformBizServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.impl.platform; 2 | 3 | import cn.common.service.platform.PlatformBizService; 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.springframework.stereotype.Service; 6 | 7 | /** 8 | * @author create by singer - Singer email:singer-coder@qq.com 9 | * @projectName animal-app-api 10 | * @Description: 11 | * @date 2022-01-18 12 | */ 13 | @Service("platformBizService") 14 | @Slf4j 15 | public class PlatformBizServiceImpl implements PlatformBizService { 16 | 17 | 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/impl/platform/PlatformDictServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.impl.platform; 2 | 3 | import cn.common.repository.entity.platform.PlatformDict; 4 | import cn.common.repository.repository.platform.PlatformDictRepository; 5 | import cn.common.service.platform.PlatformDictService; 6 | import com.alibaba.fastjson.JSON; 7 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 8 | import lombok.extern.slf4j.Slf4j; 9 | import org.springframework.stereotype.Service; 10 | import org.springframework.util.Assert; 11 | import pro.skywalking.configuration.redis.RedisRepository; 12 | import pro.skywalking.utils.CheckParam; 13 | 14 | import javax.annotation.Resource; 15 | import java.util.concurrent.TimeUnit; 16 | 17 | /** 18 | * @author create by singer - Singer email:singer-coder@qq.com 19 | * @packageName cn.common.service.impl 20 | * @Description: 平台数据字典服务方法实现 21 | * @date 2022-01-28 22 | */ 23 | @Service("platformDictService") 24 | @Slf4j 25 | public class PlatformDictServiceImpl implements PlatformDictService { 26 | 27 | @Resource 28 | private PlatformDictRepository platformDictRepository; 29 | 30 | @Resource 31 | private RedisRepository redisRepository; 32 | 33 | /** 34 | *

插入字典数据 写入缓存以及数据库

35 | * @author: create by singer - Singer email:singer-coder@qq.com 36 | * @date 2022/2/9 37 | * @param platformDict 字典内容 38 | * @return cn.common.repository.entity.platform.PlatformDict 39 | */ 40 | @Override 41 | public PlatformDict insertDict(PlatformDict platformDict){ 42 | String dictType = platformDict.getDictType(); 43 | Assert.notNull(dictType, "dictType is null"); 44 | String dictKey = platformDict.getDictKey(); 45 | Assert.notNull(dictKey, "dictKey is null"); 46 | String dictValue = platformDict.getDictValue(); 47 | Assert.notNull(dictValue, "dictValue is null"); 48 | redisRepository.delete(dictType); 49 | platformDictRepository.insert(platformDict); 50 | redisRepository.set(dictType,JSON.toJSONString(platformDict)); 51 | return platformDict; 52 | } 53 | 54 | 55 | /** 56 | *

更新字典 更新缓存里面的数据以及数据库里面的字典数据

57 | * @author: create by singer - Singer email:singer-coder@qq.com 58 | * @date 2022/2/9 59 | * @param platformDict 字典内容 60 | * @return cn.common.repository.entity.platform.PlatformDict 61 | */ 62 | @Override 63 | public PlatformDict updateDict(PlatformDict platformDict){ 64 | String dictType = platformDict.getDictType(); 65 | Assert.notNull(dictType, "dictType is null"); 66 | String dictKey = platformDict.getDictKey(); 67 | Assert.notNull(dictKey, "dictKey is null"); 68 | String dictValue = platformDict.getDictValue(); 69 | Assert.notNull(dictValue, "dictValue is null"); 70 | redisRepository.delete(dictType); 71 | PlatformDict dict = platformDictRepository.selectOne(new LambdaQueryWrapper() 72 | .eq(PlatformDict::getDictType, dictType)); 73 | if(CheckParam.isNull(dict)){ 74 | return null; 75 | } 76 | dict.setDictKey(dictKey); 77 | dict.setDictValue(dictValue); 78 | dict.setDictType(dictType); 79 | platformDictRepository.updateById(dict); 80 | redisRepository.set(dictType,JSON.toJSONString(dict)); 81 | return dict; 82 | } 83 | 84 | /** 85 | *

从缓存和数据库里面拿到字典的值,拿不到则返回空

86 | *

能拿到则设置缓存

87 | * @author: create by singer - Singer email:singer-coder@qq.com 88 | * @date 2022/2/9 89 | * @param dictType 90 | * @return cn.common.repository.entity.platform.PlatformDict 91 | */ 92 | @Override 93 | public PlatformDict getAndSetDict(String dictType){ 94 | String cache = redisRepository.get(dictType); 95 | if(!CheckParam.isNull(cache)){ 96 | return JSON.parseObject(cache,PlatformDict.class); 97 | } 98 | PlatformDict platformDict = platformDictRepository.selectOne(new LambdaQueryWrapper() 99 | .eq(PlatformDict::getDictType, dictType)); 100 | if(CheckParam.isNull(platformDict)){ 101 | return null; 102 | }else{ 103 | redisRepository.set(dictType,JSON.toJSONString(platformDict),10L, TimeUnit.SECONDS); 104 | return platformDict; 105 | } 106 | } 107 | 108 | 109 | 110 | } 111 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/impl/platform/PlatformFileServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.impl.platform; 2 | 3 | import cn.common.service.platform.PlatformFileService; 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.springframework.stereotype.Service; 6 | import org.springframework.web.multipart.MultipartFile; 7 | import pro.skywalking.configuration.oss.AliOssService; 8 | import pro.skywalking.configuration.oss.meta.MultipartFileUrlMeta; 9 | 10 | import javax.annotation.Resource; 11 | 12 | /** 13 | * @packageName cn.common.service.impl 14 | * @Description: 平台文件上传相关服务方法实现 15 | */ 16 | @Service("platformFileService") 17 | @Slf4j 18 | public class PlatformFileServiceImpl implements PlatformFileService { 19 | 20 | @Resource 21 | private AliOssService aliOssService; 22 | 23 | /** 24 | * 上传文件 25 | * @param file 26 | * @return pro.skywalking.req.platform.upload.MultipartFileUrlResp 27 | */ 28 | @Override 29 | public MultipartFileUrlMeta uploadFile(MultipartFile file){ 30 | MultipartFileUrlMeta multipartFileUrlMeta = aliOssService.multipartFileToOss(file, false); 31 | return multipartFileUrlMeta; 32 | } 33 | 34 | /** 35 | * 上传文件 36 | * @param file 37 | * @return pro.skywalking.req.platform.upload.MultipartFileUrlResp 38 | */ 39 | @Override 40 | public MultipartFileUrlMeta uploadFileMixed(MultipartFile file){ 41 | MultipartFileUrlMeta multipartFileUrlMeta = aliOssService.mixFileToOss(file, false); 42 | return multipartFileUrlMeta; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/impl/platform/PlatformServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.impl.platform; 2 | 3 | import cn.common.repository.entity.platform.AuthUser; 4 | import cn.common.repository.entity.platform.PlatformDict; 5 | import cn.common.repository.repository.platform.AuthUserRepository; 6 | import cn.common.repository.repository.platform.PlatformDictRepository; 7 | import cn.common.service.platform.PlatformService; 8 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 9 | import com.google.common.collect.Lists; 10 | import lombok.extern.slf4j.Slf4j; 11 | import ma.glasnost.orika.MapperFacade; 12 | import org.springframework.stereotype.Service; 13 | import pro.skywalking.collection.CollectionUtils; 14 | import pro.skywalking.resp.platform.dict.PlatformDictResp; 15 | import pro.skywalking.resp.platform.other.AuthUserSketchResp; 16 | 17 | import javax.annotation.Resource; 18 | import javax.servlet.http.HttpServletRequest; 19 | import java.util.List; 20 | 21 | /** 22 | * @projectName animal-app-api 23 | * @Description: 平台相关服务方法实现3 24 | */ 25 | @Service("platformService") 26 | @Slf4j 27 | public class PlatformServiceImpl implements PlatformService { 28 | 29 | /** 30 | * 注册当前的ServletRequest 31 | */ 32 | @Resource 33 | private HttpServletRequest httpServletRequest; 34 | 35 | @Resource 36 | private MapperFacade mapperFacade; 37 | 38 | @Resource 39 | private PlatformDictRepository platformDictRepository; 40 | 41 | @Resource 42 | private AuthUserRepository authUserRepository; 43 | 44 | /** 45 | * 根据字典类型查询字典 46 | * @param dictType 字典类型 47 | * @return java.util.List 48 | */ 49 | @Override 50 | public List queryDictByType(String dictType){ 51 | List platformDictList = platformDictRepository 52 | .selectList(new LambdaQueryWrapper().eq(PlatformDict::getDictType, dictType)); 53 | if(CollectionUtils.isEmpty(platformDictList)){ 54 | return Lists.newArrayList(); 55 | } 56 | return mapperFacade.mapAsList(platformDictList, PlatformDictResp.class); 57 | } 58 | 59 | /** 60 | * 查询所有用户信息 61 | * @return java.util.List 62 | */ 63 | @Override 64 | public List queryAllAuthUser(){ 65 | List authUserList = 66 | authUserRepository.selectList(new LambdaQueryWrapper<>()); 67 | if(CollectionUtils.isEmpty(authUserList)){ 68 | return Lists.newArrayList(); 69 | } 70 | List respList = mapperFacade.mapAsList(authUserList, AuthUserSketchResp.class); 71 | return respList; 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/netty/NettyBootstrapRunner.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.netty; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.beans.BeansException; 5 | import org.springframework.beans.factory.annotation.Value; 6 | import org.springframework.boot.ApplicationArguments; 7 | import org.springframework.boot.ApplicationRunner; 8 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 9 | import org.springframework.context.ApplicationContext; 10 | import org.springframework.context.ApplicationContextAware; 11 | import org.springframework.context.ApplicationListener; 12 | import org.springframework.context.event.ContextClosedEvent; 13 | import org.springframework.stereotype.Component; 14 | 15 | import io.netty.bootstrap.ServerBootstrap; 16 | import io.netty.channel.Channel; 17 | import io.netty.channel.ChannelFutureListener; 18 | import io.netty.channel.ChannelHandlerContext; 19 | import io.netty.channel.ChannelInboundHandlerAdapter; 20 | import io.netty.channel.ChannelInitializer; 21 | import io.netty.channel.ChannelPipeline; 22 | import io.netty.channel.EventLoopGroup; 23 | import io.netty.channel.nio.NioEventLoopGroup; 24 | import io.netty.channel.socket.SocketChannel; 25 | import io.netty.channel.socket.nio.NioServerSocketChannel; 26 | import io.netty.handler.codec.http.DefaultFullHttpResponse; 27 | import io.netty.handler.codec.http.FullHttpRequest; 28 | import io.netty.handler.codec.http.HttpObjectAggregator; 29 | import io.netty.handler.codec.http.HttpResponseStatus; 30 | import io.netty.handler.codec.http.HttpServerCodec; 31 | import io.netty.handler.codec.http.HttpVersion; 32 | import io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler; 33 | import io.netty.handler.codec.http.websocketx.extensions.compression.WebSocketServerCompressionHandler; 34 | import io.netty.handler.stream.ChunkedWriteHandler; 35 | 36 | import java.net.*; 37 | 38 | /** 39 | * @packageName cn.common.service.netty 40 | * @Description: 初始化Netty服务 41 | */ 42 | @Component 43 | @Slf4j 44 | @ConditionalOnProperty(prefix = "netty",name = "initStatus",havingValue = "true") 45 | public class NettyBootstrapRunner implements ApplicationRunner, ApplicationListener, 46 | ApplicationContextAware { 47 | 48 | @Value("${netty.websocket.port}") 49 | private int port; 50 | 51 | @Value("${netty.websocket.ip}") 52 | private String ip; 53 | 54 | @Value("${netty.websocket.path}") 55 | private String path; 56 | 57 | @Value("${netty.websocket.max-frame-size}") 58 | private Integer maxFrameSize; 59 | 60 | private ApplicationContext applicationContext; 61 | 62 | private Channel serverChannel; 63 | 64 | @Override 65 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { 66 | this.applicationContext = applicationContext; 67 | } 68 | 69 | @Override 70 | public void run(ApplicationArguments args) throws Exception { 71 | EventLoopGroup bossGroup = new NioEventLoopGroup(); 72 | EventLoopGroup workerGroup = new NioEventLoopGroup(); 73 | try { 74 | ServerBootstrap serverBootstrap = new ServerBootstrap(); 75 | serverBootstrap.group(bossGroup, workerGroup); 76 | serverBootstrap.channel(NioServerSocketChannel.class); 77 | serverBootstrap.localAddress(new InetSocketAddress(this.ip, this.port)); 78 | serverBootstrap.childHandler(new ChannelInitializer() { 79 | @Override 80 | protected void initChannel(SocketChannel socketChannel) throws Exception { 81 | ChannelPipeline pipeline = socketChannel.pipeline(); 82 | pipeline.addLast(new HttpServerCodec()); 83 | pipeline.addLast(new ChunkedWriteHandler()); 84 | pipeline.addLast(new HttpObjectAggregator(65536)); 85 | pipeline.addLast(new ChannelInboundHandlerAdapter() { 86 | @Override 87 | public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { 88 | if(msg instanceof FullHttpRequest) { 89 | FullHttpRequest fullHttpRequest = (FullHttpRequest) msg; 90 | String uri = fullHttpRequest.uri(); 91 | if (!uri.equals(path)) { 92 | // 访问的路径不是 websocket的端点地址,响应404 93 | ctx.channel().writeAndFlush(new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.NOT_FOUND)) 94 | .addListener(ChannelFutureListener.CLOSE); 95 | return ; 96 | } 97 | } 98 | super.channelRead(ctx, msg); 99 | } 100 | }); 101 | pipeline.addLast(new WebSocketServerCompressionHandler()); 102 | pipeline.addLast(new WebSocketServerProtocolHandler(path, null, true, maxFrameSize)); 103 | 104 | /** 105 | * 从IOC中获取到Handler 106 | */ 107 | pipeline.addLast(applicationContext.getBean(WebSocketMessageHandler.class)); 108 | } 109 | }); 110 | Channel channel = serverBootstrap.bind().sync().channel(); 111 | this.serverChannel = channel; 112 | log.info("Netty-Websocket 服务启动,ip={},port={}", this.ip, this.port); 113 | channel.closeFuture().sync(); 114 | } finally { 115 | bossGroup.shutdownGracefully(); 116 | workerGroup.shutdownGracefully(); 117 | } 118 | } 119 | 120 | @Override 121 | public void onApplicationEvent(ContextClosedEvent event) { 122 | if (this.serverChannel != null) { 123 | this.serverChannel.close(); 124 | } 125 | log.info("websocket 服务停止"); 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/netty/NettyChannelService.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.netty; 2 | 3 | import io.netty.channel.Channel; 4 | import io.netty.channel.ChannelId; 5 | import io.netty.channel.group.ChannelGroup; 6 | import io.netty.channel.group.DefaultChannelGroup; 7 | import io.netty.handler.codec.http.websocketx.TextWebSocketFrame; 8 | import io.netty.util.concurrent.GlobalEventExecutor; 9 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 10 | import org.springframework.stereotype.Service; 11 | 12 | import java.util.concurrent.ConcurrentHashMap; 13 | import java.util.concurrent.ConcurrentMap; 14 | 15 | /** 16 | * @packageName cn.common.service.netty 17 | 18 | */ 19 | @Service("nettyChannelService") 20 | public class NettyChannelService { 21 | 22 | private static ChannelGroup GlobalGroup = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE); 23 | 24 | private static ConcurrentMap ChannelMap = new ConcurrentHashMap(); 25 | 26 | public void addChannel(Channel channel){ 27 | GlobalGroup.add(channel); 28 | ChannelMap.put(channel.id().asShortText(),channel.id()); 29 | } 30 | 31 | public void removeChannel(Channel channel){ 32 | GlobalGroup.remove(channel); 33 | ChannelMap.remove(channel.id().asShortText()); 34 | } 35 | 36 | public Channel getChannel(String id){ 37 | return GlobalGroup.find(ChannelMap.get(id)); 38 | } 39 | 40 | public void send2All(TextWebSocketFrame tws){ 41 | GlobalGroup.writeAndFlush(tws); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/netty/WebSocketMessageHandler.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.netty; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import io.netty.channel.ChannelFutureListener; 5 | import io.netty.channel.ChannelHandler; 6 | import io.netty.channel.ChannelHandlerContext; 7 | import io.netty.channel.SimpleChannelInboundHandler; 8 | import io.netty.handler.codec.http.websocketx.TextWebSocketFrame; 9 | import io.netty.handler.codec.http.websocketx.WebSocketCloseStatus; 10 | import io.netty.handler.codec.http.websocketx.WebSocketFrame; 11 | import lombok.extern.slf4j.Slf4j; 12 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 13 | import org.springframework.stereotype.Component; 14 | 15 | import javax.annotation.Resource; 16 | 17 | @Component 18 | @Slf4j 19 | @ChannelHandler.Sharable 20 | @ConditionalOnProperty(prefix = "netty",name = "initStatus",havingValue = "true") 21 | public class WebSocketMessageHandler extends SimpleChannelInboundHandler { 22 | 23 | @Resource 24 | private NettyChannelService nettyChannelService; 25 | 26 | 27 | /** 28 | * Netty收到消息 29 | * @param ctx 上下文 30 | * @param ctx msg 31 | * @return 32 | */ 33 | @Override 34 | protected void channelRead0(ChannelHandlerContext ctx, WebSocketFrame msg) throws Exception { 35 | if (msg instanceof TextWebSocketFrame) { 36 | TextWebSocketFrame textWebSocketFrame = (TextWebSocketFrame) msg; 37 | //发送过来的消息 38 | String text = textWebSocketFrame.text(); 39 | // 业务层处理数据 40 | log.info(">>>>>>>>>>>>>>>>>>>>>>前端发送过来的消息:{}<<<<<<<<<<<<<<<<<<<<",text); 41 | String pushData = ""; 42 | String data = JSON.toJSONString(pushData); 43 | log.info(">>>>>>>>>>>>>>>>>>>>>>建立连接后回复的消息:{}<<<<<<<<<<<<<<<<<<<<",data); 44 | // 响应客户端 45 | ctx.channel().writeAndFlush(new TextWebSocketFrame(data)); 46 | } else { 47 | // 不接受文本以外的数据帧类型 48 | ctx.channel().writeAndFlush(WebSocketCloseStatus.INVALID_MESSAGE_TYPE).addListener(ChannelFutureListener.CLOSE); 49 | } 50 | } 51 | 52 | /** 53 | * Netty连接断开 54 | * @param ctx 上下文 55 | * @return 56 | */ 57 | @Override 58 | public void channelInactive(ChannelHandlerContext ctx) throws Exception { 59 | super.channelInactive(ctx); 60 | nettyChannelService.removeChannel(ctx.channel()); 61 | log.info("链接断开:{}", ctx.channel().remoteAddress()); 62 | } 63 | 64 | /** 65 | * Netty连接创建 66 | * @param ctx 上下文 67 | * @return 68 | */ 69 | @Override 70 | public void channelActive(ChannelHandlerContext ctx) throws Exception { 71 | super.channelActive(ctx); 72 | nettyChannelService.addChannel(ctx.channel()); 73 | log.info("链接创建:{}", ctx.channel().remoteAddress()); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/platform/AsyncHandlerService.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.platform; 2 | 3 | /** 4 | * @packageName cn.common.service 5 | * @Description: 异步处理服务 6 | */ 7 | public interface AsyncHandlerService { 8 | 9 | 10 | 11 | } 12 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/platform/AuthUserService.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.platform; 2 | 3 | 4 | import cn.common.internal.AuthUserLoginReq; 5 | import cn.common.req.AppUpdatePwdReq; 6 | import cn.common.req.AppUserRegReq; 7 | import cn.common.resp.AppLoginResp; 8 | import cn.common.resp.TokenVerifyResp; 9 | 10 | /** 11 | * @Description: 系统用户相关服务 12 | */ 13 | 14 | public interface AuthUserService { 15 | 16 | /** 17 | * 验证Token 18 | */ 19 | TokenVerifyResp verifyToken(); 20 | 21 | /** 22 | * 拿到用户ID 23 | */ 24 | String currentAppUserId(); 25 | 26 | /** 27 | * 拿到登录后的用户信息 不抛出异常 28 | */ 29 | AppLoginResp queryLoginUserMetaNoThrow(); 30 | 31 | /** 32 | * 用户注册 33 | * @param req 请求参数 34 | */ 35 | AppLoginResp userRegister(AppUserRegReq req); 36 | 37 | /** 38 | * 拿到登录后的用户信息 39 | */ 40 | AppLoginResp queryLoginUserMeta(); 41 | 42 | /** 43 | * 更新密码 44 | * @param req 请求参数 45 | */ 46 | void updatePassword(AppUpdatePwdReq req); 47 | 48 | /** 49 | * 系统退出登录 50 | */ 51 | void logOut(); 52 | 53 | /** 54 | * 系统登录 55 | * @param req 用户登录请求参数 56 | */ 57 | AppLoginResp authUserLogin(AuthUserLoginReq req); 58 | 59 | } 60 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/platform/PlatformApiLogService.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.platform; 2 | 3 | 4 | /** 5 | 6 | * @Description: 系统日志相关服务*/ 7 | public interface PlatformApiLogService { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/platform/PlatformBizService.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.platform; 2 | 3 | /** 4 | * @author create by singer - Singer email:singer-coder@qq.com 5 | * @projectName animal-app-api 6 | * @Description: 7 | * @date 2022-01-18 8 | */ 9 | public interface PlatformBizService { 10 | 11 | 12 | 13 | } 14 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/platform/PlatformDictService.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.platform; 2 | 3 | import cn.common.repository.entity.platform.PlatformDict; 4 | 5 | /** 6 | 7 | * @Description: 平台数据字典服务 8 | 9 | */ 10 | public interface PlatformDictService { 11 | 12 | /** 13 | *

插入字典数据 写入缓存以及数据库

14 | * @param platformDict 字典内容 15 | * @return cn.common.repository.entity.platform.PlatformDict 16 | */ 17 | PlatformDict insertDict(PlatformDict platformDict); 18 | 19 | /** 20 | *

从缓存和数据库里面拿到字典的值,拿不到则返回空

21 | *

能拿到则设置缓存

22 | * @param dictType 23 | * @return cn.common.repository.entity.platform.PlatformDict 24 | */ 25 | PlatformDict getAndSetDict(String dictType); 26 | 27 | /** 28 | *

更新字典 更新缓存里面的数据以及数据库里面的字典数据

29 | * @param platformDict 字典内容 30 | * @return cn.common.repository.entity.platform.PlatformDict 31 | */ 32 | PlatformDict updateDict(PlatformDict platformDict); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/platform/PlatformFileService.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.platform; 2 | 3 | import org.springframework.web.multipart.MultipartFile; 4 | import pro.skywalking.configuration.oss.meta.MultipartFileUrlMeta; 5 | 6 | /** 7 | * @packageName cn.common.service 8 | * @Description: 平台文件上传Service 9 | */ 10 | public interface PlatformFileService { 11 | 12 | /** 13 | * 上传文件 14 | * @param file 15 | * @return pro.skywalking.req.platform.upload.MultipartFileUrlResp 16 | */ 17 | MultipartFileUrlMeta uploadFile(MultipartFile file); 18 | 19 | /** 20 | * 上传文件 21 | * @param file 22 | * @return pro.skywalking.req.platform.upload.MultipartFileUrlResp 23 | */ 24 | MultipartFileUrlMeta uploadFileMixed(MultipartFile file); 25 | } 26 | -------------------------------------------------------------------------------- /platform-service/src/main/java/cn/common/service/platform/PlatformService.java: -------------------------------------------------------------------------------- 1 | package cn.common.service.platform; 2 | 3 | 4 | import pro.skywalking.resp.platform.dict.PlatformDictResp; 5 | import pro.skywalking.resp.platform.other.AuthUserSketchResp; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @projectName animal-app-api 11 | * @Description: 平台相关服务方法 12 | */ 13 | public interface PlatformService { 14 | 15 | 16 | /** 17 | * 根据字典类型查询字典 18 | * @param dictType 字典类型 19 | * @return java.util.List 20 | */ 21 | List queryDictByType(String dictType); 22 | 23 | 24 | /** 25 | * 查询所有用户信息 26 | * @return java.util.List 27 | */ 28 | List queryAllAuthUser(); 29 | } 30 | --------------------------------------------------------------------------------