This commit is contained in:
wangjinlei
2023-09-20 15:14:30 +08:00
parent f0f7e3827a
commit e0a103358c
7 changed files with 93 additions and 1 deletions

View File

@@ -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();
}
}