commit message
This commit is contained in:
31
seller-api/pom.xml
Normal file
31
seller-api/pom.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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>
|
||||
|
||||
<artifactId>seller-api</artifactId>
|
||||
<parent>
|
||||
<groupId>cn.lili</groupId>
|
||||
<artifactId>lili-shop-parent</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.lili</groupId>
|
||||
<artifactId>framework</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
38
seller-api/src/main/java/cn/lili/StoreApiApplication.java
Normal file
38
seller-api/src/main/java/cn/lili/StoreApiApplication.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package cn.lili;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.core.task.TaskExecutor;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
/**
|
||||
* 商家后台 API
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/16 10:03 下午
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableJpaAuditing
|
||||
@EnableCaching
|
||||
@EnableAsync
|
||||
public class StoreApiApplication {
|
||||
|
||||
@Primary
|
||||
@Bean
|
||||
public TaskExecutor primaryTaskExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
return executor;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
System.setProperty("es.set.netty.runtime.available.processors", "false");
|
||||
SpringApplication.run(StoreApiApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package cn.lili.controller.distribution;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.distribution.entity.dos.DistributionGoods;
|
||||
import cn.lili.modules.distribution.entity.dos.DistributionSelectedGoods;
|
||||
import cn.lili.modules.distribution.entity.dto.DistributionGoodsSearchParams;
|
||||
import cn.lili.modules.distribution.entity.vos.DistributionGoodsVO;
|
||||
import cn.lili.modules.distribution.service.DistributionGoodsService;
|
||||
import cn.lili.modules.distribution.service.DistributionSelectedGoodsService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 店铺端,分销商品接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date 2020/11/16 10:06 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,分销商品接口")
|
||||
@RequestMapping("/store/distributionGoods")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class DistributionGoodsStoreController {
|
||||
|
||||
/**
|
||||
* 分销商品
|
||||
*/
|
||||
private final DistributionGoodsService distributionGoodsService;
|
||||
|
||||
/**
|
||||
* 已选择分销商品
|
||||
*/
|
||||
private final DistributionSelectedGoodsService distributionSelectedGoodsService;
|
||||
|
||||
@ApiOperation(value = "获取分销商商品列表")
|
||||
@GetMapping
|
||||
public ResultMessage<IPage<DistributionGoodsVO>> distributionGoods(DistributionGoodsSearchParams distributionGoodsSearchParams) {
|
||||
|
||||
return ResultUtil.data(distributionGoodsService.goodsPage(distributionGoodsSearchParams));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "选择商品参与分销")
|
||||
@ApiImplicitParam(name = "skuId", value = "规格ID", required = true, dataType = "String", paramType = "path")
|
||||
@PutMapping(value = "/checked/{skuId}")
|
||||
public ResultMessage<DistributionGoods> distributionCheckGoods(@NotNull(message = "规格ID不能为空") @PathVariable String skuId,
|
||||
@NotNull(message = "佣金金额不能为空") @RequestParam Double commission) {
|
||||
return ResultUtil.data(distributionGoodsService.checked(skuId, commission));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "取消分销商品")
|
||||
@ApiImplicitParam(name = "id", value = "分销商商品ID", required = true, paramType = "path")
|
||||
@DeleteMapping(value = "/cancel/{id}")
|
||||
public ResultMessage<Object> cancel(@NotNull @PathVariable String id) {
|
||||
//清除分销商已选择分销商品
|
||||
distributionSelectedGoodsService.remove(new QueryWrapper<DistributionSelectedGoods>().eq("distribution_goods_id", id));
|
||||
//清除分销商品
|
||||
distributionGoodsService.removeById(id);
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package cn.lili.controller.distribution;
|
||||
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.distribution.entity.dos.DistributionOrder;
|
||||
import cn.lili.modules.distribution.entity.vos.DistributionOrderSearchParams;
|
||||
import cn.lili.modules.distribution.service.DistributionOrderService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 店铺端,分销订单接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date 2020/11/16 10:06 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,分销订单接口")
|
||||
@RequestMapping("/store/distributionOrder")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class DistributionOrderStoreController {
|
||||
|
||||
/**
|
||||
* 分销订单
|
||||
*/
|
||||
private final DistributionOrderService distributionOrderService;
|
||||
|
||||
@ApiOperation(value = "获取分销订单列表")
|
||||
@GetMapping
|
||||
public ResultMessage<IPage<DistributionOrder>> distributionOrder(DistributionOrderSearchParams distributionOrderSearchParams) {
|
||||
|
||||
//获取当前登录商家账号-查询当前店铺的分销订单
|
||||
distributionOrderSearchParams.setStoreId(UserContext.getCurrentUser().getId());
|
||||
//查询分销订单列表
|
||||
IPage<DistributionOrder> distributionOrderPage = distributionOrderService.getDistributionOrderPage(distributionOrderSearchParams);
|
||||
return ResultUtil.data(distributionOrderPage);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.goods.entity.dos.CategoryParameterGroup;
|
||||
import cn.lili.modules.goods.entity.dos.Parameters;
|
||||
import cn.lili.modules.goods.entity.vos.ParameterGroupVO;
|
||||
import cn.lili.modules.goods.service.CategoryParameterGroupService;
|
||||
import cn.lili.modules.goods.service.ParametersService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺端,分类绑定参数组管理接口
|
||||
*
|
||||
* @author pikachu
|
||||
* @date 2020-02-18 15:18:56
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,分类绑定参数组管理接口")
|
||||
@RequestMapping("/store/goods/category/parameters")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class CategoryParameterGroupStoreController {
|
||||
|
||||
private final ParametersService parametersService;
|
||||
private final CategoryParameterGroupService categoryParameterGroupService;
|
||||
|
||||
@ApiOperation(value = "查询某分类下绑定的参数信息")
|
||||
@GetMapping(value = "/{category_id}")
|
||||
@ApiImplicitParam(name = "category_id", value = "分类id", required = true, dataType = "String", paramType = "path")
|
||||
public List<ParameterGroupVO> getCategoryParam(@PathVariable("category_id") String categoryId) {
|
||||
return categoryParameterGroupService.getCategoryParams(categoryId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "编辑或更新数据")
|
||||
@PostMapping(value = "/save")
|
||||
public ResultMessage<CategoryParameterGroup> saveOrUpdate(CategoryParameterGroup categoryParameterGroup) {
|
||||
|
||||
if (categoryParameterGroupService.save(categoryParameterGroup)) {
|
||||
return ResultUtil.data(categoryParameterGroup);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过id删除参数组")
|
||||
@DeleteMapping(value = "/{id}")
|
||||
public ResultMessage<Object> delAllByIds(@PathVariable String id) {
|
||||
//删除参数
|
||||
parametersService.remove(new QueryWrapper<Parameters>().eq("group_id", id));
|
||||
//删除参数组
|
||||
categoryParameterGroupService.removeById(id);
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.goods.entity.dos.CategorySpecification;
|
||||
import cn.lili.modules.goods.entity.vos.CategorySpecificationVO;
|
||||
import cn.lili.modules.goods.entity.vos.GoodsSpecValueVO;
|
||||
import cn.lili.modules.goods.service.CategorySpecificationService;
|
||||
import cn.lili.modules.goods.service.SpecificationService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺端,商品分类规格接口
|
||||
*
|
||||
* @author pikachu
|
||||
* @date 2020-02-27 15:18:56
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,商品分类规格接口")
|
||||
@RequestMapping("/store/goods/category/spec")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class CategorySpecificationStoreController {
|
||||
|
||||
private final CategorySpecificationService categorySpecificationService;
|
||||
|
||||
private final SpecificationService specificationService;
|
||||
|
||||
|
||||
@ApiOperation(value = "查询某分类下绑定的规格信息")
|
||||
@GetMapping(value = "/{category_id}")
|
||||
@ApiImplicitParam(name = "category_id", value = "分类id", required = true, dataType = "String", paramType = "path")
|
||||
public List<CategorySpecificationVO> getCategorySpec(@PathVariable("category_id") String categoryId) {
|
||||
return categorySpecificationService.getCategorySpecList(categoryId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询某分类下绑定的规格信息,商品操作使用")
|
||||
@GetMapping(value = "/goods/{category_id}")
|
||||
@ApiImplicitParam(name = "category_id", value = "分类id", required = true, dataType = "String", paramType = "path")
|
||||
public List<GoodsSpecValueVO> getSpec(@PathVariable("category_id") String categoryId) {
|
||||
return specificationService.getGoodsSpecValue(categoryId);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "保存某分类下绑定的规格信息")
|
||||
@PostMapping(value = "/{category_id}")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "category_id", value = "分类id", required = true, paramType = "path", dataType = "String"),
|
||||
@ApiImplicitParam(name = "category_specs", value = "规格id数组", required = true, paramType = "query", dataType = "String[]")
|
||||
})
|
||||
public ResultMessage<Object> saveCategoryBrand(@PathVariable("category_id") String categoryId, @RequestParam("category_specs") String[] categorySpecs) {
|
||||
//删除分类规格绑定信息
|
||||
this.categorySpecificationService.remove(new QueryWrapper<CategorySpecification>().eq("category_id", categoryId));
|
||||
//绑定规格信息
|
||||
for (String specId : categorySpecs) {
|
||||
CategorySpecification categoryBrand = new CategorySpecification(categoryId, specId);
|
||||
categorySpecificationService.save(categoryBrand);
|
||||
}
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.goods.entity.vos.CategoryBrandVO;
|
||||
import cn.lili.modules.goods.entity.vos.CategoryVO;
|
||||
import cn.lili.modules.goods.service.CategoryBrandService;
|
||||
import cn.lili.modules.goods.service.CategoryService;
|
||||
import cn.lili.modules.store.service.StoreDetailService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺端,商品分类接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2021/2/20 2:26 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,商品分类接口")
|
||||
@RequestMapping("/store/goods/category")
|
||||
@CacheConfig(cacheNames = "category")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class CategoryStoreController {
|
||||
|
||||
/**
|
||||
* 分类
|
||||
*/
|
||||
private final CategoryService categoryService;
|
||||
/**
|
||||
* 分类品牌
|
||||
*/
|
||||
private final CategoryBrandService categoryBrandService;
|
||||
/**
|
||||
* 店铺详情
|
||||
*/
|
||||
private final StoreDetailService storeDetailService;
|
||||
|
||||
@ApiOperation(value = "获取店铺经营的分类")
|
||||
@GetMapping(value = "/all")
|
||||
public ResultMessage<List<CategoryVO>> getListAll() {
|
||||
//获取店铺经营范围
|
||||
String goodsManagementCategory = storeDetailService.getStoreDetail(UserContext.getCurrentUser().getStoreId()).getGoodsManagementCategory();
|
||||
return ResultUtil.data(this.categoryService.getStoreCategory(goodsManagementCategory.split(",")));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取所选分类关联的品牌信息")
|
||||
@GetMapping(value = "/{categoryId}/brands")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "categoryId", value = "分类id", required = true, paramType = "path"),
|
||||
})
|
||||
public List<CategoryBrandVO> queryBrands(@PathVariable String categoryId) {
|
||||
return this.categoryBrandService.getCategoryBrandList(categoryId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.goods.entity.dos.DraftGoods;
|
||||
import cn.lili.modules.goods.entity.dto.DraftGoodsDTO;
|
||||
import cn.lili.modules.goods.entity.dto.DraftGoodsSearchParams;
|
||||
import cn.lili.modules.goods.entity.vos.DraftGoodsVO;
|
||||
import cn.lili.modules.goods.service.DraftGoodsService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 店铺端,草稿商品接口
|
||||
*
|
||||
* @author paulG
|
||||
* @date 2021/2/20 2:26 下午
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,草稿商品接口")
|
||||
@RequestMapping("/store/draft/goods")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class DraftGoodsStoreController {
|
||||
|
||||
private final DraftGoodsService draftGoodsService;
|
||||
|
||||
|
||||
@ApiOperation(value = "分页获取草稿商品列表")
|
||||
@GetMapping(value = "/page")
|
||||
public ResultMessage<IPage<DraftGoods>> getDraftGoodsByPage(DraftGoodsSearchParams searchParams) {
|
||||
searchParams.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
return ResultUtil.data(draftGoodsService.getDraftGoods(searchParams));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取草稿商品")
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResultMessage<DraftGoodsVO> getDraftGoods(@PathVariable String id) {
|
||||
DraftGoodsVO draftGoods = draftGoodsService.getDraftGoods(id);
|
||||
if (!UserContext.getCurrentUser().getStoreId().equals(draftGoods.getStoreId())) {
|
||||
return ResultUtil.error(ResultCode.USER_AUTHORITY_ERROR);
|
||||
}
|
||||
return ResultUtil.data(draftGoods);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "保存草稿商品")
|
||||
@PostMapping(value = "/save", consumes = "application/json", produces = "application/json")
|
||||
public ResultMessage<String> saveDraftGoods(@RequestBody DraftGoodsDTO draftGoodsVO) {
|
||||
if (draftGoodsVO.getStoreId() == null) {
|
||||
AuthUser currentUser = UserContext.getCurrentUser();
|
||||
draftGoodsVO.setStoreId(currentUser.getStoreId());
|
||||
} else if (draftGoodsVO.getStoreId() != null && !UserContext.getCurrentUser().getStoreId().equals(draftGoodsVO.getStoreId())) {
|
||||
return ResultUtil.error(ResultCode.USER_AUTHORITY_ERROR);
|
||||
}
|
||||
draftGoodsService.saveGoodsDraft(draftGoodsVO);
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除草稿商品")
|
||||
@DeleteMapping(value = "/{id}")
|
||||
public ResultMessage<String> deleteDraftGoods(@PathVariable String id) {
|
||||
DraftGoods draftGoods = draftGoodsService.getById(id);
|
||||
if (!draftGoods.getStoreId().equals(UserContext.getCurrentUser().getStoreId())) {
|
||||
return ResultUtil.error(ResultCode.USER_AUTHORITY_ERROR);
|
||||
}
|
||||
draftGoodsService.deleteGoodsDraft(id);
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.utils.PageUtil;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.common.vo.SearchVO;
|
||||
import cn.lili.modules.goods.entity.dos.GoodsGallery;
|
||||
import cn.lili.modules.goods.service.GoodsGalleryService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺端,商品相册接口
|
||||
*
|
||||
* @author pikachu
|
||||
* @date 2020-03-13 11:18:56
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,商品相册接口")
|
||||
@RequestMapping("/store/goodsGallery")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class GoodsGalleryController {
|
||||
|
||||
private final GoodsGalleryService goodsGalleryService;
|
||||
|
||||
@ApiOperation(value = "通过id获取")
|
||||
@GetMapping(value = "/get/{id}")
|
||||
public ResultMessage<GoodsGallery> get(@PathVariable String id) {
|
||||
|
||||
GoodsGallery goodsGallery = goodsGalleryService.getById(id);
|
||||
return ResultUtil.data(goodsGallery);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取全部数据")
|
||||
@GetMapping(value = "/getAll")
|
||||
public ResultMessage<List<GoodsGallery>> getAll() {
|
||||
|
||||
List<GoodsGallery> list = goodsGalleryService.list();
|
||||
return ResultUtil.data(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页获取")
|
||||
@GetMapping(value = "/getByPage")
|
||||
public ResultMessage<IPage<GoodsGallery>> getByPage(GoodsGallery entity,
|
||||
SearchVO searchVo,
|
||||
PageVO page) {
|
||||
IPage<GoodsGallery> data = goodsGalleryService.page(PageUtil.initPage(page), PageUtil.initWrapper(entity, searchVo));
|
||||
return ResultUtil.data(data);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加商品相册")
|
||||
@PostMapping(value = "/save")
|
||||
public ResultMessage<GoodsGallery> save(GoodsGallery goodsGallery) {
|
||||
|
||||
if (goodsGalleryService.save(goodsGallery)) {
|
||||
return ResultUtil.data(goodsGallery);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改商品相册")
|
||||
@PostMapping(value = "/update")
|
||||
public ResultMessage<GoodsGallery> update(GoodsGallery goodsGallery) {
|
||||
|
||||
if (goodsGalleryService.updateById(goodsGallery)) {
|
||||
return ResultUtil.data(goodsGallery);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量删除")
|
||||
@DeleteMapping(value = "/delByIds/{ids}")
|
||||
public ResultMessage<Object> delAllByIds(@PathVariable List ids) {
|
||||
|
||||
goodsGalleryService.removeByIds(ids);
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.store.entity.dos.StoreGoodsLabel;
|
||||
import cn.lili.modules.store.entity.vos.StoreGoodsLabelVO;
|
||||
import cn.lili.modules.store.service.StoreGoodsLabelService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 店铺端,店铺分类接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date 2020/11/17 2:32 下午
|
||||
*/
|
||||
@Api(tags = "店铺端,店铺分类接口")
|
||||
@RestController
|
||||
@RequestMapping("/store/goods/label")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class GoodsLabelStoreController {
|
||||
|
||||
/**
|
||||
* 店铺分类
|
||||
*/
|
||||
private final StoreGoodsLabelService storeGoodsLabelService;
|
||||
|
||||
@ApiOperation(value = "获取当前店铺商品分类列表")
|
||||
@GetMapping
|
||||
public ResultMessage<List<StoreGoodsLabelVO>> list() {
|
||||
return ResultUtil.data(storeGoodsLabelService.listByStoreId(UserContext.getCurrentUser().getStoreId()));
|
||||
}
|
||||
|
||||
@ApiImplicitParam(name = "id", value = "店铺商品分类ID", required = true, paramType = "path")
|
||||
@ApiOperation(value = "获取店铺商品分类详情")
|
||||
@GetMapping("/get/{id}")
|
||||
public ResultMessage<StoreGoodsLabel> getStoreGoodsLabel(@PathVariable String id) {
|
||||
return ResultUtil.data(storeGoodsLabelService.getById(id));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加店铺商品分类")
|
||||
@PostMapping
|
||||
public ResultMessage<StoreGoodsLabel> add(StoreGoodsLabel storeGoodsLabel) {
|
||||
return ResultUtil.data(storeGoodsLabelService.addStoreGoodsLabel(storeGoodsLabel));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改店铺商品分类")
|
||||
@PutMapping
|
||||
public ResultMessage<StoreGoodsLabel> edit(StoreGoodsLabel storeGoodsLabel) {
|
||||
return ResultUtil.data(storeGoodsLabelService.editStoreGoodsLabel(storeGoodsLabel));
|
||||
}
|
||||
|
||||
@ApiImplicitParam(name = "id", value = "店铺商品分类ID", required = true, paramType = "path")
|
||||
@ApiOperation(value = "删除店铺商品分类")
|
||||
@DeleteMapping("/{id}")
|
||||
public ResultMessage<StoreGoodsLabel> delete(@PathVariable String id) {
|
||||
storeGoodsLabelService.removeStoreGoodsLabel(id);
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.goods.entity.dos.Goods;
|
||||
import cn.lili.modules.goods.entity.dos.GoodsSku;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsSearchParams;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsSkuStockDTO;
|
||||
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
||||
import cn.lili.modules.goods.entity.vos.GoodsSkuVO;
|
||||
import cn.lili.modules.goods.entity.vos.GoodsVO;
|
||||
import cn.lili.modules.goods.entity.vos.StockWarningVO;
|
||||
import cn.lili.modules.goods.service.GoodsService;
|
||||
import cn.lili.modules.goods.service.GoodsSkuService;
|
||||
import cn.lili.modules.store.service.StoreDetailService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺端,商品接口
|
||||
*
|
||||
* @author pikachu
|
||||
* @date 2020-02-23 15:18:56
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,商品接口")
|
||||
@RequestMapping("/store/goods")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class GoodsStoreController {
|
||||
|
||||
//商品
|
||||
private final GoodsService goodsService;
|
||||
//商品sku
|
||||
private final GoodsSkuService goodsSkuService;
|
||||
//店铺详情
|
||||
private final StoreDetailService storeDetailService;
|
||||
|
||||
@ApiOperation(value = "分页获取商品列表")
|
||||
@GetMapping(value = "/list")
|
||||
public ResultMessage<IPage<Goods>> getByPage(GoodsSearchParams goodsSearchParams) {
|
||||
|
||||
//获取当前登录商家账号
|
||||
AuthUser tokenUser = UserContext.getCurrentUser();
|
||||
goodsSearchParams.setStoreId(tokenUser.getStoreId());
|
||||
return ResultUtil.data(goodsService.queryByParams(goodsSearchParams));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页获取商品Sku列表")
|
||||
@GetMapping(value = "/sku/list")
|
||||
public ResultMessage<IPage<GoodsSku>> getSkuByPage(GoodsSearchParams goodsSearchParams) {
|
||||
|
||||
//获取当前登录商家账号
|
||||
AuthUser tokenUser = UserContext.getCurrentUser();
|
||||
goodsSearchParams.setStoreId(tokenUser.getStoreId());
|
||||
return ResultUtil.data(goodsSkuService.getGoodsSkuByPage(goodsSearchParams));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页获取库存告警商品列表")
|
||||
@GetMapping(value = "/list/stock")
|
||||
public ResultMessage<StockWarningVO> getWarningStockByPage(GoodsSearchParams goodsSearchParams) {
|
||||
//获取当前登录商家账号
|
||||
AuthUser tokenUser = UserContext.getCurrentUser();
|
||||
Integer stockWarnNum = storeDetailService.getStoreDetail(tokenUser.getStoreId()).getStockWarning();
|
||||
goodsSearchParams.setStoreId(tokenUser.getStoreId());
|
||||
goodsSearchParams.setQuantity(storeDetailService.getStoreDetail(tokenUser.getStoreId()).getStockWarning());
|
||||
goodsSearchParams.setMarketEnable(GoodsStatusEnum.UPPER.name());
|
||||
IPage<GoodsSku> goodsSku = goodsSkuService.getGoodsSkuByPage(goodsSearchParams);
|
||||
StockWarningVO stockWarning = new StockWarningVO(stockWarnNum, goodsSku);
|
||||
return ResultUtil.data(stockWarning);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "通过id获取")
|
||||
@GetMapping(value = "/get/{id}")
|
||||
public ResultMessage<GoodsVO> get(@PathVariable String id) {
|
||||
AuthUser tokenUser = UserContext.getCurrentUser();
|
||||
GoodsVO goods = goodsService.getGoodsVO(id);
|
||||
if (tokenUser.getStoreId().equals(goods.getStoreId())) {
|
||||
return ResultUtil.data(goods);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.USER_AUTHORITY_ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增商品")
|
||||
@PostMapping(value = "/create", consumes = "application/json", produces = "application/json")
|
||||
public ResultMessage<GoodsOperationDTO> save(@RequestBody GoodsOperationDTO goodsOperationDTO) {
|
||||
|
||||
goodsService.addGoods(goodsOperationDTO);
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改商品")
|
||||
@PutMapping(value = "/update/{goodsId}", consumes = "application/json", produces = "application/json")
|
||||
public ResultMessage<GoodsOperationDTO> update(@RequestBody GoodsOperationDTO goodsOperationDTO, @PathVariable String goodsId) {
|
||||
goodsService.editGoods(goodsOperationDTO, goodsId);
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "下架商品", notes = "下架商品时使用")
|
||||
@ApiImplicitParam(name = "goodsId", value = "商品ID", required = true, paramType = "query", allowMultiple = true)
|
||||
@PutMapping(value = "/under")
|
||||
public ResultMessage<Object> underGoods(@RequestParam List<String> goodsId) {
|
||||
|
||||
if (goodsService.updateGoodsMarketAble(goodsId, GoodsStatusEnum.DOWN, "商家下架")) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "上架商品", notes = "上架商品时使用")
|
||||
@PutMapping(value = "/up")
|
||||
@ApiImplicitParam(name = "goodsId", value = "商品ID", required = true, paramType = "query", allowMultiple = true)
|
||||
public ResultMessage<Object> unpGoods(@RequestParam List<String> goodsId) {
|
||||
if (goodsService.updateGoodsMarketAble(goodsId, GoodsStatusEnum.UPPER, "")) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除商品")
|
||||
@PutMapping(value = "/delete")
|
||||
@ApiImplicitParam(name = "goodsId", value = "商品ID", required = true, paramType = "query", allowMultiple = true)
|
||||
public ResultMessage<Object> deleteGoods(@RequestParam List<String> goodsId) {
|
||||
if (goodsService.deleteGoods(goodsId)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "设置商品运费模板")
|
||||
@PutMapping(value = "/freight")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "goodsId", value = "商品ID", required = true, paramType = "query", allowMultiple = true),
|
||||
@ApiImplicitParam(name = "freightPayer", value = "运费承担者", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "templateId", value = "运费模板ID", required = true, paramType = "query")
|
||||
})
|
||||
public ResultMessage<Object> freight(@RequestParam List<String> goodsId, @RequestParam String freightPayer, @RequestParam String templateId) {
|
||||
if (goodsService.freight(goodsId, freightPayer, templateId)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据goodsId分页获取商品规格列表")
|
||||
@GetMapping(value = "/sku/{goodsId}/list")
|
||||
public ResultMessage<List<GoodsSkuVO>> getSkuByList(@PathVariable String goodsId) {
|
||||
|
||||
return ResultUtil.data(goodsSkuService.getGoodsListByGoodsId(goodsId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改商品库存")
|
||||
@PutMapping(value = "/update/stocks", consumes = "application/json")
|
||||
public ResultMessage<Object> updateStocks(@RequestBody List<GoodsSkuStockDTO> updateStockList) {
|
||||
goodsSkuService.updateStocks(updateStockList);
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
|
||||
import cn.lili.common.utils.PageUtil;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.goods.entity.dos.GoodsUnit;
|
||||
import cn.lili.modules.goods.service.GoodsUnitService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 店铺端,商品计量单位接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date 2020/11/26 16:15
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,商品计量单位接口")
|
||||
@RequestMapping("/store/goods/unit")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class GoodsUnitStoreController {
|
||||
|
||||
private final GoodsUnitService goodsUnitService;
|
||||
|
||||
|
||||
@ApiOperation(value = "分页获取商品计量单位")
|
||||
@GetMapping
|
||||
public ResultMessage<IPage<GoodsUnit>> getByPage(PageVO pageVO) {
|
||||
return ResultUtil.data(goodsUnitService.page(PageUtil.initPage(pageVO)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.goods.entity.dos.SpecValues;
|
||||
import cn.lili.modules.goods.service.SpecValuesService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺端,规格项管理接口
|
||||
*
|
||||
* @author pikachu
|
||||
* @date 2020-02-18 15:18:56
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,规格项管理接口")
|
||||
@RequestMapping("/store/goods/spec-values")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class SpecValuesStoreController {
|
||||
|
||||
private final SpecValuesService specValuesService;
|
||||
|
||||
@GetMapping(value = "/values/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "规格项ID", required = true, dataType = "String", paramType = "path")
|
||||
@ApiOperation(value = "查询规格值列表")
|
||||
public ResultMessage<IPage<SpecValues>> list(@PathVariable("id") String id, String specVal, PageVO pageVo) {
|
||||
return ResultUtil.data(specValuesService.queryByParams(id, specVal, pageVo));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "保存规格值")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "商品规格ID", required = true, paramType = "path"),
|
||||
@ApiImplicitParam(name = "specValue", value = "商品项", required = true, allowMultiple = true, paramType = "query")
|
||||
})
|
||||
@PostMapping(value = "/save/{id}")
|
||||
public ResultMessage<List<SpecValues>> saveSpecValue(@PathVariable("id") String specId,
|
||||
@NotNull(message = "至少添加一个规格值") @RequestParam(value = "spec_value") String[] specValue) {
|
||||
//重新添加
|
||||
List<SpecValues> list = specValuesService.addSpecValue(specId, specValue);
|
||||
return ResultUtil.data(list);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.goods.entity.dos.Specification;
|
||||
import cn.lili.modules.goods.entity.dto.SpecificationSearchParams;
|
||||
import cn.lili.modules.goods.entity.vos.SpecificationVO;
|
||||
import cn.lili.modules.goods.service.SpecificationService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 店铺端,规格管理接口
|
||||
*
|
||||
* @author pikachu
|
||||
* @date 2020-02-18 15:18:56
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,规格管理接口")
|
||||
@RequestMapping("/store/goods/spec")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class SpecificationStoreController {
|
||||
|
||||
private final SpecificationService specificationService;
|
||||
|
||||
|
||||
@GetMapping(value = "/page")
|
||||
@ApiOperation(value = "分页获取")
|
||||
public ResultMessage<IPage<Specification>> getByPage(SpecificationSearchParams searchParams, PageVO pageVo) {
|
||||
searchParams.setDeleteFlag(false);
|
||||
return ResultUtil.data(specificationService.getSpecificationByPage(searchParams, pageVo));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation(value = "添加规格")
|
||||
public ResultMessage<Specification> save(@Valid SpecificationVO parameters) {
|
||||
if (parameters.getStoreId() == null) {
|
||||
parameters.setStoreId(UserContext.getCurrentUser().getId());
|
||||
}
|
||||
if (specificationService.addSpecification(parameters) != null) {
|
||||
return ResultUtil.data(parameters);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/{ids}")
|
||||
@ApiImplicitParam(name = "ids", value = "规格ID", required = true, dataType = "String", allowMultiple = true, paramType = "path")
|
||||
@ApiOperation(value = "批量删除")
|
||||
public ResultMessage<Object> delAllByIds(@PathVariable List<String> ids) {
|
||||
specificationService.deleteSpecification(ids);
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package cn.lili.controller.member;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.member.entity.dos.Member;
|
||||
import cn.lili.modules.member.service.MemberService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
/**
|
||||
* 店铺端,管理员接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/16 10:57
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,管理员接口")
|
||||
@RequestMapping("/store/user")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class StoreUserController {
|
||||
|
||||
private final MemberService memberService;
|
||||
|
||||
|
||||
@GetMapping(value = "/info")
|
||||
@ApiOperation(value = "获取当前登录用户接口")
|
||||
public ResultMessage<Member> getUserInfo() {
|
||||
AuthUser tokenUser = UserContext.getCurrentUser();
|
||||
if (tokenUser != null) {
|
||||
Member member = memberService.findByUsername(tokenUser.getUsername());
|
||||
member.setPassword(null);
|
||||
return ResultUtil.data(member);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.USER_NOT_LOGIN);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package cn.lili.controller.other;
|
||||
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.page.entity.dos.Article;
|
||||
import cn.lili.modules.page.entity.dto.ArticleSearchParams;
|
||||
import cn.lili.modules.page.entity.vos.ArticleVO;
|
||||
import cn.lili.modules.page.service.ArticleService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 店铺端,文章接口
|
||||
*
|
||||
* @author pikachu
|
||||
* @date 2020-05-06 15:18:56
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,文章接口")
|
||||
@RequestMapping("/store/article")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class ArticleStoreController {
|
||||
|
||||
/**
|
||||
* 文章
|
||||
*/
|
||||
private final ArticleService articleService;
|
||||
|
||||
@ApiOperation(value = "分页获取")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "categoryId", value = "文章分类ID", paramType = "query")
|
||||
})
|
||||
@GetMapping(value = "/getByPage")
|
||||
public ResultMessage<IPage<ArticleVO>> getByPage(ArticleSearchParams articleSearchParams) {
|
||||
return ResultUtil.data(articleService.articlePage(articleSearchParams));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查看文章")
|
||||
@ApiImplicitParam(name = "id", value = "文章ID", required = true, paramType = "path")
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResultMessage<Article> get(@PathVariable String id) {
|
||||
|
||||
return ResultUtil.data(articleService.getById(id));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package cn.lili.controller.passport;
|
||||
|
||||
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.member.entity.dos.Member;
|
||||
import cn.lili.modules.member.service.MemberService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 店铺端,商家登录接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/12/22 15:02
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@Api(tags = "店铺端,商家登录接口 ")
|
||||
@RequestMapping("/store/login")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class StorePassportController {
|
||||
|
||||
/**
|
||||
* 会员
|
||||
*/
|
||||
private final MemberService memberService;
|
||||
|
||||
|
||||
@ApiOperation(value = "登录接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "username", value = "用户名", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "password", value = "密码", required = true, paramType = "query")
|
||||
})
|
||||
@PostMapping("/userLogin")
|
||||
public ResultMessage<Object> userLogin(@NotNull(message = "用户名不能为空") @RequestParam String username,
|
||||
@NotNull(message = "密码不能为空") @RequestParam String password) {
|
||||
return ResultUtil.data(this.memberService.usernameStoreLogin(username, password));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改密码")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "password", value = "旧密码", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "newPassword", value = "新密码", required = true, paramType = "query")
|
||||
})
|
||||
@PostMapping("/modifyPass")
|
||||
public ResultMessage<Member> modifyPass(@NotNull(message = "旧密码不能为空") @RequestParam String password,
|
||||
@NotNull(message = "新密码不能为空") @RequestParam String newPassword) {
|
||||
return ResultUtil.data(memberService.modifyPass(password, newPassword));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "刷新token")
|
||||
@GetMapping("/refresh/{refreshToken}")
|
||||
public ResultMessage<Object> refreshToken(@NotNull(message = "刷新token不能为空") @PathVariable String refreshToken) {
|
||||
return ResultUtil.data(this.memberService.refreshStoreToken(refreshToken));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package cn.lili.controller.promotion;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.promotion.entity.dos.Coupon;
|
||||
import cn.lili.modules.promotion.entity.enums.PromotionStatusEnum;
|
||||
import cn.lili.modules.promotion.entity.vos.CouponSearchParams;
|
||||
import cn.lili.modules.promotion.entity.vos.CouponVO;
|
||||
import cn.lili.modules.promotion.service.CouponService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺端,优惠券接口
|
||||
*
|
||||
* @author paulG
|
||||
* @date 2020/8/28
|
||||
**/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,优惠券接口")
|
||||
@RequestMapping("/store/promotion/coupon")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class CouponStoreController {
|
||||
|
||||
private final CouponService couponService;
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation(value = "获取优惠券列表")
|
||||
public ResultMessage<IPage<CouponVO>> getCouponList(CouponSearchParams queryParam, PageVO page) {
|
||||
page.setNotConvert(true);
|
||||
AuthUser currentUser = UserContext.getCurrentUser();
|
||||
queryParam.setStoreId(currentUser.getStoreId());
|
||||
IPage<CouponVO> coupons = couponService.getCouponsByPageFromMongo(queryParam, page);
|
||||
return ResultUtil.data(coupons);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取优惠券详情")
|
||||
@GetMapping("/{couponId}")
|
||||
public ResultMessage<Coupon> getCouponList(@PathVariable String couponId) {
|
||||
AuthUser currentUser = UserContext.getCurrentUser();
|
||||
Coupon coupon = couponService.getCouponDetailFromMongo(couponId);
|
||||
if (coupon == null || !coupon.getStoreId().equals(currentUser.getStoreId())) {
|
||||
return ResultUtil.error(ResultCode.USER_AUTHORITY_ERROR);
|
||||
}
|
||||
return ResultUtil.data(coupon);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加优惠券")
|
||||
@PostMapping(consumes = "application/json", produces = "application/json")
|
||||
public ResultMessage<CouponVO> addCoupon(@RequestBody CouponVO couponVO) {
|
||||
AuthUser currentUser = UserContext.getCurrentUser();
|
||||
couponVO.setStoreId(currentUser.getStoreId());
|
||||
couponVO.setStoreName(currentUser.getStoreName());
|
||||
if (couponService.add(couponVO) != null) {
|
||||
return ResultUtil.data(couponVO);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@PutMapping(consumes = "application/json", produces = "application/json")
|
||||
@ApiOperation(value = "修改优惠券")
|
||||
public ResultMessage<Coupon> updateCoupon(@RequestBody CouponVO couponVO) {
|
||||
AuthUser currentUser = UserContext.getCurrentUser();
|
||||
couponVO.setStoreId(currentUser.getStoreId());
|
||||
couponVO.setStoreName(currentUser.getStoreName());
|
||||
couponVO.setPromotionStatus(PromotionStatusEnum.NEW.name());
|
||||
Coupon byId = couponService.getById(couponVO.getId());
|
||||
if (!currentUser.getStoreId().equals(byId.getStoreId())) {
|
||||
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
|
||||
}
|
||||
CouponVO coupon = couponService.updateCoupon(couponVO);
|
||||
if (coupon != null) {
|
||||
|
||||
return ResultUtil.data(coupon);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/{ids}")
|
||||
@ApiOperation(value = "批量删除")
|
||||
public ResultMessage<Object> delAllByIds(@PathVariable List<String> ids) {
|
||||
AuthUser currentUser = UserContext.getCurrentUser();
|
||||
Coupon byId = couponService.getById(ids.get(0));
|
||||
if (!currentUser.getStoreId().equals(byId.getStoreId())) {
|
||||
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
|
||||
}
|
||||
for (String id : ids) {
|
||||
couponService.deleteCoupon(id);
|
||||
}
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改优惠券状态")
|
||||
@PutMapping("/status")
|
||||
public ResultMessage<Object> updateCouponStatus(String couponIds, String promotionStatus) {
|
||||
String[] split = couponIds.split(",");
|
||||
if (couponService.updateCouponStatus(Arrays.asList(split), PromotionStatusEnum.valueOf(promotionStatus))) {
|
||||
return ResultUtil.success(ResultCode.COUPON_EDIT_STATUS_SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.COUPON_EDIT_STATUS_ERROR);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package cn.lili.controller.promotion;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.promotion.entity.dos.FullDiscount;
|
||||
import cn.lili.modules.promotion.entity.enums.PromotionStatusEnum;
|
||||
import cn.lili.modules.promotion.entity.vos.FullDiscountSearchParams;
|
||||
import cn.lili.modules.promotion.service.FullDiscountService;
|
||||
import cn.lili.modules.order.cart.entity.vo.FullDiscountVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 店铺端,满额活动接口
|
||||
*
|
||||
* @author paulG
|
||||
* @date 2020/8/19
|
||||
**/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,满额活动接口")
|
||||
@RequestMapping("/store/promotion/fullDiscount")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class FullDiscountStoreController {
|
||||
|
||||
private final FullDiscountService fullDiscountService;
|
||||
|
||||
@ApiOperation(value = "新增满优惠活动")
|
||||
@PostMapping(consumes = "application/json", produces = "application/json")
|
||||
public ResultMessage<FullDiscount> addFullDiscount(@RequestBody FullDiscountVO fullDiscountVO) {
|
||||
AuthUser currentUser = UserContext.getCurrentUser();
|
||||
fullDiscountVO.setStoreId(currentUser.getStoreId());
|
||||
fullDiscountVO.setStoreName(currentUser.getStoreName());
|
||||
fullDiscountVO.setPromotionStatus(PromotionStatusEnum.NEW.name());
|
||||
FullDiscount fullDiscount = fullDiscountService.addFullDiscount(fullDiscountVO);
|
||||
return ResultUtil.data(fullDiscount);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过id获取")
|
||||
@GetMapping("/{id}")
|
||||
public ResultMessage<FullDiscountVO> get(@PathVariable String id) {
|
||||
FullDiscountVO fullDiscount = fullDiscountService.getFullDiscount(id);
|
||||
return ResultUtil.data(fullDiscount);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据条件分页查询满优惠活动")
|
||||
@GetMapping
|
||||
public ResultMessage<IPage<FullDiscountVO>> getFullDiscountByPage(FullDiscountSearchParams searchParams, PageVO page) {
|
||||
String storeId = UserContext.getCurrentUser().getStoreId();
|
||||
searchParams.setStoreId(storeId);
|
||||
IPage<FullDiscountVO> fullDiscountByPage = fullDiscountService.getFullDiscountByPageFromMongo(searchParams, page);
|
||||
return ResultUtil.data(fullDiscountByPage);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改满优惠活动")
|
||||
@PutMapping(consumes = "application/json", produces = "application/json")
|
||||
public ResultMessage<String> editFullDiscount(@RequestBody FullDiscountVO fullDiscountVO) {
|
||||
AuthUser currentUser = UserContext.getCurrentUser();
|
||||
fullDiscountVO.setStoreId(currentUser.getStoreId());
|
||||
fullDiscountVO.setStoreName(currentUser.getStoreName());
|
||||
fullDiscountService.modifyFullDiscount(fullDiscountVO);
|
||||
return ResultUtil.success(ResultCode.FULL_DISCOUNT_EDIT_SUCCESS);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除满优惠活动")
|
||||
@DeleteMapping("/{id}")
|
||||
public ResultMessage<String> deleteFullDiscount(@PathVariable String id) {
|
||||
fullDiscountService.deleteFullDiscount(id);
|
||||
return ResultUtil.success(ResultCode.FULL_DISCOUNT_EDIT_DELETE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package cn.lili.controller.promotion;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.promotion.entity.dto.PromotionGoodsDTO;
|
||||
import cn.lili.modules.promotion.entity.enums.PromotionTypeEnum;
|
||||
import cn.lili.modules.promotion.entity.vos.PintuanSearchParams;
|
||||
import cn.lili.modules.promotion.entity.vos.PintuanVO;
|
||||
import cn.lili.modules.promotion.entity.vos.PromotionGoodsSearchParams;
|
||||
import cn.lili.modules.promotion.service.PintuanService;
|
||||
import cn.lili.modules.promotion.service.PromotionGoodsService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 店铺端,拼团管理接口
|
||||
*
|
||||
* @author paulG
|
||||
* @since 2020/10/9
|
||||
**/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,拼团管理接口")
|
||||
@RequestMapping("/store/promotion/pintuan")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class PintuanStoreController {
|
||||
|
||||
private final PintuanService pintuanService;
|
||||
private final PromotionGoodsService promotionGoodsService;
|
||||
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation(value = "根据条件分页查询拼团活动列表")
|
||||
public ResultMessage<IPage<PintuanVO>> getPintuanByPage(PintuanSearchParams queryParam, PageVO pageVo) {
|
||||
AuthUser currentUser = UserContext.getCurrentUser();
|
||||
queryParam.setStoreId(currentUser.getStoreId());
|
||||
IPage<PintuanVO> pintuanByPageFromMongo = pintuanService.getPintuanByPageFromMongo(queryParam, pageVo);
|
||||
return ResultUtil.data(pintuanByPageFromMongo);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation(value = "通过id获取")
|
||||
public ResultMessage<PintuanVO> get(@PathVariable String id) {
|
||||
return ResultUtil.data(pintuanService.getPintuanByIdFromMongo(id));
|
||||
}
|
||||
|
||||
@GetMapping("/goods/{pintuanId}")
|
||||
@ApiOperation(value = "根据条件分页查询拼团活动商品列表")
|
||||
public ResultMessage<IPage<PromotionGoodsDTO>> getPintuanGoodsByPage(@PathVariable String pintuanId, PageVO pageVo) {
|
||||
PromotionGoodsSearchParams searchParams = new PromotionGoodsSearchParams();
|
||||
searchParams.setPromotionId(pintuanId);
|
||||
searchParams.setPromotionType(PromotionTypeEnum.PINTUAN.name());
|
||||
IPage<PromotionGoodsDTO> promotionGoods = promotionGoodsService.getPromotionGoods(searchParams, pageVo);
|
||||
return ResultUtil.data(promotionGoods);
|
||||
}
|
||||
|
||||
@PostMapping(consumes = "application/json", produces = "application/json")
|
||||
@ApiOperation(value = "添加拼团活动")
|
||||
public ResultMessage<String> addPintuan(@RequestBody PintuanVO pintuan) {
|
||||
AuthUser currentUser = UserContext.getCurrentUser();
|
||||
pintuan.setStoreId(currentUser.getStoreId());
|
||||
pintuan.setStoreName(currentUser.getStoreName());
|
||||
if (pintuanService.addPintuan(pintuan)) {
|
||||
return ResultUtil.success(ResultCode.PINTUAN_ADD_SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.PINTUAN_ADD_ERROR);
|
||||
}
|
||||
|
||||
@PutMapping(consumes = "application/json", produces = "application/json")
|
||||
@ApiOperation(value = "修改拼团活动")
|
||||
public ResultMessage<String> editPintuan(@RequestBody PintuanVO pintuan) {
|
||||
AuthUser currentUser = UserContext.getCurrentUser();
|
||||
pintuan.setStoreId(currentUser.getStoreId());
|
||||
pintuan.setStoreName(currentUser.getStoreName());
|
||||
if (pintuanService.modifyPintuan(pintuan)) {
|
||||
return ResultUtil.success(ResultCode.PINTUAN_EDIT_SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.PINTUAN_EDIT_ERROR);
|
||||
}
|
||||
|
||||
@PutMapping("/open/{pintuanId}")
|
||||
@ApiOperation(value = "手动开启拼团活动")
|
||||
public ResultMessage<String> openPintuan(@PathVariable String pintuanId, Long startTime, Long endTime) {
|
||||
if (pintuanService.openPintuan(pintuanId, new Date(startTime), new Date(endTime))) {
|
||||
return ResultUtil.success(ResultCode.PINTUAN_MANUAL_OPEN_SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.PINTUAN_MANUAL_OPEN_ERROR);
|
||||
|
||||
}
|
||||
|
||||
@PutMapping("/close/{pintuanId}")
|
||||
@ApiOperation(value = "手动关闭拼团活动")
|
||||
public ResultMessage<String> closePintuan(@PathVariable String pintuanId) {
|
||||
if (pintuanService.closePintuan(pintuanId)) {
|
||||
return ResultUtil.success(ResultCode.PINTUAN_MANUAL_CLOSE_SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.PINTUAN_MANUAL_CLOSE_ERROR);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{pintuanId}")
|
||||
@ApiOperation(value = "手动删除拼团活动")
|
||||
public ResultMessage<String> deletePintuan(@PathVariable String pintuanId) {
|
||||
if (pintuanService.deletePintuan(pintuanId)) {
|
||||
return ResultUtil.success(ResultCode.PINTUAN_DELETE_SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.PINTUAN_DELETE_ERROR);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package cn.lili.controller.promotion;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.promotion.entity.dos.Seckill;
|
||||
import cn.lili.modules.promotion.entity.dos.SeckillApply;
|
||||
import cn.lili.modules.promotion.entity.vos.SeckillApplyVO;
|
||||
import cn.lili.modules.promotion.entity.vos.SeckillSearchParams;
|
||||
import cn.lili.modules.promotion.entity.vos.SeckillVO;
|
||||
import cn.lili.modules.promotion.service.SeckillApplyService;
|
||||
import cn.lili.modules.promotion.service.SeckillService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺端,限时抢购接口
|
||||
*
|
||||
* @author paulG
|
||||
* @date 2020/8/26
|
||||
**/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,限时抢购接口")
|
||||
@RequestMapping("/store/promotion/seckill")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class SeckillStoreController {
|
||||
|
||||
private final SeckillService seckillService;
|
||||
private final SeckillApplyService seckillApplyService;
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation(value = "获取限时抢购列表")
|
||||
public ResultMessage<IPage<SeckillVO>> getSeckillPage(SeckillSearchParams queryParam, PageVO pageVo) {
|
||||
IPage<SeckillVO> seckillPage = seckillService.getSeckillByPageFromMongo(queryParam, pageVo);
|
||||
return ResultUtil.data(seckillPage);
|
||||
}
|
||||
|
||||
@GetMapping("/apply")
|
||||
@ApiOperation(value = "获取限时抢购申请列表")
|
||||
public ResultMessage<IPage<SeckillApply>> getSeckillApplyPage(SeckillSearchParams queryParam, PageVO pageVo) {
|
||||
String storeId = UserContext.getCurrentUser().getStoreId();
|
||||
queryParam.setStoreId(storeId);
|
||||
IPage<SeckillApply> seckillPage = seckillApplyService.getSeckillApplyFromMongo(queryParam, pageVo);
|
||||
return ResultUtil.data(seckillPage);
|
||||
}
|
||||
|
||||
@GetMapping("/{seckillId}")
|
||||
@ApiOperation(value = "获取限时抢购")
|
||||
public ResultMessage<Seckill> getSeckill(@PathVariable String seckillId) {
|
||||
return ResultUtil.data(seckillService.getSeckillByIdFromMongo(seckillId));
|
||||
}
|
||||
|
||||
@GetMapping("/apply/{seckillApplyId}")
|
||||
@ApiOperation(value = "获取限时抢购申请")
|
||||
public ResultMessage<SeckillApply> getSeckillApply(@PathVariable String seckillApplyId) {
|
||||
return ResultUtil.data(seckillApplyService.getById(seckillApplyId));
|
||||
}
|
||||
|
||||
@PostMapping(path = "/apply/{seckillId}", consumes = "application/json", produces = "application/json")
|
||||
@ApiOperation(value = "添加限时抢购申请")
|
||||
public ResultMessage<String> addSeckillApply(@PathVariable String seckillId, @RequestBody List<SeckillApplyVO> applyVos) {
|
||||
String storeId = UserContext.getCurrentUser().getStoreId();
|
||||
seckillApplyService.addSeckillApply(seckillId, storeId, applyVos);
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
|
||||
@DeleteMapping("/apply/{seckillId}/{ids}")
|
||||
@ApiOperation(value = "删除限时抢购申请")
|
||||
public ResultMessage<String> deleteSeckillApply(@PathVariable("seckillId") String seckillId, @PathVariable("ids") String ids) {
|
||||
String[] idsSplit = ids.split(",");
|
||||
seckillApplyService.removeSeckillApplyByIds(seckillId, Arrays.asList(idsSplit));
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package cn.lili.controller.settings;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.store.entity.vos.FreightTemplateVO;
|
||||
import cn.lili.modules.store.service.FreightTemplateService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺端,运费模板接口
|
||||
*
|
||||
* @author paulG
|
||||
* @date 2020/8/26
|
||||
**/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,运费模板接口")
|
||||
@RequestMapping("/store/freightTemplate")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class FreightTemplateStoreController {
|
||||
|
||||
private final FreightTemplateService freightTemplateService;
|
||||
|
||||
@ApiOperation(value = "商家运费模板列表")
|
||||
@GetMapping
|
||||
private ResultMessage<List<FreightTemplateVO>> list() {
|
||||
return ResultUtil.data(freightTemplateService.getFreightTemplateList(UserContext.getCurrentUser().getStoreId()));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取商家运费模板详情")
|
||||
@ApiImplicitParam(name = "id", value = "商家模板ID", required = true, paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
private ResultMessage<FreightTemplateVO> list(@PathVariable String id) {
|
||||
return ResultUtil.data(freightTemplateService.getFreightTemplate(id));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加商家运费模板")
|
||||
@PostMapping
|
||||
public ResultMessage<FreightTemplateVO> add(@Valid @RequestBody FreightTemplateVO freightTemplateVO) {
|
||||
return ResultUtil.data(freightTemplateService.addFreightTemplate(freightTemplateVO));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改商家运费模板")
|
||||
@PutMapping("/{id}")
|
||||
public ResultMessage<FreightTemplateVO> edit(@PathVariable String id, @RequestBody @Valid FreightTemplateVO freightTemplateVO) {
|
||||
return ResultUtil.data(freightTemplateService.editFreightTemplate(freightTemplateVO));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除商家运费模板")
|
||||
@ApiImplicitParam(name = "id", value = "商家模板ID", required = true, paramType = "path")
|
||||
@DeleteMapping("/{id}")
|
||||
public ResultMessage<Object> edit(@PathVariable String id) {
|
||||
if (freightTemplateService.removeFreightTemplate(id)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package cn.lili.controller.settings;
|
||||
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.common.vo.SearchVO;
|
||||
import cn.lili.modules.permission.service.SystemLogService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
/**
|
||||
* 店铺端,日志管理接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date: 2020/11/22 14:23
|
||||
*/
|
||||
@Transactional
|
||||
@RestController
|
||||
@Api(tags = "店铺端,日志管理接口")
|
||||
@RequestMapping("/store/log")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class LogStoreController {
|
||||
|
||||
private final SystemLogService systemLogService;
|
||||
|
||||
@GetMapping(value = "/getAllByPage")
|
||||
@ApiOperation(value = "分页获取全部")
|
||||
public ResultMessage<Object> getAllByPage(@RequestParam(required = false) Integer type,
|
||||
@RequestParam String key,
|
||||
String operatorName,
|
||||
SearchVO searchVo,
|
||||
PageVO pageVo) {
|
||||
return ResultUtil.data(systemLogService.queryLog(UserContext.getCurrentUser().getStoreId(), operatorName, key, searchVo, pageVo));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package cn.lili.controller.settings;
|
||||
|
||||
|
||||
import cn.lili.common.enums.MessageCode;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.store.entity.dos.StoreLogistics;
|
||||
import cn.lili.modules.system.entity.vo.StoreLogisticsVO;
|
||||
import cn.lili.modules.system.service.StoreLogisticsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺端,物流公司接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2020/11/22 14:23
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,物流公司接口")
|
||||
@RequestMapping("/store/logistics")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class LogisticsStoreController {
|
||||
|
||||
/**
|
||||
* 物流公司
|
||||
*/
|
||||
private final StoreLogisticsService storeLogisticsService;
|
||||
|
||||
@ApiOperation(value = "获取商家物流公司列表,如果已选择则checked有值")
|
||||
@GetMapping
|
||||
public ResultMessage<List<StoreLogisticsVO>> get() {
|
||||
return ResultUtil.data(storeLogisticsService.getStoreLogistics());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取商家已选择物流公司列表")
|
||||
@GetMapping("/getChecked")
|
||||
public ResultMessage<List<StoreLogisticsVO>> getChecked() {
|
||||
return ResultUtil.data(storeLogisticsService.getStoreSelectedLogistics());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "选择物流公司")
|
||||
@ApiImplicitParam(name = "logisticsId", value = "物流公司ID", required = true, paramType = "path")
|
||||
@PostMapping("/{logisticsId}")
|
||||
public ResultMessage<StoreLogistics> checked(@PathVariable String logisticsId) {
|
||||
return ResultUtil.data(storeLogisticsService.add(logisticsId));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "取消选择物流公司")
|
||||
@ApiImplicitParam(name = "id", value = "物流公司ID", required = true, paramType = "path")
|
||||
@DeleteMapping(value = "/{id}")
|
||||
public ResultMessage<Object> cancel(@PathVariable String id) {
|
||||
storeLogisticsService.removeById(id);
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package cn.lili.controller.settings;
|
||||
|
||||
|
||||
import cn.lili.common.enums.MessageCode;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.store.entity.dos.StoreAddress;
|
||||
import cn.lili.modules.store.service.StoreAddressService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 店铺端,商家地址(自提点)接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2020/11/22 14:23
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,商家地址(自提点)接口")
|
||||
@RequestMapping("/store/storeAddress")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class StoreAddressController {
|
||||
|
||||
/**
|
||||
* 店铺自提点
|
||||
*/
|
||||
private final StoreAddressService storeAddressService;
|
||||
|
||||
@ApiOperation(value = "获取商家自提点分页")
|
||||
@GetMapping
|
||||
public ResultMessage<IPage<StoreAddress>> get(PageVO pageVo) {
|
||||
return ResultUtil.data(storeAddressService.getStoreAddress(pageVo));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取商家自提点信息")
|
||||
@ApiImplicitParam(name = "id", value = "自提点ID", required = true, paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
public ResultMessage<StoreAddress> get(@PathVariable String id) {
|
||||
return ResultUtil.data(storeAddressService.getById(id));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加")
|
||||
@PostMapping
|
||||
public ResultMessage<StoreAddress> add(@Valid StoreAddress storeAddress) {
|
||||
storeAddress.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
storeAddressService.save(storeAddress);
|
||||
return ResultUtil.data(storeAddress);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "编辑")
|
||||
@ApiImplicitParam(name = "id", value = "自提点ID", required = true, paramType = "path")
|
||||
@PutMapping("/{id}")
|
||||
public ResultMessage<StoreAddress> edit(@PathVariable String id, @Valid StoreAddress storeAddress) {
|
||||
storeAddress.setId(id);
|
||||
storeAddress.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
storeAddressService.updateById(storeAddress);
|
||||
return ResultUtil.data(storeAddress);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除")
|
||||
@ApiImplicitParam(name = "id", value = "自提点ID", required = true, paramType = "path")
|
||||
@DeleteMapping(value = "/{id}")
|
||||
public ResultMessage<Object> delByIds(@PathVariable String id) {
|
||||
storeAddressService.removeStoreAddress(id);
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package cn.lili.controller.settings;
|
||||
|
||||
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.message.entity.dos.StoreMessage;
|
||||
import cn.lili.modules.message.entity.enums.MessageStatusEnum;
|
||||
import cn.lili.modules.message.entity.vos.StoreMessageQueryVO;
|
||||
import cn.lili.modules.message.service.StoreMessageService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 店铺端,消息接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2020/11/22 14:23
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,消息接口")
|
||||
@RequestMapping("/store/message")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class StoreMessageController {
|
||||
|
||||
/**
|
||||
* 商家消息
|
||||
*/
|
||||
private final StoreMessageService storeMessageService;
|
||||
|
||||
@ApiOperation(value = "获取商家消息")
|
||||
@ApiImplicitParam(name = "status", value = "状态", required = true, paramType = "query")
|
||||
@GetMapping
|
||||
public ResultMessage<IPage<StoreMessage>> getPage(String status, PageVO pageVo) {
|
||||
StoreMessageQueryVO storeMessageQueryVO = new StoreMessageQueryVO();
|
||||
storeMessageQueryVO.setStatus(status);
|
||||
storeMessageQueryVO.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
IPage<StoreMessage> page = storeMessageService.getPage(storeMessageQueryVO, pageVo);
|
||||
return ResultUtil.data(page);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "获取商家消息总汇")
|
||||
@GetMapping("/all")
|
||||
public ResultMessage<Map<String, Object>> getPage(PageVO pageVo) {
|
||||
//返回值定义
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
StoreMessageQueryVO storeMessageQueryVO = new StoreMessageQueryVO();
|
||||
storeMessageQueryVO.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
//未读消息
|
||||
storeMessageQueryVO.setStatus(MessageStatusEnum.UN_READY.name());
|
||||
IPage<StoreMessage> page = storeMessageService.getPage(storeMessageQueryVO, pageVo);
|
||||
map.put("UN_READY", page);
|
||||
//已读消息
|
||||
storeMessageQueryVO.setStatus(MessageStatusEnum.ALREADY_READY.name());
|
||||
page = storeMessageService.getPage(storeMessageQueryVO, pageVo);
|
||||
map.put("ALREADY_READY", page);
|
||||
//回收站
|
||||
storeMessageQueryVO.setStatus(MessageStatusEnum.ALREADY_REMOVE.name());
|
||||
page = storeMessageService.getPage(storeMessageQueryVO, pageVo);
|
||||
map.put("ALREADY_REMOVE", page);
|
||||
return ResultUtil.data(map);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "已读操作")
|
||||
@ApiImplicitParam(name = "id", value = "店铺消息id", required = true, paramType = "path")
|
||||
@PutMapping("/{id}/read")
|
||||
public ResultMessage<Boolean> readMessage(@PathVariable String id) {
|
||||
Boolean result = storeMessageService.editStatus(MessageStatusEnum.ALREADY_READY.name(), id);
|
||||
return ResultUtil.data(result);
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation(value = "回收站还原消息")
|
||||
@ApiImplicitParam(name = "id", value = "店铺消息id", required = true, paramType = "path")
|
||||
@PutMapping("/{id}/reduction")
|
||||
public ResultMessage<Boolean> reductionMessage(@PathVariable String id) {
|
||||
Boolean result = storeMessageService.editStatus(MessageStatusEnum.ALREADY_READY.name(), id);
|
||||
return ResultUtil.data(result);
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除操作")
|
||||
@ApiImplicitParam(name = "id", value = "店铺消息id", required = true, paramType = "path")
|
||||
@DeleteMapping("/{id}/delete")
|
||||
public ResultMessage<Boolean> deleteMessage(@PathVariable String id) {
|
||||
Boolean result = storeMessageService.editStatus(MessageStatusEnum.ALREADY_REMOVE.name(), id);
|
||||
return ResultUtil.data(result);
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation(value = "彻底删除操作")
|
||||
@ApiImplicitParam(name = "id", value = "店铺消息id", required = true, paramType = "path")
|
||||
@DeleteMapping("/{id}")
|
||||
public ResultMessage<Boolean> disabled(@PathVariable String id) {
|
||||
Boolean result = storeMessageService.deleteByMessageId(id);
|
||||
return ResultUtil.data(result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package cn.lili.controller.settings;
|
||||
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.page.entity.dos.PageData;
|
||||
import cn.lili.modules.page.entity.dto.PageDataDTO;
|
||||
import cn.lili.modules.page.entity.enums.PageEnum;
|
||||
import cn.lili.modules.page.entity.vos.PageDataListVO;
|
||||
import cn.lili.modules.page.service.PageDataService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 店铺端,页面接口
|
||||
*
|
||||
* @author paulGao
|
||||
* @date: 2020/11/22 14:23
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,页面接口")
|
||||
@RequestMapping("/store/pageData")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class StorePageDataController {
|
||||
|
||||
private final PageDataService pageDataService;
|
||||
|
||||
@ApiOperation(value = "页面列表")
|
||||
@ApiImplicitParam(name = "pageClientType", value = "客户端类型", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/{pageClientType}/pageDataList")
|
||||
public ResultMessage<IPage<PageDataListVO>> pageDataList(@PathVariable String pageClientType, PageVO pageVO) {
|
||||
PageDataDTO pageDataDTO = new PageDataDTO();
|
||||
pageDataDTO.setPageType(PageEnum.STORE.name());
|
||||
pageDataDTO.setPageClientType(pageClientType);
|
||||
pageDataDTO.setNum(UserContext.getCurrentUser().getStoreId());
|
||||
return ResultUtil.data(pageDataService.getPageDataList(pageVO, pageDataDTO));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取页面信息")
|
||||
@ApiImplicitParam(name = "id", value = "页面ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResultMessage<PageData> getPageData(@PathVariable String id) {
|
||||
return ResultUtil.data(pageDataService.getById(id));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加店铺首页")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "name", value = "页面名称", required = true, dataType = "String", paramType = "query"),
|
||||
@ApiImplicitParam(name = "pageClientType", value = "客户端类型", required = true, dataType = "String", paramType = "query"),
|
||||
@ApiImplicitParam(name = "pageData", value = "页面数据", required = true, dataType = "String", paramType = "query")
|
||||
})
|
||||
@PostMapping("/save")
|
||||
public ResultMessage<PageData> savePageData(@RequestParam String name, @RequestParam String pageClientType, @RequestParam String pageData) {
|
||||
return ResultUtil.data(pageDataService.addPageData(new PageData(name, pageClientType, pageData)));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改首页")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "页面ID", required = true, dataType = "String", paramType = "path")
|
||||
})
|
||||
@PutMapping("/update/{id}")
|
||||
public ResultMessage<PageData> updatePageData(@Valid PageData pageData, @PathVariable String id) {
|
||||
pageData.setId(id);
|
||||
return ResultUtil.data(pageDataService.updatePageData(pageData));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "发布页面")
|
||||
@ApiImplicitParam(name = "id", value = "页面ID", required = true, dataType = "String", paramType = "path")
|
||||
@PutMapping("/release/{id}")
|
||||
public ResultMessage<PageData> releasePageData(@PathVariable String id) {
|
||||
return ResultUtil.data(pageDataService.releasePageData(id));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除页面")
|
||||
@ApiImplicitParam(name = "id", value = "页面ID", required = true, dataType = "String", paramType = "path")
|
||||
@DeleteMapping("/removePageData/{id}")
|
||||
public ResultMessage<Object> removePageData(@PathVariable String id) {
|
||||
return ResultUtil.data(pageDataService.removePageData(id));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package cn.lili.controller.settings;
|
||||
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.store.entity.dos.StoreDetail;
|
||||
import cn.lili.modules.store.entity.dto.StoreAfterSaleAddressDTO;
|
||||
import cn.lili.modules.store.entity.dto.StoreSettingDTO;
|
||||
import cn.lili.modules.store.entity.vos.StoreVO;
|
||||
import cn.lili.modules.store.service.StoreDetailService;
|
||||
import cn.lili.modules.store.service.StoreService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 店铺端,店铺设置接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2020/11/22 14:23
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,店铺设置接口")
|
||||
@RequestMapping("/store/settings")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class StoreSettingsController {
|
||||
|
||||
/**
|
||||
* 店铺
|
||||
*/
|
||||
private final StoreService storeService;
|
||||
/**
|
||||
* 店铺详情
|
||||
*/
|
||||
private final StoreDetailService storeDetailService;
|
||||
|
||||
@ApiOperation(value = "获取商家设置")
|
||||
@GetMapping
|
||||
public ResultMessage<StoreVO> get() {
|
||||
//获取当前登录商家内容
|
||||
return ResultUtil.data(storeService.getStoreDetail());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改商家设置")
|
||||
@PutMapping
|
||||
public ResultMessage<StoreDetail> edit(@Valid StoreSettingDTO storeSettingDTO) {
|
||||
//修改商家设置
|
||||
if (storeDetailService.editStoreSetting(storeSettingDTO)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改店铺库存预警数量")
|
||||
@ApiImplicitParam(name = "stockWarning", value = "库存预警数量", required = true, dataType = "Integer", paramType = "query")
|
||||
@PutMapping("/updateStockWarning")
|
||||
public ResultMessage<StoreDetail> updateStockWarning(Integer stockWarning) {
|
||||
//修改商家设置
|
||||
if (storeDetailService.updateStockWarning(stockWarning)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取商家退货收件地址")
|
||||
@GetMapping("/storeAfterSaleAddress")
|
||||
public ResultMessage<StoreAfterSaleAddressDTO> getStoreAfterSaleAddress() {
|
||||
//获取当前登录商家内容
|
||||
return ResultUtil.data(storeDetailService.getStoreAfterSaleAddressDTO());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改商家退货收件地址")
|
||||
@PutMapping("/storeAfterSaleAddress")
|
||||
public ResultMessage<StoreDetail> editStoreAfterSaleAddress(@Valid StoreAfterSaleAddressDTO storeAfterSaleAddressDTO) {
|
||||
//修改商家退货收件地址
|
||||
if (storeDetailService.editStoreAfterSaleAddressDTO(storeAfterSaleAddressDTO)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.lili.controller.statistics;
|
||||
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.statistics.model.dto.GoodsStatisticsQueryParam;
|
||||
import cn.lili.modules.statistics.model.vo.GoodsStatisticsDataVO;
|
||||
import cn.lili.modules.statistics.service.GoodsStatisticsDataService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺端,商品统计接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2020/11/22 14:23
|
||||
*/
|
||||
@Api(tags = "店铺端,商品统计接口")
|
||||
@RestController
|
||||
@RequestMapping("/store/statistics/goods")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class GoodsStatisticsStoreController {
|
||||
|
||||
/**
|
||||
* 商品统计
|
||||
*/
|
||||
private final GoodsStatisticsDataService goodsStatisticsDataService;
|
||||
|
||||
@ApiOperation(value = "获取统计列表,排行前一百的数据")
|
||||
@GetMapping
|
||||
public ResultMessage<List<GoodsStatisticsDataVO>> getByPage(GoodsStatisticsQueryParam statisticsQueryParam) {
|
||||
statisticsQueryParam.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
return ResultUtil.data(goodsStatisticsDataService.getGoodsStatisticsData(statisticsQueryParam, 100));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package cn.lili.controller.statistics;
|
||||
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.statistics.model.dto.GoodsStatisticsQueryParam;
|
||||
import cn.lili.modules.statistics.model.vo.GoodsStatisticsDataVO;
|
||||
import cn.lili.modules.statistics.model.vo.StoreIndexStatisticsVO;
|
||||
import cn.lili.modules.statistics.service.GoodsStatisticsDataService;
|
||||
import cn.lili.modules.statistics.service.IndexStatisticsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺端,首页统计接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2020/12/9 19:04
|
||||
*/
|
||||
@Api(tags = "店铺端,首页统计接口")
|
||||
@RestController
|
||||
@RequestMapping("/store/statistics/index")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class IndexStatisticsStoreController {
|
||||
|
||||
/**
|
||||
* 热卖商品统计
|
||||
*/
|
||||
private final GoodsStatisticsDataService goodsStatisticsDataService;
|
||||
/**
|
||||
* 首页统计
|
||||
*/
|
||||
private final IndexStatisticsService indexStatisticsService;
|
||||
|
||||
@ApiOperation(value = "获取统计列表,排行前一百的数据")
|
||||
@GetMapping("/top100")
|
||||
public ResultMessage<List<GoodsStatisticsDataVO>> getByPage(GoodsStatisticsQueryParam statisticsQueryParam) {
|
||||
statisticsQueryParam.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
return ResultUtil.data(goodsStatisticsDataService.getGoodsStatisticsData(statisticsQueryParam, 100));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取首页查询数据")
|
||||
@GetMapping
|
||||
public ResultMessage<StoreIndexStatisticsVO> index() {
|
||||
return ResultUtil.data(indexStatisticsService.storeIndexStatistics());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package cn.lili.controller.statistics;
|
||||
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.order.order.entity.dos.AfterSale;
|
||||
import cn.lili.modules.order.order.entity.vo.OrderSimpleVO;
|
||||
import cn.lili.modules.order.order.service.AfterSaleService;
|
||||
import cn.lili.modules.order.order.service.OrderService;
|
||||
import cn.lili.modules.statistics.model.dto.StatisticsQueryParam;
|
||||
import cn.lili.modules.statistics.model.vo.OrderOverviewVO;
|
||||
import cn.lili.modules.statistics.model.vo.OrderStatisticsDataVO;
|
||||
import cn.lili.modules.statistics.service.OrderStatisticsDataService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺端,订单统计接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2020/12/9 19:04
|
||||
*/
|
||||
@Api(tags = "店铺端,订单统计接口")
|
||||
@RestController
|
||||
@RequestMapping("/store/statistics/order")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class OrderStatisticsStoreController {
|
||||
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
private final OrderService orderService;
|
||||
/**
|
||||
* 售后
|
||||
*/
|
||||
private final AfterSaleService afterSaleService;
|
||||
/**
|
||||
* 订单统计
|
||||
*/
|
||||
private final OrderStatisticsDataService orderStatisticsDataService;
|
||||
|
||||
@ApiOperation(value = "订单概览统计")
|
||||
@GetMapping("/overview")
|
||||
public ResultMessage<OrderOverviewVO> overview(StatisticsQueryParam statisticsQueryParam) {
|
||||
try {
|
||||
statisticsQueryParam.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
return ResultUtil.data(orderStatisticsDataService.overview(statisticsQueryParam));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "订单图表统计")
|
||||
@GetMapping
|
||||
public ResultMessage<List<OrderStatisticsDataVO>> statisticsChart(StatisticsQueryParam statisticsQueryParam) {
|
||||
try {
|
||||
statisticsQueryParam.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
return ResultUtil.data(orderStatisticsDataService.statisticsChart(statisticsQueryParam));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "订单统计")
|
||||
@GetMapping("/order")
|
||||
public ResultMessage<IPage<OrderSimpleVO>> order(StatisticsQueryParam statisticsQueryParam, PageVO pageVO) {
|
||||
|
||||
try {
|
||||
statisticsQueryParam.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
return ResultUtil.data(orderService.getStatistics(statisticsQueryParam, pageVO));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "退单统计")
|
||||
@GetMapping("/refund")
|
||||
public ResultMessage<IPage<AfterSale>> refund(StatisticsQueryParam statisticsQueryParam, PageVO pageVO) {
|
||||
statisticsQueryParam.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
return ResultUtil.data(afterSaleService.getStatistics(statisticsQueryParam, pageVO));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package cn.lili.controller.statistics;
|
||||
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.statistics.model.dto.StatisticsQueryParam;
|
||||
import cn.lili.modules.statistics.model.vo.RefundOrderStatisticsDataVO;
|
||||
import cn.lili.modules.statistics.service.RefundOrderStatisticsService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 店铺端,退款统计接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2020/12/9 19:04
|
||||
*/
|
||||
@Api(tags = "店铺端,退款统计接口")
|
||||
@RestController
|
||||
@RequestMapping("/store/statistics/refund/order")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class RefundOrderStatisticsStoreController {
|
||||
|
||||
private final RefundOrderStatisticsService refundOrderStatisticsService;
|
||||
|
||||
@ApiOperation(value = "获取退款统计列表")
|
||||
@GetMapping("/getByPage")
|
||||
public ResultMessage<IPage<RefundOrderStatisticsDataVO>> getByPage(PageVO pageVO, StatisticsQueryParam statisticsQueryParam) {
|
||||
statisticsQueryParam.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
return ResultUtil.data(refundOrderStatisticsService.getRefundOrderStatisticsData(pageVO, statisticsQueryParam));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取退款统计金额")
|
||||
@GetMapping("/getPrice")
|
||||
public ResultMessage<Object> getPrice(StatisticsQueryParam statisticsQueryParam) {
|
||||
statisticsQueryParam.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
Double price = refundOrderStatisticsService.getRefundOrderStatisticsPrice(statisticsQueryParam);
|
||||
return ResultUtil.data(price);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package cn.lili.controller.statistics;
|
||||
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.statistics.model.dto.StatisticsQueryParam;
|
||||
import cn.lili.modules.statistics.model.vo.PlatformViewVO;
|
||||
import cn.lili.modules.statistics.service.PlatformViewDataService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺端,流量统计接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2021/2/9 11:19
|
||||
*/
|
||||
@Api(tags = "店铺端,流量统计接口")
|
||||
@RestController
|
||||
@RequestMapping("/store/statistics/view")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class ViewStatisticsStoreController {
|
||||
|
||||
private final PlatformViewDataService platformViewDataService;
|
||||
|
||||
@ApiOperation(value = "流量数据 表单获取")
|
||||
@GetMapping("/list")
|
||||
public ResultMessage<List<PlatformViewVO>> getByPage(StatisticsQueryParam queryParam) {
|
||||
queryParam.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
return ResultUtil.data(platformViewDataService.list(queryParam));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package cn.lili.controller.trade;
|
||||
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.order.order.entity.dos.AfterSale;
|
||||
import cn.lili.modules.order.order.entity.vo.AfterSaleSearchParams;
|
||||
import cn.lili.modules.order.order.entity.vo.AfterSaleVO;
|
||||
import cn.lili.modules.order.order.service.AfterSaleService;
|
||||
import cn.lili.modules.system.entity.vo.Traces;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 店铺端,售后管理接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/17 4:29 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,售后管理接口")
|
||||
@RequestMapping("/store/afterSale")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class AfterSaleStoreController {
|
||||
|
||||
private final AfterSaleService afterSaleService;
|
||||
|
||||
@ApiOperation(value = "查看售后服务详情")
|
||||
@ApiImplicitParam(name = "sn", value = "售后单号", required = true, paramType = "path")
|
||||
@GetMapping(value = "/{sn}")
|
||||
public ResultMessage<AfterSaleVO> get(@PathVariable String sn) {
|
||||
return ResultUtil.data(afterSaleService.getAfterSale(sn));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页获取售后服务")
|
||||
@GetMapping(value = "/page")
|
||||
public ResultMessage<IPage<AfterSaleVO>> getByPage(AfterSaleSearchParams searchParams) {
|
||||
return ResultUtil.data(afterSaleService.getAfterSalePages(searchParams));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "审核售后申请")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "afterSaleSn", value = "售后sn", required = true, paramType = "path"),
|
||||
@ApiImplicitParam(name = "serviceStatus", value = "PASS:审核通过,REFUSE:审核未通过", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "remark", value = "备注", paramType = "query"),
|
||||
@ApiImplicitParam(name = "actualRefundPrice", value = "实际退款金额", paramType = "query")
|
||||
})
|
||||
@PutMapping(value = "/review/{afterSaleSn}")
|
||||
public ResultMessage<AfterSale> review(@NotNull(message = "请选择售后单") @PathVariable String afterSaleSn,
|
||||
@NotNull(message = "请审核") String serviceStatus,
|
||||
String remark,
|
||||
Double actualRefundPrice) {
|
||||
|
||||
return ResultUtil.data(afterSaleService.review(afterSaleSn, serviceStatus, remark,actualRefundPrice));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "卖家确认收货")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "afterSaleSn", value = "售后sn", required = true, paramType = "path"),
|
||||
@ApiImplicitParam(name = "serviceStatus", value = "PASS:审核通过,REFUSE:审核未通过", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "remark", value = "备注", paramType = "query")
|
||||
})
|
||||
@PutMapping(value = "/confirm/{afterSaleSn}")
|
||||
public ResultMessage<AfterSale> confirm(@NotNull(message = "请选择售后单") @PathVariable String afterSaleSn,
|
||||
@NotNull(message = "请审核") String serviceStatus,
|
||||
String remark) {
|
||||
|
||||
return ResultUtil.data(afterSaleService.storeConfirm(afterSaleSn, serviceStatus, remark));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查看买家退货物流踪迹")
|
||||
@ApiImplicitParam(name = "sn", value = "售后单号", required = true, paramType = "path")
|
||||
@GetMapping(value = "/getDeliveryTraces/{sn}")
|
||||
public ResultMessage<Traces> getDeliveryTraces(@PathVariable String sn) {
|
||||
return ResultUtil.data(afterSaleService.deliveryTraces(sn));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package cn.lili.controller.trade;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.order.order.entity.dos.StoreFlow;
|
||||
import cn.lili.modules.store.entity.dos.Bill;
|
||||
import cn.lili.modules.store.entity.dto.BillSearchParams;
|
||||
import cn.lili.modules.store.entity.vos.BillListVO;
|
||||
import cn.lili.modules.store.service.BillService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 店铺端,结算单接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/17 4:29 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,结算单接口")
|
||||
@RequestMapping("/store/bill")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class BillStoreController {
|
||||
|
||||
private final BillService billService;
|
||||
|
||||
@ApiOperation(value = "获取结算单分页")
|
||||
@GetMapping(value = "/getByPage")
|
||||
public ResultMessage<IPage<BillListVO>> getByPage(BillSearchParams billSearchParams) {
|
||||
return ResultUtil.data(billService.billPage(billSearchParams));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过id获取结算单")
|
||||
@ApiImplicitParam(name = "id", value = "结算单ID", required = true, paramType = "path", dataType = "String")
|
||||
@GetMapping(value = "/get/{id}")
|
||||
public ResultMessage<Bill> get(@PathVariable String id) {
|
||||
return ResultUtil.data(billService.getById(id));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取商家结算单流水分页")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "结算单ID", required = true, paramType = "path", dataType = "String"),
|
||||
@ApiImplicitParam(name = "flowType", value = "流水类型:PAY、REFUND", paramType = "query", dataType = "String")
|
||||
})
|
||||
@GetMapping(value = "/{id}/getStoreFlow")
|
||||
public ResultMessage<IPage<StoreFlow>> getStoreFlow(@PathVariable String id, String flowType, PageVO pageVO) {
|
||||
return ResultUtil.data(billService.getStoreFlow(id, flowType, pageVO));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取商家分销订单流水分页")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "结算单ID", required = true, paramType = "path", dataType = "String")
|
||||
})
|
||||
@GetMapping(value = "/{id}/getDistributionFlow")
|
||||
public ResultMessage<IPage<StoreFlow>> getDistributionFlow(@PathVariable String id, PageVO pageVO) {
|
||||
return ResultUtil.data(billService.getDistributionFlow(id, pageVO));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "核对结算单")
|
||||
@ApiImplicitParam(name = "id", value = "结算单ID", required = true, paramType = "path", dataType = "String")
|
||||
@PutMapping(value = "/check/{id}")
|
||||
public ResultMessage<Object> examine(@PathVariable String id) {
|
||||
if (billService.check(id)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package cn.lili.controller.trade;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.member.entity.dto.StoreEvaluationQueryParams;
|
||||
import cn.lili.modules.member.entity.vo.MemberEvaluationListVO;
|
||||
import cn.lili.modules.member.entity.vo.MemberEvaluationVO;
|
||||
import cn.lili.modules.member.service.MemberEvaluationService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 店铺端,商品评价管理接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date 2020-02-25 14:10:16
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,商品评价管理接口")
|
||||
@RequestMapping("/store/memberEvaluation")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class MemberEvaluationStoreController {
|
||||
|
||||
private final MemberEvaluationService memberEvaluationService;
|
||||
|
||||
@ApiOperation(value = "分页获取会员评论列表")
|
||||
@GetMapping
|
||||
public ResultMessage<IPage<MemberEvaluationListVO>> getByPage(StoreEvaluationQueryParams storeEvaluationQueryParams) {
|
||||
|
||||
return ResultUtil.data(memberEvaluationService.queryByParams(storeEvaluationQueryParams));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过id获取")
|
||||
@ApiImplicitParam(name = "id", value = "评价ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping(value = "/get/{id}")
|
||||
public ResultMessage<MemberEvaluationVO> get(@PathVariable String id) {
|
||||
return ResultUtil.data(memberEvaluationService.queryById(id));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "回复评价")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "评价ID", required = true, dataType = "String", paramType = "path"),
|
||||
@ApiImplicitParam(name = "reply", value = "回复内容", required = true, dataType = "String", paramType = "query"),
|
||||
@ApiImplicitParam(name = "replyImage", value = "回复图片", dataType = "String", paramType = "query")
|
||||
})
|
||||
@PutMapping(value = "/reply/{id}")
|
||||
public ResultMessage<MemberEvaluationVO> reply(@PathVariable String id, @RequestParam String reply, @RequestParam String replyImage) {
|
||||
if (memberEvaluationService.reply(id, reply, replyImage)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.lili.controller.trade;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.order.order.entity.dos.OrderComplaint;
|
||||
import cn.lili.modules.order.order.entity.enums.CommunicationOwnerEnum;
|
||||
import cn.lili.modules.order.order.entity.vo.*;
|
||||
import cn.lili.modules.order.order.service.OrderComplaintCommunicationService;
|
||||
import cn.lili.modules.order.order.service.OrderComplaintService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 店铺端,交易投诉接口
|
||||
*
|
||||
* @author paulG
|
||||
* @date 2020/12/5
|
||||
**/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,交易投诉接口")
|
||||
@RequestMapping("/store/complain")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class OrderComplaintStoreController {
|
||||
|
||||
/**
|
||||
* 交易投诉
|
||||
*/
|
||||
private final OrderComplaintService orderComplaintService;
|
||||
|
||||
/**
|
||||
* 投诉沟通
|
||||
*/
|
||||
private final OrderComplaintCommunicationService orderComplaintCommunicationService;
|
||||
|
||||
@ApiOperation(value = "通过id获取")
|
||||
@ApiImplicitParam(name = "id", value = "投诉单ID", required = true, paramType = "path")
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResultMessage<OrderComplaintVO> get(@PathVariable String id) {
|
||||
return ResultUtil.data(orderComplaintService.getOrderComplainById(id));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页获取")
|
||||
@GetMapping
|
||||
public ResultMessage<IPage<OrderComplaint>> get(OrderComplaintSearchParams searchParams, PageVO pageVO) {
|
||||
searchParams.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
return ResultUtil.data(orderComplaintService.getOrderComplainByPage(searchParams, pageVO));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加交易投诉对话")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "complainId", value = "投诉单ID", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "content", value = "内容", required = true, paramType = "query")
|
||||
})
|
||||
@PostMapping("/communication")
|
||||
public ResultMessage<OrderComplaintCommunicationVO> addCommunication(@RequestParam String complainId, @RequestParam String content) {
|
||||
AuthUser currentUser = UserContext.getCurrentUser();
|
||||
OrderComplaintCommunicationVO communicationVO = new OrderComplaintCommunicationVO(complainId, content, CommunicationOwnerEnum.STORE.name(), currentUser.getStoreId(), currentUser.getUsername());
|
||||
if (orderComplaintCommunicationService.addCommunication(communicationVO)) {
|
||||
return ResultUtil.data(communicationVO);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改申诉信息")
|
||||
@PutMapping
|
||||
public ResultMessage<OrderComplaintVO> update(OrderComplaintVO orderComplainVO) {
|
||||
orderComplainVO.setStoreId(UserContext.getCurrentUser().getId());
|
||||
if (orderComplaintService.updateOrderComplain(orderComplainVO)) {
|
||||
return ResultUtil.data(orderComplainVO);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation(value = "申诉")
|
||||
@PutMapping("/appeal")
|
||||
public ResultMessage<OrderComplaintVO> appeal(StoreAppealVO storeAppealVO) {
|
||||
//申诉接口
|
||||
if (orderComplaintService.appeal(storeAppealVO)) {
|
||||
return ResultUtil.data(orderComplaintService.getOrderComplainById(storeAppealVO.getOrderComplaintId()));
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改状态")
|
||||
@PutMapping(value = "/status")
|
||||
public ResultMessage<Object> updateStatus(OrderComplaintOperationParams orderComplainVO) {
|
||||
if (orderComplaintService.updateOrderComplainByStatus(orderComplainVO) != null) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package cn.lili.controller.trade;
|
||||
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.order.trade.entity.dos.OrderLog;
|
||||
import cn.lili.modules.order.trade.service.OrderLogService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺端,订单日志接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/12/5
|
||||
**/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,订单日志接口")
|
||||
@RequestMapping("/store/orderLog")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class OrderLogStoreController {
|
||||
|
||||
private final OrderLogService orderLogService;
|
||||
|
||||
@ApiOperation(value = "通过订单编号获取订单日志")
|
||||
@ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, paramType = "path")
|
||||
@GetMapping(value = "/{orderSn}")
|
||||
public ResultMessage<List<OrderLog>> get(@PathVariable String orderSn) {
|
||||
return ResultUtil.data(orderLogService.getOrderLog(orderSn));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package cn.lili.controller.trade;
|
||||
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.member.entity.dto.MemberAddressDTO;
|
||||
import cn.lili.modules.order.order.entity.dto.OrderSearchParams;
|
||||
import cn.lili.modules.order.order.entity.vo.OrderDetailVO;
|
||||
import cn.lili.modules.order.order.entity.vo.OrderSimpleVO;
|
||||
import cn.lili.modules.order.order.service.OrderPriceService;
|
||||
import cn.lili.modules.order.order.service.OrderService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 店铺端,订单接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/17 4:35 下午
|
||||
**/
|
||||
@RestController
|
||||
@RequestMapping("/store/orders")
|
||||
@Api(tags = "店铺端,订单接口")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class OrderStoreController {
|
||||
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
private final OrderService orderService;
|
||||
|
||||
/**
|
||||
* 订单价格
|
||||
*/
|
||||
private final OrderPriceService orderPriceService;
|
||||
|
||||
@ApiOperation(value = "查询订单列表")
|
||||
@GetMapping
|
||||
public ResultMessage<IPage<OrderSimpleVO>> queryMineOrder(OrderSearchParams orderSearchParams) {
|
||||
return ResultUtil.data(orderService.queryByParams(orderSearchParams));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "订单明细")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, dataType = "String", paramType = "path")
|
||||
})
|
||||
@GetMapping(value = "/{orderSn}")
|
||||
public ResultMessage<OrderDetailVO> detail(@NotNull @PathVariable String orderSn) {
|
||||
|
||||
return ResultUtil.data(orderService.queryDetail(orderSn));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改收货人信息")
|
||||
@ApiImplicitParam(name = "orderSn", value = "订单sn", required = true, dataType = "String", paramType = "path")
|
||||
@PostMapping(value = "/update/{orderSn}/consignee")
|
||||
public ResultMessage<Object> consignee(@NotNull(message = "参数非法") @PathVariable String orderSn,
|
||||
@Valid MemberAddressDTO memberAddressDTO) {
|
||||
return ResultUtil.data(orderService.updateConsignee(orderSn, memberAddressDTO));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改订单价格")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "orderSn", value = "订单sn", required = true, dataType = "String", paramType = "path"),
|
||||
@ApiImplicitParam(name = "orderPrice", value = "订单价格", required = true, dataType = "Double", paramType = "query"),
|
||||
})
|
||||
@PutMapping(value = "/update/{orderSn}/price")
|
||||
public ResultMessage<Object> updateOrderPrice(@PathVariable String orderSn,
|
||||
@NotNull(message = "订单价格不能为空") @RequestParam Double orderPrice) {
|
||||
return ResultUtil.data(orderPriceService.updatePrice(orderSn, orderPrice));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "订单发货")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "orderSn", value = "订单sn", required = true, dataType = "String", paramType = "path"),
|
||||
@ApiImplicitParam(name = "logisticsNo", value = "发货单号", required = true, dataType = "String", paramType = "query"),
|
||||
@ApiImplicitParam(name = "logisticsId", value = "物流公司", required = true, dataType = "String", paramType = "query")
|
||||
})
|
||||
@PostMapping(value = "/{orderSn}/delivery")
|
||||
public ResultMessage<Object> delivery(@NotNull(message = "参数非法") @PathVariable String orderSn,
|
||||
@NotNull(message = "发货单号不能为空") String logisticsNo,
|
||||
@NotNull(message = "请选择物流公司") String logisticsId) {
|
||||
return ResultUtil.data(orderService.delivery(orderSn, logisticsNo, logisticsId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "取消订单")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, dataType = "String", paramType = "path"),
|
||||
@ApiImplicitParam(name = "reason", value = "取消原因", required = true, dataType = "String", paramType = "query")
|
||||
})
|
||||
@PostMapping(value = "/{orderSn}/cancel")
|
||||
public ResultMessage<Object> cancel(@PathVariable String orderSn, @RequestParam String reason) {
|
||||
return ResultUtil.data(orderService.cancel(orderSn, reason));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "订单核验")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "orderSn", value = "订单sn", required = true, dataType = "String", paramType = "path"),
|
||||
@ApiImplicitParam(name = "qrCode", value = "发货单号", required = true, dataType = "String", paramType = "query")
|
||||
})
|
||||
@PostMapping(value = "/{orderSn}/take")
|
||||
public ResultMessage<Object> take(@NotNull(message = "参数非法") @PathVariable String orderSn,
|
||||
@NotNull(message = "核验码") String qrCode) {
|
||||
return ResultUtil.data(orderService.take(orderSn, qrCode));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询物流踪迹")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, dataType = "String", paramType = "path")
|
||||
})
|
||||
@PostMapping(value = "/getTraces/{orderSn}")
|
||||
public ResultMessage<Object> getTraces(@NotBlank(message = "订单编号不能为空") @PathVariable String orderSn) {
|
||||
return ResultUtil.data(orderService.getTraces(orderSn));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package cn.lili.controller.trade;
|
||||
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.order.order.entity.dos.Receipt;
|
||||
import cn.lili.modules.order.order.entity.dto.OrderReceiptDTO;
|
||||
import cn.lili.modules.order.order.entity.dto.ReceiptSearchParams;
|
||||
import cn.lili.modules.order.order.service.ReceiptService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 店铺端,发票接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date 2020/11/28 14:09
|
||||
**/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,发票接口")
|
||||
@RequestMapping("/store/receipt")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class ReceiptStoreController {
|
||||
|
||||
private final ReceiptService receiptService;
|
||||
|
||||
@ApiOperation(value = "分页获取")
|
||||
@GetMapping
|
||||
public ResultMessage<IPage<OrderReceiptDTO>> getByPage(PageVO page, ReceiptSearchParams receiptSearchParams) {
|
||||
receiptSearchParams.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
return ResultUtil.data(receiptService.getReceiptData(receiptSearchParams, page));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过id获取")
|
||||
@ApiImplicitParam(name = "id", value = "发票ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping(value = "/get/{id}")
|
||||
public ResultMessage<Receipt> get(@PathVariable String id) {
|
||||
return ResultUtil.data(receiptService.getById(id));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "开发票")
|
||||
@ApiImplicitParam(name = "id", value = "发票ID", required = true, dataType = "String", paramType = "path")
|
||||
@PostMapping(value = "/{id}/invoicing")
|
||||
public ResultMessage<Receipt> invoicing(@PathVariable String id) {
|
||||
return ResultUtil.data(receiptService.invoicing(id));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过订单编号获取")
|
||||
@ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping(value = "/get/orderSn/{orderSn}")
|
||||
public ResultMessage<Receipt> getByOrderSn(@PathVariable String orderSn) {
|
||||
return ResultUtil.data(receiptService.getByOrderSn(orderSn));
|
||||
}
|
||||
|
||||
}
|
||||
104
seller-api/src/main/java/cn/lili/security/StoreAuthenticationFilter.java
Executable file
104
seller-api/src/main/java/cn/lili/security/StoreAuthenticationFilter.java
Executable file
@@ -0,0 +1,104 @@
|
||||
package cn.lili.security;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.lili.common.cache.Cache;
|
||||
import cn.lili.common.cache.CachePrefix;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
import cn.lili.common.security.enums.SecurityEnum;
|
||||
import cn.lili.common.security.enums.UserEnums;
|
||||
import cn.lili.common.token.SecretKeyUtil;
|
||||
import cn.lili.common.utils.ResponseUtil;
|
||||
import com.google.gson.Gson;
|
||||
import io.jsonwebtoken.Claims;
|
||||
import io.jsonwebtoken.ExpiredJwtException;
|
||||
import io.jsonwebtoken.Jwts;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Chopper
|
||||
*/
|
||||
@Slf4j
|
||||
public class StoreAuthenticationFilter extends BasicAuthenticationFilter {
|
||||
|
||||
private final Cache cache;
|
||||
|
||||
public StoreAuthenticationFilter(AuthenticationManager authenticationManager,
|
||||
Cache cache) {
|
||||
super(authenticationManager);
|
||||
this.cache = cache;
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@Override
|
||||
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException {
|
||||
|
||||
String accessToken = request.getHeader(SecurityEnum.HEADER_TOKEN.getValue());
|
||||
if (StrUtil.isBlank(accessToken)) {
|
||||
chain.doFilter(request, response);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
UsernamePasswordAuthenticationToken authentication = getAuthentication(accessToken, response);
|
||||
SecurityContextHolder.getContext().setAuthentication(authentication);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
|
||||
chain.doFilter(request, response);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取token信息
|
||||
*
|
||||
* @param jwt
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
private UsernamePasswordAuthenticationToken getAuthentication(String jwt, HttpServletResponse response) {
|
||||
|
||||
try {
|
||||
Claims claims
|
||||
= Jwts.parser()
|
||||
.setSigningKey(SecretKeyUtil.generalKeyByDecoders())
|
||||
.parseClaimsJws(jwt).getBody();
|
||||
//获取存储在claims中的用户信息
|
||||
String json = claims.get(SecurityEnum.USER_CONTEXT.getValue()).toString();
|
||||
AuthUser authUser = new Gson().fromJson(json, AuthUser.class);
|
||||
|
||||
// 校验redis中是否有权限
|
||||
if (cache.hasKey(CachePrefix.ACCESS_TOKEN.getPrefix(UserEnums.STORE) + jwt)) {
|
||||
//用户角色
|
||||
List<GrantedAuthority> auths = new ArrayList<>();
|
||||
auths.add(new SimpleGrantedAuthority("ROLE_" + authUser.getRole().name()));
|
||||
//构造返回信息
|
||||
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(authUser.getUsername(), null, auths);
|
||||
authentication.setDetails(authUser);
|
||||
return authentication;
|
||||
}
|
||||
ResponseUtil.output(response, 403, ResponseUtil.resultMap(false, 403, "登录已失效,请重新登录"));
|
||||
return null;
|
||||
} catch (ExpiredJwtException e) {
|
||||
log.debug("user analysis exception:", e);
|
||||
} catch (Exception e) {
|
||||
log.error("user analysis exception:", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
package cn.lili.security;
|
||||
|
||||
import cn.lili.common.cache.Cache;
|
||||
import cn.lili.common.security.CustomAccessDeniedHandler;
|
||||
import cn.lili.common.utils.SpringContextUtil;
|
||||
import cn.lili.config.properties.IgnoredUrlsProperties;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
|
||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||
import org.springframework.web.cors.CorsConfigurationSource;
|
||||
|
||||
/**
|
||||
* spring Security 核心配置类 Store安全配置中心
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/14 16:20
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
@EnableGlobalMethodSecurity(prePostEnabled = true)
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class StoreSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
|
||||
/**
|
||||
* 忽略验权配置
|
||||
*/
|
||||
private final IgnoredUrlsProperties ignoredUrlsProperties;
|
||||
|
||||
/**
|
||||
* spring security -》 权限不足处理
|
||||
*/
|
||||
private final CustomAccessDeniedHandler accessDeniedHandler;
|
||||
|
||||
|
||||
private final Cache<String> cache;
|
||||
|
||||
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
|
||||
ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry = http
|
||||
.authorizeRequests();
|
||||
// 配置的url 不需要授权
|
||||
for (String url : ignoredUrlsProperties.getUrls()) {
|
||||
registry.antMatchers(url).permitAll();
|
||||
}
|
||||
registry.and()
|
||||
// 禁止网页iframe
|
||||
.headers().frameOptions().disable()
|
||||
.and()
|
||||
.logout()
|
||||
.permitAll()
|
||||
.and()
|
||||
.authorizeRequests()
|
||||
// 任何请求
|
||||
.anyRequest()
|
||||
// 需要身份认证
|
||||
.authenticated()
|
||||
.and()
|
||||
// 允许跨域
|
||||
.cors().configurationSource((CorsConfigurationSource) SpringContextUtil.getBean("corsConfigurationSource")).and()
|
||||
// 关闭跨站请求防护
|
||||
.csrf().disable()
|
||||
// 前后端分离采用JWT 不需要session
|
||||
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
|
||||
.and()
|
||||
// 自定义权限拒绝处理类
|
||||
.exceptionHandling().accessDeniedHandler(accessDeniedHandler)
|
||||
.and()
|
||||
// 添加JWT认证过滤器
|
||||
.addFilter(new StoreAuthenticationFilter(authenticationManager(), cache));
|
||||
}
|
||||
|
||||
}
|
||||
301
seller-api/src/main/resources/application.yml
Normal file
301
seller-api/src/main/resources/application.yml
Normal file
@@ -0,0 +1,301 @@
|
||||
server:
|
||||
port: 8889
|
||||
|
||||
servlet:
|
||||
context-path: /
|
||||
|
||||
# 正式部署时候,解开此处配置,防止文件夹被清除导致的文件上传失败问题
|
||||
# multipart:
|
||||
# location: /Users/lifenlong/Desktop/ceshi
|
||||
tomcat:
|
||||
uri-encoding: UTF-8
|
||||
threads:
|
||||
min-spare: 50
|
||||
max: 1000
|
||||
|
||||
# 与Spring Boot 2一样,默认情况下,大多数端点都不通过http公开,我们公开了所有端点。对于生产,您应该仔细选择要公开的端点。
|
||||
management:
|
||||
# health:
|
||||
# elasticsearch:
|
||||
# enabled: false
|
||||
# datasource:
|
||||
# enabled: false
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: '*'
|
||||
spring:
|
||||
# 要在其中注册的Spring Boot Admin Server的URL。
|
||||
boot:
|
||||
admin:
|
||||
client:
|
||||
url: http://127.0.0.1:8000
|
||||
# mongodb
|
||||
data:
|
||||
mongodb:
|
||||
host: 127.0.0.1
|
||||
port: 27017
|
||||
database: lilishop
|
||||
username: root
|
||||
password: lilishop
|
||||
authentication-database: admin
|
||||
# replica-set-name: mongoreplset
|
||||
cache:
|
||||
type: redis
|
||||
|
||||
jpa:
|
||||
# 自动生成表结构
|
||||
generate-ddl: true
|
||||
open-in-view: false
|
||||
# Redis
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password: lilishop
|
||||
lettuce:
|
||||
pool:
|
||||
# 连接池最大连接数(使用负值表示没有限制) 默认 8
|
||||
max-active: 200
|
||||
# 连接池最大阻塞等待时间(使用负值表示没有限制) 默认 -1
|
||||
max-wait: 20
|
||||
# 连接池中的最大空闲连接 默认 8
|
||||
max-idle: 10
|
||||
# 连接池中的最小空闲连接 默认 8
|
||||
min-idle: 8
|
||||
# 文件大小上传配置
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 20MB
|
||||
max-request-size: 20MB
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
serialization:
|
||||
#关闭jackson 对json做解析
|
||||
fail-on-empty-beans: false
|
||||
|
||||
shardingsphere:
|
||||
datasource:
|
||||
# 数据库名称,可自定义,可以为多个,以逗号隔开,每个在这里定义的库,都要在下面定义连接属性
|
||||
names: default-datasource
|
||||
default-datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: lilishop
|
||||
maxActive: 20
|
||||
initialSize: 5
|
||||
maxWait: 60000
|
||||
minIdle: 5
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
validationQuery: SELECT 1 FROM DUAL
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
#是否缓存preparedStatement,也就是PSCache。在mysql下建议关闭。 PSCache对支持游标的数据库性能提升巨大,比如说oracle。
|
||||
poolPreparedStatements: false
|
||||
#要启用PSCache,-1为关闭 必须配置大于0,当大于0时,poolPreparedStatements自动触发修改为true 可以把这个数值配置大一些,比如说100
|
||||
maxOpenPreparedStatements: -1
|
||||
#配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
|
||||
filters: stat,wall,log4j2
|
||||
#通过connectProperties属性来打开mergeSql功能;慢SQL记录
|
||||
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
|
||||
#合并多个DruidDataSource的监控数据
|
||||
useGlobalDataSourceStat: true
|
||||
loginUsername: druid
|
||||
loginPassword: druid
|
||||
# sharding:
|
||||
# default-data-source-name: default-datasource
|
||||
# #需要拆分的表,可以设置多个 在 li_order 级别即可
|
||||
# tables:
|
||||
# #需要进行分表的逻辑表名
|
||||
# li_order:
|
||||
# #实际的表结点,下面代表的是li_order_为开头的所有表,如果能确定表的范围例如按月份分表,这里的写法是data2020.li_order_$->{2020..2021}_$->{01..12} 表示例如 li_order_2020_01 li_order_2020_03 li_order_2021_01
|
||||
# actual-data-nodes: data2020.li_order_$->{2019..2021}_$->{01..12}
|
||||
# table-strategy:
|
||||
# # 分表策略,根据创建日期
|
||||
# standard:
|
||||
# sharding-column: create_time
|
||||
# #分表策略
|
||||
# precise-algorithm-class-name: cn.lili.config.sharding.CreateTimeShardingTableAlgorithm
|
||||
# #范围查询实现
|
||||
# range-algorithm-class-name: cn.lili.config.sharding.CreateTimeShardingTableAlgorithm
|
||||
props:
|
||||
#是否打印逻辑SQL语句和实际SQL语句,建议调试时打印,在生产环境关闭
|
||||
sql:
|
||||
show: true
|
||||
|
||||
# 忽略鉴权url
|
||||
ignored:
|
||||
urls:
|
||||
- /editor-app/**
|
||||
- /actuator**
|
||||
- /actuator/**
|
||||
- /MP_verify_qSyvBPhDsPdxvOhC.txt
|
||||
- /weixin/**
|
||||
- /source/**
|
||||
- /buyer/mini-program/**
|
||||
- /buyer/cashier/**
|
||||
- /buyer/pageData/**
|
||||
- /buyer/article/**
|
||||
- /buyer/goods/**
|
||||
- /buyer/category/**
|
||||
- /buyer/shop/**
|
||||
- /buyer/connect/**
|
||||
- /buyer/members/smsLogin
|
||||
- /buyer/members/refresh/*
|
||||
- /buyer/members/refresh**
|
||||
- /buyer/promotion/pintuan
|
||||
- /buyer/promotion/seckill
|
||||
- /buyer/memberEvaluation/**/goodsEvaluation
|
||||
- /buyer/memberEvaluation/**/evaluationNumber
|
||||
- /store/login/**
|
||||
- /manager/user/login
|
||||
- /manager/user/refresh/**
|
||||
- /druid/**
|
||||
- /swagger-ui.html
|
||||
- /doc.html
|
||||
- /swagger-resources/**
|
||||
- /swagger/**
|
||||
- /**/**.js
|
||||
- /**/**.png
|
||||
- /**/**.css
|
||||
- /webjars/**
|
||||
- /v2/api-docs
|
||||
- /configuration/ui
|
||||
- /boot-admin
|
||||
statics:
|
||||
- /**/*.js
|
||||
- /**/*.css
|
||||
- /**/*.png
|
||||
- /**/*.ico
|
||||
|
||||
# Swagger界面内容配置
|
||||
swagger:
|
||||
title: lili API接口文档
|
||||
description: lili Api Documentation
|
||||
version: 1.0.0
|
||||
termsOfServiceUrl: https://pickmall.cn
|
||||
contact:
|
||||
name: lili
|
||||
url: https://pickmall.cn
|
||||
email: admin@pickmall.com
|
||||
|
||||
# Mybatis-plus
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:mapper/*.xml
|
||||
configuration:
|
||||
#缓存开启
|
||||
cache-enabled: true
|
||||
#日志
|
||||
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
||||
# 日志
|
||||
logging:
|
||||
# 输出级别
|
||||
level:
|
||||
cn.lili: info
|
||||
# org.hibernate: debug
|
||||
# org.springframework: debug
|
||||
# org.springframework.data.mongodb.core: debug
|
||||
file:
|
||||
# 指定路径
|
||||
path: lili-logs
|
||||
# 最大保存天数
|
||||
max-history: 7
|
||||
# 每个文件最大大小
|
||||
max-size: 5MB
|
||||
#加密参数
|
||||
jasypt:
|
||||
encryptor:
|
||||
password: lili
|
||||
|
||||
lili:
|
||||
system:
|
||||
isDemoSite: true
|
||||
statistics:
|
||||
# 在线人数统计 X 小时。这里设置48,即统计过去48小时每小时在线人数
|
||||
onlineMember: 48
|
||||
# 当前在线人数刷新时间间隔,单位秒,设置为600,则每10分钟刷新一次
|
||||
currentOnlineUpdate: 600
|
||||
#qq lbs 申请
|
||||
lbs:
|
||||
key: 4BYBZ-7MT6S-PUAOA-6BNWL-FJUD7-UUFXT
|
||||
sk: zhNKVrJK6UPOhqIjn8AQvG37b9sz6
|
||||
#域名
|
||||
domain:
|
||||
pc: https://pc.b2b2c.pickmall.cn
|
||||
wap: https://m.b2b2c.pickmall.cn
|
||||
store: https://store.b2b2c.pickmall.cn
|
||||
admin: https://admin.b2b2c.pickmall.cn
|
||||
#api地址
|
||||
api:
|
||||
buyer: https://buyer-api.pickmall.cn
|
||||
common: https://common-api.pickmall.cn
|
||||
manager: https://admin-api.pickmall.cn
|
||||
store: https://store-api.pickmall.cn
|
||||
|
||||
# jwt 细节设定
|
||||
jwt-setting:
|
||||
# token过期时间(分钟)
|
||||
tokenExpireTime: 60
|
||||
|
||||
# 使用Spring @Cacheable注解失效时间
|
||||
cache:
|
||||
# 过期时间 单位秒 永久不过期设为-1
|
||||
timeout: 1500
|
||||
#多线程配置
|
||||
thread:
|
||||
corePoolSize: 5
|
||||
maxPoolSize: 50
|
||||
queueCapacity: 50
|
||||
data:
|
||||
elasticsearch:
|
||||
cluster-name: elasticsearch
|
||||
cluster-nodes: 127.0.0.1:9200
|
||||
index:
|
||||
number-of-replicas: 0
|
||||
number-of-shards: 3
|
||||
index-prefix: lili
|
||||
schema: http
|
||||
# account:
|
||||
# username: elastic
|
||||
# password: LiLiShopES
|
||||
|
||||
rocketmq:
|
||||
promotion-topic: lili_promotion_topic
|
||||
promotion-group: lili_promotion_group
|
||||
msg-ext-topic: lili_msg_topic
|
||||
msg-ext-group: lili_msg_group
|
||||
goods-topic: lili_goods_topic
|
||||
goods-group: lili_goods_group
|
||||
order-topic: lili_order_topic
|
||||
order-group: lili_order_group
|
||||
member-topic: lili_member_topic
|
||||
member-group: lili_member_group
|
||||
other-topic: lili_other_topic
|
||||
other-group: lili_other_group
|
||||
notice-topic: lili_notice_topic
|
||||
notice-group: lili_notice_group
|
||||
notice-send-topic: lili_send_notice_topic
|
||||
notice-send-group: lili_send_notice_group
|
||||
after-sale-topic: lili_after_sale_topic
|
||||
after-sale-group: lili_after_sale_group
|
||||
rocketmq:
|
||||
name-server: 127.0.0.1:9876
|
||||
producer:
|
||||
group: lili_group
|
||||
send-message-timeout: 30000
|
||||
|
||||
xxl:
|
||||
job:
|
||||
admin:
|
||||
addresses: http://127.0.0.1:9001/xxl-job-admin
|
||||
executor:
|
||||
appname: xxl-job-executor-lilishop
|
||||
address:
|
||||
ip:
|
||||
port: 8891
|
||||
logpath: ./xxl-job/executor
|
||||
logretentiondays: 7
|
||||
Reference in New Issue
Block a user