wip: 商品重构临时提交

This commit is contained in:
Ray.Hao 2024-06-17 08:25:01 +08:00
parent 3aca0f3b31
commit 3af68bcc7e
56 changed files with 36 additions and 28 deletions

View File

@ -68,9 +68,9 @@ youlai-mall
├── sql # SQL脚本 ├── sql # SQL脚本
├── mysql5 # MySQL5脚本 ├── mysql5 # MySQL5脚本
├── mysql8 # MySQL8脚本 ├── mysql8 # MySQL8脚本
├── mall-marketing # 营销服务(Sales Management Service) ├── mall-sales # 营销服务(Sales Management Service)
├── sms-api # 营销服务-Feign客户端 ├── sms-api # 营销服务-Feign客户端
├── sms-boot # 营销服务-启动应用 ├── sales-boot # 营销服务-启动应用
├── mall-product # 商品服务(Product Management Service) ├── mall-product # 商品服务(Product Management Service)
├── product-api # 商品服务-Feign客户端 ├── product-api # 商品服务-Feign客户端
├── product-boot # 商品服务-启动应用 ├── product-boot # 商品服务-启动应用

View File

@ -52,7 +52,16 @@ public class AttributeController {
return Result.judge(result); return Result.judge(result);
} }
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 2)
@Operation(summary = "获取属性组表单")
@GetMapping("/group/form")
public Result saveAttributeGroup(@RequestBody @Valid AttrGroupForm formData) {
boolean result = attrGroupService.saveAttributeGroup(formData);
return Result.judge(result);
}
@ApiOperationSupport(order = 4)
@Operation(summary = "修改属性组") @Operation(summary = "修改属性组")
@PutMapping(value = "/group/{id}") @PutMapping(value = "/group/{id}")
public Result updateAttributeGroup(@Parameter(description = "属性组ID") @PathVariable Long id, public Result updateAttributeGroup(@Parameter(description = "属性组ID") @PathVariable Long id,
@ -61,7 +70,7 @@ public class AttributeController {
return Result.judge(result); return Result.judge(result);
} }
@ApiOperationSupport(order = 4) @ApiOperationSupport(order = 5)
@Operation(summary = "删除属性组") @Operation(summary = "删除属性组")
@DeleteMapping("/group/{ids}") @DeleteMapping("/group/{ids}")
public Result deleteAttributeGroups( public Result deleteAttributeGroups(
@ -71,7 +80,7 @@ public class AttributeController {
return Result.success(); return Result.success();
} }
@ApiOperationSupport(order = 5) @ApiOperationSupport(order = 6)
@Operation(summary = "新增属性") @Operation(summary = "新增属性")
@PostMapping @PostMapping
public Result saveAttribute(@RequestBody @Valid AttrForm formData) { public Result saveAttribute(@RequestBody @Valid AttrForm formData) {
@ -79,7 +88,7 @@ public class AttributeController {
return Result.judge(result); return Result.judge(result);
} }
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 7)
@Operation(summary = "属性表单数据") @Operation(summary = "属性表单数据")
@GetMapping("/{id}/form") @GetMapping("/{id}/form")
public Result<AttrForm> getAttributeForm( public Result<AttrForm> getAttributeForm(
@ -89,7 +98,7 @@ public class AttributeController {
return Result.success(formData); return Result.success(formData);
} }
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = )
@Operation(summary = "修改属性") @Operation(summary = "修改属性")
@PutMapping(value = "/{id}") @PutMapping(value = "/{id}")
public Result updateAttribute(@Parameter(description = "属性ID") @PathVariable Long id, public Result updateAttribute(@Parameter(description = "属性ID") @PathVariable Long id,
@ -98,7 +107,7 @@ public class AttributeController {
return Result.judge(result); return Result.judge(result);
} }
@ApiOperationSupport(order = 8) @ApiOperationSupport(order = 9)
@Operation(summary = "删除属性") @Operation(summary = "删除属性")
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public Result deleteAttributes( public Result deleteAttributes(

View File

@ -11,7 +11,7 @@ import com.youlai.mall.product.model.bo.SpecBO;
import org.mapstruct.Mapping; import org.mapstruct.Mapping;
/** /**
* 转换器 * 规格转换器
* *
* @author Ray Hao * @author Ray Hao
* @since 2024-06-13 * @since 2024-06-13
@ -20,7 +20,7 @@ import org.mapstruct.Mapping;
public interface SpecConverter { public interface SpecConverter {
@Mapping(target = "inputTypeLabel", @Mapping(target = "inputTypeLabel",
expression = "java(bo.getInputType()!=null ? bo.getInputType().getLabel(): Strings.EMPTY)" expression = "java(bo.getInputType()!=null ? bo.getInputType().getLabel(): \"\")"
) )
SpecPageVO toPageVo(SpecBO bo); SpecPageVO toPageVo(SpecBO bo);
@ -28,6 +28,5 @@ public interface SpecConverter {
SpecForm toForm(Spec entity); SpecForm toForm(Spec entity);
@InheritInverseConfiguration(name = "toForm") Spec toEntity(SpecForm formData);
Spec toEntity(SpecForm entity);
} }

View File

@ -9,12 +9,12 @@
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>mall-marketing</artifactId> <artifactId>mall-sales</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<modules> <modules>
<module>marketing-api</module> <module>sales-api</module>
<module>marketing-boot</module> <module>sales-boot</module>
</modules> </modules>
</project> </project>

View File

@ -3,13 +3,13 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<artifactId>mall-marketing</artifactId> <artifactId>mall-sales</artifactId>
<groupId>com.youlai</groupId> <groupId>com.youlai</groupId>
<version>3.2.1</version> <version>3.2.1</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>marketing-api</artifactId> <artifactId>sales-api</artifactId>
<dependencies> <dependencies>

View File

@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam;
* @author huawei * @author huawei
* @since 2021/3/17 * @since 2021/3/17
*/ */
@FeignClient(value = "mall-marketing") @FeignClient(value = "mall-sales")
public interface CouponRecordFeignClient { public interface CouponRecordFeignClient {
@GetMapping("/api.app/v1/coupon_record/list") @GetMapping("/api.app/v1/coupon_record/list")

View File

@ -14,7 +14,7 @@ RUN echo "https://mirrors.ustc.edu.cn/alpine/v3.7/main/" > /etc/apk/repositories
VOLUME /tmp VOLUME /tmp
# 复制主机文件至镜像内,复制的目录需放置在 Dockerfile 文件同级目录下 # 复制主机文件至镜像内,复制的目录需放置在 Dockerfile 文件同级目录下
ADD target/sms-boot.jar app.jar ADD target/sales-boot.jar app.jar
# 容器启动执行命令 # 容器启动执行命令
CMD java \ CMD java \

View File

@ -3,13 +3,13 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<artifactId>mall-marketing</artifactId> <artifactId>mall-sales</artifactId>
<groupId>com.youlai</groupId> <groupId>com.youlai</groupId>
<version>3.2.1</version> <version>3.2.1</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>marketing-boot</artifactId> <artifactId>sales-boot</artifactId>
<properties> <properties>
<service.port>8804</service.port> <service.port>8804</service.port>
@ -55,7 +55,7 @@
<dependency> <dependency>
<groupId>com.youlai</groupId> <groupId>com.youlai</groupId>
<artifactId>marketing-api</artifactId> <artifactId>sales-api</artifactId>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -16,9 +16,9 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@EnableDiscoveryClient @EnableDiscoveryClient
@EnableFeignClients @EnableFeignClients
@EnableScheduling @EnableScheduling
public class MarketingApplication { public class SalesApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(MarketingApplication.class, args); SpringApplication.run(SalesApplication.class, args);
} }
} }

View File

@ -1,6 +1,6 @@
spring: spring:
application: application:
name: mall-marketing name: mall-sales
profiles: profiles:
active: dev active: dev

View File

@ -9,7 +9,7 @@ import org.springframework.boot.test.context.SpringBootTest;
* @since 2021/7/3 * @since 2021/7/3
*/ */
@SpringBootTest @SpringBootTest
public class MarketingApplicationTest { public class SalesApplicationTest {
@Test @Test
public void contestLoad(){ public void contestLoad(){

View File

@ -17,7 +17,7 @@
<module>youlai-auth</module> <module>youlai-auth</module>
<!-- 商城模块 --> <!-- 商城模块 -->
<module>mall-marketing</module> <module>mall-sales</module>
<module>mall-member</module> <module>mall-member</module>
<module>mall-product</module> <module>mall-product</module>
<module>mall-order</module> <module>mall-order</module>
@ -244,7 +244,7 @@
<dependency> <dependency>
<groupId>com.youlai</groupId> <groupId>com.youlai</groupId>
<artifactId>marketing-api</artifactId> <artifactId>sales-api</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>