mirror of
https://gitee.com/gz-yami/mall4j.git
synced 2025-12-25 23:56:20 +08:00
代码规约
This commit is contained in:
parent
b91119e9fa
commit
e4e36571c5
@ -15,6 +15,9 @@ import lombok.AllArgsConstructor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Configuration
|
||||
@AllArgsConstructor
|
||||
public class AdminBeanConfig {
|
||||
|
||||
@ -16,26 +16,27 @@ import io.swagger.v3.oas.models.info.License;
|
||||
import org.springdoc.core.GroupedOpenApi;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
|
||||
/**
|
||||
* Swagger文档,只有在测试环境才会使用
|
||||
* @author LGH
|
||||
*/
|
||||
//@Profile("dev")
|
||||
@Profile("dev")
|
||||
@Configuration
|
||||
public class SwaggerConfiguration {
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi baseRestApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("基础版")
|
||||
.packagesToScan("com.yami.shop.api")
|
||||
.group("接口文档")
|
||||
.packagesToScan("com.yami")
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public OpenAPI springShopOpenAPI() {
|
||||
public OpenAPI springShopOpenApi() {
|
||||
return new OpenAPI()
|
||||
.info(new Info().title("Mall4j接口文档")
|
||||
.description("Mall4j接口文档,openapi3.0 接口,用于前端对接")
|
||||
|
||||
@ -44,8 +44,8 @@ public class AttributeController {
|
||||
public ResponseEntity<IPage<ProdProp>> page(ProdProp prodProp,PageParam<ProdProp> page){
|
||||
prodProp.setRule(ProdPropRule.ATTRIBUTE.value());
|
||||
prodProp.setShopId(SecurityUtils.getSysUser().getShopId());
|
||||
IPage<ProdProp> prodPropIPage = prodPropService.pagePropAndValue(prodProp,page);
|
||||
return ResponseEntity.ok(prodPropIPage);
|
||||
IPage<ProdProp> prodPropPage = prodPropService.pagePropAndValue(prodProp,page);
|
||||
return ResponseEntity.ok(prodPropPage);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -75,7 +75,7 @@ public class CategoryController {
|
||||
if(categoryName != null){
|
||||
throw new YamiShopBindException("类目名称已存在!");
|
||||
}
|
||||
categoryService.saveCategroy(category);
|
||||
categoryService.saveCategory(category);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@ -95,16 +95,16 @@ public class CategoryController {
|
||||
if(categoryName != null){
|
||||
throw new YamiShopBindException("类目名称已存在!");
|
||||
}
|
||||
Category categoryDB = categoryService.getById(category.getCategoryId());
|
||||
Category categoryDb = categoryService.getById(category.getCategoryId());
|
||||
// 如果从下线改成正常,则需要判断上级的状态
|
||||
if (Objects.equals(categoryDB.getStatus(),0) && Objects.equals(category.getStatus(),1) && !Objects.equals(category.getParentId(),0L)){
|
||||
if (Objects.equals(categoryDb.getStatus(),0) && Objects.equals(category.getStatus(),1) && !Objects.equals(category.getParentId(),0L)){
|
||||
Category parentCategory = categoryService.getOne(new LambdaQueryWrapper<Category>().eq(Category::getCategoryId, category.getParentId()));
|
||||
if(Objects.isNull(parentCategory) || Objects.equals(parentCategory.getStatus(),0)){
|
||||
// 修改失败,上级分类不存在或者不为正常状态
|
||||
throw new YamiShopBindException("修改失败,上级分类不存在或者不为正常状态");
|
||||
}
|
||||
}
|
||||
categoryService.updateCategroy(category);
|
||||
categoryService.updateCategory(category);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ public class CategoryController {
|
||||
if (categoryService.count(new LambdaQueryWrapper<Category>().eq(Category::getParentId,categoryId)) >0) {
|
||||
return ResponseEntity.badRequest().body("请删除子分类,再删除该分类");
|
||||
}
|
||||
categoryService.deleteCategroy(categoryId);
|
||||
categoryService.deleteCategory(categoryId);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@ public class HotSearchController {
|
||||
hotSearch.setShopId(SecurityUtils.getSysUser().getShopId());
|
||||
hotSearchService.save(hotSearch);
|
||||
//清除缓存
|
||||
hotSearchService.removeHotSearchDtoCacheByshopId(SecurityUtils.getSysUser().getShopId());
|
||||
hotSearchService.removeHotSearchDtoCacheByShopId(SecurityUtils.getSysUser().getShopId());
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ public class HotSearchController {
|
||||
public ResponseEntity<Void> update(@RequestBody @Valid HotSearch hotSearch){
|
||||
hotSearchService.updateById(hotSearch);
|
||||
//清除缓存
|
||||
hotSearchService.removeHotSearchDtoCacheByshopId(SecurityUtils.getSysUser().getShopId());
|
||||
hotSearchService.removeHotSearchDtoCacheByShopId(SecurityUtils.getSysUser().getShopId());
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ public class HotSearchController {
|
||||
public ResponseEntity<Void> delete(@RequestBody List<Long> ids){
|
||||
hotSearchService.removeByIds(ids);
|
||||
//清除缓存
|
||||
hotSearchService.removeHotSearchDtoCacheByshopId(SecurityUtils.getSysUser().getShopId());
|
||||
hotSearchService.removeHotSearchDtoCacheByShopId(SecurityUtils.getSysUser().getShopId());
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ public class IndexImgController {
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('admin:indexImg:delete')")
|
||||
public ResponseEntity<Void> delete(@RequestBody Long[] ids) {
|
||||
indexImgService.deleteIndexImgsByIds(ids);
|
||||
indexImgService.deleteIndexImgByIds(ids);
|
||||
indexImgService.removeIndexImgCache();
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@ -47,11 +47,11 @@ public class NoticeController {
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public ResponseEntity<IPage<Notice>> getNoticePage(PageParam<Notice> page, Notice notice) {
|
||||
IPage<Notice> noticeIPage = noticeService.page(page, new LambdaQueryWrapper<Notice>()
|
||||
IPage<Notice> noticePage = noticeService.page(page, new LambdaQueryWrapper<Notice>()
|
||||
.eq(notice.getStatus() != null, Notice::getStatus, notice.getStatus())
|
||||
.eq(notice.getIsTop()!=null,Notice::getIsTop,notice.getIsTop())
|
||||
.like(notice.getTitle() != null, Notice::getTitle, notice.getTitle()).orderByDesc(Notice::getUpdateTime));
|
||||
return ResponseEntity.ok(noticeIPage);
|
||||
return ResponseEntity.ok(noticePage);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -75,8 +75,8 @@ public class OrderController {
|
||||
public ResponseEntity<IPage<Order>> page(OrderParam orderParam,PageParam<Order> page) {
|
||||
Long shopId = SecurityUtils.getSysUser().getShopId();
|
||||
orderParam.setShopId(shopId);
|
||||
IPage<Order> orderIPage = orderService.pageOrdersDetialByOrderParam(page, orderParam);
|
||||
return ResponseEntity.ok(orderIPage);
|
||||
IPage<Order> orderPage = orderService.pageOrdersDetailByOrderParam(page, orderParam);
|
||||
return ResponseEntity.ok(orderPage);
|
||||
|
||||
|
||||
}
|
||||
@ -145,7 +145,7 @@ public class OrderController {
|
||||
Long shopId = SecurityUtils.getSysUser().getShopId();
|
||||
order.setShopId(shopId);
|
||||
order.setStatus(OrderStatus.PADYED.value());
|
||||
List<Order> orders = orderService.listOrdersDetialByOrder(order, startTime, endTime);
|
||||
List<Order> orders = orderService.listOrdersDetailByOrder(order, startTime, endTime);
|
||||
|
||||
//通过工具类创建writer
|
||||
ExcelWriter writer = ExcelUtil.getWriter();
|
||||
@ -199,7 +199,7 @@ public class OrderController {
|
||||
Long shopId = SecurityUtils.getSysUser().getShopId();
|
||||
order.setShopId(shopId);
|
||||
order.setIsPayed(1);
|
||||
List<Order> orders = orderService.listOrdersDetialByOrder(order, startTime, endTime);
|
||||
List<Order> orders = orderService.listOrdersDetailByOrder(order, startTime, endTime);
|
||||
|
||||
//通过工具类创建writer
|
||||
ExcelWriter writer = ExcelUtil.getWriter();
|
||||
|
||||
@ -51,12 +51,12 @@ public class ProdTagController {
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public ResponseEntity<IPage<ProdTag>> getProdTagPage(PageParam<ProdTag> page, ProdTag prodTag) {
|
||||
IPage<ProdTag> tagIPage = prodTagService.page(
|
||||
IPage<ProdTag> tagPage = prodTagService.page(
|
||||
page, new LambdaQueryWrapper<ProdTag>()
|
||||
.eq(prodTag.getStatus() != null, ProdTag::getStatus, prodTag.getStatus())
|
||||
.like(prodTag.getTitle() != null, ProdTag::getTitle, prodTag.getTitle())
|
||||
.orderByDesc(ProdTag::getSeq, ProdTag::getCreateTime));
|
||||
return ResponseEntity.ok(tagIPage);
|
||||
return ResponseEntity.ok(tagPage);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -51,7 +51,6 @@ public class ShopDetailController {
|
||||
* 修改分销开关
|
||||
*/
|
||||
@PutMapping("/isDistribution")
|
||||
//@PreAuthorize("@pms.hasPermission('shop:shopDetail:update')")
|
||||
public ResponseEntity<Void> updateIsDistribution(@RequestParam Integer isDistribution){
|
||||
ShopDetail shopDetail=new ShopDetail();
|
||||
shopDetail.setShopId(SecurityUtils.getSysUser().getShopId());
|
||||
|
||||
@ -10,32 +10,20 @@
|
||||
|
||||
package com.yami.shop.admin.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.emoji.EmojiUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yami.shop.bean.model.User;
|
||||
import com.yami.shop.common.util.PageParam;
|
||||
import com.yami.shop.service.UserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
import com.yami.shop.common.util.PageParam;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yami.shop.bean.model.User;
|
||||
import com.yami.shop.service.UserService;
|
||||
|
||||
import cn.hutool.extra.emoji.EmojiUtil;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
@ -54,13 +42,13 @@ public class UserController {
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('admin:user:page')")
|
||||
public ResponseEntity<IPage<User>> page(User user,PageParam<User> page) {
|
||||
IPage<User> userIPage = userService.page(page, new LambdaQueryWrapper<User>()
|
||||
IPage<User> userPage = userService.page(page, new LambdaQueryWrapper<User>()
|
||||
.like(StrUtil.isNotBlank(user.getNickName()), User::getNickName, user.getNickName())
|
||||
.eq(user.getStatus() != null, User::getStatus, user.getStatus()));
|
||||
for (User userResult : userIPage.getRecords()) {
|
||||
for (User userResult : userPage.getRecords()) {
|
||||
userResult.setNickName(EmojiUtil.toUnicode(userResult.getNickName() == null ? "" : userResult.getNickName()));
|
||||
}
|
||||
return ResponseEntity.ok(userIPage);
|
||||
return ResponseEntity.ok(userPage);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -15,6 +15,9 @@ import lombok.AllArgsConstructor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Configuration
|
||||
@AllArgsConstructor
|
||||
public class ApiBeanConfig {
|
||||
|
||||
@ -16,12 +16,13 @@ import io.swagger.v3.oas.models.info.License;
|
||||
import org.springdoc.core.GroupedOpenApi;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
|
||||
/**
|
||||
* Swagger文档,只有在测试环境才会使用
|
||||
* @author LGH
|
||||
*/
|
||||
//@Profile("dev")
|
||||
@Profile("dev")
|
||||
@Configuration
|
||||
public class SwaggerConfiguration {
|
||||
|
||||
@ -29,7 +30,7 @@ public class SwaggerConfiguration {
|
||||
public GroupedOpenApi createRestApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("接口文档")
|
||||
.packagesToScan("com.yami")
|
||||
.packagesToScan("com.yami.shop.api")
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@ -30,7 +30,9 @@ import javax.validation.Valid;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/p/address")
|
||||
@Tag(name = "地址接口")
|
||||
|
||||
@ -28,6 +28,9 @@ import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import ma.glasnost.orika.MapperFacade;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/category")
|
||||
@Tag(name = "分类接口")
|
||||
|
||||
@ -28,6 +28,9 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/delivery")
|
||||
@Tag(name = "查看物流接口")
|
||||
|
||||
@ -13,18 +13,19 @@ package com.yami.shop.api.controller;
|
||||
import com.yami.shop.bean.app.dto.IndexImgDto;
|
||||
import com.yami.shop.bean.model.IndexImg;
|
||||
import com.yami.shop.service.IndexImgService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import ma.glasnost.orika.MapperFacade;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@RestController
|
||||
@Tag(name = "首页轮播图接口")
|
||||
public class IndexImgController {
|
||||
@ -40,7 +41,7 @@ public class IndexImgController {
|
||||
@GetMapping("/indexImgs")
|
||||
@Operation(summary = "首页轮播图" , description = "获取首页轮播图列表信息")
|
||||
public ResponseEntity<List<IndexImgDto>> indexImgs() {
|
||||
List<IndexImg> indexImgList = indexImgService.listIndexImgs();
|
||||
List<IndexImg> indexImgList = indexImgService.listIndexImg();
|
||||
List<IndexImgDto> indexImgDtos = mapperFacade.mapAsList(indexImgList, IndexImgDto.class);
|
||||
return ResponseEntity.ok(indexImgDtos);
|
||||
}
|
||||
|
||||
@ -35,6 +35,9 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/p/myOrder")
|
||||
@Tag(name = "我的订单接口")
|
||||
|
||||
@ -29,6 +29,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/shop/notice")
|
||||
@Tag(name = "公告管理接口")
|
||||
|
||||
@ -38,6 +38,9 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/p/order")
|
||||
@Tag(name = "订单接口")
|
||||
@ -130,7 +133,7 @@ public class OrderController {
|
||||
shopCartOrderMergerDto.setShopCartOrders(shopCartOrders);
|
||||
shopCartOrderMergerDto.setOrderReduce(orderReduce);
|
||||
|
||||
orderService.putConfirmOrderCache(userId,shopCartOrderMergerDto);
|
||||
shopCartOrderMergerDto = orderService.putConfirmOrderCache(userId, shopCartOrderMergerDto);
|
||||
|
||||
return ResponseEntity.ok(shopCartOrderMergerDto);
|
||||
}
|
||||
|
||||
@ -26,6 +26,9 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/p/order")
|
||||
@Tag(name = "订单接口")
|
||||
|
||||
@ -15,6 +15,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Hidden
|
||||
@RestController
|
||||
@RequestMapping("/notice/pay")
|
||||
|
||||
@ -29,6 +29,9 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/prodComm")
|
||||
@Tag(name = "评论接口")
|
||||
|
||||
@ -101,7 +101,7 @@ public class ProdController {
|
||||
@Parameters({
|
||||
})
|
||||
public ResponseEntity<IPage<ProductDto>> lastedProdPage(PageParam<ProductDto> page) {
|
||||
IPage<ProductDto> productPage = prodService.pageByPutawayTime(page);
|
||||
IPage<ProductDto> productPage = prodService.pageByPutAwayTime(page);
|
||||
return ResponseEntity.ok(productPage);
|
||||
}
|
||||
|
||||
|
||||
@ -10,12 +10,11 @@
|
||||
|
||||
package com.yami.shop.api.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.yami.shop.bean.app.dto.ProdTagDto;
|
||||
import com.yami.shop.bean.model.ProdTag;
|
||||
import com.yami.shop.service.ProdTagService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import ma.glasnost.orika.MapperFacade;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@ -25,6 +24,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/prod/tag")
|
||||
@Tag(name = "商品分组标签接口")
|
||||
|
||||
@ -16,7 +16,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yami.shop.common.util.PageParam;
|
||||
import com.yami.shop.bean.dto.HotSearchDto;
|
||||
import com.yami.shop.bean.dto.SearchProdDto;
|
||||
import com.yami.shop.common.util.PageParam;
|
||||
import com.yami.shop.service.HotSearchService;
|
||||
import com.yami.shop.service.ProductService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -32,6 +31,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/search")
|
||||
@Tag(name = "搜索接口")
|
||||
@ -50,7 +52,7 @@ public class SearchController {
|
||||
@Parameter(name = "sort", description = "是否按照顺序(0 否 1是)"),
|
||||
})
|
||||
public ResponseEntity<List<HotSearchDto>> hotSearchByShopId(Long shopId,Integer number,Integer sort) {
|
||||
List<HotSearchDto> list = hotSearchService.getHotSearchDtoByshopId(shopId);
|
||||
List<HotSearchDto> list = hotSearchService.getHotSearchDtoByShopId(shopId);
|
||||
|
||||
return getListResponseEntity(number, sort, list);
|
||||
}
|
||||
@ -62,7 +64,7 @@ public class SearchController {
|
||||
@Parameter(name = "sort", description = "是否按照顺序(0 否 1是)", required = false ),
|
||||
})
|
||||
public ResponseEntity<List<HotSearchDto>> hotSearch(Integer number,Integer sort) {
|
||||
List<HotSearchDto> list = hotSearchService.getHotSearchDtoByshopId(0L);
|
||||
List<HotSearchDto> list = hotSearchService.getHotSearchDtoByShopId(0L);
|
||||
return getListResponseEntity(number, sort, list);
|
||||
}
|
||||
|
||||
|
||||
@ -39,6 +39,9 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/p/shopCart")
|
||||
@Tag(name = "购物车接口")
|
||||
|
||||
@ -26,6 +26,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sku")
|
||||
@Tag(name = "sku规格接口")
|
||||
|
||||
@ -24,6 +24,9 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/p/sms")
|
||||
@Tag(name = "发送验证码接口")
|
||||
|
||||
@ -31,7 +31,9 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/p/user/collection")
|
||||
@Tag(name = "收藏接口")
|
||||
@ -98,8 +100,8 @@ public class UserCollectionController {
|
||||
@Operation(summary = "获取用户收藏商品列表" , description = "获取用户收藏商品列表")
|
||||
public ResponseEntity<IPage<ProductDto>> collectionProds(PageParam page) {
|
||||
String userId = SecurityUtils.getUser().getUserId();
|
||||
IPage<ProductDto> productDtoIPage = productService.collectionProds(page, userId);
|
||||
return ResponseEntity.ok(productDtoIPage);
|
||||
IPage<ProductDto> productDtoPage = productService.collectionProds(page, userId);
|
||||
return ResponseEntity.ok(productDtoPage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -22,7 +22,9 @@ import lombok.AllArgsConstructor;
|
||||
import ma.glasnost.orika.MapperFacade;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/p/user")
|
||||
@Tag(name = "用户接口")
|
||||
|
||||
@ -20,6 +20,7 @@ import com.yami.shop.bean.enums.OrderStatus;
|
||||
import com.yami.shop.bean.event.SubmitOrderEvent;
|
||||
import com.yami.shop.bean.model.*;
|
||||
import com.yami.shop.bean.order.SubmitOrderOrder;
|
||||
import com.yami.shop.common.constants.Constant;
|
||||
import com.yami.shop.common.exception.YamiShopBindException;
|
||||
import com.yami.shop.common.util.Arith;
|
||||
import com.yami.shop.dao.*;
|
||||
@ -82,9 +83,9 @@ public class SubmitOrderListener {
|
||||
List<ShopCartOrderDto> shopCartOrders = mergerOrder.getShopCartOrders();
|
||||
|
||||
List<Long> basketIds = new ArrayList<>();
|
||||
// 商品skuid为key 需要更新的sku为value的map
|
||||
// 商品skuId为key 需要更新的sku为value的map
|
||||
Map<Long, Sku> skuStocksMap = new HashMap<>(16);
|
||||
// 商品productid为key 需要更新的product为value的map
|
||||
// 商品productId为key 需要更新的product为value的map
|
||||
Map<Long, Product> prodStocksMap = new HashMap<>(16);
|
||||
|
||||
// 把订单地址保存到数据库
|
||||
@ -102,95 +103,7 @@ public class SubmitOrderListener {
|
||||
|
||||
// 每个店铺生成一个订单
|
||||
for (ShopCartOrderDto shopCartOrderDto : shopCartOrders) {
|
||||
// 使用雪花算法生成的订单号
|
||||
String orderNumber = String.valueOf(snowflake.nextId());
|
||||
shopCartOrderDto.setOrderNumber(orderNumber);
|
||||
|
||||
Long shopId = shopCartOrderDto.getShopId();
|
||||
|
||||
// 订单商品名称
|
||||
StringBuilder orderProdName = new StringBuilder(100);
|
||||
|
||||
List<OrderItem> orderItems = new ArrayList<>();
|
||||
|
||||
List<ShopCartItemDiscountDto> shopCartItemDiscounts = shopCartOrderDto.getShopCartItemDiscounts();
|
||||
for (ShopCartItemDiscountDto shopCartItemDiscount : shopCartItemDiscounts) {
|
||||
List<ShopCartItemDto> shopCartItems = shopCartItemDiscount.getShopCartItems();
|
||||
for (ShopCartItemDto shopCartItem : shopCartItems) {
|
||||
Sku sku = checkAndGetSku(shopCartItem.getSkuId(), shopCartItem, skuStocksMap);
|
||||
Product product = checkAndGetProd(shopCartItem.getProdId(), shopCartItem, prodStocksMap);
|
||||
|
||||
OrderItem orderItem = new OrderItem();
|
||||
orderItem.setShopId(shopId);
|
||||
orderItem.setOrderNumber(orderNumber);
|
||||
orderItem.setProdId(sku.getProdId());
|
||||
orderItem.setSkuId(sku.getSkuId());
|
||||
orderItem.setSkuName(sku.getSkuName());
|
||||
orderItem.setProdCount(shopCartItem.getProdCount());
|
||||
orderItem.setProdName(sku.getProdName());
|
||||
orderItem.setPic(StrUtil.isBlank(sku.getPic()) ? product.getPic() : sku.getPic());
|
||||
orderItem.setPrice(shopCartItem.getPrice());
|
||||
orderItem.setUserId(userId);
|
||||
orderItem.setProductTotalAmount(shopCartItem.getProductTotalAmount());
|
||||
orderItem.setRecTime(now);
|
||||
orderItem.setCommSts(0);
|
||||
orderItem.setBasketDate(shopCartItem.getBasketDate());
|
||||
orderProdName.append(orderItem.getProdName()).append(",");
|
||||
//推广员卡号
|
||||
orderItem.setDistributionCardNo(shopCartItem.getDistributionCardNo());
|
||||
|
||||
orderItems.add(orderItem);
|
||||
|
||||
if (shopCartItem.getBasketId() != null && shopCartItem.getBasketId() != 0) {
|
||||
basketIds.add(shopCartItem.getBasketId());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
orderProdName.subSequence(0, Math.min(orderProdName.length() - 1, 100));
|
||||
if (orderProdName.lastIndexOf(",") == orderProdName.length() - 1) {
|
||||
orderProdName.deleteCharAt(orderProdName.length() - 1);
|
||||
}
|
||||
|
||||
|
||||
// 订单信息
|
||||
com.yami.shop.bean.model.Order order = new com.yami.shop.bean.model.Order();
|
||||
|
||||
order.setShopId(shopId);
|
||||
order.setOrderNumber(orderNumber);
|
||||
// 订单商品名称
|
||||
order.setProdName(orderProdName.toString());
|
||||
// 用户id
|
||||
order.setUserId(userId);
|
||||
// 商品总额
|
||||
order.setTotal(shopCartOrderDto.getTotal());
|
||||
// 实际总额
|
||||
order.setActualTotal(shopCartOrderDto.getActualTotal());
|
||||
order.setStatus(OrderStatus.UNPAY.value());
|
||||
order.setUpdateTime(now);
|
||||
order.setCreateTime(now);
|
||||
order.setIsPayed(0);
|
||||
order.setDeleteStatus(0);
|
||||
order.setProductNums(shopCartOrderDto.getTotalCount());
|
||||
order.setAddrOrderId(addrOrderId);
|
||||
order.setReduceAmount(Arith.sub(Arith.add(shopCartOrderDto.getTotal(), shopCartOrderDto.getTransfee()), shopCartOrderDto.getActualTotal()));
|
||||
order.setFreightAmount(shopCartOrderDto.getTransfee());
|
||||
order.setRemarks(shopCartOrderDto.getRemarks());
|
||||
|
||||
order.setOrderItems(orderItems);
|
||||
event.getOrders().add(order);
|
||||
// 插入订单结算表
|
||||
OrderSettlement orderSettlement = new OrderSettlement();
|
||||
orderSettlement.setUserId(userId);
|
||||
orderSettlement.setIsClearing(0);
|
||||
orderSettlement.setCreateTime(now);
|
||||
orderSettlement.setOrderNumber(orderNumber);
|
||||
orderSettlement.setPayAmount(order.getActualTotal());
|
||||
orderSettlement.setPayStatus(0);
|
||||
orderSettlement.setVersion(0);
|
||||
orderSettlementMapper.insert(orderSettlement);
|
||||
createOrder(event, now, userId, basketIds, skuStocksMap, prodStocksMap, addrOrderId, shopCartOrderDto);
|
||||
|
||||
}
|
||||
|
||||
@ -221,6 +134,108 @@ public class SubmitOrderListener {
|
||||
|
||||
}
|
||||
|
||||
private void createOrder(SubmitOrderEvent event, Date now, String userId, List<Long> basketIds, Map<Long, Sku> skuStocksMap, Map<Long, Product> prodStocksMap, Long addrOrderId, ShopCartOrderDto shopCartOrderDto) {
|
||||
// 使用雪花算法生成的订单号
|
||||
String orderNumber = String.valueOf(snowflake.nextId());
|
||||
shopCartOrderDto.setOrderNumber(orderNumber);
|
||||
|
||||
Long shopId = shopCartOrderDto.getShopId();
|
||||
|
||||
// 订单商品名称
|
||||
StringBuilder orderProdName = new StringBuilder(100);
|
||||
|
||||
List<OrderItem> orderItems = new ArrayList<>();
|
||||
|
||||
List<ShopCartItemDiscountDto> shopCartItemDiscounts = shopCartOrderDto.getShopCartItemDiscounts();
|
||||
for (ShopCartItemDiscountDto shopCartItemDiscount : shopCartItemDiscounts) {
|
||||
List<ShopCartItemDto> shopCartItems = shopCartItemDiscount.getShopCartItems();
|
||||
for (ShopCartItemDto shopCartItem : shopCartItems) {
|
||||
Sku sku = checkAndGetSku(shopCartItem.getSkuId(), shopCartItem, skuStocksMap);
|
||||
Product product = checkAndGetProd(shopCartItem.getProdId(), shopCartItem, prodStocksMap);
|
||||
|
||||
OrderItem orderItem = getOrderItem(now, userId, orderNumber, shopId, orderProdName, shopCartItem, sku, product);
|
||||
|
||||
orderItems.add(orderItem);
|
||||
|
||||
if (shopCartItem.getBasketId() != null && shopCartItem.getBasketId() != 0) {
|
||||
basketIds.add(shopCartItem.getBasketId());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
orderProdName.subSequence(0, Math.min(orderProdName.length() - 1, 100));
|
||||
if (orderProdName.lastIndexOf(Constant.COMMA) == orderProdName.length() - 1) {
|
||||
orderProdName.deleteCharAt(orderProdName.length() - 1);
|
||||
}
|
||||
|
||||
|
||||
// 订单信息
|
||||
com.yami.shop.bean.model.Order order = getOrder(now, userId, addrOrderId, shopCartOrderDto, orderNumber, shopId, orderProdName, orderItems);
|
||||
event.getOrders().add(order);
|
||||
// 插入订单结算表
|
||||
OrderSettlement orderSettlement = new OrderSettlement();
|
||||
orderSettlement.setUserId(userId);
|
||||
orderSettlement.setIsClearing(0);
|
||||
orderSettlement.setCreateTime(now);
|
||||
orderSettlement.setOrderNumber(orderNumber);
|
||||
orderSettlement.setPayAmount(order.getActualTotal());
|
||||
orderSettlement.setPayStatus(0);
|
||||
orderSettlement.setVersion(0);
|
||||
orderSettlementMapper.insert(orderSettlement);
|
||||
}
|
||||
|
||||
private com.yami.shop.bean.model.Order getOrder(Date now, String userId, Long addrOrderId, ShopCartOrderDto shopCartOrderDto, String orderNumber, Long shopId, StringBuilder orderProdName, List<OrderItem> orderItems) {
|
||||
com.yami.shop.bean.model.Order order = new com.yami.shop.bean.model.Order();
|
||||
|
||||
order.setShopId(shopId);
|
||||
order.setOrderNumber(orderNumber);
|
||||
// 订单商品名称
|
||||
order.setProdName(orderProdName.toString());
|
||||
// 用户id
|
||||
order.setUserId(userId);
|
||||
// 商品总额
|
||||
order.setTotal(shopCartOrderDto.getTotal());
|
||||
// 实际总额
|
||||
order.setActualTotal(shopCartOrderDto.getActualTotal());
|
||||
order.setStatus(OrderStatus.UNPAY.value());
|
||||
order.setUpdateTime(now);
|
||||
order.setCreateTime(now);
|
||||
order.setIsPayed(0);
|
||||
order.setDeleteStatus(0);
|
||||
order.setProductNums(shopCartOrderDto.getTotalCount());
|
||||
order.setAddrOrderId(addrOrderId);
|
||||
order.setReduceAmount(Arith.sub(Arith.add(shopCartOrderDto.getTotal(), shopCartOrderDto.getTransfee()), shopCartOrderDto.getActualTotal()));
|
||||
order.setFreightAmount(shopCartOrderDto.getTransfee());
|
||||
order.setRemarks(shopCartOrderDto.getRemarks());
|
||||
|
||||
order.setOrderItems(orderItems);
|
||||
return order;
|
||||
}
|
||||
|
||||
private OrderItem getOrderItem(Date now, String userId, String orderNumber, Long shopId, StringBuilder orderProdName, ShopCartItemDto shopCartItem, Sku sku, Product product) {
|
||||
OrderItem orderItem = new OrderItem();
|
||||
orderItem.setShopId(shopId);
|
||||
orderItem.setOrderNumber(orderNumber);
|
||||
orderItem.setProdId(sku.getProdId());
|
||||
orderItem.setSkuId(sku.getSkuId());
|
||||
orderItem.setSkuName(sku.getSkuName());
|
||||
orderItem.setProdCount(shopCartItem.getProdCount());
|
||||
orderItem.setProdName(sku.getProdName());
|
||||
orderItem.setPic(StrUtil.isBlank(sku.getPic()) ? product.getPic() : sku.getPic());
|
||||
orderItem.setPrice(shopCartItem.getPrice());
|
||||
orderItem.setUserId(userId);
|
||||
orderItem.setProductTotalAmount(shopCartItem.getProductTotalAmount());
|
||||
orderItem.setRecTime(now);
|
||||
orderItem.setCommSts(0);
|
||||
orderItem.setBasketDate(shopCartItem.getBasketDate());
|
||||
orderProdName.append(orderItem.getProdName()).append(",");
|
||||
//推广员卡号
|
||||
orderItem.setDistributionCardNo(shopCartItem.getDistributionCardNo());
|
||||
return orderItem;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"Duplicates"})
|
||||
private Product checkAndGetProd(Long prodId, ShopCartItemDto shopCartItem, Map<Long, Product> prodStocksMap) {
|
||||
Product product = productService.getProductByProdId(prodId);
|
||||
|
||||
@ -17,6 +17,9 @@ import com.yami.shop.bean.bo.SmsInfoBo;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
public class SmsInfoContext {
|
||||
|
||||
/** The request holder. */
|
||||
|
||||
@ -19,6 +19,9 @@ import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class BasketItemDto implements Serializable {
|
||||
|
||||
|
||||
@ -15,6 +15,9 @@ import com.yami.shop.common.serializer.json.ImgJsonSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class CategoryDto {
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@ import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 购物车中选中的满减活动项信息
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class ChooseDiscountItemDto implements Serializable {
|
||||
|
||||
@ -10,15 +10,13 @@
|
||||
|
||||
package com.yami.shop.bean.app.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class CouponOrderDto implements Serializable {
|
||||
|
||||
|
||||
@ -10,11 +10,14 @@
|
||||
|
||||
package com.yami.shop.bean.app.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class DeliveryDto {
|
||||
|
||||
|
||||
@ -13,6 +13,9 @@ package com.yami.shop.bean.app.dto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class DeliveryInfoDto {
|
||||
|
||||
|
||||
@ -14,6 +14,9 @@ import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class DiscountDto implements Serializable {
|
||||
|
||||
|
||||
@ -17,6 +17,9 @@ import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Schema(description = "首页图片对象")
|
||||
@Data
|
||||
public class IndexImgDto {
|
||||
|
||||
@ -10,11 +10,14 @@
|
||||
|
||||
package com.yami.shop.bean.app.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "我的订单")
|
||||
public class MyOrderDto {
|
||||
|
||||
@ -15,6 +15,9 @@ import com.yami.shop.common.serializer.json.ImgJsonSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Schema(description = "我的订单-订单项")
|
||||
@Data
|
||||
public class MyOrderItemDto {
|
||||
|
||||
@ -16,6 +16,9 @@ import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Schema(description = "公告对象")
|
||||
@Data
|
||||
public class NoticeDto {
|
||||
|
||||
@ -13,6 +13,9 @@ package com.yami.shop.bean.app.dto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "我的订单数量")
|
||||
public class OrderCountData {
|
||||
|
||||
@ -13,6 +13,9 @@ package com.yami.shop.bean.app.dto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class OrderNumbersDto {
|
||||
|
||||
@ -22,4 +25,5 @@ public class OrderNumbersDto {
|
||||
public OrderNumbersDto(String orderNumbers) {
|
||||
this.orderNumbers = orderNumbers;
|
||||
}
|
||||
public OrderNumbersDto(){}
|
||||
}
|
||||
|
||||
@ -13,7 +13,9 @@ package com.yami.shop.bean.app.dto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Schema(description = "商品评论数据")
|
||||
@Data
|
||||
public class ProdCommDataDto {
|
||||
|
||||
@ -19,8 +19,10 @@ import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Schema(description = "评论对象")
|
||||
@Data
|
||||
public class ProdCommDto {
|
||||
|
||||
@ -13,6 +13,9 @@ package com.yami.shop.bean.app.dto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class ProdTagDto {
|
||||
|
||||
|
||||
@ -10,15 +10,17 @@
|
||||
|
||||
package com.yami.shop.bean.app.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.yami.shop.bean.model.Transport;
|
||||
|
||||
import com.yami.shop.common.serializer.json.ImgJsonSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class ProductDto {
|
||||
/**
|
||||
|
||||
@ -13,6 +13,9 @@ package com.yami.shop.bean.app.dto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "购物车合计")
|
||||
public class ShopCartAmountDto {
|
||||
|
||||
@ -16,6 +16,9 @@ import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class ShopCartDto implements Serializable {
|
||||
|
||||
|
||||
@ -15,6 +15,9 @@ import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "购物车失效商品对象")
|
||||
public class ShopCartExpiryItemDto {
|
||||
|
||||
@ -16,6 +16,9 @@ import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class ShopCartItemDiscountDto implements Serializable {
|
||||
|
||||
|
||||
@ -18,6 +18,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 单个店铺的订单信息
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class ShopCartOrderDto implements Serializable{
|
||||
|
||||
@ -19,6 +19,7 @@ import java.util.List;
|
||||
/**
|
||||
* 多个店铺订单合并在一起的合并类
|
||||
* "/confirm" 使用
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class ShopCartOrderMergerDto implements Serializable{
|
||||
|
||||
@ -17,6 +17,9 @@ import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class SkuDto implements Serializable {
|
||||
|
||||
|
||||
@ -10,12 +10,14 @@
|
||||
|
||||
package com.yami.shop.bean.app.dto;
|
||||
|
||||
import com.yami.shop.bean.model.ProdTag;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class TagProductDto {
|
||||
|
||||
|
||||
@ -14,7 +14,9 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class UserAddrDto implements Serializable {
|
||||
@Schema(description = "地址id" , required = true)
|
||||
|
||||
@ -14,7 +14,9 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Schema(description = "收藏对象")
|
||||
@Data
|
||||
public class UserCollectionDto {
|
||||
|
||||
@ -11,7 +11,9 @@
|
||||
package com.yami.shop.bean.app.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
public class UserDto {
|
||||
|
||||
|
||||
|
||||
@ -10,10 +10,13 @@
|
||||
|
||||
package com.yami.shop.bean.app.param;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Schema(description = "地址参数")
|
||||
public class AddrParam {
|
||||
|
||||
|
||||
@ -12,6 +12,9 @@ package com.yami.shop.bean.app.param;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Schema(description = "登陆参数")
|
||||
public class LoginParam {
|
||||
|
||||
|
||||
@ -10,12 +10,15 @@
|
||||
|
||||
package com.yami.shop.bean.app.param;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "购物车物品参数")
|
||||
public class OrderItemParam {
|
||||
|
||||
@ -10,15 +10,15 @@
|
||||
|
||||
package com.yami.shop.bean.app.param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.yami.shop.bean.enums.OrderEntry;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "订单参数")
|
||||
public class OrderParam {
|
||||
|
||||
@ -5,6 +5,9 @@ import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class OrderRefundExpressParam {
|
||||
|
||||
|
||||
@ -6,6 +6,9 @@ import lombok.Data;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class OrderRefundParam {
|
||||
|
||||
@ -17,17 +20,11 @@ public class OrderRefundParam {
|
||||
@NotNull(message = "申请类型不能为空")
|
||||
private Integer applyType;
|
||||
|
||||
// @Schema(description = "订单金额" , required = true)
|
||||
// @NotNull(message = "订单金额不能为空")
|
||||
// private Double orderAmount;
|
||||
|
||||
@Schema(description = "订单项id(全部退款是0)" , required = true)
|
||||
@NotNull(message = "订单项id不能为空")
|
||||
private Long orderItemId;
|
||||
|
||||
// @Schema(description = "退款金额" , required = true)
|
||||
// @NotNull(message = "退款金额不能为空")
|
||||
// private BigDecimal refundAmount;
|
||||
|
||||
@Schema(description = "凭证图片列表" , required = true)
|
||||
private String photoFiles;
|
||||
|
||||
@ -12,6 +12,9 @@ package com.yami.shop.bean.app.param;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
public class OrderShopParam {
|
||||
|
||||
/** 店铺ID **/
|
||||
|
||||
@ -15,6 +15,9 @@ import javax.validation.constraints.NotNull;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Schema(description = "支付参数")
|
||||
public class PayParam {
|
||||
|
||||
|
||||
@ -10,14 +10,14 @@
|
||||
|
||||
package com.yami.shop.bean.app.param;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.yami.shop.common.serializer.json.ImgJsonSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "添加评论信息")
|
||||
public class ProdCommParam {
|
||||
|
||||
@ -10,10 +10,13 @@
|
||||
|
||||
package com.yami.shop.bean.app.param;
|
||||
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Schema(description = "发送验证码参数")
|
||||
public class SendSmsParam {
|
||||
|
||||
|
||||
@ -13,6 +13,9 @@ package com.yami.shop.bean.app.param;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Schema(description = "购物车参数")
|
||||
@Data
|
||||
public class ShopCartParam {
|
||||
|
||||
@ -14,6 +14,9 @@ import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class ShopCartParams {
|
||||
List<ShopCartParam> shopCartParams;
|
||||
|
||||
@ -10,11 +10,14 @@
|
||||
|
||||
package com.yami.shop.bean.app.param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "提交订单参数")
|
||||
public class SubmitOrderParam {
|
||||
|
||||
@ -12,7 +12,9 @@ package com.yami.shop.bean.app.param;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "设置用户信息")
|
||||
public class UserInfoParam {
|
||||
|
||||
@ -10,10 +10,13 @@
|
||||
|
||||
package com.yami.shop.bean.bo;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.yami.shop.bean.enums.SmsType;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
public class SmsInfoBo {
|
||||
|
||||
private SmsType smsType;
|
||||
|
||||
@ -15,6 +15,7 @@ import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户购物数据
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class UserShoppingDataDto {
|
||||
|
||||
@ -16,6 +16,9 @@ import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Schema(description = "热搜数据")
|
||||
@Data
|
||||
public class HotSearchDto implements Serializable {
|
||||
|
||||
@ -16,6 +16,9 @@ import lombok.Data;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
public class ProductDto {
|
||||
/**
|
||||
|
||||
@ -15,7 +15,9 @@ import com.yami.shop.common.serializer.json.ImgJsonSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "搜索商品数据")
|
||||
public class SearchProdDto {
|
||||
|
||||
@ -10,6 +10,9 @@
|
||||
|
||||
package com.yami.shop.bean.enums;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
public enum MessageStatus {
|
||||
|
||||
/**
|
||||
|
||||
@ -10,6 +10,9 @@
|
||||
|
||||
package com.yami.shop.bean.enums;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
public enum OrderStatus {
|
||||
|
||||
/**
|
||||
|
||||
@ -10,6 +10,9 @@
|
||||
|
||||
package com.yami.shop.bean.enums;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
public enum PayType {
|
||||
|
||||
/** 微信支付*/
|
||||
|
||||
@ -10,6 +10,9 @@
|
||||
|
||||
package com.yami.shop.bean.enums;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
public enum SmsType {
|
||||
|
||||
/**
|
||||
|
||||
@ -10,14 +10,18 @@
|
||||
|
||||
package com.yami.shop.bean.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@TableName("tz_area")
|
||||
public class Area implements Serializable {
|
||||
|
||||
@ -10,11 +10,16 @@
|
||||
|
||||
package com.yami.shop.bean.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@TableName("tz_attach_file")
|
||||
public class AttachFile implements Serializable {
|
||||
|
||||
@ -10,11 +10,16 @@
|
||||
|
||||
package com.yami.shop.bean.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@TableName("tz_basket")
|
||||
public class Basket implements Serializable {
|
||||
|
||||
@ -10,11 +10,16 @@
|
||||
|
||||
package com.yami.shop.bean.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@TableName("tz_brand")
|
||||
public class Brand implements Serializable {
|
||||
|
||||
@ -19,6 +19,9 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@TableName("tz_category")
|
||||
public class Category implements Serializable {
|
||||
|
||||
@ -15,6 +15,9 @@ import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@TableName("tz_category_brand")
|
||||
public class CategoryBrand implements Serializable {
|
||||
|
||||
@ -15,6 +15,9 @@ import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@TableName("tz_category_prop")
|
||||
public class CategoryProp implements Serializable {
|
||||
|
||||
@ -10,11 +10,16 @@
|
||||
|
||||
package com.yami.shop.bean.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@TableName("tz_delivery")
|
||||
public class Delivery implements Serializable {
|
||||
|
||||
@ -10,14 +10,17 @@
|
||||
|
||||
package com.yami.shop.bean.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@TableName("tz_hot_search")
|
||||
public class HotSearch implements Serializable {
|
||||
|
||||
@ -10,14 +10,19 @@
|
||||
|
||||
package com.yami.shop.bean.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.yami.shop.common.serializer.json.ImgJsonSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@TableName("tz_index_img")
|
||||
public class IndexImg implements Serializable {
|
||||
|
||||
@ -10,11 +10,16 @@
|
||||
|
||||
package com.yami.shop.bean.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@TableName("tz_login_hist")
|
||||
public class LoginHist implements Serializable {
|
||||
|
||||
@ -10,15 +10,17 @@
|
||||
|
||||
package com.yami.shop.bean.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@TableName("tz_message")
|
||||
public class Message implements Serializable {
|
||||
|
||||
@ -10,18 +10,19 @@
|
||||
|
||||
package com.yami.shop.bean.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@TableName("tz_order")
|
||||
public class Order implements Serializable {
|
||||
|
||||
@ -18,6 +18,9 @@ import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@TableName("tz_order_item")
|
||||
public class OrderItem implements Serializable {
|
||||
|
||||
@ -18,6 +18,9 @@ import java.util.List;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@TableName("tz_order_refund")
|
||||
public class OrderRefund implements Serializable {
|
||||
|
||||
@ -10,11 +10,16 @@
|
||||
|
||||
package com.yami.shop.bean.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author lanhai
|
||||
*/
|
||||
@Data
|
||||
@TableName("tz_order_settlement")
|
||||
public class OrderSettlement implements Serializable {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user