Search in sources :

Example 6 with BussinessLog

use of com.ikoori.vip.common.annotion.log.BussinessLog in project vip by guangdada.

the class UserMgrController method reset.

/**
 * 重置管理员的密码
 */
@RequestMapping("/reset")
@BussinessLog(value = "重置管理员密码", key = "userId", dict = Dict.UserDict)
@Permission(Const.ADMIN_NAME)
@ResponseBody
public Tip reset(@RequestParam Integer userId) {
    if (ToolUtil.isEmpty(userId)) {
        throw new BussinessException(BizExceptionEnum.REQUEST_NULL);
    }
    User user = this.userMapper.selectById(userId);
    user.setSalt(ShiroKit.getRandomSalt(5));
    user.setPassword(ShiroKit.md5(Const.DEFAULT_PWD, user.getSalt()));
    this.userMapper.updateById(user);
    return SUCCESS_TIP;
}
Also used : ShiroUser(com.ikoori.vip.server.core.shiro.ShiroUser) User(com.ikoori.vip.common.persistence.model.User) BussinessException(com.ikoori.vip.common.exception.BussinessException) Permission(com.ikoori.vip.common.annotion.Permission) BussinessLog(com.ikoori.vip.common.annotion.log.BussinessLog) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

BussinessLog (com.ikoori.vip.common.annotion.log.BussinessLog)6 BussinessException (com.ikoori.vip.common.exception.BussinessException)5 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)5 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)5 Permission (com.ikoori.vip.common.annotion.Permission)3 ShiroUser (com.ikoori.vip.server.core.shiro.ShiroUser)3 User (com.ikoori.vip.common.persistence.model.User)2 Date (java.util.Date)2 EntityWrapper (com.baomidou.mybatisplus.mapper.EntityWrapper)1 AbstractDictMap (com.ikoori.vip.common.constant.dictmap.base.AbstractDictMap)1 Menu (com.ikoori.vip.common.persistence.model.Menu)1 Notice (com.ikoori.vip.common.persistence.model.Notice)1 Method (java.lang.reflect.Method)1 HashMap (java.util.HashMap)1 Signature (org.aspectj.lang.Signature)1 MethodSignature (org.aspectj.lang.reflect.MethodSignature)1