| package cc.mrbird.febs.mall.controller.banner; | 
|   | 
| import cc.mrbird.febs.common.annotation.ControllerEndpoint; | 
| import cc.mrbird.febs.common.controller.BaseController; | 
| import cc.mrbird.febs.common.entity.FebsResponse; | 
| import cc.mrbird.febs.common.entity.QueryRequest; | 
| import cc.mrbird.febs.mall.entity.PlatformBanner; | 
| import cc.mrbird.febs.mall.service.IAdminBannerService; | 
| import lombok.RequiredArgsConstructor; | 
| import lombok.extern.slf4j.Slf4j; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.validation.annotation.Validated; | 
| import org.springframework.web.bind.annotation.*; | 
|   | 
| import javax.validation.Valid; | 
| import javax.validation.constraints.NotNull; | 
| import java.util.Map; | 
| @Slf4j | 
| @Validated | 
| @RestController | 
| @RequiredArgsConstructor | 
| @RequestMapping(value = "/admin/banner") | 
| public class AdminBannerController extends BaseController { | 
|   | 
|     @Autowired | 
|     private IAdminBannerService iAdminBannerService; | 
|   | 
|     /** | 
|      * 轮播图---列表 | 
|      */ | 
|     @GetMapping("platformBanner") | 
|     public FebsResponse platformBanner(PlatformBanner platformBannerEntity, QueryRequest request) { | 
|         Map<String, Object> data = getDataTable(iAdminBannerService.findPlatformBannerInPage(platformBannerEntity, request)); | 
|         return new FebsResponse().success().data(data); | 
|     } | 
|   | 
|     /** | 
|      * 轮播图---确认 | 
|      * @return | 
|      */ | 
|     @PostMapping("platformBannerConfirm") | 
|     @ControllerEndpoint(operation = "轮播图---确认", exceptionMessage = "设置失败") | 
|     public FebsResponse platformBannerConfirm(@Valid PlatformBanner platformBannerEntity) { | 
|         return iAdminBannerService.platformBannerConfirm(platformBannerEntity); | 
|     } | 
|   | 
|     /** | 
|      * 轮播图---删除 | 
|      * @return | 
|      */ | 
|     @GetMapping("platformBannerDelete/{id}") | 
|     @ControllerEndpoint(operation = "轮播图---删除", exceptionMessage = "删除失败") | 
|     public FebsResponse platformBannerDelete(@NotNull(message = "{required}") @PathVariable Long id) { | 
|         return iAdminBannerService.platformBannerDelete(id); | 
|     } | 
|   | 
|     /** | 
|      * 轮播图---新增 | 
|      */ | 
|     @PostMapping("platformBannerAdds") | 
|     @ControllerEndpoint(operation = "轮播图---新增", exceptionMessage = "新增失败") | 
|     public FebsResponse platformBannerAdds(@Valid PlatformBanner platformBannerEntity) { | 
|         iAdminBannerService.platformBannerAdd(platformBannerEntity); | 
|         return new FebsResponse().success(); | 
|     } | 
|   | 
|   | 
|     /** | 
|      * 轮播图-获取分类 | 
|      * @return | 
|      */ | 
|     @GetMapping(value = "/typeAll") | 
|     public FebsResponse typeAll() { | 
|   | 
|         return iAdminBannerService.typeAll(); | 
|     } | 
| } |