Search in sources :

Example 61 with Permission

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);
}
Also used : WxConfig(com.ikoori.vip.common.persistence.model.WxConfig) WxconfigWarpper(com.ikoori.vip.server.modular.biz.warpper.WxconfigWarpper) Map(java.util.Map) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 62 with Permission

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();
        }
    }
}
Also used : MethodSignature(org.aspectj.lang.reflect.MethodSignature) Permission(com.ikoori.vip.common.annotion.Permission) NoPermissionException(javax.naming.NoPermissionException) Method(java.lang.reflect.Method) Around(org.aspectj.lang.annotation.Around)

Example 63 with Permission

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";
}
Also used : SignLog(com.ikoori.vip.common.persistence.model.SignLog) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 64 with Permission

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";
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) Store(com.ikoori.vip.common.persistence.model.Store) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 65 with Permission

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";
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) Store(com.ikoori.vip.common.persistence.model.Store) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

Permission (com.ikoori.vip.common.annotion.Permission)93 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)92 Merchant (com.ikoori.vip.common.persistence.model.Merchant)55 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)47 HashMap (java.util.HashMap)31 Map (java.util.Map)23 BussinessException (com.ikoori.vip.common.exception.BussinessException)18 Store (com.ikoori.vip.common.persistence.model.Store)12 Coupon (com.ikoori.vip.common.persistence.model.Coupon)11 Card (com.ikoori.vip.common.persistence.model.Card)9 MemberCard (com.ikoori.vip.common.persistence.model.MemberCard)6 StoreCoupon (com.ikoori.vip.common.persistence.model.StoreCoupon)6 User (com.ikoori.vip.common.persistence.model.User)6 ShiroUser (com.ikoori.vip.server.core.shiro.ShiroUser)4 LinkedHashMap (java.util.LinkedHashMap)4 BussinessLog (com.ikoori.vip.common.annotion.log.BussinessLog)3 OperationLog (com.ikoori.vip.common.persistence.model.OperationLog)3 WxConfig (com.ikoori.vip.common.persistence.model.WxConfig)3 LogWarpper (com.ikoori.vip.server.modular.system.warpper.LogWarpper)3 EntityWrapper (com.baomidou.mybatisplus.mapper.EntityWrapper)2