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);
|
}
|
|
}
|