use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.
the class WxConfigController method list.
/**
* 获取公众号管理列表
*/
@RequestMapping(value = "/list", method = RequestMethod.POST)
@Permission
@ResponseBody
public Object list(String appid) {
Page<WxConfig> page = new PageFactory<WxConfig>().defaultPage();
List<Map<String, Object>> result = wxConfigDao.getWxConfigList(page, appid, page.getOrderByField(), page.isAsc());
page.setRecords((List<WxConfig>) new WxconfigWarpper(result).warp());
return super.packForBT(page);
}
use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.
the class PermissionAop method doPermission.
@Around("cutPermission()")
public Object doPermission(ProceedingJoinPoint point) throws Throwable {
MethodSignature ms = (MethodSignature) point.getSignature();
Method method = ms.getMethod();
Permission permission = method.getAnnotation(Permission.class);
Object[] permissions = permission.value();
if (permissions == null || permissions.length == 0) {
// 检查全体角色
boolean result = PermissionCheckManager.checkAll();
if (result) {
return point.proceed();
} else {
throw new NoPermissionException();
}
} else {
// 检查指定角色
boolean result = PermissionCheckManager.check(permissions);
if (result) {
return point.proceed();
} else {
throw new NoPermissionException();
}
}
}
use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.
the class SignLogController method signLogUpdate.
/**
* 跳转到修改签到记录
*/
@Permission
@RequestMapping("/signLog_update/{signLogId}")
public String signLogUpdate(@PathVariable Long signLogId, Model model) {
SignLog signLog = signLogService.selectById(signLogId);
model.addAttribute(signLog);
return PREFIX + "signLog_edit.html";
}
use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.
the class StoreEmployeeController method index.
/**
* 跳转到员工管理首页
*/
@Permission
@RequestMapping("")
public String index(Model model) {
Long userId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(userId);
Map<String, Object> condition = new HashMap<String, Object>();
condition.put("merchantId", merchant.getId());
List<Store> stores = storeService.selectByCondition(condition);
// 查询店铺
model.addAttribute("stores", stores);
// 角色
model.addAttribute("roles", RoleType.values());
return PREFIX + "storeEmployee.html";
}
use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.
the class TicketController method index.
/**
* 跳转到小票首页
*/
@Permission
@RequestMapping("")
public String index(Model model) {
Long userId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(userId);
Map<String, Object> condition = new HashMap<String, Object>();
condition.put("merchantId", merchant.getId());
List<Store> stores = storeService.selectByCondition(condition);
// 查询店铺
model.addAttribute("stores", stores);
/*
* Long userId = Long.valueOf(ShiroKit.getUser().getId()); Ticket
* ticket=ticketMapper.selectById(1); model.addAttribute("ticket",
* ticket);
*/
return PREFIX + "ticket.html";
}
Aggregations