为什么我的spring boot设置不生成端点?

时间:2019-06-16 05:54:51

标签: java spring spring-boot

我尝试使用Vue.js作为客户端并将Spring Boot作为资源服务器来构建完整的CRUD Web应用程序。 我提到这个网站 https://developer.okta.com/blog/2018/11/20/build-crud-spring-and-vue

我想输出将是

HTTP/1.1 200
Content-Type: application/hal+json;charset=UTF-8
Date: Fri, 09 Nov 2018 03:44:37 GMT
Transfer-Encoding: chunked
{
  "_links": {
    "profile": {
      "href": "http://localhost:9000/profile"
    },
    "todos": {
      "href": "http://localhost:9000/todos{?page,size,sort}",
      "templated": true
    }
  }
}

但是我的输出是

Yamatos-MBP:springbootvue yamatokataoka$ http GET http://localhost:9000
HTTP/1.1 200 
Content-Type: application/hal+json;charset=UTF-8
Date: Sun, 16 Jun 2019 05:36:16 GMT
Transfer-Encoding: chunked

{
    "_links": {
        "profile": {
            "href": "http://localhost:9000/profile"
        }
    }
}

为什么我的Todo.java不生成todos端点?

Todo.java

package com.okta.springbootvue;

import lombok.*;

import javax.persistence.Id;
import javax.persistence.GeneratedValue;
import javax.persistence.Entity;

@Entity
@Data
@NoArgsConstructor

public class Todo {

    @Id @GeneratedValue
    private Long id;

    @NonNull
    private String title;

    private Boolean completed = false;
}

0 个答案:

没有答案