Restful API
2021-05-15 23:29
标签:Pageable var api java pac span erb pre pat Restful API 标签:Pageable var api java pac span erb pre pat 原文地址:https://www.cnblogs.com/mingforyou/p/14649468.htmlpackage com.example.query;
import java.io.Serializable;
public class UserQuery implements Serializable {
private Integer id;
private String username;
private String name;
private String phone;
private String telepone;
private String address;
private String email;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getTelepone() {
return telepone;
}
public void setTelepone(String telepone) {
this.telepone = telepone;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public String toString() {
return "UserQuery{" +
"id=" + id +
", username=‘" + username + ‘\‘‘ +
", name=‘" + name + ‘\‘‘ +
", phone=‘" + phone + ‘\‘‘ +
", telepone=‘" + telepone + ‘\‘‘ +
", address=‘" + address + ‘\‘‘ +
", email=‘" + email + ‘\‘‘ +
‘}‘;
}
}
package com.example.controller;
import com.example.pojo.User;
import com.example.query.UserQuery;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;
import java.util.List;
//@Controller
@RestController
@Api(tags = "用户数据接口")
@RequestMapping("/user")
public class UserController {
// @RequestMapping(value = "/user/username", method = RequestMethod.GET)
// @GetMapping("/user/username")
@GetMapping("/username")
// public List
下一篇:Windows端口开启关闭