diff --git a/src/main/java/com/dl/officialsite/common/constants/Constants.java b/src/main/java/com/dl/officialsite/common/constants/Constants.java index 37011c2f..c7789bd1 100644 --- a/src/main/java/com/dl/officialsite/common/constants/Constants.java +++ b/src/main/java/com/dl/officialsite/common/constants/Constants.java @@ -13,7 +13,7 @@ public class Constants { * 1: 申请中 * 2: 已退出 */ - public static final int APPROVE_TEAM = 0; + public static final int IN_TEAM = 0; /** * 0: 同意加入 diff --git a/src/main/java/com/dl/officialsite/hiring/HireController.java b/src/main/java/com/dl/officialsite/hiring/HireController.java index 8f83b90a..4ffd45e2 100644 --- a/src/main/java/com/dl/officialsite/hiring/HireController.java +++ b/src/main/java/com/dl/officialsite/hiring/HireController.java @@ -84,7 +84,7 @@ public BaseResponse all(@RequestParam String address,@RequestParam List } /** - * 按照创建者查看简历 + * 按照创建者查看招聘 */ @GetMapping("/address") public BaseResponse allByAddress(@RequestParam String address, diff --git a/src/main/java/com/dl/officialsite/hiring/HireService.java b/src/main/java/com/dl/officialsite/hiring/HireService.java index 690b8e27..d059b606 100644 --- a/src/main/java/com/dl/officialsite/hiring/HireService.java +++ b/src/main/java/com/dl/officialsite/hiring/HireService.java @@ -186,6 +186,8 @@ public void update(HiringVO hiringVO) { BeanUtils.copyProperties(hiringVO, hiring); hireRepository.save(hiring); //删除原有的技能 + + //todo hiringSkillRepository.deleteByHiringId(hiring.getId()); //添加新的技能 hiringVO.getMainSkills().forEach(mainSkill -> { @@ -211,6 +213,8 @@ public Page selectByAddress(String address, Pageable pageable) { return equal; }; Page page = hireRepository.findAll(spec, pageable); + + //findIDS page.getContent().forEach(hiring -> { List mainSkills = hiringSkillRepository.findByHiringId(hiring.getId()) .stream() @@ -240,17 +244,19 @@ public Page selectByAddress(String address, Pageable pageable) { return hiringVOPage; } - //todo + + //application public void apply(Long hireId, String file) { Hiring hiring = hireRepository.findById(hireId) .orElseThrow(() -> new BizException(NOT_FOUND_JD.getCode(), NOT_FOUND_JD.getMsg())); String address = hiring.getAddress(); + System.out.println("address!!! " + address); Member member = memberRepository.findByAddress(address).orElseThrow(() -> new BizException( NOT_FOUND_MEMBER.getCode(), NOT_FOUND_MEMBER.getMsg())); try { - // File file1 = new File(String.valueOf(fileService.download(""))); - - // emailService.sendMailWithFile(member.getEmail(), "有新人投递简历", "有新人投递简历", file1); + // File file1 = new File(String.valueOf(fileService.download(""))); + // emailService.sendMailWithFile(member.getEmail(), "有新人投递简历", "有新人投递简历", file1); + emailService.sendMail(member.getEmail(), "有新人投递简历", "有新人投递简历:\n简历地址:\n "+ "https://dlh-1257682033.cos.ap-hongkong.myqcloud.com/"+ file ); } catch (Exception e) { throw new RuntimeException(e); diff --git a/src/main/java/com/dl/officialsite/login/AuthAspect.java b/src/main/java/com/dl/officialsite/login/AuthAspect.java index 41ad66b3..30f6d702 100644 --- a/src/main/java/com/dl/officialsite/login/AuthAspect.java +++ b/src/main/java/com/dl/officialsite/login/AuthAspect.java @@ -11,12 +11,14 @@ import org.aspectj.lang.annotation.Pointcut; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; import java.util.List; import java.util.stream.Collectors; -@Component +@ConditionalOnProperty(value="login.filter", + havingValue = "true") @Aspect public class AuthAspect { // @Autowired @@ -29,6 +31,8 @@ public void authPointcut() {} @Before("authPointcut() && @annotation(auth)") public void authBefore(JoinPoint joinPoint, Auth auth) throws UnauthorizedException { + + String permission = auth.value(); UserPrincipleData userPrincipleData = UserSecurityUtils.getUserLogin(); logger.info("userPrincipleData address "+ userPrincipleData.getAddress()); diff --git a/src/main/java/com/dl/officialsite/login/filter/LoginFilter.java b/src/main/java/com/dl/officialsite/login/filter/LoginFilter.java index 267288f0..c8e96ec8 100644 --- a/src/main/java/com/dl/officialsite/login/filter/LoginFilter.java +++ b/src/main/java/com/dl/officialsite/login/filter/LoginFilter.java @@ -46,12 +46,12 @@ public class LoginFilter extends OncePerRequestFilter { add("/login/check"); add("/login/check-session"); add("/login/logout"); - add("/share/usershare/all"); - add("/share/usershare/queryByShareId"); - add("/share/usershare/byUser"); - add("/share/usershare/create"); - add("/share/usershare/update"); - add("/share/usershare/delete"); + add("/share/all"); + add("/share/queryByShareId"); + add("/share/byUser"); + add("/share/create"); + add("/share/update"); + add("/share/delete"); }} ; @Override diff --git a/src/main/java/com/dl/officialsite/team/teammember/TeamMember.java b/src/main/java/com/dl/officialsite/team/teammember/TeamMember.java index 40cb4acf..d8d3cf4e 100644 --- a/src/main/java/com/dl/officialsite/team/teammember/TeamMember.java +++ b/src/main/java/com/dl/officialsite/team/teammember/TeamMember.java @@ -28,7 +28,6 @@ public class TeamMember { private Long memberId; - //todo private UserRoleEnum role; /** * 0: 已加入