package cc.mrbird.febs.mall.controller.clothes;
|
|
import cc.mrbird.febs.common.annotation.ControllerEndpoint;
|
import cc.mrbird.febs.common.controller.BaseController;
|
import cc.mrbird.febs.common.entity.FebsResponse;
|
import cc.mrbird.febs.common.entity.QueryRequest;
|
import cc.mrbird.febs.mall.dto.clothes.AdminClothesTypeInfoDto;
|
import cc.mrbird.febs.mall.dto.memberLevel.AdminMemberLabelAddDto;
|
import cc.mrbird.febs.mall.dto.memberLevel.AdminMemberLabelDto;
|
import cc.mrbird.febs.mall.dto.memberLevel.AdminMemberLabelUpdateDto;
|
import cc.mrbird.febs.mall.entity.*;
|
import cc.mrbird.febs.mall.service.ClothesTypeService;
|
import cc.mrbird.febs.mall.vo.clothes.AdminClothesTypeInfoVo;
|
import cc.mrbird.febs.mall.vo.memberLevel.AdminMemberLabelSetDto;
|
import lombok.RequiredArgsConstructor;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.validation.annotation.Validated;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.validation.Valid;
|
import javax.validation.constraints.NotNull;
|
import java.util.Map;
|
|
@Slf4j
|
@Validated
|
@RestController
|
@RequiredArgsConstructor
|
@RequestMapping(value = "/admin/clothesType")
|
public class AdminClothesTypeController extends BaseController {
|
|
private final ClothesTypeService clothesTypeService;
|
/**
|
* 分类列表
|
* @return
|
*/
|
@GetMapping("typeList")
|
public FebsResponse typeList(ClothesType dto, QueryRequest request) {
|
|
Map<String, Object> data = getDataTable(clothesTypeService.adminTypeList(dto, request));
|
return new FebsResponse().success().data(data);
|
}
|
/**
|
* 分类-新增
|
*/
|
@PostMapping("typeAdd")
|
@ControllerEndpoint(operation = " 分类-新增", exceptionMessage = "操作失败")
|
public FebsResponse typeAdd(@RequestBody @Valid ClothesType dto) {
|
|
return clothesTypeService.typeAdd(dto);
|
}
|
/**
|
* 分类-更新
|
*/
|
@PostMapping("typeUpdate")
|
@ControllerEndpoint(operation = "分类-更新", exceptionMessage = "操作失败")
|
public FebsResponse typeUpdate(@RequestBody @Valid ClothesType dto) {
|
|
return clothesTypeService.typeUpdate(dto);
|
}
|
/**
|
* 分类-状态操作
|
*/
|
@GetMapping("changeState/{id}/{type}/{state}")
|
@ControllerEndpoint(operation = "分类-状态操作", exceptionMessage = "操作失败")
|
public FebsResponse changeState(
|
@NotNull(message = "{required}") @PathVariable Long id,
|
@NotNull(message = "{required}") @PathVariable Integer type,
|
@NotNull(message = "{required}") @PathVariable Integer state
|
) {
|
|
return clothesTypeService.changeState(id,type,state);
|
}
|
/**
|
* 尺码列表
|
* @return
|
*/
|
@GetMapping("sizeList")
|
public FebsResponse sizeList(ClothesSize dto, QueryRequest request) {
|
|
Map<String, Object> data = getDataTable(clothesTypeService.adminSizeList(dto, request));
|
return new FebsResponse().success().data(data);
|
}
|
/**
|
* 尺码-新增
|
*/
|
@PostMapping("sizeAdd")
|
@ControllerEndpoint(operation = "新增", exceptionMessage = "操作失败")
|
public FebsResponse sizeAdd(@RequestBody @Valid ClothesSize dto) {
|
|
return clothesTypeService.sizeAdd(dto);
|
}
|
/**
|
* 尺码-更新
|
*/
|
@PostMapping("sizeUpdate")
|
@ControllerEndpoint(operation = "分类-更新", exceptionMessage = "操作失败")
|
public FebsResponse sizeUpdate(@RequestBody @Valid ClothesSize dto) {
|
|
return clothesTypeService.sizeUpdate(dto);
|
}
|
/**
|
* 图案列表
|
* @return
|
*/
|
@GetMapping("patternList")
|
public FebsResponse patternList(ClothesPattern dto, QueryRequest request) {
|
|
Map<String, Object> data = getDataTable(clothesTypeService.adminPatternList(dto, request));
|
return new FebsResponse().success().data(data);
|
}
|
/**
|
* 图案-新增
|
*/
|
@PostMapping("patternAdd")
|
@ControllerEndpoint(operation = "新增", exceptionMessage = "操作失败")
|
public FebsResponse patternAdd(@RequestBody @Valid ClothesPattern dto) {
|
|
return clothesTypeService.patternAdd(dto);
|
}
|
/**
|
* 图案-更新
|
*/
|
@PostMapping("patternUpdate")
|
@ControllerEndpoint(operation = "分类-更新", exceptionMessage = "操作失败")
|
public FebsResponse patternUpdate(@RequestBody @Valid ClothesPattern dto) {
|
|
return clothesTypeService.patternUpdate(dto);
|
}
|
|
|
/**
|
* 位置列表
|
* @return
|
*/
|
@GetMapping("locationList")
|
public FebsResponse locationList(ClothesLocation dto, QueryRequest request) {
|
|
Map<String, Object> data = getDataTable(clothesTypeService.adminLocationList(dto, request));
|
return new FebsResponse().success().data(data);
|
}
|
/**
|
* 位置-新增
|
*/
|
@PostMapping("locationAdd")
|
@ControllerEndpoint(operation = "新增", exceptionMessage = "操作失败")
|
public FebsResponse locationAdd(@RequestBody @Valid ClothesLocation dto) {
|
|
return clothesTypeService.locationAdd(dto);
|
}
|
/**
|
* 位置-更新
|
*/
|
@PostMapping("locationUpdate")
|
@ControllerEndpoint(operation = "分类-更新", exceptionMessage = "操作失败")
|
public FebsResponse locationUpdate(@RequestBody @Valid ClothesLocation dto) {
|
|
return clothesTypeService.locationUpdate(dto);
|
}
|
|
|
/**
|
* 布料列表
|
* @return
|
*/
|
@GetMapping("clothList")
|
public FebsResponse clothList(ClothesCloth dto, QueryRequest request) {
|
|
Map<String, Object> data = getDataTable(clothesTypeService.adminClothList(dto, request));
|
return new FebsResponse().success().data(data);
|
}
|
/**
|
* 布料-新增
|
*/
|
@PostMapping("clothAdd")
|
@ControllerEndpoint(operation = "新增", exceptionMessage = "操作失败")
|
public FebsResponse clothAdd(@RequestBody @Valid ClothesCloth dto) {
|
|
return clothesTypeService.clothAdd(dto);
|
}
|
/**
|
* 布料-更新
|
*/
|
@PostMapping("clothUpdate")
|
@ControllerEndpoint(operation = "分类-更新", exceptionMessage = "操作失败")
|
public FebsResponse clothUpdate(@RequestBody @Valid ClothesCloth dto) {
|
|
return clothesTypeService.clothUpdate(dto);
|
}
|
|
|
/**
|
* 工艺列表
|
* @return
|
*/
|
@GetMapping("artList")
|
public FebsResponse artList(ClothesArt dto, QueryRequest request) {
|
|
Map<String, Object> data = getDataTable(clothesTypeService.adminArtList(dto, request));
|
return new FebsResponse().success().data(data);
|
}
|
/**
|
* 工艺-新增
|
*/
|
@PostMapping("artAdd")
|
@ControllerEndpoint(operation = "新增", exceptionMessage = "操作失败")
|
public FebsResponse artAdd(@RequestBody @Valid ClothesArt dto) {
|
|
return clothesTypeService.artAdd(dto);
|
}
|
/**
|
* 工艺-更新
|
*/
|
@PostMapping("artUpdate")
|
@ControllerEndpoint(operation = "分类-更新", exceptionMessage = "操作失败")
|
public FebsResponse artUpdate(@RequestBody @Valid ClothesArt dto) {
|
|
return clothesTypeService.artUpdate(dto);
|
}
|
|
@PostMapping("artSet")
|
@ControllerEndpoint(operation = "设置", exceptionMessage = "操作失败")
|
public FebsResponse artSet(@RequestBody @Valid AdminClothesTypeInfoDto dto) {
|
|
return clothesTypeService.artSet(dto);
|
}
|
|
@PostMapping("sizeSet")
|
@ControllerEndpoint(operation = "设置", exceptionMessage = "操作失败")
|
public FebsResponse sizeSet(@RequestBody @Valid AdminClothesTypeInfoDto dto) {
|
|
return clothesTypeService.sizeSet(dto);
|
}
|
|
@PostMapping("clothSet")
|
@ControllerEndpoint(operation = "设置", exceptionMessage = "操作失败")
|
public FebsResponse clothSet(@RequestBody @Valid AdminClothesTypeInfoDto dto) {
|
|
return clothesTypeService.clothSet(dto);
|
}
|
|
@PostMapping("patternSet")
|
@ControllerEndpoint(operation = "设置", exceptionMessage = "操作失败")
|
public FebsResponse patternSet(@RequestBody @Valid AdminClothesTypeInfoDto dto) {
|
|
return clothesTypeService.patternSet(dto);
|
}
|
|
@PostMapping("locationSet")
|
@ControllerEndpoint(operation = "设置", exceptionMessage = "操作失败")
|
public FebsResponse locationSet(@RequestBody @Valid AdminClothesTypeInfoDto dto) {
|
|
return clothesTypeService.locationSet(dto);
|
}
|
|
}
|