提交 69380224 编写于 作者: Y Yiming Liu

Remove lombok

上级 d1771497
package com.ctrip.apollo.portal.controller;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.web.PageableDefault;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
......@@ -19,14 +21,17 @@ public class AppController {
private AppRepository appRepository;
@RequestMapping("")
public Page<App> list() {
Pageable pageable = new PageRequest(0, 10);
public Page<App> list(@PageableDefault(size = 50) Pageable pageable) {
return appRepository.findAll(pageable);
}
@RequestMapping(value = "", method = RequestMethod.POST)
public App create() {
App ramdomApp = new App();
ramdomApp.setId(String.valueOf(System.currentTimeMillis()));
ramdomApp.setName("new app " + System.currentTimeMillis());
ramdomApp.setOwner("owner " + System.currentTimeMillis());
ramdomApp.setCreateTimestamp(new Date());
return appRepository.save(ramdomApp);
}
}
......@@ -7,10 +7,7 @@ import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import lombok.Data;
@Entity
@Data
public class App implements Serializable {
/**
......@@ -38,4 +35,60 @@ public class App implements Serializable {
@Column
private Date lastUpdatedTimestamp;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getOwner() {
return owner;
}
public void setOwner(String owner) {
this.owner = owner;
}
public String getOwnerPhone() {
return ownerPhone;
}
public void setOwnerPhone(String ownerPhone) {
this.ownerPhone = ownerPhone;
}
public String getOwnerMail() {
return ownerMail;
}
public void setOwnerMail(String ownerMail) {
this.ownerMail = ownerMail;
}
public Date getCreateTimestamp() {
return createTimestamp;
}
public void setCreateTimestamp(Date createTimestamp) {
this.createTimestamp = createTimestamp;
}
public Date getLastUpdatedTimestamp() {
return lastUpdatedTimestamp;
}
public void setLastUpdatedTimestamp(Date lastUpdatedTimestamp) {
this.lastUpdatedTimestamp = lastUpdatedTimestamp;
}
}
......@@ -15,13 +15,6 @@
<module>apollo-portal</module>
<module>apollo-assembly</module>
</modules>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
......@@ -47,11 +40,6 @@
<artifactId>mysql-connector-java</artifactId>
<version>5.1.38</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.8</version>
</dependency>
<!--for test -->
<dependency>
<groupId>com.h2database</groupId>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册