remove lombok, update scripts threads

This commit is contained in:
Loredana
2020-10-09 15:48:30 +03:00
parent e663f89592
commit 68f35280c3
9 changed files with 64 additions and 45 deletions
@@ -1,26 +0,0 @@
package com.baeldung.loadtesting;
import com.baeldung.loadtesting.model.Transaction;
import com.baeldung.loadtesting.repository.TransactionRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@Deprecated
public class TransactionController {
@Autowired
private TransactionRepository transactionRepository;
@PostMapping(path="/addTransaction")
public @ResponseBody
String saveTransactions(@RequestBody Transaction trnsctn){
transactionRepository.save(trnsctn);
return "Saved Transaction.";
}
@GetMapping(path="/findAll/{rewardId}")
public @ResponseBody Iterable<Transaction> getTransactions(@RequestParam Integer id){
return transactionRepository.findByCustomerRewardsId(id);
}
}
@@ -5,10 +5,7 @@ import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import lombok.Data;
@Entity
@Data
public class CustomerRewardsAccount {
@Id
@@ -19,4 +16,18 @@ public class CustomerRewardsAccount {
public Integer getCustomerId(){
return this.customerId;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public void setCustomerId(Integer customerId) {
this.customerId = customerId;
}
}
@@ -1,7 +1,5 @@
package com.baeldung.loadtesting.model;
import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
@@ -10,7 +8,6 @@ import java.util.Date;
import java.util.Calendar;
@Entity
@Data
public class Transaction {
@Id
@@ -27,4 +24,34 @@ public class Transaction {
public void setTransactionDate(Date transactionDate){
this.transactionDate = transactionDate;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getCustomerRewardsId() {
return customerRewardsId;
}
public void setCustomerRewardsId(Integer customerRewardsId) {
this.customerRewardsId = customerRewardsId;
}
public Integer getCustomerId() {
return customerId;
}
public void setCustomerId(Integer customerId) {
this.customerId = customerId;
}
public Date getTransactionDate() {
return transactionDate;
}
}