{}表示占位符,使用方法如下:

 1 package org.pine.controller;
 2 
 3 import javax.annotation.Resource;
 4 import org.pine.service.CashAccountService;
 5 import org.slf4j.Logger;
 6 import org.slf4j.LoggerFactory;
 7 import org.springframework.stereotype.Controller;
 8 import org.springframework.web.bind.annotation.RequestMapping;
 9 import org.springframework.web.bind.annotation.ResponseBody;
10 
11 @Controller
12 @RequestMapping("/cashAccount")
13 public class CashAccountController {
14     private static Logger logger = LoggerFactory.getLogger(CashAccountController.class);
15     
16     @Resource
17     private CashAccountService cashAccountService;
18     
19     @RequestMapping("/transfer")
20     @ResponseBody
21     public String transfer(Integer from, Integer to, Double amount) {
22         try {
23             logger.info("from:{},to:{},amount:{}",from,to,amount);
24             this.cashAccountService.transfer(from, to, amount);
25             return "success";
26         } catch (Exception e) {
27             return "failure";
28         }
29 
30     }
31 
32 }

 

相关文章:

  • 2021-10-18
  • 2021-12-26
  • 2021-11-09
  • 2022-12-23
  • 2022-01-02
  • 2021-11-22
  • 2022-12-23
  • 2022-01-29
猜你喜欢
  • 2021-10-10
  • 2021-12-01
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
相关资源
相似解决方案