记得上下班打卡 | git大法好,push需谨慎

Commit 9ea32b04 authored by zhengfuxin's avatar zhengfuxin

金刚位增删改查的搭建

parent eabdb68e
package com.liquidnet.client.admin.web.controller.zhengzai.goblin;
import com.alibaba.fastjson.JSON;
import com.liquidnet.client.admin.common.core.controller.BaseController;
import com.liquidnet.client.admin.common.core.domain.AjaxResult;
import com.liquidnet.client.admin.zhengzai.goblin.service.imp.GoblinFrontNavigationServiceImpl;
import com.liquidnet.service.goblin.entity.GoblinFrontBanner;
import com.liquidnet.service.goblin.entity.GoblinFrontNavigation;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* <p>
* 首页导航栏
前端控制器
* </p>
*
* @author liquidnet
* @since 2021-12-28
*/
@Api(tags = "金刚位管理")
@RestController
@RequestMapping("/navigation")
public class GoblinFrontNavigationController extends BaseController {
@Autowired
GoblinFrontNavigationServiceImpl goblinFrontNavigationService;
/***
* @author zhangfuxin
* @Description: 添加金刚位
* @date 2021/12/28 上午11:22
*/
@PostMapping("create")
@ApiOperation(value = "增加金刚位")
@ResponseBody
public AjaxResult create(@RequestBody GoblinFrontNavigation goblinFrontNavigation) {
logger.info("增加金刚位{}", JSON.toJSONString(goblinFrontNavigation));
boolean result=goblinFrontNavigationService.create(goblinFrontNavigation);
if (result ) {
return success("操作成功");
} else {
return error("操作失败");
}
}
/**
* @author zhangfuxin
* @Description:修改金刚位
* @date 2021/12/28 上午11:23
*/
@PostMapping("update")
@ApiOperation(value = "修改金刚位")
@ResponseBody
public AjaxResult update( @RequestBody GoblinFrontNavigation goblinFrontNavigation) {
logger.info("修改金刚位{}", JSON.toJSONString(goblinFrontNavigation));
boolean result=goblinFrontNavigationService.update(goblinFrontNavigation);
if (result ) {
return success("操作成功");
} else {
return error("操作失败");
}
}
/**
* 删除金刚位
*/
@PostMapping("delete")
@ApiOperation(value = "删除金刚位")
@ResponseBody
public AjaxResult delete( @RequestBody GoblinFrontNavigation goblinFrontNavigation) {
logger.info("删除金刚位{}", JSON.toJSONString(goblinFrontNavigation));
boolean result=goblinFrontNavigationService.delte(goblinFrontNavigation.getMid());
if (result ) {
return success("操作成功");
} else {
return error("操作失败");
}
}
/**
* 分页金刚位
*/
@PostMapping("page")
@ApiOperation(value = "分页")
@ResponseBody
public AjaxResult page( @RequestParam(name = "pageSize", required = true) int pageSize,@RequestParam(name = "pageNumber", required = true)int pageNumber,@RequestBody GoblinFrontBanner goblinFrontBanner) {
logger.info("分页banner{}", JSON.toJSONString(goblinFrontBanner));
return AjaxResult.success(goblinFrontNavigationService.page(pageSize,pageNumber,null));
}
/**
* @author zhangfuxin
* @Description:查看金刚位
* @date 2021/12/28 上午11:24
*/
@PostMapping("getOne")
@ApiOperation(value = "查看金刚位")
@ResponseBody
public AjaxResult getOne( @RequestBody GoblinFrontNavigation goblinFrontNavigation) {
logger.info("修改banner{}", JSON.toJSONString(goblinFrontNavigation));
goblinFrontNavigation=goblinFrontNavigationService.getOne(goblinFrontNavigation.getMid());
return AjaxResult.success(goblinFrontNavigation);
}
}
package com.liquidnet.client.admin.zhengzai.goblin.service;
import com.liquidnet.service.goblin.entity.GoblinFrontNavigation;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 首页导航栏
服务类
* </p>
*
* @author liquidnet
* @since 2021-12-28
*/
public interface IGoblinFrontNavigationService extends IService<GoblinFrontNavigation> {
}
package com.liquidnet.client.admin.zhengzai.goblin.service.imp;
import com.github.pagehelper.PageInfo;
import com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinFrontNavigationService;
import com.liquidnet.service.goblin.entity.GoblinFrontBanner;
import com.liquidnet.service.goblin.entity.GoblinFrontNavigation;
import com.liquidnet.service.goblin.mapper.GoblinFrontNavigationMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 首页导航栏
服务实现类
* </p>
*
* @author liquidnet
* @since 2021-12-28
*/
@Service
public class GoblinFrontNavigationServiceImpl extends ServiceImpl<GoblinFrontNavigationMapper, GoblinFrontNavigation> implements IGoblinFrontNavigationService {
public boolean create(GoblinFrontNavigation goblinFrontBanner){
return true;
}
public boolean update(GoblinFrontNavigation goblinFrontBanner){
return true;
}
public GoblinFrontNavigation getOne(Long id){
return null;
}
public boolean delte(Long id){
return true;
}
public PageInfo<GoblinFrontNavigation> page(int pageSize, int pageNumber, GoblinFrontNavigation goblinFrontNavigation) {
return null;
}
}
package com.liquidnet.service.goblin.entity;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
package com.liquidnet.service.goblin.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 首页导航栏
* </p>
*
* @author liquidnet
* @since 2021-12-27
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class GoblinFrontNavigation implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long mid;
/**
* 图片路径或id
*/
private String picUrl;
/**
* 标题
*/
private String title;
/**
* 商品id
*/
private String spuId;
/**
* 展示形式:1、一行2、二行
*/
private Integer displayType;
/**
* 分类
*/
private String categoryType;
/**
* 活动链接
*/
private String activityUrl;
/**
* 1、分类2、专题3、商品单品
*/
private Integer navigationType;
/**
* 顺序
*/
private Integer indexs;
/**
* 创建时间
*/
private LocalDateTime createTime;
/**
* 修改时间
*/
private LocalDateTime updateTime;
/**
* 导航id
*/
private String navigationId;
/**
* 0未删除1已删除
*/
private Integer delTag;
}
* </p>
*
* @author liquidnet
* @since 2021-12-28
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class GoblinFrontNavigation implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* 图片路径或id
*/
private String picUrl;
/**
* 标题
*/
private String title;
/**
* 商品id
*/
private String spuId;
/**
* 展示形式:1、一行2、二行
*/
private Integer displayType;
/**
* 分类
*/
private String categoryType;
/**
* 活动链接
*/
private String activityUrl;
/**
* 1、分类2、专题3、商品单品
*/
private Integer navigationType;
/**
* 顺序
*/
private Integer indexs;
/**
* 创建时间
*/
private LocalDateTime createTime;
/**
* 修改时间
*/
private LocalDateTime updateTime;
/**
* 导航id
*/
private String navigationId;
/**
* 0未删除1已删除
*/
private Integer delTag;
/**
* 商品名字
*/
private String spuName;
}
package com.liquidnet.service.goblin.mapper;
import com.liquidnet.service.goblin.entity.GoblinFrontNavigation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
package com.liquidnet.service.goblin.mapper;
import com.liquidnet.service.goblin.entity.GoblinFrontNavigation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 首页导航栏
Mapper 接口
* </p>
*
* @author liquidnet
* @since 2021-12-27
*/
public interface GoblinFrontNavigationMapper extends BaseMapper<GoblinFrontNavigation> {
}
Mapper 接口
* </p>
*
* @author liquidnet
* @since 2021-12-28
*/
public interface GoblinFrontNavigationMapper extends BaseMapper<GoblinFrontNavigation> {
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment