nickchange
2023-11-30 fabe5684d31e0c52548b33b7afbfec0855f9880e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package com.dsh.guns.modular.system.controller.code;
 
 
import com.dsh.course.feignClient.account.CoachTypeClient;
import com.dsh.course.feignClient.account.model.CoachType;
import com.dsh.guns.config.UserExt;
import com.dsh.guns.modular.system.model.QuestionSearchVO;
import net.bytebuddy.asm.Advice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
 
/**
 * 教练类型
 */
@Controller
@RequestMapping("/tCoachType")
public class CoachTypeController {
 
    private String PREFIX = "/system/tCoachType/";
    @Autowired
    private CoachTypeClient coachTypeClient;
 
    /**
     * 跳转常见问题首页
     */
    @RequestMapping("")
    public String index(Model model) {
 
        String roleid = UserExt.getUser().getRoleid();
        model.addAttribute("role",roleid);
        return PREFIX + "TCoachType.html";
    }
    /**
     * 获取教练类型列表
     */
    @RequestMapping("/list")
    @ResponseBody
    public List<CoachType> list() {
        return coachTypeClient.list();
    }
    /**
     * 新增教练类型
     */
    @RequestMapping("/add")
    @ResponseBody
    public Object addCoachType(String name) {
        return coachTypeClient.add(name);
    }
    /**
     * 修改教练类型
     */
    @RequestMapping("/update")
    @ResponseBody
    public Object updateCoachType(@RequestBody CoachType vo) {
 
        return coachTypeClient.update(vo);
    }
    /**
     * 删除教练类型
     */
    @RequestMapping("/delete")
    @ResponseBody
    public Object deleteCoachType(Integer id) {
        CoachType coachType = new CoachType();
        coachType.setId(id);
        coachType.setState(3);
        return coachTypeClient.update(coachType);
    }
 
}