Skip to content

Commit

Permalink
fix the apply
Browse files Browse the repository at this point in the history
  • Loading branch information
liberhe committed Dec 16, 2023
1 parent a5f1a24 commit 3fae7aa
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class Constants {
* 1: 申请中
* 2: 已退出
*/
public static final int APPROVE_TEAM = 0;
public static final int IN_TEAM = 0;

/**
* 0: 同意加入
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public BaseResponse all(@RequestParam String address,@RequestParam List<String>
}

/**
* 按照创建者查看简历
* 按照创建者查看招聘
*/
@GetMapping("/address")
public BaseResponse allByAddress(@RequestParam String address,
Expand Down
14 changes: 10 additions & 4 deletions src/main/java/com/dl/officialsite/hiring/HireService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> {
Expand All @@ -211,6 +213,8 @@ public Page<HiringVO> selectByAddress(String address, Pageable pageable) {
return equal;
};
Page<Hiring> page = hireRepository.findAll(spec, pageable);

//findIDS
page.getContent().forEach(hiring -> {
List<HiringSkillVO> mainSkills = hiringSkillRepository.findByHiringId(hiring.getId())
.stream()
Expand Down Expand Up @@ -240,17 +244,19 @@ public Page<HiringVO> 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);
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/dl/officialsite/login/AuthAspect.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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());
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/dl/officialsite/login/filter/LoginFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public class TeamMember {

private Long memberId;

//todo
private UserRoleEnum role;
/**
* 0: 已加入
Expand Down

0 comments on commit 3fae7aa

Please sign in to comment.