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

View File

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