|
@ -15,6 +15,8 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@ -28,6 +30,7 @@ import java.io.IOException;
|
|
|
import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
/***
|
|
|
* @ClassName: ZjxlBannerCnotroller
|
|
|
* @Description:
|
|
@ -39,6 +42,8 @@ import java.util.List;
|
|
|
@RequestMapping(value = "/zjxl/banner")
|
|
|
public class ZjxlBannerCnotroller extends BaseController {
|
|
|
|
|
|
private Logger logger = (Logger) LoggerFactory.getLogger(ZjxlBannerCnotroller.class);
|
|
|
|
|
|
@Autowired
|
|
|
private ZjxlBannerService bannerService;
|
|
|
|
|
@ -80,6 +85,7 @@ public class ZjxlBannerCnotroller extends BaseController {
|
|
|
banner.setBannerType(bannerType);
|
|
|
banner.setBannerTypeUrl(bannerTypeUrl);
|
|
|
try {
|
|
|
logger.info("执行banner添加,参数:"+banner);
|
|
|
return write(200,"添加成功","data",bannerService.addBanner(banner));
|
|
|
}catch (Exception e){
|
|
|
return write(-1,"添加失败");
|
|
@ -90,6 +96,10 @@ public class ZjxlBannerCnotroller extends BaseController {
|
|
|
@ApiOperation(value = "删除banner")
|
|
|
public String deleteBannerById(String id){
|
|
|
try {
|
|
|
logger.info("删除banner,参数"+id);
|
|
|
if(id == null){
|
|
|
return write(-1,"参数获取失败:null");
|
|
|
}
|
|
|
return write(200,"删除成功","data",bannerService.deleteBannerById(id));
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
@ -101,6 +111,10 @@ public class ZjxlBannerCnotroller extends BaseController {
|
|
|
@ApiOperation(value = "修改是否上线")
|
|
|
public String updateIsLine(String id,Integer isLine){
|
|
|
try {
|
|
|
logger.info("修改是否上线:id====="+id+",isLine===="+isLine);
|
|
|
if (id == null || isLine == null){
|
|
|
return write(-1,"获取参数失败");
|
|
|
}
|
|
|
return write(200,"修改成功","data",bannerService.updateIsLine(id,isLine));
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|