feat():钢种crud
This commit is contained in:
@@ -0,0 +1,44 @@
|
|||||||
|
package com.fizz.business.controller;
|
||||||
|
|
||||||
|
import com.fizz.business.domain.SteelGradeInfo;
|
||||||
|
import com.fizz.business.service.SteelGradeInfoService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Api("南钢钢种接口")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/steelGrade")
|
||||||
|
public class SteelGradeInfoController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SteelGradeInfoService steelGradeInfoService;
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation("查询钢种列表")
|
||||||
|
public List<SteelGradeInfo> list() {
|
||||||
|
return steelGradeInfoService.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增")
|
||||||
|
public boolean add(@RequestBody SteelGradeInfo steelGradeInfo) {
|
||||||
|
return steelGradeInfoService.save(steelGradeInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@ApiOperation("更新")
|
||||||
|
public boolean update(@RequestBody SteelGradeInfo steelGradeInfo) {
|
||||||
|
return steelGradeInfoService.updateById(steelGradeInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除")
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public boolean delete(@PathVariable Integer id) {
|
||||||
|
return steelGradeInfoService.removeById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.fizz.business.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("steel_grade_info")
|
||||||
|
public class SteelGradeInfo implements Serializable {
|
||||||
|
|
||||||
|
@TableId(value = "steel_grade_id", type = IdType.AUTO)
|
||||||
|
@ApiModelProperty(value = "钢种ID")
|
||||||
|
private Integer steelGradeId;
|
||||||
|
|
||||||
|
@TableField("steel_grade_name")
|
||||||
|
@ApiModelProperty(value = "钢种名称")
|
||||||
|
private String steelGradeName;
|
||||||
|
|
||||||
|
@TableField("steel_grade_des")
|
||||||
|
@ApiModelProperty(value = "钢种描述")
|
||||||
|
private String steelGradeDes;
|
||||||
|
|
||||||
|
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
// Getters and Setters
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package com.fizz.business.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.fizz.business.domain.SteelGradeInfo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface SteelGradeInfoMapper extends BaseMapper<SteelGradeInfo> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.fizz.business.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.fizz.business.domain.SteelGradeInfo;
|
||||||
|
|
||||||
|
public interface SteelGradeInfoService extends IService<SteelGradeInfo> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.fizz.business.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.fizz.business.domain.SteelGradeInfo;
|
||||||
|
import com.fizz.business.mapper.SteelGradeInfoMapper;
|
||||||
|
import com.fizz.business.service.SteelGradeInfoService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class SteelGradeInfoServiceImpl extends ServiceImpl<SteelGradeInfoMapper, SteelGradeInfo> implements SteelGradeInfoService {
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.fizz.business.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
|
||||||
|
public class SteelGradeInfoVO implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "钢种ID")
|
||||||
|
private Integer steelGradeId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "钢种名称")
|
||||||
|
private String steelGradeName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "钢种描述")
|
||||||
|
private String steelGradeDes;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
// Getters and Setters
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.fizz.business.mapper.SteelGradeInfoMapper">
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user