|
|
@ -1,50 +1,35 @@ |
|
|
package org.jeecg.modules.webBanner.controller; |
|
|
|
|
|
|
|
|
package org.jeecg.modules.banner.controller; |
|
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
import java.util.Arrays; |
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
import java.io.IOException; |
|
|
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
|
|
import java.net.URLDecoder; |
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
import org.jeecg.common.api.vo.Result; |
|
|
import org.jeecg.common.api.vo.Result; |
|
|
import org.jeecg.common.system.query.QueryGenerator; |
|
|
import org.jeecg.common.system.query.QueryGenerator; |
|
|
import org.jeecg.common.util.oConvertUtils; |
|
|
|
|
|
import org.jeecg.modules.webBanner.entity.WebBanner; |
|
|
|
|
|
import org.jeecg.modules.webBanner.service.IWebBannerService; |
|
|
|
|
|
|
|
|
import org.jeecg.modules.banner.entity.WebBanner; |
|
|
|
|
|
import org.jeecg.modules.banner.service.IWebBannerService; |
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil; |
|
|
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
|
|
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams; |
|
|
|
|
|
import org.jeecgframework.poi.excel.entity.ImportParams; |
|
|
|
|
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
|
|
|
|
|
import org.jeecg.common.system.base.controller.JeecgController; |
|
|
import org.jeecg.common.system.base.controller.JeecgController; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
import org.springframework.web.multipart.MultipartHttpServletRequest; |
|
|
|
|
|
import org.springframework.web.servlet.ModelAndView; |
|
|
import org.springframework.web.servlet.ModelAndView; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
|
import io.swagger.annotations.Api; |
|
|
import io.swagger.annotations.Api; |
|
|
import io.swagger.annotations.ApiOperation; |
|
|
import io.swagger.annotations.ApiOperation; |
|
|
import org.jeecg.common.aspect.annotation.AutoLog; |
|
|
import org.jeecg.common.aspect.annotation.AutoLog; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Description: 网站banner图 |
|
|
|
|
|
|
|
|
* @Description: banner设置 |
|
|
* @Author: jeecg-boot |
|
|
* @Author: jeecg-boot |
|
|
* @Date: 2024-10-11 |
|
|
|
|
|
|
|
|
* @Date: 2024-10-28 |
|
|
* @Version: V1.0 |
|
|
* @Version: V1.0 |
|
|
*/ |
|
|
*/ |
|
|
@Api(tags="网站banner图") |
|
|
|
|
|
|
|
|
@Api(tags="banner设置") |
|
|
@RestController |
|
|
@RestController |
|
|
@RequestMapping("/webBanner/webBanner") |
|
|
|
|
|
|
|
|
@RequestMapping("/banner/webBanner") |
|
|
@Slf4j |
|
|
@Slf4j |
|
|
public class WebBannerController extends JeecgController<WebBanner, IWebBannerService> { |
|
|
public class WebBannerController extends JeecgController<WebBanner, IWebBannerService> { |
|
|
@Autowired |
|
|
@Autowired |
|
|
@ -59,8 +44,8 @@ public class WebBannerController extends JeecgController<WebBanner, IWebBannerSe |
|
|
* @param req |
|
|
* @param req |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
//@AutoLog(value = "网站banner图-分页列表查询") |
|
|
|
|
|
@ApiOperation(value="网站banner图-分页列表查询", notes="网站banner图-分页列表查询") |
|
|
|
|
|
|
|
|
//@AutoLog(value = "banner设置-分页列表查询") |
|
|
|
|
|
@ApiOperation(value="banner设置-分页列表查询", notes="banner设置-分页列表查询") |
|
|
@GetMapping(value = "/list") |
|
|
@GetMapping(value = "/list") |
|
|
public Result<IPage<WebBanner>> queryPageList(WebBanner webBanner, |
|
|
public Result<IPage<WebBanner>> queryPageList(WebBanner webBanner, |
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|
|
@ -78,8 +63,8 @@ public class WebBannerController extends JeecgController<WebBanner, IWebBannerSe |
|
|
* @param webBanner |
|
|
* @param webBanner |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@AutoLog(value = "网站banner图-添加") |
|
|
|
|
|
@ApiOperation(value="网站banner图-添加", notes="网站banner图-添加") |
|
|
|
|
|
|
|
|
@AutoLog(value = "banner设置-添加") |
|
|
|
|
|
@ApiOperation(value="banner设置-添加", notes="banner设置-添加") |
|
|
@PostMapping(value = "/add") |
|
|
@PostMapping(value = "/add") |
|
|
public Result<String> add(@RequestBody WebBanner webBanner) { |
|
|
public Result<String> add(@RequestBody WebBanner webBanner) { |
|
|
webBannerService.save(webBanner); |
|
|
webBannerService.save(webBanner); |
|
|
@ -92,8 +77,8 @@ public class WebBannerController extends JeecgController<WebBanner, IWebBannerSe |
|
|
* @param webBanner |
|
|
* @param webBanner |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@AutoLog(value = "网站banner图-编辑") |
|
|
|
|
|
@ApiOperation(value="网站banner图-编辑", notes="网站banner图-编辑") |
|
|
|
|
|
|
|
|
@AutoLog(value = "banner设置-编辑") |
|
|
|
|
|
@ApiOperation(value="banner设置-编辑", notes="banner设置-编辑") |
|
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
|
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
|
|
public Result<String> edit(@RequestBody WebBanner webBanner) { |
|
|
public Result<String> edit(@RequestBody WebBanner webBanner) { |
|
|
webBannerService.updateById(webBanner); |
|
|
webBannerService.updateById(webBanner); |
|
|
@ -106,8 +91,8 @@ public class WebBannerController extends JeecgController<WebBanner, IWebBannerSe |
|
|
* @param id |
|
|
* @param id |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@AutoLog(value = "网站banner图-通过id删除") |
|
|
|
|
|
@ApiOperation(value="网站banner图-通过id删除", notes="网站banner图-通过id删除") |
|
|
|
|
|
|
|
|
@AutoLog(value = "banner设置-通过id删除") |
|
|
|
|
|
@ApiOperation(value="banner设置-通过id删除", notes="banner设置-通过id删除") |
|
|
@DeleteMapping(value = "/delete") |
|
|
@DeleteMapping(value = "/delete") |
|
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
|
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
|
|
webBannerService.removeById(id); |
|
|
webBannerService.removeById(id); |
|
|
@ -120,8 +105,8 @@ public class WebBannerController extends JeecgController<WebBanner, IWebBannerSe |
|
|
* @param ids |
|
|
* @param ids |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@AutoLog(value = "网站banner图-批量删除") |
|
|
|
|
|
@ApiOperation(value="网站banner图-批量删除", notes="网站banner图-批量删除") |
|
|
|
|
|
|
|
|
@AutoLog(value = "banner设置-批量删除") |
|
|
|
|
|
@ApiOperation(value="banner设置-批量删除", notes="banner设置-批量删除") |
|
|
@DeleteMapping(value = "/deleteBatch") |
|
|
@DeleteMapping(value = "/deleteBatch") |
|
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
|
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
|
|
this.webBannerService.removeByIds(Arrays.asList(ids.split(","))); |
|
|
this.webBannerService.removeByIds(Arrays.asList(ids.split(","))); |
|
|
@ -134,8 +119,8 @@ public class WebBannerController extends JeecgController<WebBanner, IWebBannerSe |
|
|
* @param id |
|
|
* @param id |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
//@AutoLog(value = "网站banner图-通过id查询") |
|
|
|
|
|
@ApiOperation(value="网站banner图-通过id查询", notes="网站banner图-通过id查询") |
|
|
|
|
|
|
|
|
//@AutoLog(value = "banner设置-通过id查询") |
|
|
|
|
|
@ApiOperation(value="banner设置-通过id查询", notes="banner设置-通过id查询") |
|
|
@GetMapping(value = "/queryById") |
|
|
@GetMapping(value = "/queryById") |
|
|
public Result<WebBanner> queryById(@RequestParam(name="id",required=true) String id) { |
|
|
public Result<WebBanner> queryById(@RequestParam(name="id",required=true) String id) { |
|
|
WebBanner webBanner = webBannerService.getById(id); |
|
|
WebBanner webBanner = webBannerService.getById(id); |
|
|
@ -153,7 +138,7 @@ public class WebBannerController extends JeecgController<WebBanner, IWebBannerSe |
|
|
*/ |
|
|
*/ |
|
|
@RequestMapping(value = "/exportXls") |
|
|
@RequestMapping(value = "/exportXls") |
|
|
public ModelAndView exportXls(HttpServletRequest request, WebBanner webBanner) { |
|
|
public ModelAndView exportXls(HttpServletRequest request, WebBanner webBanner) { |
|
|
return super.exportXls(request, webBanner, WebBanner.class, "网站banner图"); |
|
|
|
|
|
|
|
|
return super.exportXls(request, webBanner, WebBanner.class, "banner设置"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |