新增restful模式

This commit is contained in:
六如
2025-02-02 15:51:47 +08:00
parent 1f04edeaff
commit ddc709ede4
97 changed files with 1487 additions and 867 deletions

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.gitee.sop</groupId>
<artifactId>product-api</artifactId>
<version>5.0.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

View File

@@ -0,0 +1,12 @@
package com.gitee.sop.story.api;
import com.gitee.sop.story.api.resp.ProductResult;
/**
* @author 六如
*/
public interface ProductService {
ProductResult getById(Long id);
}

View File

@@ -0,0 +1,51 @@
package com.gitee.sop.story.api.resp;
import java.io.Serializable;
import java.util.Date;
/**
* @author 六如
*/
public class ProductResult implements Serializable {
private static final long serialVersionUID = -3743413007549072654L;
private Integer id;
private String name;
// 日期格式要用Date,暂不支持LocalDateTime
private Date addTime = new Date();
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Date getAddTime() {
return addTime;
}
public void setAddTime(Date addTime) {
this.addTime = addTime;
}
@Override
public String toString() {
return "StoryResult{" +
"id=" + id +
", name='" + name + '\'' +
", addTime=" + addTime +
'}';
}
}