标签组及子标签接口

This commit is contained in:
陈伏伽
2023-10-19 17:19:30 +08:00
parent 82b63d6db0
commit 0ca2897252
4 changed files with 35 additions and 5 deletions

View File

@@ -7,16 +7,14 @@ import com.cool.store.dto.label.LabelUpdateDTO;
import com.cool.store.exception.ApiException;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.LabelService;
import com.cool.store.vo.LabelGroupListVo;
import com.cool.store.vo.LabelListVo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -40,6 +38,13 @@ public class LabelController {
return ResponseResult.success(new PageInfo<>(result));
}
@ApiOperation("查询标签组及子标签列表")
@GetMapping("/labelGroupAndLabelList")
public ResponseResult<List<LabelGroupListVo>> getAllLabelList() {
List<LabelGroupListVo> result = labelService.getAllGroupAndLabelList();
return ResponseResult.success(result);
}
@ApiOperation("新增标签")
@PostMapping("/add")
public ResponseResult addLabel(@RequestBody LabelAddDTO dto) throws ApiException {