| | |
| | | package cn.lili.controller.store; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.common.enums.ResultUtil; |
| | | import cn.lili.common.security.AuthUser; |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.common.utils.StringUtils; |
| | | 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.entity.dto.GoodsOperationDTO; |
| | | import cn.lili.modules.goods.entity.vos.StoreGoodsLabelVO; |
| | | import cn.lili.modules.goods.service.GoodsService; |
| | | import cn.lili.modules.goods.service.GoodsUnitService; |
| | | import cn.lili.modules.goods.service.StoreGoodsLabelService; |
| | | import cn.lili.modules.store.entity.dos.Store; |
| | | import cn.lili.modules.store.entity.dto.StoreBankDTO; |
| | | import cn.lili.modules.store.entity.dto.StoreCompanyDTO; |
| | | import cn.lili.modules.store.entity.dto.StoreOtherInfoDTO; |
| | | import cn.lili.modules.store.entity.vos.*; |
| | | import cn.lili.modules.store.service.FreightTemplateService; |
| | | import cn.lili.modules.store.service.StoreDetailService; |
| | | import cn.lili.modules.store.service.StoreService; |
| | | import cn.lili.mybatis.util.PageUtil; |
| | | import cn.lili.utils.COSUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | |
| | | /** |
| | |
| | | private StoreDetailService storeDetailService; |
| | | @Autowired |
| | | private COSUtil cosUtil; |
| | | |
| | | @Autowired |
| | | private FreightTemplateService freightTemplateService; |
| | | |
| | | @Autowired |
| | | private GoodsUnitService goodsUnitService; |
| | | |
| | | @Autowired |
| | | private GoodsService goodsService; |
| | | |
| | | @ApiOperation(value = "获取店铺列表分页") |
| | | @GetMapping |
| | |
| | | public ResultMessage<StoreDetailVO> apply() { |
| | | return ResultUtil.data(storeDetailService.getStoreDetailVOByMemberId(UserContext.getCurrentUser().getId())); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "获取店铺下的物流模板") |
| | | @GetMapping(value = "/freightTemplate") |
| | | public ResultMessage<List<FreightTemplateVO>> freightTemplate() { |
| | | String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); |
| | | return ResultUtil.data(freightTemplateService.getFreightTemplateList(storeId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取店铺下的计量单位") |
| | | @GetMapping(value = "/goods/unit") |
| | | public ResultMessage<IPage<GoodsUnit>> goodsUnit(PageVO pageVO) { |
| | | return ResultUtil.data(goodsUnitService.page(PageUtil.initPage(pageVO))); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增商品") |
| | | @PostMapping(value = "/goods/create", consumes = "application/json", produces = "application/json") |
| | | public ResultMessage<GoodsOperationDTO> save(@Valid @RequestBody GoodsOperationDTO goodsOperationDTO) { |
| | | goodsService.addGoods(goodsOperationDTO); |
| | | return ResultUtil.success(); |
| | | } |
| | | } |