新版
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
package com.peanut.modules.book.controller;
|
||||||
|
|
||||||
|
import com.peanut.common.utils.R;
|
||||||
|
import com.peanut.modules.book.entity.ShopProductLabelEntity;
|
||||||
|
import com.peanut.modules.book.service.ShopProductLabelService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("book/label")
|
||||||
|
public class ShopProductLabelController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ShopProductLabelService shopProductLabelService;
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping("/addLabel")
|
||||||
|
public R addLabel(@RequestParam String labelName){
|
||||||
|
ShopProductLabelEntity shopProductLabelEntity = new ShopProductLabelEntity();
|
||||||
|
shopProductLabelEntity.setLabelName(labelName);
|
||||||
|
shopProductLabelService.save(shopProductLabelEntity);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.peanut.modules.book.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.peanut.modules.book.entity.ShopProductLabelEntity;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface ShopProductLabelDao extends BaseMapper<ShopProductLabelEntity> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.peanut.modules.book.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("shop_product_label")
|
||||||
|
public class ShopProductLabelEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Integer splId;
|
||||||
|
|
||||||
|
private String labelName;
|
||||||
|
|
||||||
|
private Date ctime;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField("del_flag")
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.peanut.modules.book.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.peanut.modules.book.entity.ShopProductLabelEntity;
|
||||||
|
|
||||||
|
public interface ShopProductLabelService extends IService<ShopProductLabelEntity> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.peanut.modules.book.service.impl;
|
||||||
|
|
||||||
|
import com.peanut.modules.book.dao.ShopProductLabelDao;
|
||||||
|
import com.peanut.modules.book.entity.ShopProductLabelEntity;
|
||||||
|
import com.peanut.modules.book.service.ShopProductLabelService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service("ShopProductLabelService")
|
||||||
|
public class ShopProductLabelServiceImpl extends ServiceImpl<ShopProductLabelDao, ShopProductLabelEntity> implements ShopProductLabelService {
|
||||||
|
|
||||||
|
}
|
||||||
5
src/main/resources/mapper/ShopProductLabelMapper.xml
Normal file
5
src/main/resources/mapper/ShopProductLabelMapper.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?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.peanut.modules.book.dao.ShopProductLabelMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -6,7 +6,7 @@ public class Test {
|
|||||||
public void test01(){
|
public void test01(){
|
||||||
String a = "dsadasdasdas";
|
String a = "dsadasdasdas";
|
||||||
String substring = a.substring(5, 1);
|
String substring = a.substring(5, 1);
|
||||||
System.out.println(substring);
|
System.out.println(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user