| | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | 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.MallOrderInfo; |
| | | import cc.mrbird.febs.dapp.dto.*; |
| | | import cc.mrbird.febs.dapp.entity.*; |
| | | import cc.mrbird.febs.dapp.enumerate.DataDictionaryEnum; |
| | | import cc.mrbird.febs.dapp.service.IAdminMallGoodsService; |
| | | import cc.mrbird.febs.dapp.service.IMallNewsInfoService; |
| | | 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); |
| | | } |
| | | |
| | | /** |
| | | * 订单列表-发货 |
| | | */ |
| | | @PostMapping("deliverGoods") |
| | | @ControllerEndpoint(operation = "订单列表-发货", exceptionMessage = "操作失败") |
| | | public FebsResponse deliverGoods(@Valid DeliverGoodsDto deliverGoodsDto) { |
| | | return adminMallGoodsService.deliverGoods(deliverGoodsDto); |
| | | } |
| | | |
| | | /** |
| | | * 订单列表-删除订单 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("delOrder/{id}") |
| | | @ControllerEndpoint(operation = "订单列表-删除订单", exceptionMessage = "操作失败") |
| | | public FebsResponse delOrder(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | return adminMallGoodsService.delOrder(id); |
| | | } |
| | | |
| | | @GetMapping(value = "/findDicByType/{type}") |
| | | public FebsResponse findDicByType(@PathVariable("type") String type) { |
| | | return new FebsResponse().success().data(adminMallGoodsService.findDataDicByType(type)); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 轮播图---列表 |
| | | */ |
| | | @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(); |
| | | } |
| | | |
| | | private final IMallNewsInfoService mallNewsInfoService; |
| | | |
| | | /** |
| | | * 新闻中心-列表 |
| | | * @param mallNewsInfo |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @GetMapping("getNewInfoList") |
| | | public FebsResponse getNewInfoList(MallNewsInfo mallNewsInfo, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(mallNewsInfoService.getNewInfoList(mallNewsInfo, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 新闻中心-新增 |
| | | */ |
| | | @PostMapping("addNewsInfo") |
| | | @ControllerEndpoint(operation = " 新闻中心-新增", exceptionMessage = "操作失败") |
| | | public FebsResponse addNewsInfo(@Valid MallNewsInfoDto mallNewsInfoDto) { |
| | | return mallNewsInfoService.addNewsInfo(mallNewsInfoDto); |
| | | } |
| | | |
| | | /** |
| | | * 新闻中心-删除 |
| | | */ |
| | | @GetMapping("delNewsInfo/{id}") |
| | | @ControllerEndpoint(operation = " 新闻中心-删除", exceptionMessage = "操作失败") |
| | | public FebsResponse delNewsInfo(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | return mallNewsInfoService.delNewsInfo(id); |
| | | } |
| | | |
| | | /** |
| | | * 新闻中心-更新 |
| | | */ |
| | | @PostMapping("updateNewsInfo") |
| | | @ControllerEndpoint(operation = "新闻中心-更新", exceptionMessage = "操作失败") |
| | | public FebsResponse updateNewsInfo(@Valid MallNewsInfoDto mallNewsInfoDto) { |
| | | return mallNewsInfoService.updateNewsInfo(mallNewsInfoDto); |
| | | } |
| | | |
| | | |
| | | @GetMapping("findNewsCategoryList") |
| | | @ControllerEndpoint(operation = "新闻分类列表", exceptionMessage = "获取失败") |
| | | public FebsResponse findNewsCategoryList(MallNewsCategory mallNewsCategory, QueryRequest request) { |
| | | return new FebsResponse().success().data(getDataTable(mallNewsInfoService.findNewsCategoryInPage(mallNewsCategory, request))); |
| | | } |
| | | |
| | | @PostMapping("addOrModifyNewsCategory") |
| | | @ControllerEndpoint(operation = "新闻分类", exceptionMessage = "新增失败") |
| | | public FebsResponse addOrModifyNewsCategory(MallNewsCategory mallNewsCategory) { |
| | | mallNewsInfoService.addOrModifyNewsCategory(mallNewsCategory); |
| | | return new FebsResponse().success().message("新增成功"); |
| | | } |
| | | |
| | | /** |
| | | * 新闻分类-删除 |
| | | */ |
| | | @GetMapping("delNewsCategoryInfo/{id}") |
| | | @ControllerEndpoint(operation = "新闻分类-删除", exceptionMessage = "操作失败") |
| | | public FebsResponse delNewsCategoryInfo(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | return mallNewsInfoService.delNewsCategoryInfo(id); |
| | | } |
| | | |
| | | @GetMapping(value = "findAllCategoryList") |
| | | public FebsResponse findAllCategoryList() { |
| | | List<MallNewsCategory> categories = mallNewsInfoService.findAllCategory(); |
| | | return new FebsResponse().success().data(categories); |
| | | } |
| | | |
| | | @PostMapping(value = "/topNews/{id}") |
| | | public FebsResponse topNews(@PathVariable Long id) { |
| | | MallNewsInfo mallNewsInfo = new MallNewsInfo(); |
| | | mallNewsInfo.setIsTop(1); |
| | | mallNewsInfo.setId(id); |
| | | mallNewsInfoService.updateById(mallNewsInfo); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @PostMapping(value = "/unTopNews/{id}") |
| | | public FebsResponse unTopNews(@PathVariable Long id) { |
| | | MallNewsInfo mallNewsInfo = new MallNewsInfo(); |
| | | mallNewsInfo.setIsTop(2); |
| | | mallNewsInfo.setId(id); |
| | | mallNewsInfoService.updateById(mallNewsInfo); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |