提交 339e06fc authored 作者: liupengfei's avatar liupengfei

--no commit message

上级 a40054a4
......@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zrqx.core.commons.redis.Redis;
import com.zrqx.core.exception.BaseException;
import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam;
......@@ -36,10 +37,14 @@ public class RoleController {
@Autowired
private RoleService roleService;
@Autowired
private Redis redis;
@ApiOperation(value = "新增" , notes ="新增一个角色")
@PostMapping(value = "/save")
public CallBack<Boolean> save(@RequestBody Role role){
role.setCreateTime(new Date());
role.setCreater(redis.getUser().getUserName());
if (!roleService.insert(role)) {
throw new BaseException("操作失败");
}
......@@ -49,6 +54,7 @@ public class RoleController {
@PostMapping(value = "/update")
public CallBack<Boolean> update(@RequestBody Role role){
role.setModifDate(new Date());
role.setModifIer(redis.getUser().getUserName());
if (!roleService.updateByPrimaryKeySelective(role)) {
throw new BaseException("操作失败");
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论