1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- package com.yihu.client.controller;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.jdbc.core.JdbcTemplate;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.*;
- import javax.websocket.server.PathParam;
- /**
- * Created by chenweida on 2018/5/23 0023.
- */
- @RestController
- @RequestMapping("demo")
- public class DemoController {
- @Autowired
- private JdbcTemplate jdbcTemplate;
- @RequestMapping(value = "/testSQL", method = RequestMethod.GET)
- public String loginfoGET(
- String sql
- ) {
- jdbcTemplate.queryForList(sql);
- jdbcTemplate.queryForList(sql);
- jdbcTemplate.queryForList(sql);
- return "成功";
- }
- @RequestMapping(value = "/testSQL", method = RequestMethod.DELETE)
- public String loginfoDELETE(
- String sql
- ) {
- jdbcTemplate.queryForList(sql);
- jdbcTemplate.queryForList(sql);
- jdbcTemplate.queryForList(sql);
- return "成功";
- }
- @RequestMapping(value = "/testSQL", method = RequestMethod.PUT)
- public String loginfoPUT(
- String sql
- ) {
- jdbcTemplate.queryForList(sql);
- jdbcTemplate.queryForList(sql);
- jdbcTemplate.queryForList(sql);
- return "成功";
- }
- @RequestMapping(value = "/testSQL", method = RequestMethod.POST)
- public String loginfoPOST(
- String sql
- ) {
- jdbcTemplate.queryForList(sql);
- jdbcTemplate.queryForList(sql);
- jdbcTemplate.queryForList(sql);
- return "成功";
- }
- @RequestMapping(value = "/testSQL/{value}", method = RequestMethod.GET)
- public String loginfoValue(
- @PathVariable(value = "value") String value
- ) {
- jdbcTemplate.queryForList(value);
- jdbcTemplate.queryForList(value);
- jdbcTemplate.queryForList(value);
- return "成功";
- }
- }
|