| | |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.utils.OssUtils; |
| | | import cc.mrbird.febs.dapp.dto.AddMallGoodsDto; |
| | | import cc.mrbird.febs.dapp.dto.HlmBasicPerkDto; |
| | | import cc.mrbird.febs.dapp.dto.MallGoodsUpdateDto; |
| | | import cc.mrbird.febs.dapp.dto.MallOrderInfoDto; |
| | | import cc.mrbird.febs.dapp.entity.MallGoods; |
| | | import cc.mrbird.febs.dapp.entity.MallGoodsCategory; |
| | | import cc.mrbird.febs.dapp.entity.MallOrderInfo; |
| | | import cc.mrbird.febs.dapp.entity.PlatformBanner; |
| | | import cc.mrbird.febs.dapp.enumerate.DataDictionaryEnum; |
| | | import cc.mrbird.febs.dapp.service.IAdminMallGoodsService; |
| | | import cc.mrbird.febs.dapp.vo.AdminMallGoodsCategoryTreeVo; |
| | | import cn.hutool.core.util.IdUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | public class AdminMallGoodsController extends BaseController { |
| | | |
| | | private final IAdminMallGoodsService adminMallGoodsService; |
| | | |
| | | /** |
| | | * 商品分类-选择 |
| | | */ |
| | | @GetMapping("categorys/tree") |
| | | @ControllerEndpoint(exceptionMessage = "获取分类失败") |
| | | public List<AdminMallGoodsCategoryTreeVo> getParentCategorys(){ |
| | | return adminMallGoodsService.getParentCategorys(); |
| | | } |
| | | |
| | | /** |
| | | * 商品分类列表 |
| | | * @param mallGoodsCategory |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @GetMapping("categoryList") |
| | | public FebsResponse getCategoryList(MallGoodsCategory mallGoodsCategory, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(adminMallGoodsService.getCategoryList(mallGoodsCategory, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 商品分类-新增 |
| | | */ |
| | | @PostMapping("addCategory") |
| | | @ControllerEndpoint(operation = " 商品分类-新增", exceptionMessage = "操作失败") |
| | | public FebsResponse addCategory(@Valid MallGoodsCategory mallGoodsCategory) { |
| | | return adminMallGoodsService.addCategory(mallGoodsCategory); |
| | | } |
| | | |
| | | /** |
| | | * 商品分类-编辑 |
| | | */ |
| | | @PostMapping("updateCategory") |
| | | @ControllerEndpoint(operation = " 商品分类-编辑", exceptionMessage = "操作失败") |
| | | public FebsResponse updateCategory(@Valid MallGoodsCategory mallGoodsCategory) { |
| | | return adminMallGoodsService.updateCategory(mallGoodsCategory); |
| | | } |
| | | |
| | | /** |
| | | * 商品分类-删除 |
| | | */ |
| | | @GetMapping("delCategary/{id}") |
| | | @ControllerEndpoint(operation = " 商品分类-删除", exceptionMessage = "操作失败") |
| | | public FebsResponse delCategary(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | return adminMallGoodsService.delCategary(id); |
| | | } |
| | | |
| | | /** |
| | | * 图片上传 |
| | |
| | | return new FebsResponse().success().data(dataTable); |
| | | } |
| | | |
| | | @GetMapping(value = "/findDicByType/{type}") |
| | | public FebsResponse findDicByType(@PathVariable("type") String type) { |
| | | return new FebsResponse().success().data(adminMallGoodsService.findDataDicByType(type)); |
| | | } |
| | | |
| | | @PostMapping(value = "/bonusSystemSetting") |
| | | public FebsResponse bonusSystemSetting(@RequestBody Map<String, Object> map) { |
| | | adminMallGoodsService.bonusSystemSetting(map); |
| | | return new FebsResponse().success().message("设置成功"); |
| | | } |
| | | |
| | | @PostMapping(value = "/hlmBasicPerk") |
| | | public FebsResponse hlmBasicPerk(HlmBasicPerkDto hlmBasicPerkDto) { |
| | | adminMallGoodsService.hlmBasicPerk(hlmBasicPerkDto); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 轮播图---列表 |
| | | */ |
| | | @GetMapping("platformBanner") |
| | | public FebsResponse platformBanner(PlatformBanner platformBannerEntity, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(adminMallGoodsService.findPlatformBannerInPage(platformBannerEntity, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 轮播图---确认 |
| | | * @return |
| | | */ |
| | | @PostMapping("platformBannerConfirm") |
| | | @ControllerEndpoint(operation = "轮播图---确认", exceptionMessage = "设置失败") |
| | | public FebsResponse platformBannerConfirm(@Valid PlatformBanner platformBannerEntity) { |
| | | return adminMallGoodsService.platformBannerConfirm(platformBannerEntity); |
| | | } |
| | | |
| | | /** |
| | | * 轮播图---删除 |
| | | * @return |
| | | */ |
| | | @GetMapping("platformBannerDelete/{id}") |
| | | @ControllerEndpoint(operation = "轮播图---删除", exceptionMessage = "删除失败") |
| | | public FebsResponse platformBannerDelete(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | return adminMallGoodsService.platformBannerDelete(id); |
| | | } |
| | | |
| | | /** |
| | | * 轮播图---新增 |
| | | */ |
| | | @PostMapping("platformBannerAdds") |
| | | @ControllerEndpoint(operation = "轮播图---新增", exceptionMessage = "新增失败") |
| | | public FebsResponse platformBannerAdds(@Valid PlatformBanner platformBannerEntity) { |
| | | adminMallGoodsService.platformBannerAdd(platformBannerEntity); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |