|  | @ -1,12 +1,15 @@
 | 
	
		
			
				|  |  | package cn.stylefeng.guns.zjxl.cnotroller;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import cn.stylefeng.guns.zjxl.model.ZjxlCompanyCase;
 | 
	
		
			
				|  |  | import cn.stylefeng.guns.zjxl.service.ZjxlCompanyCaseService;
 | 
	
		
			
				|  |  | import cn.stylefeng.guns.zjxlUtil.BaseController;
 | 
	
		
			
				|  |  | import io.swagger.annotations.Api;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiOperation;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiParam;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.RequestMapping;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.RequestMethod;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.RequestParam;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.RestController;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | /***
 | 
	
	
		
			
				|  | @ -16,7 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
 | 
	
		
			
				|  |  |  * @Date: 2020/11/2 9:21
 | 
	
		
			
				|  |  |  */
 | 
	
		
			
				|  |  | @RestController
 | 
	
		
			
				|  |  | @Api(description = "公司官网主页")
 | 
	
		
			
				|  |  | @Api(description = "公司官网主页-公司案例")
 | 
	
		
			
				|  |  | @RequestMapping(value = "/zjxl/CompanyCase")
 | 
	
		
			
				|  |  | public class ZjxlCompanyCaseController extends BaseController {
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -24,13 +27,68 @@ public class ZjxlCompanyCaseController extends BaseController {
 | 
	
		
			
				|  |  |     private ZjxlCompanyCaseService companyCaseService;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "/findCompanyCaseById", method = RequestMethod.GET)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "根据Id查看CompanyCase")
 | 
	
		
			
				|  |  |     public String findCompanyCaseById(String id){
 | 
	
		
			
				|  |  |     @ApiOperation(value = "查看CompanyCase")
 | 
	
		
			
				|  |  |     public String findCompanyCaseById(@ApiParam(name = "id", value = "companyId", required = false) @RequestParam(value = "id", required = false)String id,
 | 
	
		
			
				|  |  |                                       @ApiParam(name = "name", value = "companyName", required = false) @RequestParam(value = "name", required = false)String name,
 | 
	
		
			
				|  |  |                                       @ApiParam(name = "page", value = "第几页", defaultValue = "0") @RequestParam(value = "page", required = false) Integer page,
 | 
	
		
			
				|  |  |                                       @ApiParam(name = "pagesize", value = "分页大小", defaultValue = "10") @RequestParam(value = "pagesize", required = false) Integer pagesize){
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             return write(200,"查询成功","data",companyCaseService.findById(id));
 | 
	
		
			
				|  |  |             return write(200,"查询成功","data",companyCaseService.findById(id,name,page,pagesize));
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             e.printStackTrace();
 | 
	
		
			
				|  |  |             return write(-1,"查询失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "/addCompanyCase", method = RequestMethod.POST)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "添加公司案例")
 | 
	
		
			
				|  |  |     public String addCompanyCase(
 | 
	
		
			
				|  |  |             @ApiParam(name = "companyName", value = "案例名称", required = false) @RequestParam(value = "companyName", required = false)String companyName,
 | 
	
		
			
				|  |  |             @ApiParam(name = "companyDescribe", value = "案例描述", required = false) @RequestParam(value = "companyDescribe", required = false)String companyDescribe,
 | 
	
		
			
				|  |  |             @ApiParam(name = "companyDefaultImg", value = "默认图片", required = false) @RequestParam(value = "companyDefaultImg", required = false)String companyDefaultImg,
 | 
	
		
			
				|  |  |             @ApiParam(name = "companyExchangeImg", value = "交互图片", required = false) @RequestParam(value = "companyExchangeImg", required = false)String companyExchangeImg,
 | 
	
		
			
				|  |  |             @ApiParam(name = "companyAssociatedCase", value = "关联案例", required = false) @RequestParam(value = "companyAssociatedCase", required = false)String companyAssociatedCase,
 | 
	
		
			
				|  |  |             @ApiParam(name = "companyJumpUrl", value = "跳转链接", required = false) @RequestParam(value = "companyJumpUrl", required = false)String companyJumpUrl,
 | 
	
		
			
				|  |  |             @ApiParam(name = "companySort", value = "排序", required = false) @RequestParam(value = "companySort", required = false)Integer companySort,
 | 
	
		
			
				|  |  |             @ApiParam(name = "companyIsLine", value = "是否上线", required = false, defaultValue = "0") @RequestParam(value = "companyIsLine", required = false)Integer companyIsLine,
 | 
	
		
			
				|  |  |             @ApiParam(name = "companyTestBannerId", value = "测试用字段", required = false, defaultValue = "1") @RequestParam(value = "companyTestBannerId", required = false)String companyTestBannerId){
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             ZjxlCompanyCase companyCase = new ZjxlCompanyCase();
 | 
	
		
			
				|  |  |             companyCase.setCompanyName(companyName);
 | 
	
		
			
				|  |  |             companyCase.setCompanyDescribe(companyDescribe);
 | 
	
		
			
				|  |  |             companyCase.setCompanyDefaultImg(companyDefaultImg);
 | 
	
		
			
				|  |  |             companyCase.setCompanyExchangeImg(companyExchangeImg);
 | 
	
		
			
				|  |  |             companyCase.setCompanyAssociatedCase(companyAssociatedCase);
 | 
	
		
			
				|  |  |             companyCase.setCompanyJumpUrl(companyJumpUrl);
 | 
	
		
			
				|  |  |             companyCase.setCompanySort(companySort);
 | 
	
		
			
				|  |  |             companyCase.setCompanyIsLine(companyIsLine);
 | 
	
		
			
				|  |  |             companyCase.setCompanyTestBannerId(companyTestBannerId);
 | 
	
		
			
				|  |  |             return write(200,"添加成功","data",companyCaseService.addCompanyCase(companyCase));
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             e.printStackTrace();
 | 
	
		
			
				|  |  |             return write(-1,"添加失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "/deleteCompanyCase", method = RequestMethod.DELETE)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "根据id删除案例")
 | 
	
		
			
				|  |  |     public String deleteCompanyCase(String id){
 | 
	
		
			
				|  |  |         try{
 | 
	
		
			
				|  |  |             return write(200,"删除成功","data",companyCaseService.deleteCompanyCase(id));
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             e.printStackTrace();
 | 
	
		
			
				|  |  |             return write(-1,"删除失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "/updateIsLine", method = RequestMethod.POST)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "根据id修改案例是否上线")
 | 
	
		
			
				|  |  |     public String updateIsLine(String id, Integer isLine){
 | 
	
		
			
				|  |  |         try{
 | 
	
		
			
				|  |  |             return write(200,"修改成功","data",companyCaseService.updateIsLine(id, isLine));
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             e.printStackTrace();
 | 
	
		
			
				|  |  |             return write(-1,"修改失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | }
 |