feat():完善内部新增功能接口

dev2
WeiRan 2024-08-25 18:51:22 +08:00
parent a3e17f8143
commit d4475c3c17
10 changed files with 63 additions and 2 deletions

View File

@ -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;
}

View File

@ -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();
}

View File

@ -56,4 +56,5 @@ public class CustomerAddReq {
private String email;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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();

View File

@ -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>

View File

@ -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;
/**
* @Authorweiran
* @Packagecom.muyu.cloud.market.config
* @Projectcloud-market
* @nameSwaggerConfig
* @Date2024/8/25 15:10
*/
@Configuration
public class SwaggerConfig {
@Bean
public GroupedOpenApi publicApi() {
return GroupedOpenApi.builder()
.group("spring-shop")
.pathsToMatch("/api/**")
.build();
}
}

View File

@ -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