我在@RestController一个应用程序中使用s,其中所有请求都是POST请求...正如我从这篇文章中了解到的那样,你不能将各个post参数映射到单个方法参数,而是需要将所有参数包装在一个对象中然后使用它object作为用@RequestBody这样注释的方法参数
@RequestMapping(value="/requestotp",method = RequestMethod.POST)
public String requestOTP( @RequestParam(value="idNumber") String idNumber , @RequestParam(value="applicationId") String applicationId) {
return customerService.requestOTP(idNumber, applicationId);
Run Code Online (Sandbox Code Playgroud)
不适POST用于身体的要求{"idNumber":"345","applicationId":"64536"}
我的问题是,我有很多的POST要求,每个只有一个或两个参数,这将是乏味的创建所有这些对象只是为了得到里面的请求......所以有相似的地方获得请求的方式任何其他方式参数(URL参数)处理?
我开始使用spring boot,运行一个demo spring web starter项目,我通过调用http:// localhost:8080/mappings和http:// localhost:8080/health来检查弹簧执行器功能 ...它给了我"Whitelabel错误页面"...日志没有显示任何内容
该项目是一个非常简单的启动应用程序,在STS中创建,其中一个@RestController工作正常
主要课程:
@SpringBootApplication
public class DemoApplication {
public static HashMap<Long,Student> hmStudent;
public static void main(String[] args) {
//dummt code
SpringApplication.run(DemoApplication.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)
休息控制器:
import java.util.HashMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.example.demo.DemoApplication;
import com.example.demo.entities.Student;
@RestController
@RequestMapping(value="/rest/student")
class StudentService{
@RequestMapping(value="/",method = RequestMethod.GET)
public HashMap<Long,Student> getAllStudents(){
return DemoApplication.hmStudent;
}
.
.
.
.
}
Run Code Online (Sandbox Code Playgroud)
应用属性:
spring.datasource.url=jdbc:oracle:thin:@localhost:ibmwas
spring.datasource.username=u
spring.datasource.password=p
spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
Run Code Online (Sandbox Code Playgroud)
的pom.xml …
我知道之前问过这个问题,但我可能有不同的情况,我有这个表:
| PK_DATA | EVENT_TYPE | DATE |
-------------------------------------
| 123 | D | 12 DEC |
| 123 | I | 11 DEC |
| 123 | U | 10 DEC |
| 124 | D | 11 JAN |
| 124 | U | 12 JAN |
| 125 | I | 1 JAN |
-------------------------------------
Run Code Online (Sandbox Code Playgroud)
我想要一个查询给出max(DATE)分组,PK_DATE同时给出相应的EVENT_TYPE.... ie:
| 123 | D | 12 DEC |
| 124 | U | 12 …Run Code Online (Sandbox Code Playgroud) 我有一个VB3应用程序可以在Windows XP上运行并赢得7个32位版本,但不适用于win 7 64位版本.有谁能解释为什么?我知道驱动程序具有相同的行为,但这不是我的情况,它只是一个从Access数据库读取的简单应用程序.据我所知,大多数32位应用程序都支持64位架构.
据我了解,当我运行git clone,然后开始在本地存储库上添加/编辑文件时,我实际上有 2 个存储库:master并且origin/master- 后者指向远程 - ,我从什么中得到了这种直觉git fetch,它实际上得到了从remoterepo到origin/masterrepo的最新版本没有将其与本地合并master,只有当我调用时git merge这些远程更改才会合并到本地master
所以第一个问题:我理解正确吗?我在本地确实有 2 个仓库
第二个问题:如果是这种情况,那么为什么将更改推送到远程服务器是一个 2 步骤过程(git commit然后git push),如果我真的有 2 个本地存储库,我相信我将需要执行 3 个步骤:提交到本地master- 合并然后origin/master推到remote/master...现在如何只通过两个步骤完成,是否发生任何隐式操作或者我出错了?
spring ×2
32bit-64bit ×1
git ×1
group-by ×1
java ×1
ms-access ×1
oracle ×1
spring-boot ×1
spring-mvc ×1
sql ×1
vb6 ×1
windows ×1