| @@ -9,6 +9,7 @@ import org.apache.shiro.spring.LifecycleBeanPostProcessor; | |||||
| import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor; | import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor; | ||||
| import org.apache.shiro.spring.web.ShiroFilterFactoryBean; | import org.apache.shiro.spring.web.ShiroFilterFactoryBean; | ||||
| import org.apache.shiro.web.mgt.DefaultWebSecurityManager; | import org.apache.shiro.web.mgt.DefaultWebSecurityManager; | ||||
| import org.apache.shiro.web.servlet.SimpleCookie; | |||||
| import org.apache.shiro.web.session.mgt.DefaultWebSessionManager; | import org.apache.shiro.web.session.mgt.DefaultWebSessionManager; | ||||
| import org.crazycake.shiro.RedisCacheManager; | import org.crazycake.shiro.RedisCacheManager; | ||||
| import org.crazycake.shiro.RedisManager; | import org.crazycake.shiro.RedisManager; | ||||
| @@ -41,8 +42,8 @@ public class ShiroConfig { | |||||
| @Value("${spring.redis.expire}") | @Value("${spring.redis.expire}") | ||||
| private int expire; | private int expire; | ||||
| @Value("${spring.redis.password}") | |||||
| private String password; | |||||
| @Value("${spring.redis.password}") | |||||
| private String password; | |||||
| @Bean | @Bean | ||||
| public static LifecycleBeanPostProcessor getLifecycleBeanPostProcessor() { | public static LifecycleBeanPostProcessor getLifecycleBeanPostProcessor() { | ||||
| @@ -104,7 +105,12 @@ public class ShiroConfig { | |||||
| // filterChainDefinitionMap.put(resources.getUrl(),permission); | // filterChainDefinitionMap.put(resources.getUrl(),permission); | ||||
| // } | // } | ||||
| // } | // } | ||||
| filterChainDefinitionMap.put("/swagger-ui.html","anon"); | |||||
| filterChainDefinitionMap.put("/v2/**","anon"); | |||||
| filterChainDefinitionMap.put("/swagger-resources/**","anon"); | |||||
| filterChainDefinitionMap.put("/webjars/**","anon"); | |||||
| filterChainDefinitionMap.put("/**", "authc"); | filterChainDefinitionMap.put("/**", "authc"); | ||||
| // filterChainDefinitionMap.put("/**", "anon"); | |||||
| shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap); | shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap); | ||||
| @@ -130,6 +136,8 @@ public class ShiroConfig { | |||||
| myShiroRealm.setCredentialsMatcher(hashedCredentialsMatcher()); | myShiroRealm.setCredentialsMatcher(hashedCredentialsMatcher()); | ||||
| return myShiroRealm; | return myShiroRealm; | ||||
| } | } | ||||
| /** | /** | ||||
| * 凭证匹配器 | * 凭证匹配器 | ||||
| @@ -201,13 +209,53 @@ public class ShiroConfig { | |||||
| } | } | ||||
| /** | /** | ||||
| * shiro session的管理 | |||||
| * shiro session的管理 | |||||
| */ | */ | ||||
| @Bean | @Bean | ||||
| public DefaultWebSessionManager sessionManager() { | public DefaultWebSessionManager sessionManager() { | ||||
| DefaultWebSessionManager sessionManager = new DefaultWebSessionManager(); | DefaultWebSessionManager sessionManager = new DefaultWebSessionManager(); | ||||
| sessionManager.setSessionDAO(redisSessionDAO()); | sessionManager.setSessionDAO(redisSessionDAO()); | ||||
| sessionManager.setSessionIdCookie(simpleCookie()); | |||||
| return sessionManager; | return sessionManager; | ||||
| } | } | ||||
| @Bean | |||||
| public SimpleCookie simpleCookie() { | |||||
| SimpleCookie simpleCookie = new SimpleCookie("SSIDS"); | |||||
| simpleCookie.setDomain(""); | |||||
| return simpleCookie; | |||||
| } | |||||
| // @Bean | |||||
| // public SimpleCookie rememberMeCookie(){ | |||||
| // //System.out.println("ShiroConfiguration.rememberMeCookie()"); | |||||
| // //这个参数是cookie的名称,对应前端的checkbox的name = rememberMe | |||||
| // SimpleCookie simpleCookie = new SimpleCookie("rememberMe"); | |||||
| // //<!-- 记住我cookie生效时间30天 ,单位秒;--> | |||||
| // simpleCookie.setMaxAge(60*30); | |||||
| // return simpleCookie; | |||||
| // } | |||||
| // @Bean | |||||
| // public CookieRememberMeManager rememberMeManager(){ | |||||
| // //System.out.println("ShiroConfiguration.rememberMeManager()"); | |||||
| // CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); | |||||
| // cookieRememberMeManager.setCookie(rememberMeCookie()); | |||||
| // //rememberMe cookie加密的密钥 建议每个项目都不一样 默认AES算法 密钥长度(128 256 512 位) | |||||
| // cookieRememberMeManager.setCipherKey(Base64.decodeBytes("2AvVhdsgUs0FSA3SDFAdag==")); | |||||
| // return cookieRememberMeManager; | |||||
| // } | |||||
| // @Bean(name = "securityManager") | |||||
| // public DefaultWebSecurityManager defaultWebSecurityManager(MyShiroRealm realm){ | |||||
| // DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(); | |||||
| // //设置realm | |||||
| // securityManager.setRealm(realm); | |||||
| // //用户授权/认证信息Cache, 采用EhCache缓存 | |||||
| // securityManager.setCacheManager(cacheManager()); | |||||
| // //注入记住我管理器 | |||||
| // securityManager.setRememberMeManager(rememberMeManager()); | |||||
| // return securityManager; | |||||
| // } | |||||
| } | } | ||||
| @@ -10,6 +10,8 @@ import org.omg.CORBA.SystemException; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.util.StringUtils; | import org.springframework.util.StringUtils; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.PostMapping; | |||||
| import org.springframework.web.bind.annotation.RequestBody; | |||||
| import org.springframework.web.bind.annotation.RestController; | import org.springframework.web.bind.annotation.RestController; | ||||
| import com.simple.common.ErrorCode; | import com.simple.common.ErrorCode; | ||||
| @@ -20,9 +22,14 @@ import com.simple.domain.po.SysRole; | |||||
| import com.simple.domain.po.UserInfo; | import com.simple.domain.po.UserInfo; | ||||
| import com.simple.service.SysPermissionService; | import com.simple.service.SysPermissionService; | ||||
| import com.simple.service.SysRoleService; | import com.simple.service.SysRoleService; | ||||
| import com.simple.shiro.UserSession; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | @RestController | ||||
| @Api(description="登录相关接口") | |||||
| public class HomeController { | public class HomeController { | ||||
| @Autowired | @Autowired | ||||
| @@ -36,23 +43,34 @@ public class HomeController { | |||||
| return new ResultData(Result.UNLOGIN, "用户未登录"); | return new ResultData(Result.UNLOGIN, "用户未登录"); | ||||
| } | } | ||||
| @GetMapping("/doLogin") | |||||
| public ResultData login(UserInfo user) { | |||||
| @ApiOperation("登录") | |||||
| @PostMapping("/doLogin") | |||||
| public ResultData login(@RequestBody UserInfo user) { | |||||
| ResultData data = new ResultData(); | |||||
| if (StringUtils.isEmpty(user.getUsername()) || StringUtils.isEmpty(user.getPassword())) { | if (StringUtils.isEmpty(user.getUsername()) || StringUtils.isEmpty(user.getPassword())) { | ||||
| // throw new SystemException(ErrorCode.LOGIN_USER_OR_PWD_ERROR); | // throw new SystemException(ErrorCode.LOGIN_USER_OR_PWD_ERROR); | ||||
| return new ResultData(ResultData.ERROR); | |||||
| return new ResultData(ResultData.ERROR,"用户名或者密码错误"); | |||||
| } | } | ||||
| Subject subject = SecurityUtils.getSubject(); | |||||
| UsernamePasswordToken token = new UsernamePasswordToken(user.getUsername(), user.getPassword()); | |||||
| subject.login(token); | |||||
| List<SysRole> roleList = sysRoleService.findRoleByUserId(user.getId()); | |||||
| if (null != roleList && roleList.size() > 0) { | |||||
| List<SysPermission> permissionList = sysPermissionService | |||||
| .findPermissionByRoleIds(roleList.stream().map(SysRole::getId).collect(Collectors.toList())); | |||||
| // user.setRole(roleList); | |||||
| user.setPermission(permissionList); | |||||
| try { | |||||
| Subject subject = SecurityUtils.getSubject(); | |||||
| UsernamePasswordToken token = new UsernamePasswordToken(user.getUsername(), user.getPassword()); | |||||
| subject.login(token); | |||||
| List<SysRole> roleList = sysRoleService.findRoleByUserId(user.getId()); | |||||
| if (null != roleList && roleList.size() > 0) { | |||||
| List<SysPermission> permissionList = sysPermissionService | |||||
| .findPermissionByRoleIds(roleList.stream().map(SysRole::getId).collect(Collectors.toList())); | |||||
| user.setRole(roleList); | |||||
| user.setPermission(permissionList); | |||||
| } | |||||
| UserInfo info =(UserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo); | |||||
| info.setPassword("保密"); | |||||
| System.out.println("id:"+ SecurityUtils.getSubject().getSession().getId()); | |||||
| data.data=info; | |||||
| }catch(Exception e) { | |||||
| return new ResultData(ResultData.ERROR,"用户名或者密码错误"); | |||||
| } | } | ||||
| return new ResultData(); | |||||
| return data; | |||||
| } | } | ||||
| @@ -11,11 +11,14 @@ import com.simple.common.ResultData; | |||||
| import com.simple.domain.po.WxMerchant; | import com.simple.domain.po.WxMerchant; | ||||
| import com.simple.service.WxMerchantService; | import com.simple.service.WxMerchantService; | ||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| @RestController | @RestController | ||||
| @RequestMapping("wxMerchant") | @RequestMapping("wxMerchant") | ||||
| @Api(description="商户相关接口") | |||||
| public class WxMerchantController extends BaseController | public class WxMerchantController extends BaseController | ||||
| { | { | ||||
| @Autowired | @Autowired | ||||
| @@ -50,11 +50,14 @@ public class MyShiroRealm extends AuthorizingRealm { | |||||
| protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { | protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { | ||||
| //获取用户的输入的账号. | //获取用户的输入的账号. | ||||
| String username = (String)token.getPrincipal(); | String username = (String)token.getPrincipal(); | ||||
| UserInfo user = userService.getByName(username); | |||||
| if(user==null) throw new UnknownAccountException(); | |||||
| UserInfo user = userService.getByUsername(username); | |||||
| if(user==null) throw new UnknownAccountException("用户名不存在"); | |||||
| // if (0==user.getEnable()) { | // if (0==user.getEnable()) { | ||||
| // throw new LockedAccountException(); // 帐号锁定 | // throw new LockedAccountException(); // 帐号锁定 | ||||
| // } | // } | ||||
| if(user.getStatus()==null || 1!=user.getStatus()) {//用户被禁用 | |||||
| throw new UnknownAccountException("用户被禁用"); | |||||
| } | |||||
| SimpleAuthenticationInfo authenticationInfo = new SimpleAuthenticationInfo( | SimpleAuthenticationInfo authenticationInfo = new SimpleAuthenticationInfo( | ||||
| user, //用户 | user, //用户 | ||||
| user.getPassword(), //密码 | user.getPassword(), //密码 | ||||
| @@ -2,13 +2,14 @@ package com.simple.domain.po; | |||||
| import javax.persistence.*; | import javax.persistence.*; | ||||
| import java.util.*; | import java.util.*; | ||||
| import java.io.Serializable; | |||||
| import java.math.*; | import java.math.*; | ||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| @Table(name = "sys_permission") | @Table(name = "sys_permission") | ||||
| public class SysPermission { | |||||
| public class SysPermission implements Serializable{ | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -2,13 +2,14 @@ package com.simple.domain.po; | |||||
| import javax.persistence.*; | import javax.persistence.*; | ||||
| import java.util.*; | import java.util.*; | ||||
| import java.io.Serializable; | |||||
| import java.math.*; | import java.math.*; | ||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| @Table(name = "sys_role") | @Table(name = "sys_role") | ||||
| public class SysRole { | |||||
| public class SysRole implements Serializable{ | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -2,13 +2,14 @@ package com.simple.domain.po; | |||||
| import javax.persistence.*; | import javax.persistence.*; | ||||
| import java.util.*; | import java.util.*; | ||||
| import java.io.Serializable; | |||||
| import java.math.*; | import java.math.*; | ||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| @Table(name = "sys_role_permission") | @Table(name = "sys_role_permission") | ||||
| public class SysRolePermission { | |||||
| public class SysRolePermission implements Serializable{ | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -2,13 +2,14 @@ package com.simple.domain.po; | |||||
| import javax.persistence.*; | import javax.persistence.*; | ||||
| import java.util.*; | import java.util.*; | ||||
| import java.io.Serializable; | |||||
| import java.math.*; | import java.math.*; | ||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| @Table(name = "sys_user_role") | @Table(name = "sys_user_role") | ||||
| public class SysUserRole { | |||||
| public class SysUserRole implements Serializable{ | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -1,14 +1,15 @@ | |||||
| package com.simple.domain.po; | package com.simple.domain.po; | ||||
| import javax.persistence.*; | |||||
| import java.util.*; | |||||
| import java.math.*; | |||||
| import javax.persistence.Transient; | |||||
| import java.io.Serializable; | |||||
| import java.util.Date; | |||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import javax.persistence.Table; | |||||
| import javax.persistence.Transient; | |||||
| @Table(name = "user_info") | @Table(name = "user_info") | ||||
| public class UserInfo { | |||||
| public class UserInfo implements Serializable{ | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_appinfo") | @Table(name = "wx_appinfo") | ||||
| public class WxAppinfo { | |||||
| public class WxAppinfo implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_b_log") | @Table(name = "wx_b_log") | ||||
| public class WxBLog { | |||||
| public class WxBLog implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -1,14 +1,13 @@ | |||||
| package com.simple.domain.po; | package com.simple.domain.po; | ||||
| import javax.persistence.*; | import javax.persistence.*; | ||||
| import java.util.*; | |||||
| import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_b_user_merchant") | @Table(name = "wx_b_user_merchant") | ||||
| public class WxBUserMerchant { | |||||
| public class WxBUserMerchant implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_banners") | @Table(name = "wx_banners") | ||||
| public class WxBanners { | |||||
| public class WxBanners implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_business") | @Table(name = "wx_business") | ||||
| public class WxBusiness { | |||||
| public class WxBusiness implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_c_log") | @Table(name = "wx_c_log") | ||||
| public class WxCLog { | |||||
| public class WxCLog implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_c_user") | @Table(name = "wx_c_user") | ||||
| public class WxCUser { | |||||
| public class WxCUser implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_c_user_cars") | @Table(name = "wx_c_user_cars") | ||||
| public class WxCUserCars { | |||||
| public class WxCUserCars implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_c_user_cloud") | @Table(name = "wx_c_user_cloud") | ||||
| public class WxCUserCloud { | |||||
| public class WxCUserCloud implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_c_user_etcp_token") | @Table(name = "wx_c_user_etcp_token") | ||||
| public class WxCUserEtcpToken { | |||||
| public class WxCUserEtcpToken implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_c_user_tags") | @Table(name = "wx_c_user_tags") | ||||
| public class WxCUserTags { | |||||
| public class WxCUserTags implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -1,14 +1,15 @@ | |||||
| package com.simple.domain.po; | package com.simple.domain.po; | ||||
| import javax.persistence.*; | import javax.persistence.*; | ||||
| import java.util.*; | |||||
| import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| import java.util.*; | |||||
| import java.math.*; | |||||
| @Table(name = "wx_coupon") | @Table(name = "wx_coupon") | ||||
| public class WxCoupon { | |||||
| public class WxCoupon implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_coupon_action_log") | @Table(name = "wx_coupon_action_log") | ||||
| public class WxCouponActionLog { | |||||
| public class WxCouponActionLog implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_coupon_activity") | @Table(name = "wx_coupon_activity") | ||||
| public class WxCouponActivity { | |||||
| public class WxCouponActivity implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_coupon_record") | @Table(name = "wx_coupon_record") | ||||
| public class WxCouponRecord { | |||||
| public class WxCouponRecord implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_coupon_type") | @Table(name = "wx_coupon_type") | ||||
| public class WxCouponType { | |||||
| public class WxCouponType implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_etcp_coupon_record") | @Table(name = "wx_etcp_coupon_record") | ||||
| public class WxEtcpCouponRecord { | |||||
| public class WxEtcpCouponRecord implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_etcp_park_dissolution") | @Table(name = "wx_etcp_park_dissolution") | ||||
| public class WxEtcpParkDissolution { | |||||
| public class WxEtcpParkDissolution implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_etcp_park_in") | @Table(name = "wx_etcp_park_in") | ||||
| public class WxEtcpParkIn { | |||||
| public class WxEtcpParkIn implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_etcp_park_msg_suc") | @Table(name = "wx_etcp_park_msg_suc") | ||||
| public class WxEtcpParkMsgSuc { | |||||
| public class WxEtcpParkMsgSuc implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_etcp_park_orderunpay") | @Table(name = "wx_etcp_park_orderunpay") | ||||
| public class WxEtcpParkOrderunpay { | |||||
| public class WxEtcpParkOrderunpay implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_etcp_park_out") | @Table(name = "wx_etcp_park_out") | ||||
| public class WxEtcpParkOut { | |||||
| public class WxEtcpParkOut implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_etcp_park_transaction") | @Table(name = "wx_etcp_park_transaction") | ||||
| public class WxEtcpParkTransaction { | |||||
| public class WxEtcpParkTransaction implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_etcp_park_unbind") | @Table(name = "wx_etcp_park_unbind") | ||||
| public class WxEtcpParkUnbind { | |||||
| public class WxEtcpParkUnbind implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_flash_sale") | @Table(name = "wx_flash_sale") | ||||
| public class WxFlashSale { | |||||
| public class WxFlashSale implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_mall") | @Table(name = "wx_mall") | ||||
| public class WxMall { | |||||
| public class WxMall implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_mall_building") | @Table(name = "wx_mall_building") | ||||
| public class WxMallBuilding { | |||||
| public class WxMallBuilding implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_mall_floor") | @Table(name = "wx_mall_floor") | ||||
| public class WxMallFloor { | |||||
| public class WxMallFloor implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_merchant") | @Table(name = "wx_merchant") | ||||
| public class WxMerchant { | |||||
| public class WxMerchant implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_merchant_shop") | @Table(name = "wx_merchant_shop") | ||||
| public class WxMerchantShop { | |||||
| public class WxMerchantShop implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_merchant_trade_days") | @Table(name = "wx_merchant_trade_days") | ||||
| public class WxMerchantTradeDays { | |||||
| public class WxMerchantTradeDays implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_msg") | @Table(name = "wx_msg") | ||||
| public class WxMsg { | |||||
| public class WxMsg implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_msg_config") | @Table(name = "wx_msg_config") | ||||
| public class WxMsgConfig { | |||||
| public class WxMsgConfig implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_msg_model") | @Table(name = "wx_msg_model") | ||||
| public class WxMsgModel { | |||||
| public class WxMsgModel implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_msg_signature") | @Table(name = "wx_msg_signature") | ||||
| public class WxMsgSignature { | |||||
| public class WxMsgSignature implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_orders") | @Table(name = "wx_orders") | ||||
| public class WxOrders { | |||||
| public class WxOrders implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_park") | @Table(name = "wx_park") | ||||
| public class WxPark { | |||||
| public class WxPark implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_score_history") | @Table(name = "wx_score_history") | ||||
| public class WxScoreHistory { | |||||
| public class WxScoreHistory implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_score_rules") | @Table(name = "wx_score_rules") | ||||
| public class WxScoreRules { | |||||
| public class WxScoreRules implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_score_validity_period") | @Table(name = "wx_score_validity_period") | ||||
| public class WxScoreValidityPeriod { | |||||
| public class WxScoreValidityPeriod implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_shop") | @Table(name = "wx_shop") | ||||
| public class WxShop { | |||||
| public class WxShop implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_tags") | @Table(name = "wx_tags") | ||||
| public class WxTags { | |||||
| public class WxTags implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -6,9 +6,10 @@ import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_web_log") | @Table(name = "wx_web_log") | ||||
| public class WxWebLog { | |||||
| public class WxWebLog implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| @@ -53,7 +53,7 @@ public interface UserInfoService { | |||||
| * @param username | * @param username | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| UserInfo getByName(String username); | |||||
| UserInfo getByUsername(String username); | |||||
| /** | /** | ||||
| * 删除用户相关数据(用户记录,角色关联) | * 删除用户相关数据(用户记录,角色关联) | ||||
| @@ -1,16 +1,18 @@ | |||||
| package com.simple.service.impl; | package com.simple.service.impl; | ||||
| import java.util.*; | |||||
| import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.simple.domain.po.UserInfo; | |||||
| import com.simple.mapper.UserInfoMapper; | |||||
| import com.simple.service.UserInfoService; | |||||
| import java.util.UUID; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
| import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.simple.domain.po.SysUserRole; | import com.simple.domain.po.SysUserRole; | ||||
| import com.simple.domain.po.UserInfo; | |||||
| import com.simple.mapper.SysUserRoleMapper; | import com.simple.mapper.SysUserRoleMapper; | ||||
| import com.simple.mapper.UserInfoMapper; | |||||
| import com.simple.service.UserInfoService; | |||||
| @Service | @Service | ||||
| public class UserInfoServiceImpl implements UserInfoService { | public class UserInfoServiceImpl implements UserInfoService { | ||||
| @@ -51,9 +53,9 @@ public class UserInfoServiceImpl implements UserInfoService { | |||||
| @Override | @Override | ||||
| public UserInfo getByName(String username) { | |||||
| public UserInfo getByUsername(String username) { | |||||
| UserInfo userInfo = new UserInfo(); | UserInfo userInfo = new UserInfo(); | ||||
| userInfo.setName(username); | |||||
| userInfo.setUsername(username); | |||||
| return userInfoMapper.selectOne(userInfo); | return userInfoMapper.selectOne(userInfo); | ||||
| } | } | ||||