首页管理代码

master
王皓雯 6 years ago
parent 7bdcc6d9a6
commit 178f76a3e5

@ -0,0 +1,83 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.SmsHomeAdvertise;
import com.macro.mall.service.SmsHomeAdvertiseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 广Controller
*/
@Controller
@Api(tags = "SmsHomeAdvertiseController", description = "首页轮播广告管理")
@RequestMapping("/home/advertise")
public class SmsHomeAdvertiseController {
@Autowired
private SmsHomeAdvertiseService advertiseService;
@ApiOperation("添加广告")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestBody SmsHomeAdvertise advertise) {
int count = advertiseService.create(advertise);
if (count > 0)
return new CommonResult().success(count);
return new CommonResult().failed();
}
@ApiOperation("删除广告")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestParam("ids") List<Long> ids) {
int count = advertiseService.delete(ids);
if (count > 0)
return new CommonResult().success(count);
return new CommonResult().failed();
}
@ApiOperation("修改上下线状态")
@RequestMapping(value = "/update/status/{id}", method = RequestMethod.POST)
@ResponseBody
public Object updateStatus(@PathVariable Long id, Integer status) {
int count = advertiseService.updateStatus(id, status);
if (count > 0)
return new CommonResult().success(count);
return new CommonResult().failed();
}
@ApiOperation("获取广告详情")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public Object getItem(@PathVariable Long id) {
SmsHomeAdvertise advertise = advertiseService.getItem(id);
return new CommonResult().success(advertise);
}
@ApiOperation("修改广告")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable Long id, @RequestBody SmsHomeAdvertise advertise) {
int count = advertiseService.update(id, advertise);
if (count > 0)
return new CommonResult().success(count);
return new CommonResult().failed();
}
@ApiOperation("分页查询广告")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list(@RequestParam(value = "name", required = false) String name,//名称
@RequestParam(value = "type", required = false) Integer type,//类型
@RequestParam(value = "endTime", required = false) String endTime,//结束时间
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsHomeAdvertise> advertiseList = advertiseService.list(name, type, endTime, pageSize, pageNum);
return new CommonResult().pageSuccess(advertiseList);
}
}

@ -0,0 +1,77 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.SmsHomeBrand;
import com.macro.mall.service.SmsHomeBrandService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "SmsHomeBrandController", description = "看女틔탬밗잿")
@RequestMapping("/home/brand")
public class SmsHomeBrandController {
@Autowired
private SmsHomeBrandService homeBrandService;
@ApiOperation("警속看女股수틔탬")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestBody List<SmsHomeBrand> homeBrandList) {
int count = homeBrandService.create(homeBrandList);//看女틔탬륩蛟
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("錦맣틔탬탤埼")
@RequestMapping(value = "/update/sort/{id}", method = RequestMethod.POST)
@ResponseBody
public Object updateSort(@PathVariable Long id, Integer sort) {//뫘劤탤埼
int count = homeBrandService.updateSort(id,sort);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("툽좆<ED88BD>뇜股수틔탬")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestParam("ids") List<Long> ids) {
int count = homeBrandService.delete(ids);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("툽좆錦맣股수榴檄")
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
@ResponseBody
public Object updateRecommendStatus(@RequestParam("ids") List<Long> ids, @RequestParam Integer recommendStatus) {
int count = homeBrandService.updateRecommendStatus(ids,recommendStatus);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("롸女꿴璂股수틔탬")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list(@RequestParam(value = "brandName", required = false) String brandName,//틔탬츰냔
@RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,//股수榴檄
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsHomeBrand> homeBrandList = homeBrandService.list(brandName,recommendStatus,pageSize,pageNum);
return new CommonResult().pageSuccess(homeBrandList);
}
}

@ -0,0 +1,77 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.SmsHomeNewProduct;
import com.macro.mall.service.SmsHomeNewProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "SmsHomeNewProductController", description = "首页新品管理")
@RequestMapping("/home/newProduct")
public class SmsHomeNewProductController {
@Autowired
private SmsHomeNewProductService homeNewProductService;
@ApiOperation("添加首页推荐品牌")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestBody List<SmsHomeNewProduct> homeBrandList) {
int count = homeNewProductService.create(homeBrandList);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("修改推荐排序")
@RequestMapping(value = "/update/sort/{id}", method = RequestMethod.POST)
@ResponseBody
public Object updateSort(@PathVariable Long id, Integer sort) {
int count = homeNewProductService.updateSort(id,sort);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("批量删除推荐")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestParam("ids") List<Long> ids) {
int count = homeNewProductService.delete(ids);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("批量修改推荐状态")
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
@ResponseBody
public Object updateRecommendStatus(@RequestParam("ids") List<Long> ids, @RequestParam Integer recommendStatus) {
int count = homeNewProductService.updateRecommendStatus(ids,recommendStatus);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("分页查询推荐")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list(@RequestParam(value = "productName", required = false) String productName,//商品名称
@RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsHomeNewProduct> homeBrandList = homeNewProductService.list(productName,recommendStatus,pageSize,pageNum);
return new CommonResult().pageSuccess(homeBrandList);
}
}

@ -0,0 +1,77 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.SmsHomeRecommendProduct;
import com.macro.mall.service.SmsHomeRecommendProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "SmsHomeRecommendProductController", description = "看女훙폭股수밗잿")
@RequestMapping("/home/recommendProduct")
public class SmsHomeRecommendProductController {
@Autowired
private SmsHomeRecommendProductService recommendProductService;
@ApiOperation("警속看女股수")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestBody List<SmsHomeRecommendProduct> homeBrandList) {
int count = recommendProductService.create(homeBrandList);//股수<E882A1>틔륩蛟
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("錦맣股수탤埼")
@RequestMapping(value = "/update/sort/{id}", method = RequestMethod.POST)
@ResponseBody
public Object updateSort(@PathVariable Long id, Integer sort) {
int count = recommendProductService.updateSort(id,sort);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("툽좆<ED88BD>뇜股수")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestParam("ids") List<Long> ids) {
int count = recommendProductService.delete(ids);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("툽좆錦맣股수榴檄")
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
@ResponseBody
public Object updateRecommendStatus(@RequestParam("ids") List<Long> ids, @RequestParam Integer recommendStatus) {
int count = recommendProductService.updateRecommendStatus(ids,recommendStatus);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("롸女꿴璂股수")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list(@RequestParam(value = "productName", required = false) String productName,
@RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsHomeRecommendProduct> homeBrandList = recommendProductService.list(productName,recommendStatus,pageSize,pageNum);
return new CommonResult().pageSuccess(homeBrandList);
}
}

@ -0,0 +1,77 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.SmsHomeRecommendSubject;
import com.macro.mall.service.SmsHomeRecommendSubjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "SmsHomeRecommendSubjectController", description = "看女淚痙股수밗잿")
@RequestMapping("/home/recommendSubject")
public class SmsHomeRecommendSubjectController {
@Autowired
private SmsHomeRecommendSubjectService recommendSubjectService;
@ApiOperation("警속看女股수淚痙")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestBody List<SmsHomeRecommendSubject> homeBrandList) {
int count = recommendSubjectService.create(homeBrandList);//股수淚痙륩蛟
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("錦맣股수탤埼")
@RequestMapping(value = "/update/sort/{id}", method = RequestMethod.POST)
@ResponseBody
public Object updateSort(@PathVariable Long id, Integer sort) {
int count = recommendSubjectService.updateSort(id,sort);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("툽좆<ED88BD>뇜股수")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestParam("ids") List<Long> ids) {
int count = recommendSubjectService.delete(ids);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("툽좆錦맣股수榴檄")
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
@ResponseBody
public Object updateRecommendStatus(@RequestParam("ids") List<Long> ids, @RequestParam Integer recommendStatus) {
int count = recommendSubjectService.updateRecommendStatus(ids,recommendStatus);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("롸女꿴璂股수")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list(@RequestParam(value = "subjectName", required = false) String subjectName,//淚痙츰냔
@RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsHomeRecommendSubject> homeBrandList = recommendSubjectService.list(subjectName,recommendStatus,pageSize,pageNum);
return new CommonResult().pageSuccess(homeBrandList);
}
}
Loading…
Cancel
Save