Simplify annotation usage (#1729)

BAEL-742
This commit is contained in:
Luís Soares 2017-04-25 13:36:21 +01:00 committed by KevinGilmore
parent 3751e27288
commit 129c751cb4
2 changed files with 4 additions and 9 deletions

View File

@ -8,8 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import static org.springframework.web.bind.annotation.RequestMethod.POST;
import org.springframework.web.bind.annotation.PostMapping;
@Log
@Controller
@ -18,7 +17,7 @@ public class ChargeController {
@Autowired
StripeService paymentsService;
@RequestMapping(value = "/charge", method = POST)
@PostMapping("/charge")
public String charge(ChargeRequest chargeRequest, Model model) throws StripeException {
chargeRequest.setDescription("Example charge");
chargeRequest.setCurrency(Currency.EUR);

View File

@ -1,12 +1,8 @@
package com.baeldung.stripe;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.Data;
@Getter
@Setter
@ToString(includeFieldNames = false)
@Data
public class ChargeRequest {
public enum Currency {