编写后台服务代码
编写后台服务代码
被调用方后台代码编写
调用方前台代码编写
引入前台Jasmine测试框架
1、创建Spring Boot工程




2、创建Controller类提供服务

package com.ajax.server.controller;
import com.ajax.server.bean.ResultBean;
importorg.springframework.web.bind.annotation.GetMapping;
importorg.springframework.web.bind.annotation.RequestMapping;
importorg.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/test")
public class AjaxController {
@GetMapping("/get1")
public ResultBean get1(){
System.out.println("AjaxController.get1()");
return new ResultBean("get1OK");
}
}
3、创建返回值对象Bean

package com.ajax.server.bean;
public class ResultBean {
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
private Object data;
public ResultBean(Object data) {
this.data = data;
}
}
4、调试服务是否正常
