com.base4j.mvc.sys.controller.SysRoleController Maven / Gradle / Ivy
package com.base4j.mvc.sys.controller;
import com.base4j.mvc.base.controller.BaseController;
import com.base4j.mvc.base.entity.EntityUtil;
import com.base4j.mvc.sys.entity.*;
import com.base4j.mvc.sys.service.SysRoleService;
import com.base4j.mvc.util.Res;
import com.base4j.mybatis.base.QueryParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RequestMapping("/sys/role")
@RestController
public class SysRoleController extends BaseController {
@Autowired
private SysRoleService sysRoleService;
/**
* 根据ID删除数据
* @param id
* @return Res
*/
@RequestMapping("/deleteByPrimary/{id}")
public Res deleteByPrimary(@PathVariable("id") long id) {
// QueryParams params = new QueryParams(SysRole.class);
// QueryParams.Criteria criteria = params.createCriteria();
// criteria.andEqualTo("id", id);
sysRoleService.deleteByPrimaryKey(id);
return Res.ok();
}
}