记得上下班打卡 | 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 com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
......@@ -12,7 +14,7 @@ import lombok.EqualsAndHashCode;
* </p>
*
* @author liquidnet
* @since 2021-12-27
* @since 2021-12-28
*/
@Data
@EqualsAndHashCode(callSuper = false)
......@@ -23,6 +25,7 @@ public class GoblinFrontNavigation implements Serializable {
/**
* 主键
*/
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
......@@ -85,5 +88,10 @@ public class GoblinFrontNavigation implements Serializable {
*/
private Integer delTag;
/**
* 商品名字
*/
private String spuName;
}
......@@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p>
*
* @author liquidnet
* @since 2021-12-27
* @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