|
|
@ -22,9 +22,6 @@ import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
|
|
|
import com.epmet.commons.tools.validator.group.AddGroup; |
|
|
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
|
|
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|
|
|
import com.epmet.dto.GuideCategoryDTO; |
|
|
|
import com.epmet.dto.form.EditGuideCategoryFormDTO; |
|
|
|
import com.epmet.dto.form.GuideCateOrderFormDTO; |
|
|
@ -33,7 +30,10 @@ import com.epmet.dto.form.GuideCategoryPageFormDTO; |
|
|
|
import com.epmet.dto.result.GuideDictResDTO; |
|
|
|
import com.epmet.service.GuideCategoryService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
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 java.util.List; |
|
|
|
|
|
|
@ -111,7 +111,7 @@ public class GuideCategoryController { |
|
|
|
@PostMapping("disable") |
|
|
|
public Result disable(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){ |
|
|
|
formDTO.setStaffId(tokenDto.getUserId()); |
|
|
|
ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.AddUserInternalGroup.class,EditGuideCategoryFormDTO.StatusGroup.class); |
|
|
|
ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.StatusGroup.class,EditGuideCategoryFormDTO.AddUserInternalGroup.class); |
|
|
|
guideCategoryService.disableGuideCategory(formDTO); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
@ -134,19 +134,38 @@ public class GuideCategoryController { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping |
|
|
|
public Result save(@RequestBody GuideCategoryDTO dto){ |
|
|
|
//效验数据
|
|
|
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|
|
|
guideCategoryService.save(dto); |
|
|
|
/** |
|
|
|
* 新增分类,名称和编码客户内唯一 |
|
|
|
* |
|
|
|
* @param tokenDto |
|
|
|
* @param formDTO |
|
|
|
* @return com.epmet.commons.tools.utils.Result |
|
|
|
* @author yinzuomei |
|
|
|
* @date 2021/9/8 5:11 下午 |
|
|
|
*/ |
|
|
|
@PostMapping("save") |
|
|
|
public Result save(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){ |
|
|
|
formDTO.setStaffId(tokenDto.getUserId()); |
|
|
|
ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.AddUserInternalGroup.class,EditGuideCategoryFormDTO.SaveInfoGroup.class); |
|
|
|
guideCategoryService.save(formDTO); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
@PutMapping |
|
|
|
public Result update(@RequestBody GuideCategoryDTO dto){ |
|
|
|
//效验数据
|
|
|
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|
|
|
guideCategoryService.update(dto); |
|
|
|
|
|
|
|
/** |
|
|
|
* 编辑名称 |
|
|
|
* |
|
|
|
* @param tokenDto |
|
|
|
* @param formDTO |
|
|
|
* @return com.epmet.commons.tools.utils.Result |
|
|
|
* @author yinzuomei |
|
|
|
* @date 2021/9/8 5:37 下午 |
|
|
|
*/ |
|
|
|
@PostMapping("update") |
|
|
|
public Result update(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){ |
|
|
|
formDTO.setStaffId(tokenDto.getUserId()); |
|
|
|
ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.AddUserInternalGroup.class,EditGuideCategoryFormDTO.UpdateInfoGroup.class); |
|
|
|
guideCategoryService.update(formDTO); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|