use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.
the class UserMgrController method add.
/**
* 添加管理员
*/
@RequestMapping("/add")
@BussinessLog(value = "添加管理员", key = "account", dict = Dict.UserDict)
@Permission(Const.ADMIN_NAME)
@ResponseBody
public Tip add(@Valid UserDto user, BindingResult result) {
if (result.hasErrors()) {
throw new BussinessException(BizExceptionEnum.REQUEST_NULL);
}
// 判断账号是否重复
User theUser = managerDao.getByAccount(user.getAccount());
if (theUser != null) {
throw new BussinessException(BizExceptionEnum.USER_ALREADY_REG);
}
// 完善账号信息
user.setSalt(ShiroKit.getRandomSalt(5));
user.setPassword(ShiroKit.md5(user.getPassword(), user.getSalt()));
user.setStatus(ManagerStatus.OK.getCode());
user.setCreatetime(new Date());
this.userMapper.insert(UserFactory.createUser(user));
return SUCCESS_TIP;
}
use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.
the class UserMgrController method userEdit.
/**
* 跳转到编辑管理员页面
*/
@Permission
@RequestMapping("/user_edit/{userId}")
public String userEdit(@PathVariable Integer userId, Model model) {
if (ToolUtil.isEmpty(userId)) {
throw new BussinessException(BizExceptionEnum.REQUEST_NULL);
}
User user = this.userMapper.selectById(userId);
model.addAttribute(user);
model.addAttribute("roleName", ConstantFactory.me().getRoleName(user.getRoleid()));
model.addAttribute("deptName", ConstantFactory.me().getDeptName(user.getDeptid()));
LogObjectHolder.me().set(user);
return PREFIX + "user_edit.html";
}
use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.
the class CodeController method add.
/**
* 代码生成
*/
@ApiOperation("生成代码")
@RequestMapping(value = "/generate", method = RequestMethod.POST)
@ResponseBody
@Permission(Const.ADMIN_NAME)
public Object add(@ApiParam(value = "模块名称", required = true) @RequestParam String moduleName, @RequestParam String bizChName, @RequestParam String bizEnName, @RequestParam String path) {
if (ToolUtil.isOneEmpty(bizChName, bizEnName)) {
throw new BussinessException(BizExceptionEnum.REQUEST_NULL);
}
ContextConfig contextConfig = new ContextConfig();
contextConfig.setBizChName(bizChName);
contextConfig.setBizEnName(bizEnName);
contextConfig.setModuleName(moduleName);
if (ToolUtil.isNotEmpty(path)) {
contextConfig.setProjectPath(path);
}
GunsTemplateEngine gunsTemplateEngine = new SimpleTemplateEngine();
gunsTemplateEngine.setContextConfig(contextConfig);
gunsTemplateEngine.start();
return super.SUCCESS_TIP;
}
use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.
the class DeptController method deptUpdate.
/**
* 跳转到修改部门
*/
@Permission
@RequestMapping("/dept_update/{deptId}")
public String deptUpdate(@PathVariable Integer deptId, Model model) {
Dept dept = deptMapper.selectById(deptId);
model.addAttribute(dept);
model.addAttribute("pName", ConstantFactory.me().getDeptName(dept.getPid()));
LogObjectHolder.me().set(dept);
return PREFIX + "dept_edit.html";
}
use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.
the class RedpackLogController method index.
/**
* 跳转到红包记录首页
*/
@RequestMapping("")
@Permission
public String index(Model model) {
Long userId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(userId);
List<Redpack> redpacks = redpackService.selectByMerchantId(merchant.getId());
model.addAttribute("sendStatus", RedPackSendStatus.values());
model.addAttribute("redpacks", redpacks);
return PREFIX + "redpackLog.html";
}
Aggregations