puzhibing
2024-02-05 640ff18d2d7f4be02ddb7f8f75e899f05545eb98
cloud-server-account/src/main/java/com/dsh/account/controller/CoachTypeController.java
@@ -25,29 +25,31 @@
    /**
     * 根据门店
     *
     * @param
     * @return
     */
    @ResponseBody
    @PostMapping("/coachType/list")
    public List<CoachType> list(){
    public List<CoachType> list() {
        return typeService.list(new QueryWrapper<CoachType>().ne("state",3));
        return typeService.list(new QueryWrapper<CoachType>().ne("state", 3));
    }
    /**
     * 新增教练类型
     *
     * @param
     * @return
     */
    @ResponseBody
    @RequestMapping("/coachType/add")
    public Object add(@RequestBody String name){
    public Object add(@RequestBody String name) {
        List<CoachType> list = typeService.list(new QueryWrapper<CoachType>().eq("name", name));
        if (list.size()!= 0){
        if (list.size() != 0) {
            return 500;
        }else{
        } else {
            CoachType coachType = new CoachType();
            coachType.setName(name);
            coachType.setState(1);
@@ -55,14 +57,16 @@
            return 200;
        }
    }
    /**
     * 删除教练类型
     *
     * @param
     * @return
     */
    @ResponseBody
    @RequestMapping("/coachType/delete")
    public Object delete(@RequestBody Integer id){
    public Object delete(@RequestBody Integer id) {
        CoachType coachType = new CoachType();
        coachType.setId(id);
        coachType.setState(3);
@@ -71,16 +75,17 @@
    /**
     * 修改教练类型
     *
     * @param
     * @return
     */
    @ResponseBody
    @RequestMapping("/coachType/update")
    public Object update(@RequestBody CoachType coachType){
    public Object update(@RequestBody CoachType coachType) {
        List<CoachType> list = typeService.list(new QueryWrapper<CoachType>().eq("name", coachType.getName()));
        if (list.size()!= 0){
        if (list.size() != 0) {
            return 500;
        }else{
        } else {
            typeService.updateById(coachType);
            return 200;