Skip to content

Commit

Permalink
add bounty module
Browse files Browse the repository at this point in the history
  • Loading branch information
liberhe committed Jan 26, 2024
1 parent 50c49dc commit 5bf643c
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 14 deletions.
17 changes: 11 additions & 6 deletions src/main/java/com/dl/officialsite/bounty/Bounty.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.dl.officialsite.bounty;


import com.dl.officialsite.member.Member;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
Expand All @@ -25,25 +26,29 @@ public class Bounty {
/**
* 创建岗位人地址
*/
private String creator;
@Embedded
private Member member;

private String title;

@Column(columnDefinition = "TEXT")
private String description;

private String Salary;
private String salary;
// 线性释放, 指数释放
private int paymentType;

private Long projectLength;
private String projectLength;

private String techTag;

/**
* 0:jd 招聘中
* 1: 已匹配
* 1:jd 删除
* 2:jd 过期
* 设置默认值,默认值为招聘中
* 2:jd 已完成结算
* 3:jd 已过期
* 4:jd 已退款
* 5: 已删除
*/
private int status;

Expand Down
30 changes: 30 additions & 0 deletions src/main/java/com/dl/officialsite/bounty/BountyController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.dl.officialsite.bounty;


import com.dl.officialsite.member.Member;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.stereotype.Controller;

import javax.persistence.*;
import java.util.Date;



@Controller
public class BountyController {


//1 bounty 创建/更新/查询/删除(置status)


// 2 bounty申请和匹配





}
1 change: 1 addition & 0 deletions src/main/java/com/dl/officialsite/member/Member.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
@EntityListeners(AuditingEntityListener.class)
@Entity
@Embeddable
@DynamicUpdate
@Table(name = "member", schema = "dl", uniqueConstraints = {
@UniqueConstraint(name = "address", columnNames = {"address"}),
Expand Down
24 changes: 16 additions & 8 deletions src/main/java/com/dl/officialsite/redpacket/RedPacketService.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,22 @@ public void updateRedpacketStatus() throws IOException {
JsonObject data = jsonObject.getAsJsonObject("data");
JsonArray redpacketsArray = data.getAsJsonArray("redpackets");
JsonArray lastupdatesArray = data.getAsJsonArray("lastupdates");
// String lastTimestampFromGraph = lastupdatesArray.get(0).getAsJsonObject().get("lastupdateTimestamp").getAsString();

// open in prod todo
// if(Objects.equals(lastTimestampFromGraph, lastUpdateTimestamp)){
// return;
// } else {
// lastUpdateTimestamp = lastTimestampFromGraph;
// }
log.info("lastupdatesArray"+ lastupdatesArray.toString());


// open in prod todo
if(lastupdatesArray.size() != 0){
String lastTimestampFromGraph = lastupdatesArray.get(0).getAsJsonObject().get("lastupdateTimestamp").getAsString();

if(Objects.equals(lastTimestampFromGraph, lastUpdateTimestamp)){
return;
} else {
lastUpdateTimestamp = lastTimestampFromGraph;
}
}





List<RedPacket> redPacketList = redPacketRepository.findUnfinishedRedpacketByChainId(chainId);
Expand Down

0 comments on commit 5bf643c

Please sign in to comment.