feat():完善内部新增功能接口
parent
a3e17f8143
commit
d4475c3c17
|
@ -77,4 +77,8 @@ public class MyApi {
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "产品上架日期",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||
private Date productShelvesdate;
|
||||
/**
|
||||
*接口地址
|
||||
*/
|
||||
private String productAddress;
|
||||
}
|
||||
|
|
|
@ -76,7 +76,10 @@ public class Product extends BaseEntity {
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "产品上架日期",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||
private Date productShelvesdate;
|
||||
|
||||
/**
|
||||
*接口地址
|
||||
*/
|
||||
private String productAddress;
|
||||
|
||||
public static Product addProductList(ProductAddReq productAddReq){
|
||||
return Product.builder()
|
||||
|
@ -90,6 +93,7 @@ public class Product extends BaseEntity {
|
|||
.productSales(productAddReq.getProductSales())
|
||||
.productType(productAddReq.getProductType())
|
||||
.productShelvesdate(productAddReq.getProductShelvesdate())
|
||||
.productAddress(productAddReq.getProductAddress())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -106,6 +110,7 @@ public class Product extends BaseEntity {
|
|||
.productSales(productUpdReq.getProductSales())
|
||||
.productType(productUpdReq.getProductType())
|
||||
.productShelvesdate(productUpdReq.getProductShelvesdate())
|
||||
.productAddress(productUpdReq.getProductAddress())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
|
@ -56,4 +56,5 @@ public class CustomerAddReq {
|
|||
private String email;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -68,4 +68,8 @@ public class ProductAddReq {
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "产品上架日期",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||
private Date productShelvesdate;
|
||||
/**
|
||||
*接口地址
|
||||
*/
|
||||
private String productAddress;
|
||||
}
|
||||
|
|
|
@ -40,6 +40,10 @@ public class ProductListReq {
|
|||
*/
|
||||
@Schema(description = "产品状态 同数据字典-系统是否",defaultValue = "1",type = "Integer")
|
||||
private String productState;
|
||||
/**
|
||||
*接口地址
|
||||
*/
|
||||
private String productAddress;
|
||||
|
||||
@Schema(description = "创建人",defaultValue = "muyu",type = "String")
|
||||
private String createBy;
|
||||
|
|
|
@ -67,4 +67,8 @@ public class ProductUpdReq {
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "产品上架日期",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||
private Date productShelvesdate;
|
||||
/**
|
||||
*接口地址
|
||||
*/
|
||||
private String productAddress;
|
||||
}
|
||||
|
|
|
@ -49,6 +49,10 @@ public class ProductListResp {
|
|||
* 产品销量
|
||||
*/
|
||||
private Integer productSales;
|
||||
/**
|
||||
*接口地址
|
||||
*/
|
||||
private String productAddress;
|
||||
|
||||
@Schema(description = "创建人",defaultValue = "muyu",type = "String")
|
||||
private String createBy;
|
||||
|
@ -72,6 +76,7 @@ public class ProductListResp {
|
|||
.productContent(product.getProductContent())
|
||||
.productState(product.getProductState())
|
||||
.productSales(product.getProductSales())
|
||||
.productAddress(product.getProductAddress())
|
||||
.createBy(product.getCreateBy())
|
||||
.createTime(product.getCreateTime())
|
||||
.build();
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-market-common</artifactId>
|
||||
|
@ -96,6 +98,13 @@
|
|||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger 3.x/OpenAPI 3 依赖 -->
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
<version>2.0.4</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package com.muyu.cloud.market.config;
|
||||
|
||||
import org.springdoc.core.models.GroupedOpenApi;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.market.config
|
||||
* @Project:cloud-market
|
||||
* @name:SwaggerConfig
|
||||
* @Date:2024/8/25 15:10
|
||||
*/
|
||||
@Configuration
|
||||
public class SwaggerConfig {
|
||||
@Bean
|
||||
public GroupedOpenApi publicApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("spring-shop")
|
||||
.pathsToMatch("/api/**")
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -15,6 +15,7 @@
|
|||
<result property="productSales" column="product_sales"></result>
|
||||
<result property="productType" column="product_type"></result>
|
||||
<result property="productShelvesdate" column="product_shelvesdate"></result>
|
||||
<result property="productAddress" column="product_address"></result>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectmyapi">
|
||||
|
@ -28,7 +29,8 @@
|
|||
product_specification,
|
||||
product_sales,
|
||||
product_type,
|
||||
product_shelvesdate
|
||||
product_shelvesdate,
|
||||
product_address
|
||||
FROM
|
||||
myapi
|
||||
LEFT JOIN product ON myapi.product_id = product.product_id
|
||||
|
|
Loading…
Reference in New Issue