springcloud_k8s_panzhihuazhihuishequ/.idea/compiler.xml
@@ -9,6 +9,7 @@ <outputRelativeToContentRoot value="true" /> <module name="applets" /> <module name="service_user" /> <module name="service_community" /> <module name="common" /> <module name="auth" /> <module name="service_partybuilding" /> @@ -31,6 +32,7 @@ <module name="auth" options="" /> <module name="community_backstage" options="" /> <module name="config_server" options="" /> <module name="service_community" options="" /> <module name="service_dangjian" options="" /> <module name="service_user" options="" /> <module name="zhihuishequ" options="-parameters" /> springcloud_k8s_panzhihuazhihuishequ/.idea/encodings.xml
@@ -16,6 +16,8 @@ <file url="file://$PROJECT_DIR$/config_server/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/eureka_server/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/eureka_server/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/service_community/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/service_community/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/service_partybuilding/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/service_partybuilding/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/service_user/src/main/java" charset="UTF-8" /> springcloud_k8s_panzhihuazhihuishequ/.idea/misc.xml
@@ -15,6 +15,7 @@ <option value="$PROJECT_DIR$/community_backstage/pom.xml" /> <option value="$PROJECT_DIR$/applets_backstage/pom.xml" /> <option value="$PROJECT_DIR$/service_user/pom.xml" /> <option value="$PROJECT_DIR$/service_community/pom.xml" /> </list> </option> </component> springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/UserApi.java
@@ -1,16 +1,17 @@ package com.panzhihua.applets_backstage.api; import com.panzhihua.common.constants.HttpStatus; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.exceptions.UnAuthenticationException; import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.user.ChangePasswordVO; import com.panzhihua.common.service.user.UserService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.util.ObjectUtils; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -38,4 +39,21 @@ LoginUserInfoVO loginUserInfoVO = userInfoByUserId.getData(); return R.ok(loginUserInfoVO); } @ApiOperation(value = "修改密码") @PutMapping("changepassword") public R changePassword(@Validated @RequestBody ChangePasswordVO changePasswordVO){ Long userId = this.getUserId(); if (ObjectUtils.isEmpty(userId)) { return R.fail(HttpStatus.UNAUTHORIZED); } String newPassword = changePasswordVO.getNewPassword(); String oldPassword=changePasswordVO.getOldPassword(); if (newPassword.equals(oldPassword)) { return R.fail("修改失败,新密码和原密码一致"); } changePasswordVO.setUserId(userId); R r=userService.changePassword(changePasswordVO); return r; } } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/constants/UserConstants.java
@@ -11,4 +11,6 @@ public static final String PASSWORD = "y5g9w8*0TTWV4UgJ"; public static final String USER_ID = "user_id"; public static final String LOGOUT_TOKEN = "logout:"; public static final String COMMUNITY_ID = "community_id"; public static final String LOGIN_USER_INFO = "login_user_info:"; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/controller/BaseController.java
@@ -1,7 +1,9 @@ package com.panzhihua.common.controller; import com.alibaba.fastjson.JSONObject; import com.panzhihua.common.constants.TokenConstant; import com.panzhihua.common.constants.UserConstants; import com.panzhihua.common.exceptions.UnAuthenticationException; import com.panzhihua.common.model.vos.LoginUserInfoVO; import io.swagger.models.auth.In; import org.springframework.util.ObjectUtils; @@ -26,29 +28,47 @@ /** * 获取登录对象信息 * @return * @return 对象userid */ public Long getUserId(){ HttpServletRequest request = this.getRequest(); Long header = Long.valueOf(request.getHeader(UserConstants.USER_ID)); boolean empty = ObjectUtils.isEmpty(header); if (empty) { return null; } return header; LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); Long userId = loginUserInfo.getUserId(); return userId; } /** * 获取登录对象所在社区id * @return 社区id */ public Long getCommunityId(){ LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); Long communityId = loginUserInfo.getCommunityId(); return communityId; } /** * 获取登录token * @return * @return token */ public String getToken(){ HttpServletRequest request = this.getRequest(); String header = request.getHeader(TokenConstant.TOKEN_LOGOUT); boolean empty = ObjectUtils.isEmpty(header); if (empty) { return null; } return header; } /** * 获取登录对象所有信息 * @return 所有信息 */ public LoginUserInfoVO getLoginUserInfo(){ HttpServletRequest request = this.getRequest(); String userInfo = request.getHeader(UserConstants.LOGIN_USER_INFO); boolean empty = ObjectUtils.isEmpty(userInfo); if (empty) { throw new UnAuthenticationException("获取登录人信息失败"); } LoginUserInfoVO loginUserInfoVO= JSONObject.parseObject(userInfo,LoginUserInfoVO.class); return loginUserInfoVO; } } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/R.java
@@ -87,5 +87,13 @@ return apiResult; } /** * 请求是否成功 * @return */ public boolean isOk(){ return this.code==Constants.SUCCESS.intValue(); } } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActActPrizeVO.java
New file @@ -0,0 +1,31 @@ package com.panzhihua.common.model.vos.community; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 活动奖品 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:17 **/ @Data @ApiModel("社区》活动》活动奖品") public class ComActActPrizeVO { @ApiModelProperty("自增id") private Long id; @ApiModelProperty("所属活动id") private Long activityId; @ApiModelProperty("奖品名称") private String prizeName; @ApiModelProperty("奖品图片路径") private String prizePhoto; @ApiModelProperty("是否报名既有 1 是 0 不是") private Integer type; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActActSignVO.java
New file @@ -0,0 +1,25 @@ package com.panzhihua.common.model.vos.community; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 社区活动报名记录 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:11 **/ @Data @ApiModel("社区》活动》活动报名列表") public class ComActActSignVO { @ApiModelProperty("自增id") private Long id; @ApiModelProperty("所属活动id") private Long activityId; @ApiModelProperty("用户id, 和用户信息表的相关id关联") private Long userId; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActActivityVO.java
New file @@ -0,0 +1,103 @@ package com.panzhihua.common.model.vos.community; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.models.auth.In; import lombok.Data; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.util.Date; import java.util.List; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 社区活动 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:01 **/ @Data @ApiModel("社区活动") public class ComActActivityVO { @ApiModelProperty("自增id") private Long id; @ApiModelProperty("活动名称") @NotBlank private String activityName; @ApiModelProperty("负责人userID") @NotNull private Long sponsorId; @ApiModelProperty("活动地址") @NotBlank private String activityAddr; @ApiModelProperty("活动状态") private boolean status; @ApiModelProperty("发布时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date publishAt; @ApiModelProperty("活动结束时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @NotNull private Date endAt; @ApiModelProperty("活动开始时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @NotNull private Date beginAt; @ApiModelProperty("报名开始时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @NotNull private Date signUpBegin; @ApiModelProperty("报名结束时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @NotNull private Date signUpEnd; @ApiModelProperty("志愿者人数下线") private Integer volunteerMin; @ApiModelProperty("志愿者人数上限") private Integer volunteerMax; @ApiModelProperty("参与者人数下线") private Integer participantMin; @ApiModelProperty("参与者人数上限") private Integer participantMax; @ApiModelProperty("活动封面") @NotNull private String cover; @ApiModelProperty("是否有奖品 1 有 0 无") private Integer hasPrize; @ApiModelProperty("奖品备注") private String prizeRemark; @ApiModelProperty("奖励说明") @NotBlank private String rewardDesc; @ApiModelProperty("活动内容") @NotBlank private String content; @ApiModelProperty("活动奖品集合") private List<ComActActPrizeVO> comActActPrizeVOList; @ApiModelProperty(value = "社区id",hidden = true) private Long communityId; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActEasyPhotoVO.java
New file @@ -0,0 +1,54 @@ package com.panzhihua.common.model.vos.community; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 随手拍 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:19 **/ @Data @ApiModel("社区活动 》随手拍") public class ComActEasyPhotoVO { @ApiModelProperty("自增id") private Long id; @ApiModelProperty("发起人id") private Long sponsorId; @ApiModelProperty("发生地质") private String happenAddr; @ApiModelProperty("状态") private boolean status; @ApiModelProperty("处理人id") private Long handlerId; @ApiModelProperty("创建开始时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createBegin; @ApiModelProperty("创建结束时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createEnd; @ApiModelProperty("详情") private String detail; @ApiModelProperty("图片路径列表,逗号分隔") private String photoPathList; @ApiModelProperty("处理结果") private String handleResult; @ApiModelProperty("处理结果,图片路径列表,逗号分隔") private String handlePhotoList; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActMicroWishVO.java
New file @@ -0,0 +1,61 @@ package com.panzhihua.common.model.vos.community; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 微心愿 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:25 **/ @Data @ApiModel("社区活动 》微心愿") public class ComActMicroWishVO { @ApiModelProperty("id") private Long id; @ApiModelProperty("发起人id") private Long sponsorId; @ApiModelProperty("发起人电话号码") private String sponsorPhone; @ApiModelProperty("微心愿名称") private String wishName; @ApiModelProperty("状态") private boolean status; @ApiModelProperty("集星数") private Integer startNum; @ApiModelProperty("形式") private String form; @ApiModelProperty("责任人id") private Long responsibleId; @ApiModelProperty("创建开始时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createBegin; @ApiModelProperty("创建结束时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createEnd; @ApiModelProperty("评分") private Integer score; @ApiModelProperty("详情") private String detail; @ApiModelProperty("图片路径列表,逗号分隔") private String photoPathList; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActVO.java
New file @@ -0,0 +1,61 @@ package com.panzhihua.common.model.vos.community; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import lombok.Data; import java.util.Date; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 社区动态 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:04 **/ @Data @ApiModel("社区动态") public class ComActVO { /** * 自增id */ private Long id; /** * 标题 */ private String title; /** * 阅读数 */ private Integer readNum; /** * 状态 */ private boolean status; /** * 是否置顶 */ private String isTopping; /** * 发布时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date publishAt; /** * 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createAt; /** * 修改时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date updateAt; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/ActivityManagerVO.java
New file @@ -0,0 +1,23 @@ package com.panzhihua.common.model.vos.partybuilding; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 负责人 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:45 **/ @Data @ApiModel("负责人") public class ActivityManagerVO { @ApiModelProperty("负责人id") private Long managerId; @ApiModelProperty("负责人名字") private String name; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
New file @@ -0,0 +1,24 @@ package com.panzhihua.common.service.community; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComActActivityVO; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 社区 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 15:59 **/ @FeignClient(name = "community") public interface CommunityService { /** * 新增社区活动 * @param comActActivityVO 新增信息 * @return 新增结果 */ @PostMapping("/activity") R addActivity(@RequestBody ComActActivityVO comActActivityVO); } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/user/UserService.java
@@ -96,4 +96,12 @@ */ @PostMapping("/user/changepassword") R changePassword(@RequestBody ChangePasswordVO changePasswordVO); /** * 某社区后台人员查询 * @param param 名字 * @param communityId 社区id * @return 人员集合 */ R listActivityManager(@RequestParam("param") String param, @RequestParam("communityId")Long communityId); } springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/constants/UserConstants.classBinary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/controller/BaseController.classBinary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/R.classBinary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/community/ComActActPrizeVO.classBinary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/community/ComActActSignVO.classBinary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/community/ComActActivityVO.classBinary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/community/ComActEasyPhotoVO.classBinary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/community/ComActMicroWishVO.classBinary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/community/ComActVO.classBinary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/partybuilding/ActivityManagerVO.classBinary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/service/community/CommunityService.classBinary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/service/user/UserService.classBinary files differ
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityActivityAPI.java
New file @@ -0,0 +1,55 @@ package com.panzhihua.community_backstage.api; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComActActivityVO; import com.panzhihua.common.model.vos.partybuilding.ActivityManagerVO; import com.panzhihua.common.service.community.CommunityService; import com.panzhihua.common.service.user.UserService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.util.ObjectUtils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 社区活动 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:38 **/ @Slf4j @Api(tags = {"社区动态","随手拍","微心愿","社区活动"}) @RestController @RequestMapping("/communityactivityapi/") public class CommunityActivityAPI extends BaseController { @Resource private UserService userService; @Resource private CommunityService communityService; @ApiOperation(value = "活动负责人下拉选择",response = ActivityManagerVO.class) @GetMapping("activitymanager") @ApiImplicitParam(name = "param",value = "搜索参数【不传返回所有后台人员】",required = false) public R listActivityManager(String param) { Long communityId = this.getCommunityId(); if (ObjectUtils.isEmpty(param)) { param=""; } R r=userService.listActivityManager(param,communityId); return r; } @ApiOperation(value = "新增社区活动") @PostMapping("activity") public R addActivity(@RequestBody ComActActivityVO ComActActivityVO) { Long communityId = this.getCommunityId(); ComActActivityVO.setCommunityId(communityId); R r = communityService.addActivity(ComActActivityVO); return r; } } springcloud_k8s_panzhihuazhihuishequ/pom.xml
@@ -203,6 +203,7 @@ <module>applets_backstage</module> <module>applets</module> <module>community_backstage</module> <module>service_community</module> </modules> <packaging>pom</packaging> springcloud_k8s_panzhihuazhihuishequ/service_community/.gitignore
New file @@ -0,0 +1,33 @@ HELP.md target/ !.mvn/wrapper/maven-wrapper.jar !**/src/main/**/target/ !**/src/test/**/target/ ### STS ### .apt_generated .classpath .factorypath .project .settings .springBeans .sts4-cache ### IntelliJ IDEA ### .idea *.iws *.iml *.ipr ### NetBeans ### /nbproject/private/ /nbbuild/ /dist/ /nbdist/ /.nb-gradle/ build/ !**/src/main/**/build/ !**/src/test/**/build/ ### VS Code ### .vscode/ springcloud_k8s_panzhihuazhihuishequ/service_community/.mvn/wrapper/MavenWrapperDownloader.java
New file @@ -0,0 +1,118 @@ /* * Copyright 2007-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import java.net.*; import java.io.*; import java.nio.channels.*; import java.util.Properties; public class MavenWrapperDownloader { private static final String WRAPPER_VERSION = "0.5.6"; /** * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. */ private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; /** * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to * use instead of the default one. */ private static final String MAVEN_WRAPPER_PROPERTIES_PATH = ".mvn/wrapper/maven-wrapper.properties"; /** * Path where the maven-wrapper.jar will be saved to. */ private static final String MAVEN_WRAPPER_JAR_PATH = ".mvn/wrapper/maven-wrapper.jar"; /** * Name of the property which should be used to override the default download url for the wrapper. */ private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; public static void main(String args[]) { System.out.println("- Downloader started"); File baseDirectory = new File(args[0]); System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); // If the maven-wrapper.properties exists, read it and check if it contains a custom // wrapperUrl parameter. File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); String url = DEFAULT_DOWNLOAD_URL; if (mavenWrapperPropertyFile.exists()) { FileInputStream mavenWrapperPropertyFileInputStream = null; try { mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); Properties mavenWrapperProperties = new Properties(); mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); } catch (IOException e) { System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); } finally { try { if (mavenWrapperPropertyFileInputStream != null) { mavenWrapperPropertyFileInputStream.close(); } } catch (IOException e) { // Ignore ... } } } System.out.println("- Downloading from: " + url); File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); if (!outputFile.getParentFile().exists()) { if (!outputFile.getParentFile().mkdirs()) { System.out.println( "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); } } System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); try { downloadFileFromURL(url, outputFile); System.out.println("Done"); System.exit(0); } catch (Throwable e) { System.out.println("- Error downloading"); e.printStackTrace(); System.exit(1); } } private static void downloadFileFromURL(String urlString, File destination) throws Exception { if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { String username = System.getenv("MVNW_USERNAME"); char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); Authenticator.setDefault(new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(username, password); } }); } URL website = new URL(urlString); ReadableByteChannel rbc; rbc = Channels.newChannel(website.openStream()); FileOutputStream fos = new FileOutputStream(destination); fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); fos.close(); rbc.close(); } } springcloud_k8s_panzhihuazhihuishequ/service_community/.mvn/wrapper/maven-wrapper.jarBinary files differ
springcloud_k8s_panzhihuazhihuishequ/service_community/.mvn/wrapper/maven-wrapper.properties
New file @@ -0,0 +1,2 @@ distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar springcloud_k8s_panzhihuazhihuishequ/service_community/mvnw
New file @@ -0,0 +1,310 @@ #!/bin/sh # ---------------------------------------------------------------------------- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- # Maven Start Up Batch script # # Required ENV vars: # ------------------ # JAVA_HOME - location of a JDK home dir # # Optional ENV vars # ----------------- # M2_HOME - location of maven2's installed home dir # MAVEN_OPTS - parameters passed to the Java VM when running Maven # e.g. to debug Maven itself, use # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 # MAVEN_SKIP_RC - flag to disable loading of mavenrc files # ---------------------------------------------------------------------------- if [ -z "$MAVEN_SKIP_RC" ] ; then if [ -f /etc/mavenrc ] ; then . /etc/mavenrc fi if [ -f "$HOME/.mavenrc" ] ; then . "$HOME/.mavenrc" fi fi # OS specific support. $var _must_ be set to either true or false. cygwin=false; darwin=false; mingw=false case "`uname`" in CYGWIN*) cygwin=true ;; MINGW*) mingw=true;; Darwin*) darwin=true # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home # See https://developer.apple.com/library/mac/qa/qa1170/_index.html if [ -z "$JAVA_HOME" ]; then if [ -x "/usr/libexec/java_home" ]; then export JAVA_HOME="`/usr/libexec/java_home`" else export JAVA_HOME="/Library/Java/Home" fi fi ;; esac if [ -z "$JAVA_HOME" ] ; then if [ -r /etc/gentoo-release ] ; then JAVA_HOME=`java-config --jre-home` fi fi if [ -z "$M2_HOME" ] ; then ## resolve links - $0 may be a link to maven's home PRG="$0" # need this for relative symlinks while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '/.*' > /dev/null; then PRG="$link" else PRG="`dirname "$PRG"`/$link" fi done saveddir=`pwd` M2_HOME=`dirname "$PRG"`/.. # make it fully qualified M2_HOME=`cd "$M2_HOME" && pwd` cd "$saveddir" # echo Using m2 at $M2_HOME fi # For Cygwin, ensure paths are in UNIX format before anything is touched if $cygwin ; then [ -n "$M2_HOME" ] && M2_HOME=`cygpath --unix "$M2_HOME"` [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"` fi # For Mingw, ensure paths are in UNIX format before anything is touched if $mingw ; then [ -n "$M2_HOME" ] && M2_HOME="`(cd "$M2_HOME"; pwd)`" [ -n "$JAVA_HOME" ] && JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" fi if [ -z "$JAVA_HOME" ]; then javaExecutable="`which javac`" if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then # readlink(1) is not available as standard on Solaris 10. readLink=`which readlink` if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then if $darwin ; then javaHome="`dirname \"$javaExecutable\"`" javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" else javaExecutable="`readlink -f \"$javaExecutable\"`" fi javaHome="`dirname \"$javaExecutable\"`" javaHome=`expr "$javaHome" : '\(.*\)/bin'` JAVA_HOME="$javaHome" export JAVA_HOME fi fi fi if [ -z "$JAVACMD" ] ; then if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" else JAVACMD="$JAVA_HOME/bin/java" fi else JAVACMD="`which java`" fi fi if [ ! -x "$JAVACMD" ] ; then echo "Error: JAVA_HOME is not defined correctly." >&2 echo " We cannot execute $JAVACMD" >&2 exit 1 fi if [ -z "$JAVA_HOME" ] ; then echo "Warning: JAVA_HOME environment variable is not set." fi CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher # traverses directory structure from process work directory to filesystem root # first directory with .mvn subdirectory is considered project base directory find_maven_basedir() { if [ -z "$1" ] then echo "Path not specified to find_maven_basedir" return 1 fi basedir="$1" wdir="$1" while [ "$wdir" != '/' ] ; do if [ -d "$wdir"/.mvn ] ; then basedir=$wdir break fi # workaround for JBEAP-8937 (on Solaris 10/Sparc) if [ -d "${wdir}" ]; then wdir=`cd "$wdir/.."; pwd` fi # end of workaround done echo "${basedir}" } # concatenates all lines of a file concat_lines() { if [ -f "$1" ]; then echo "$(tr -s '\n' ' ' < "$1")" fi } BASE_DIR=`find_maven_basedir "$(pwd)"` if [ -z "$BASE_DIR" ]; then exit 1; fi ########################################################################################## # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central # This allows using the maven wrapper in projects that prohibit checking in binary data. ########################################################################################## if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then if [ "$MVNW_VERBOSE" = true ]; then echo "Found .mvn/wrapper/maven-wrapper.jar" fi else if [ "$MVNW_VERBOSE" = true ]; then echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." fi if [ -n "$MVNW_REPOURL" ]; then jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" else jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" fi while IFS="=" read key value; do case "$key" in (wrapperUrl) jarUrl="$value"; break ;; esac done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" if [ "$MVNW_VERBOSE" = true ]; then echo "Downloading from: $jarUrl" fi wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" if $cygwin; then wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` fi if command -v wget > /dev/null; then if [ "$MVNW_VERBOSE" = true ]; then echo "Found wget ... using wget" fi if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then wget "$jarUrl" -O "$wrapperJarPath" else wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" fi elif command -v curl > /dev/null; then if [ "$MVNW_VERBOSE" = true ]; then echo "Found curl ... using curl" fi if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then curl -o "$wrapperJarPath" "$jarUrl" -f else curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f fi else if [ "$MVNW_VERBOSE" = true ]; then echo "Falling back to using Java to download" fi javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" # For Cygwin, switch paths to Windows format before running javac if $cygwin; then javaClass=`cygpath --path --windows "$javaClass"` fi if [ -e "$javaClass" ]; then if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then if [ "$MVNW_VERBOSE" = true ]; then echo " - Compiling MavenWrapperDownloader.java ..." fi # Compiling the Java class ("$JAVA_HOME/bin/javac" "$javaClass") fi if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then # Running the downloader if [ "$MVNW_VERBOSE" = true ]; then echo " - Running MavenWrapperDownloader.java ..." fi ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") fi fi fi fi ########################################################################################## # End of extension ########################################################################################## export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} if [ "$MVNW_VERBOSE" = true ]; then echo $MAVEN_PROJECTBASEDIR fi MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" # For Cygwin, switch paths to Windows format before running java if $cygwin; then [ -n "$M2_HOME" ] && M2_HOME=`cygpath --path --windows "$M2_HOME"` [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --windows "$CLASSPATH"` [ -n "$MAVEN_PROJECTBASEDIR" ] && MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` fi # Provide a "standardized" way to retrieve the CLI args that will # work with both Windows and non-Windows executions. MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" export MAVEN_CMD_LINE_ARGS WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain exec "$JAVACMD" \ $MAVEN_OPTS \ -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" springcloud_k8s_panzhihuazhihuishequ/service_community/mvnw.cmd
New file @@ -0,0 +1,182 @@ @REM ---------------------------------------------------------------------------- @REM Licensed to the Apache Software Foundation (ASF) under one @REM or more contributor license agreements. See the NOTICE file @REM distributed with this work for additional information @REM regarding copyright ownership. The ASF licenses this file @REM to you under the Apache License, Version 2.0 (the @REM "License"); you may not use this file except in compliance @REM with the License. You may obtain a copy of the License at @REM @REM https://www.apache.org/licenses/LICENSE-2.0 @REM @REM Unless required by applicable law or agreed to in writing, @REM software distributed under the License is distributed on an @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @REM KIND, either express or implied. See the License for the @REM specific language governing permissions and limitations @REM under the License. @REM ---------------------------------------------------------------------------- @REM ---------------------------------------------------------------------------- @REM Maven Start Up Batch script @REM @REM Required ENV vars: @REM JAVA_HOME - location of a JDK home dir @REM @REM Optional ENV vars @REM M2_HOME - location of maven2's installed home dir @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven @REM e.g. to debug Maven itself, use @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files @REM ---------------------------------------------------------------------------- @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' @echo off @REM set title of command window title %0 @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% @REM set %HOME% to equivalent of $HOME if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") @REM Execute a user defined script before this one if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre @REM check for pre script, once with legacy .bat ending and once with .cmd ending if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" :skipRcPre @setlocal set ERROR_CODE=0 @REM To isolate internal variables from possible post scripts, we use another setlocal @setlocal @REM ==== START VALIDATION ==== if not "%JAVA_HOME%" == "" goto OkJHome echo. echo Error: JAVA_HOME not found in your environment. >&2 echo Please set the JAVA_HOME variable in your environment to match the >&2 echo location of your Java installation. >&2 echo. goto error :OkJHome if exist "%JAVA_HOME%\bin\java.exe" goto init echo. echo Error: JAVA_HOME is set to an invalid directory. >&2 echo JAVA_HOME = "%JAVA_HOME%" >&2 echo Please set the JAVA_HOME variable in your environment to match the >&2 echo location of your Java installation. >&2 echo. goto error @REM ==== END VALIDATION ==== :init @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". @REM Fallback to current working directory if not found. set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir set EXEC_DIR=%CD% set WDIR=%EXEC_DIR% :findBaseDir IF EXIST "%WDIR%"\.mvn goto baseDirFound cd .. IF "%WDIR%"=="%CD%" goto baseDirNotFound set WDIR=%CD% goto findBaseDir :baseDirFound set MAVEN_PROJECTBASEDIR=%WDIR% cd "%EXEC_DIR%" goto endDetectBaseDir :baseDirNotFound set MAVEN_PROJECTBASEDIR=%EXEC_DIR% cd "%EXEC_DIR%" :endDetectBaseDir IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig @setlocal EnableExtensions EnableDelayedExpansion for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% :endReadAdditionalConfig SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B ) @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central @REM This allows using the maven wrapper in projects that prohibit checking in binary data. if exist %WRAPPER_JAR% ( if "%MVNW_VERBOSE%" == "true" ( echo Found %WRAPPER_JAR% ) ) else ( if not "%MVNW_REPOURL%" == "" ( SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" ) if "%MVNW_VERBOSE%" == "true" ( echo Couldn't find %WRAPPER_JAR%, downloading it ... echo Downloading from: %DOWNLOAD_URL% ) powershell -Command "&{"^ "$webclient = new-object System.Net.WebClient;"^ "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ "}"^ "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ "}" if "%MVNW_VERBOSE%" == "true" ( echo Finished downloading %WRAPPER_JAR% ) ) @REM End of extension @REM Provide a "standardized" way to retrieve the CLI args that will @REM work with both Windows and non-Windows executions. set MAVEN_CMD_LINE_ARGS=%* %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* if ERRORLEVEL 1 goto error goto end :error set ERROR_CODE=1 :end @endlocal & set ERROR_CODE=%ERROR_CODE% if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost @REM check for post script, once with legacy .bat ending and once with .cmd ending if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" :skipRcPost @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' if "%MAVEN_BATCH_PAUSE%" == "on" pause if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% exit /B %ERROR_CODE% springcloud_k8s_panzhihuazhihuishequ/service_community/pom.xml
New file @@ -0,0 +1,103 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.panzhihua</groupId> <artifactId>zhihuishequ</artifactId> <version>1.0-SNAPSHOT</version> </parent> <groupId>com.panzhihua</groupId> <artifactId>service_community</artifactId> <version>0.0.1-SNAPSHOT</version> <name>service_community</name> <description>社区</description> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-config</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-openfeign</artifactId> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>com.netflix.hystrix</groupId> <artifactId>hystrix-javanica</artifactId> </dependency> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> </dependency> <dependency> <groupId>com.panzhihua</groupId> <artifactId>common</artifactId> </dependency> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-redis</artifactId> </dependency> </dependencies> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>${spring-cloud.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> <repositories> <repository> <id>spring-milestones</id> <name>Spring Milestones</name> <url>https://repo.spring.io/milestone</url> </repository> </repositories> </project> springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/ServiceCommunityApplication.java
New file @@ -0,0 +1,15 @@ package com.panzhihua.service_community; import org.springframework.boot.SpringApplication; import org.springframework.cloud.client.SpringCloudApplication; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; @SpringCloudApplication @EnableEurekaClient public class ServiceCommunityApplication { public static void main(String[] args) { SpringApplication.run(ServiceCommunityApplication.class, args); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java
New file @@ -0,0 +1,71 @@ package com.panzhihua.service_community.api; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComActActPrizeVO; import com.panzhihua.common.model.vos.community.ComActActivityVO; import com.panzhihua.service_community.model.dos.ComActActPrizeDO; import com.panzhihua.service_community.service.ComActActPrizeService; import com.panzhihua.service_community.service.ComActActivityService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.ObjectUtils; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 社区活动 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 16:02 **/ @Slf4j @RestController @RequestMapping("/") public class CommunityApi { @Resource private ComActActivityService comActActivityService; @Resource private ComActActPrizeService comActActPrizeService; /** * 新增社区活动 * @param comActActivityVO 新增信息 * @return 新增结果 */ @PostMapping("/activity") @Transactional(rollbackFor = Exception.class) public R addActivity(@RequestBody ComActActivityVO comActActivityVO){ R r = comActActivityService.addActivity(comActActivityVO); boolean ok = r.isOk(); if (ok) { Long activityId = (Long)r.getData(); Integer hasPrize = comActActivityVO.getHasPrize(); if (hasPrize.intValue()>0) { List<ComActActPrizeVO> comActActPrizeVOList = comActActivityVO.getComActActPrizeVOList(); if (!ObjectUtils.isEmpty(comActActPrizeVOList)) { List<ComActActPrizeDO> comActActPrizeDOS=new ArrayList<>(); comActActPrizeVOList.forEach(comActActPrizeVO -> { ComActActPrizeDO comActActPrizeDO=new ComActActPrizeDO(); BeanUtils.copyProperties(comActActPrizeVO,comActActPrizeDO); comActActPrizeDO.setActivityId(activityId); comActActPrizeDOS.add(comActActPrizeDO); }); boolean saveBatch = comActActPrizeService.saveBatch(comActActPrizeDOS); if (!saveBatch) { throw new RuntimeException("奖品保存失败"); } } } } return R.fail(); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActPrizeDAO.java
New file @@ -0,0 +1,15 @@ package com.panzhihua.service_community.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.panzhihua.service_community.model.dos.ComActActPrizeDO; import org.apache.ibatis.annotations.Mapper; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 活动奖品 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:16 **/ @Mapper public interface ComActActPrizeDAO extends BaseMapper<ComActActPrizeDO> { } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActSignDAO.java
New file @@ -0,0 +1,15 @@ package com.panzhihua.service_community.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.panzhihua.service_community.model.dos.ComActActSignDO; import org.apache.ibatis.annotations.Mapper; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 社区活动报名记录 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:09 **/ @Mapper public interface ComActActSignDAO extends BaseMapper<ComActActSignDO> { } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java
New file @@ -0,0 +1,15 @@ package com.panzhihua.service_community.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.panzhihua.service_community.model.dos.ComActActivityDO; import org.apache.ibatis.annotations.Mapper; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 社区活动 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 13:59 **/ @Mapper public interface ComActActivityDAO extends BaseMapper<ComActActivityDO> { } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDAO.java
New file @@ -0,0 +1,15 @@ package com.panzhihua.service_community.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.panzhihua.service_community.model.dos.ComActDO; import org.apache.ibatis.annotations.Mapper; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 社区 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:13 **/ @Mapper public interface ComActDAO extends BaseMapper<ComActDO> { } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDynDAO.java
New file @@ -0,0 +1,15 @@ package com.panzhihua.service_community.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.panzhihua.service_community.model.dos.ComActDynDO; import org.apache.ibatis.annotations.Mapper; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 社区动态 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:06 **/ @Mapper public interface ComActDynDAO extends BaseMapper<ComActDynDO> { } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoDAO.java
New file @@ -0,0 +1,15 @@ package com.panzhihua.service_community.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.panzhihua.service_community.model.dos.ComActEasyPhotoDO; import org.apache.ibatis.annotations.Mapper; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 随手拍 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:22 **/ @Mapper public interface ComActEasyPhotoDAO extends BaseMapper<ComActEasyPhotoDO> { } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java
New file @@ -0,0 +1,15 @@ package com.panzhihua.service_community.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.panzhihua.service_community.model.dos.ComActMicroWishDO; import org.apache.ibatis.annotations.Mapper; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 微心愿 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:27 **/ @Mapper public interface ComActMicroWishDAO extends BaseMapper<ComActMicroWishDO> { } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActActPrizeDO.java
New file @@ -0,0 +1,47 @@ package com.panzhihua.service_community.model.dos; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import java.io.Serializable; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 活动奖品 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:14 **/ @Data @TableName(value = "com_act_act_prize") public class ComActActPrizeDO implements Serializable { private static final long serialVersionUID = 1L; /** * 自增id */ @TableId(type = IdType.AUTO) private Long id; /** * 所属活动id */ private Long activityId; /** * 奖品名称 */ private String prizeName; /** * 奖品图片路径 */ private String prizePhoto; /** * 是否报名既有 1 是 0 不是 */ private Integer type; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActActSignDO.java
New file @@ -0,0 +1,37 @@ package com.panzhihua.service_community.model.dos; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import java.io.Serializable; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 活动报名列表 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:07 **/ @Data @TableName(value = "com_act_act_sign") public class ComActActSignDO implements Serializable { private static final long serialVersionUID = 1L; /** * 自增id */ @TableId(type = IdType.AUTO) private Long id; /** * 所属活动id */ private Long activityId; /** * 用户id, 和用户信息表的相关id关联 */ private Long userId; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActActivityDO.java
New file @@ -0,0 +1,121 @@ package com.panzhihua.service_community.model.dos; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.util.Date; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 社区活动 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 13:56 **/ @Data @TableName(value = "com_act_activity") public class ComActActivityDO implements Serializable { private static final long serialVersionUID = 1L; /** * 自增id */ @TableId(type = IdType.AUTO) private Long id; /** * 活动名称 */ private String activityName; /** * 负责人userID */ private Long sponsorId; /** * 活动地址 */ private String activityAddr; /** * 活动状态 */ private boolean status; /** * 发布时间 */ private Date publishAt; /** * 互动结束时间 */ private Date endAt; /** * 活动开始时间 */ private Date beginAt; /** * 报名开始时间 */ private Date signUpBegin; /** * 报名结束时间 */ private Date signUpEnd; /** * 志愿者人数下线 */ private Integer volunteerMin; /** * 志愿者人数上限 */ private Integer volunteerMax; /** * 参与者人数下线 */ private Integer participantMin; /** * 参与者人数上限 */ private Integer participantMax; /** * 活动封面 */ private String cover; /** * 是否有奖品 1 有 0 无 */ private Integer hasPrize; /** * 奖品备注 */ private String prizeRemark; /** * 奖励说明 */ private String rewardDesc; /** * 活动内容 */ private String content; /** * 创建时间 */ private Date createAt; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActDO.java
New file @@ -0,0 +1,52 @@ package com.panzhihua.service_community.model.dos; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import java.io.Serializable; import java.util.Date; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 社区表 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:12 **/ @Data @TableName(value = "com_act") public class ComActDO implements Serializable { private static final long serialVersionUID = 1L; /** * community_id */ @TableId(type = IdType.AUTO) private Long communityId; /** * 社区名字 */ private String name; /** * 社区地址 */ private String address; /** * 经度 */ private String lng; /** * 维度 */ private String lat; /** * 创建时间 */ private Date createAt; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActDynDO.java
New file @@ -0,0 +1,62 @@ package com.panzhihua.service_community.model.dos; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import java.io.Serializable; import java.util.Date; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 社区动态 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:05 **/ @Data @TableName(value = "com_act_dyn") public class ComActDynDO implements Serializable { private static final long serialVersionUID = 1L; /** * 自增id */ @TableId(type = IdType.AUTO) private Long id; /** * 标题 */ private String title; /** * 阅读数 */ private Integer readNum; /** * 状态 */ private boolean status; /** * 是否置顶 */ private String isTopping; /** * 发布时间 */ private Date publishAt; /** * 创建时间 */ private Date createAt; /** * 修改时间 */ private Date updateAt; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActEasyPhotoDO.java
New file @@ -0,0 +1,77 @@ package com.panzhihua.service_community.model.dos; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import java.io.Serializable; import java.util.Date; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 随手拍 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:21 **/ @Data @TableName(value = "com_act_easy_photo") public class ComActEasyPhotoDO implements Serializable { private static final long serialVersionUID = 1L; /** * 自增id */ @TableId(type = IdType.AUTO) private Long id; /** * 发起人id */ private Long sponsorId; /** * 发生地质 */ private String happenAddr; /** * 状态 */ private boolean status; /** * 处理人id */ private Long handlerId; /** * 创建开始时间 */ private Date createBegin; /** * 创建结束时间 */ private Date createEnd; /** * 详情 */ private String detail; /** * 图片路径列表,逗号分隔 */ private String photoPathList; /** * 处理结果 */ private String handleResult; /** * 处理结果,图片路径列表,逗号分隔 */ private String handlePhotoList; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActMicroWishDO.java
New file @@ -0,0 +1,88 @@ package com.panzhihua.service_community.model.dos; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import java.io.Serializable; import java.util.Date; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 微心愿 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:24 **/ @Data @TableName(value = "com_act_micro_wish") public class ComActMicroWishDO implements Serializable { private static final long serialVersionUID = 1L; /** * 自增id */ @TableId(type = IdType.AUTO) private Long id; /** * 发起人id */ private Long sponsorId; /** * 发起人电话号码 */ private String sponsorPhone; /** * 微心愿名称 */ private String wishName; /** * 状态 */ private boolean status; /** * 集星数 */ private Integer startNum; /** * 形式 */ private String form; /** * 责任人id */ private Long responsibleId; /** * 创建开始时间 */ private Date createBegin; /** * 创建结束时间 */ private Date createEnd; /** * 评分 */ private Integer score; /** * 详情 */ private String detail; /** * 图片路径列表,逗号分隔 */ private String photoPathList; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActActPrizeService.java
New file @@ -0,0 +1,13 @@ package com.panzhihua.service_community.service; import com.baomidou.mybatisplus.extension.service.IService; import com.panzhihua.service_community.model.dos.ComActActPrizeDO; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 奖品 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 16:31 **/ public interface ComActActPrizeService extends IService<ComActActPrizeDO> { } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActActivityService.java
New file @@ -0,0 +1,17 @@ package com.panzhihua.service_community.service; import com.baomidou.mybatisplus.extension.service.IService; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComActActivityVO; import com.panzhihua.service_community.model.dos.ComActActivityDO; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 社区活动 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:35 **/ public interface ComActActivityService extends IService<ComActActivityDO> { R addActivity(ComActActivityVO comActActivityVO); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActDynService.java
New file @@ -0,0 +1,13 @@ package com.panzhihua.service_community.service; import com.baomidou.mybatisplus.extension.service.IService; import com.panzhihua.service_community.model.dos.ComActDynDO; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 社区动态 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:28 **/ public interface ComActDynService extends IService<ComActDynDO> { } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActEasyPhotoService.java
New file @@ -0,0 +1,13 @@ package com.panzhihua.service_community.service; import com.baomidou.mybatisplus.extension.service.IService; import com.panzhihua.service_community.model.dos.ComActEasyPhotoDO; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 随手拍 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:31 **/ public interface ComActEasyPhotoService extends IService<ComActEasyPhotoDO> { } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActMicroWishService.java
New file @@ -0,0 +1,13 @@ package com.panzhihua.service_community.service; import com.baomidou.mybatisplus.extension.service.IService; import com.panzhihua.service_community.model.dos.ComActMicroWishDO; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 微心愿 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:33 **/ public interface ComActMicroWishService extends IService<ComActMicroWishDO> { } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActPrizeServiceImpl.java
New file @@ -0,0 +1,17 @@ package com.panzhihua.service_community.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.service_community.dao.ComActActPrizeDAO; import com.panzhihua.service_community.model.dos.ComActActPrizeDO; import com.panzhihua.service_community.service.ComActActPrizeService; import org.springframework.stereotype.Service; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 奖品 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 16:31 **/ @Service public class ComActActPrizeServiceImpl extends ServiceImpl<ComActActPrizeDAO, ComActActPrizeDO> implements ComActActPrizeService { } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java
New file @@ -0,0 +1,45 @@ package com.panzhihua.service_community.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComActActPrizeVO; import com.panzhihua.common.model.vos.community.ComActActivityVO; import com.panzhihua.service_community.dao.ComActActPrizeDAO; import com.panzhihua.service_community.dao.ComActActivityDAO; import com.panzhihua.service_community.model.dos.ComActActPrizeDO; import com.panzhihua.service_community.model.dos.ComActActivityDO; import com.panzhihua.service_community.service.ComActActivityService; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.ObjectUtils; import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 社区活动 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:35 **/ @Service public class ComActActivityServiceImpl extends ServiceImpl<ComActActivityDAO, ComActActivityDO> implements ComActActivityService { @Resource private ComActActPrizeDAO comActActPrizeDAO; @Override public R addActivity(ComActActivityVO comActActivityVO) { ComActActivityDO comActActivityDO=new ComActActivityDO(); BeanUtils.copyProperties(comActActivityVO,comActActivityDO); boolean save = this.save(comActActivityDO); if(!save){ return R.fail(); } ComActActivityDO one = this.getOne(new QueryWrapper<ComActActivityDO>().lambda().eq(ComActActivityDO::getActivityName, comActActivityDO.getActivityName()).orderByDesc(ComActActivityDO::getCreateAt).last(" limit 1 ")); Long activityId = one.getId(); return R.ok(activityId); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDynServiceImpl.java
New file @@ -0,0 +1,17 @@ package com.panzhihua.service_community.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.service_community.dao.ComActDynDAO; import com.panzhihua.service_community.model.dos.ComActDynDO; import com.panzhihua.service_community.service.ComActDynService; import org.springframework.stereotype.Service; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 社区动态 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:29 **/ @Service public class ComActDynServiceImpl extends ServiceImpl<ComActDynDAO, ComActDynDO> implements ComActDynService { } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java
New file @@ -0,0 +1,17 @@ package com.panzhihua.service_community.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.service_community.dao.ComActEasyPhotoDAO; import com.panzhihua.service_community.model.dos.ComActEasyPhotoDO; import com.panzhihua.service_community.service.ComActEasyPhotoService; import org.springframework.stereotype.Service; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 随手拍 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:31 **/ @Service public class ComActEasyPhotoServiceImpl extends ServiceImpl<ComActEasyPhotoDAO, ComActEasyPhotoDO> implements ComActEasyPhotoService { } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMicroWishServiceImpl.java
New file @@ -0,0 +1,17 @@ package com.panzhihua.service_community.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.service_community.dao.ComActMicroWishDAO; import com.panzhihua.service_community.model.dos.ComActMicroWishDO; import com.panzhihua.service_community.service.ComActMicroWishService; import org.springframework.stereotype.Service; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 微心愿 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:34 **/ @Service public class ComActMicroWishServiceImpl extends ServiceImpl<ComActMicroWishDAO, ComActMicroWishDO> implements ComActMicroWishService { } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/application.yml
New file @@ -0,0 +1,91 @@ server: port: 8199 spring: application: name: community datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/smart_life?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root password: 123456 druid: # 初始连接数 initialSize: 5 # 最小连接池数量 minIdle: 10 # 最大连接池数量 maxActive: 20 # 配置获取连接等待超时的时间 maxWait: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 timeBetweenEvictionRunsMillis: 60000 # 配置一个连接在池中最小生存的时间,单位是毫秒 minEvictableIdleTimeMillis: 300000 # 配置一个连接在池中最大生存的时间,单位是毫秒 maxEvictableIdleTimeMillis: 900000 # 配置检测连接是否有效 validationQuery: SELECT 1 FROM DUAL testWhileIdle: true testOnBorrow: false testOnReturn: false webStatFilter: enabled: true statViewServlet: enabled: true # 设置白名单,不填则允许所有访问 allow: url-pattern: /monitor/druid/* filter: stat: enabled: true # 慢SQL记录 log-slow-sql: false slow-sql-millis: 1000 merge-sql: true wall: config: multi-statement-allow: true eureka: client: service-url: defaultZone: http://localhost:8192/eureka instance: prefer‐ip‐address: true #可以跨域访问 feign: hystrix: enabled: true mybatis-plus: #SIMPLE:该执行器类型不做特殊的事情,为每个语句的执行创建一个新的预处理语句,REUSE:该执行器类型会复用预处理语句,BATCH:该执行器类型会批量执行所有的更新语句 default-executor-type: REUSE configuration: # 是否开启自动驼峰命名规则(camel case)映射,即从经典数据库列名 A_COLUMN(下划线命名) 到经典 Java 属性名 aColumn(驼峰命名) 的类似映射 map-underscore-to-camel-case: true # 全局地开启或关闭配置文件中的所有映射器已经配置的任何缓存,默认为 true cache-enabled: false #如果查询结果中包含空值的列,则 MyBatis 在映射的时候,不会映射这个字段 call-setters-on-nulls: true # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用 log-impl: org.apache.ibatis.logging.stdout.StdOutImpl global-config: db-config: #表名下划线命名默认true table-underline: true #id类型 id-type: auto #是否开启大写命名,默认不开启 #capital-mode: false #逻辑已删除值,(逻辑删除下有效) 需要注入逻辑策略LogicSqlInjector 以@Bean方式注入 logic-not-delete-value: 0 #逻辑未删除值,(逻辑删除下有效) logic-delete-value: 1 #数据库类型 db-type: mysql select-strategy: not_empty update-strategy: not_empty insert-strategy: not_empty springcloud_k8s_panzhihuazhihuishequ/service_community/src/test/java/com/panzhihua/service_community/ServiceCommunityApplicationTests.java
New file @@ -0,0 +1,13 @@ package com.panzhihua.service_community; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class ServiceCommunityApplicationTests { @Test void contextLoads() { } } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/api/UserApi.java
@@ -90,4 +90,16 @@ public R changePassword(@RequestBody ChangePasswordVO changePasswordVO){ return userService.changePassword(changePasswordVO); } /** * 某社区后台人员查询 * @param param 名字 * @param communityId 社区id * @return 人员集合 */ public R listActivityManager(@RequestParam("param") String param, @RequestParam("communityId")Long communityId){ return userService.listActivityManager(param,communityId); } } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/UserService.java
@@ -57,4 +57,11 @@ * @return 修改结果 */ R changePassword(ChangePasswordVO changePasswordVO); /** * 某社区后台人员查询 * @param param 名字 * @param communityId 社区id * @return 人员集合 */ R listActivityManager(String param, Long communityId); } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -5,6 +5,7 @@ import com.panzhihua.common.constants.UserConstants; import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.partybuilding.ActivityManagerVO; import com.panzhihua.common.model.vos.user.ChangePasswordVO; import com.panzhihua.service_user.dao.RoleDAO; import com.panzhihua.service_user.dao.UserDao; @@ -16,10 +17,7 @@ import org.springframework.util.ObjectUtils; import javax.annotation.Resource; import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.*; /** * @program: springcloud_k8s_panzhihuazhihuishequ @@ -209,6 +207,33 @@ return R.fail(); } /** * 某社区后台人员查询 * * @param param 名字 * @param communityId 社区id * @return 人员集合 */ @Override public R listActivityManager(String param, Long communityId) { LambdaQueryWrapper<SysUserDO> queryWrapper=new LambdaQueryWrapper<>(); List<ActivityManagerVO> activityManagerVOS=new ArrayList<>(); queryWrapper = new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getCommunityId, communityId).eq(SysUserDO::getStatus, 1); if (!ObjectUtils.isEmpty(param)) { queryWrapper = queryWrapper.eq(SysUserDO::getName, param); } List<SysUserDO> sysUserDOS = userDao.selectList(queryWrapper); if (!ObjectUtils.isEmpty(sysUserDOS)) { sysUserDOS.forEach(sysUserDO -> { ActivityManagerVO activityManagerVO=new ActivityManagerVO(); activityManagerVO.setManagerId(sysUserDO.getUserId()); activityManagerVO.setName(sysUserDO.getName()); activityManagerVOS.add(activityManagerVO); }); } return R.ok(activityManagerVOS); } public static void main(String[] args) { String encode = new BCryptPasswordEncoder().encode("123456"); System.out.println(encode); springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/java/com/panzhihua/zuul/filters/JWTAuthenticationTokenFilter.java
@@ -1,10 +1,12 @@ package com.panzhihua.zuul.filters; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.panzhihua.common.constants.HttpStatus; import com.panzhihua.common.constants.SecurityConstants; import com.panzhihua.common.constants.TokenConstant; import com.panzhihua.common.constants.UserConstants; import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.service.user.UserService; import com.panzhihua.common.utlis.JWTTokenUtil; @@ -134,8 +136,20 @@ } UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(username, username, authorities);//主要使用权限 账户 密码 不重要 SecurityContextHolder.getContext().setAuthentication(authentication); safeboxRequestWrapper.addHeader(UserConstants.USER_ID,username); safeboxRequestWrapper.addHeader(TokenConstant.TOKEN_LOGOUT,tokenHeader); //登录用户的所有信息 String userKey = UserConstants.LOGIN_USER_INFO + username; Boolean hasKeyLoginUserInfo = stringRedisTemplate.hasKey(userKey); if(hasKeyLoginUserInfo){ String userInfo = valueOperations.get(userKey); safeboxRequestWrapper.addHeader(UserConstants.LOGIN_USER_INFO,userInfo); }else{ R<LoginUserInfoVO> userInfoByUserId = userService.getUserInfoByUserId(username); LoginUserInfoVO data = userInfoByUserId.getData(); String userInfo = JSONObject.toJSONString(data); valueOperations.set(userKey,userInfo,24,TimeUnit.HOURS); safeboxRequestWrapper.addHeader(UserConstants.LOGIN_USER_INFO,userInfo); } } else { ResultUtil.responseJson(response, R.fail(HttpStatus.UNAUTHORIZED, "token校验失败"));