作者 钟来

流水鱼登陆合并整理

正在显示 41 个修改的文件 包含 677 行增加1321 行删除
  1 +-----BEGIN PRIVATE KEY-----
  2 +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDc/LnVeh5jDk2X
  3 +k5YrxlDmxyuunJ+Oy9OhevrtyqeW4sZlOsams5dQ9fHCfC8dMSTF4S+rq6x6fS6l
  4 +KYVZJ5Jap/XVJq+F+B/XNfeBOddr2os4baZ4nvQnuYaZjM2bxIdP8QUGRbcgkFb6
  5 +xACm6AZqHoodoQB2mSJLVNzoLjSUvN6abVrsrSmsLGlJ8/myegTA2G7NWnI+8xAT
  6 +iles3W9bmVPMoOyT9glPB0wI5WRKi2Gq9yKFus7NX3caGf0tNcE5WRl2bbeJ4WN+
  7 +CUmkK5W0xxWQdqbzpuV3UizHoSxP8RekEOWJXKuWfskesLwpfEHHKSSPu8tJ2ANa
  8 +mzAg0Aw1AgMBAAECggEAR/NZJjJ+lk3f4YxCBrqpOJp8lHuWT835d8gszyN+cVgg
  9 +tHDwoPI0QD3zmxkH1f9cM7lf5gsdOzxq5YehTSffNPkex2mzGHFzHIULst18UDd1
  10 +wMeivf8zC4QSWQhJIYBZdiPJOQOV3lpgl4EdnTpKbF7JJWB4YCT3z4Mv8cCpigth
  11 +oqvZlE5Xl9Z1mbzMfaIiBkXd9J4e9FcA5sOWJqlPem1RUBvBb92pcHzSbpe41UnV
  12 +SGLeiQ4QXxN0GSzDy86kdkUf9pAWKGZq/BzuyqSzNfuv0UagVkcRW33mc64Qh11b
  13 +qTQaUAiVbYBuccn1VgTiWT7nkUog9DfAr7jauCHU+QKBgQDwMKjpQqOJonWHvR2h
  14 +3QCmN0mDWsvfgURvvnFvsStuIqdbX8ip3DCdgMetXEJSYuUNWkzL5kzRKw43UT8/
  15 +2Fwb1IDPEMC/0iCPR1tRr/Ch7un2O4uild/u7trgVwVd5EG9GxLQvscP/BACB0sR
  16 +Ogbbw+Zrd+G8YonT9wsKmE77XwKBgQDriHyf7JmYSRV5oGNhqqLP9KXtjZ9BM4VX
  17 +JrWnJXoF+f9WrvYjuJ8ui5aEjRUBAB3K2La7i6y+cTPE/vPHSEuwnM476HhvOtRk
  18 +XiC/pLfALQ3uG1+Qb9QRi2DXFiqMcSIVkUYF9gEQEp/Gj5T+8Pe1plaCSW24D/fR
  19 +MRuNAsA06wKBgBrcRjd3xVQh/+TDKGoujeEIs8blw4DmMuIQOR1VgdbaNz8HsigU
  20 +wLcMbMgdVilid90LaSUwRwzpNLjI9DrOllZiaFk/tV5+QDflsferpkxlrHJl7FKt
  21 +UhKlUYLfGHGMkjF0sqD3hMlr1dp0OFff1l6DRORlzq/DkUhMC0cPC14fAoGBAKhb
  22 +JiG2IE/vJY+Lqp38N2aIDDbSPVyAtDYIcF3qdt9gxDg01bHQ3M+LbWqP4cyWRbVh
  23 +1LQX8cEq74NHbf8rWRcD7pJ55+Qx2/FmKuhxl/qg+c0R+ewnUyG7S9xSdtVuZJuf
  24 +/Lp0Dmxrs5NdvHXCzn0kSb/VNr0ThOMdxAC2T6dDAoGBANelRgj/DtoPnid2FkGq
  25 +CFpC0arLgSXZyeTykWo1mPYB5CBz/O+lQ6+o8AiS61HUjaaNp4byrJU/Ijq87FvG
  26 +TpM0f8frAlAj2pvaVwtAhxIWC89Zt7cS06ZOl8IVCs0TUodUbGAjW9+pxE2KjsqG
  27 +7RVaFYGJYx+3TiAKJ+J/94Iv
  28 +-----END PRIVATE KEY-----
  1 +-----BEGIN PUBLIC KEY-----
  2 +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3Py51XoeYw5Nl5OWK8ZQ
  3 +5scrrpyfjsvToXr67cqnluLGZTrGprOXUPXxwnwvHTEkxeEvq6usen0upSmFWSeS
  4 +Wqf11Savhfgf1zX3gTnXa9qLOG2meJ70J7mGmYzNm8SHT/EFBkW3IJBW+sQApugG
  5 +ah6KHaEAdpkiS1Tc6C40lLzemm1a7K0prCxpSfP5snoEwNhuzVpyPvMQE4pXrN1v
  6 +W5lTzKDsk/YJTwdMCOVkSothqvcihbrOzV93Ghn9LTXBOVkZdm23ieFjfglJpCuV
  7 +tMcVkHam86bld1Isx6EsT/EXpBDliVyrln7JHrC8KXxBxykkj7vLSdgDWpswINAM
  8 +NQIDAQAB
  9 +-----END PUBLIC KEY-----
1 -package com.zhonglai.luhui.domain.user;  
2 -  
3 -import org.apache.commons.lang3.builder.ToStringBuilder;  
4 -import org.apache.commons.lang3.builder.ToStringStyle;  
5 -import io.swagger.annotations.ApiModel;  
6 -import io.swagger.annotations.ApiModelProperty;  
7 -import com.ruoyi.common.tool.BaseEntity;  
8 -  
9 -/**  
10 - * 用户账户信息对象 user_account_info  
11 - *  
12 - * @author zhonglai  
13 - * @date 2025-10-18  
14 - */  
15 -@ApiModel("用户账户信息")  
16 -public class UserAccountInfo extends BaseEntity  
17 -{  
18 - private static final long serialVersionUID = 1L;  
19 -  
20 - /** 用户ID,主键关联 */  
21 - @ApiModelProperty(value="主键id")  
22 - private Integer id;  
23 -  
24 - /** 积分 */  
25 - @ApiModelProperty(value="积分")  
26 - private Integer integral;  
27 -  
28 - /** 余额 */  
29 - @ApiModelProperty(value="余额")  
30 - private Integer balance;  
31 -  
32 - /** 级别 */  
33 - @ApiModelProperty(value="级别")  
34 - private Integer level;  
35 -  
36 - /** 货币 */  
37 - @ApiModelProperty(value="货币")  
38 - private Integer currency;  
39 -  
40 - /** 经验 */  
41 - @ApiModelProperty(value="经验")  
42 - private Integer experience;  
43 -  
44 - /** 年度服务费 */  
45 - @ApiModelProperty(value="年度服务费")  
46 - private Integer annualServiceCharge;  
47 -  
48 - /** 点苗器到期时间 */  
49 - @ApiModelProperty(value="点苗器到期时间")  
50 - private Integer dianmiaoEndTime;  
51 -  
52 - public void setId(Integer id)  
53 - {  
54 - this.id = id;  
55 - }  
56 -  
57 - public Integer getId()  
58 - {  
59 - return id;  
60 - }  
61 - public void setIntegral(Integer integral)  
62 - {  
63 - this.integral = integral;  
64 - }  
65 -  
66 - public Integer getIntegral()  
67 - {  
68 - return integral;  
69 - }  
70 - public void setBalance(Integer balance)  
71 - {  
72 - this.balance = balance;  
73 - }  
74 -  
75 - public Integer getBalance()  
76 - {  
77 - return balance;  
78 - }  
79 - public void setLevel(Integer level)  
80 - {  
81 - this.level = level;  
82 - }  
83 -  
84 - public Integer getLevel()  
85 - {  
86 - return level;  
87 - }  
88 - public void setCurrency(Integer currency)  
89 - {  
90 - this.currency = currency;  
91 - }  
92 -  
93 - public Integer getCurrency()  
94 - {  
95 - return currency;  
96 - }  
97 - public void setExperience(Integer experience)  
98 - {  
99 - this.experience = experience;  
100 - }  
101 -  
102 - public Integer getExperience()  
103 - {  
104 - return experience;  
105 - }  
106 - public void setAnnualServiceCharge(Integer annualServiceCharge)  
107 - {  
108 - this.annualServiceCharge = annualServiceCharge;  
109 - }  
110 -  
111 - public Integer getAnnualServiceCharge()  
112 - {  
113 - return annualServiceCharge;  
114 - }  
115 - public void setDianmiaoEndTime(Integer dianmiaoEndTime)  
116 - {  
117 - this.dianmiaoEndTime = dianmiaoEndTime;  
118 - }  
119 -  
120 - public Integer getDianmiaoEndTime()  
121 - {  
122 - return dianmiaoEndTime;  
123 - }  
124 -  
125 - @Override  
126 - public String toString() {  
127 - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)  
128 - .append("id", getId())  
129 - .append("integral", getIntegral())  
130 - .append("balance", getBalance())  
131 - .append("level", getLevel())  
132 - .append("currency", getCurrency())  
133 - .append("experience", getExperience())  
134 - .append("annualServiceCharge", getAnnualServiceCharge())  
135 - .append("dianmiaoEndTime", getDianmiaoEndTime())  
136 - .toString();  
137 - }  
138 -}  
1 -package com.zhonglai.luhui.domain.user;  
2 -  
3 -import org.apache.commons.lang3.builder.ToStringBuilder;  
4 -import org.apache.commons.lang3.builder.ToStringStyle;  
5 -import io.swagger.annotations.ApiModel;  
6 -import io.swagger.annotations.ApiModelProperty;  
7 -import com.ruoyi.common.tool.BaseEntity;  
8 -  
9 -/**  
10 - * 用户地理信息对象 user_address_info  
11 - *  
12 - * @author zhonglai  
13 - * @date 2025-10-18  
14 - */  
15 -@ApiModel("用户地理信息")  
16 -public class UserAddressInfo extends BaseEntity  
17 -{  
18 - private static final long serialVersionUID = 1L;  
19 -  
20 - /** 用户ID,主键关联 */  
21 - @ApiModelProperty(value="主键id")  
22 - private Integer id;  
23 -  
24 - /** */  
25 - @ApiModelProperty(value="")  
26 - private String provinceId;  
27 -  
28 - /** */  
29 - @ApiModelProperty(value="")  
30 - private String cityId;  
31 -  
32 - /** */  
33 - @ApiModelProperty(value="")  
34 - private String countyId;  
35 -  
36 - /** */  
37 - @ApiModelProperty(value="")  
38 - private String provinceName;  
39 -  
40 - /** */  
41 - @ApiModelProperty(value="")  
42 - private String cityName;  
43 -  
44 - /** */  
45 - @ApiModelProperty(value="")  
46 - private String countyName;  
47 -  
48 - /** */  
49 - @ApiModelProperty(value="")  
50 - private String address;  
51 -  
52 - /** 常用搜索 */  
53 - @ApiModelProperty(value="常用搜索")  
54 - private String search;  
55 -  
56 - public void setId(Integer id)  
57 - {  
58 - this.id = id;  
59 - }  
60 -  
61 - public Integer getId()  
62 - {  
63 - return id;  
64 - }  
65 - public void setProvinceId(String provinceId)  
66 - {  
67 - this.provinceId = provinceId;  
68 - }  
69 -  
70 - public String getProvinceId()  
71 - {  
72 - return provinceId;  
73 - }  
74 - public void setCityId(String cityId)  
75 - {  
76 - this.cityId = cityId;  
77 - }  
78 -  
79 - public String getCityId()  
80 - {  
81 - return cityId;  
82 - }  
83 - public void setCountyId(String countyId)  
84 - {  
85 - this.countyId = countyId;  
86 - }  
87 -  
88 - public String getCountyId()  
89 - {  
90 - return countyId;  
91 - }  
92 - public void setProvinceName(String provinceName)  
93 - {  
94 - this.provinceName = provinceName;  
95 - }  
96 -  
97 - public String getProvinceName()  
98 - {  
99 - return provinceName;  
100 - }  
101 - public void setCityName(String cityName)  
102 - {  
103 - this.cityName = cityName;  
104 - }  
105 -  
106 - public String getCityName()  
107 - {  
108 - return cityName;  
109 - }  
110 - public void setCountyName(String countyName)  
111 - {  
112 - this.countyName = countyName;  
113 - }  
114 -  
115 - public String getCountyName()  
116 - {  
117 - return countyName;  
118 - }  
119 - public void setAddress(String address)  
120 - {  
121 - this.address = address;  
122 - }  
123 -  
124 - public String getAddress()  
125 - {  
126 - return address;  
127 - }  
128 - public void setSearch(String search)  
129 - {  
130 - this.search = search;  
131 - }  
132 -  
133 - public String getSearch()  
134 - {  
135 - return search;  
136 - }  
137 -  
138 - @Override  
139 - public String toString() {  
140 - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)  
141 - .append("id", getId())  
142 - .append("provinceId", getProvinceId())  
143 - .append("cityId", getCityId())  
144 - .append("countyId", getCountyId())  
145 - .append("provinceName", getProvinceName())  
146 - .append("cityName", getCityName())  
147 - .append("countyName", getCountyName())  
148 - .append("address", getAddress())  
149 - .append("search", getSearch())  
150 - .toString();  
151 - }  
152 -}  
1 -package com.zhonglai.luhui.domain.user;  
2 -  
3 -import org.apache.commons.lang3.builder.ToStringBuilder;  
4 -import org.apache.commons.lang3.builder.ToStringStyle;  
5 -import io.swagger.annotations.ApiModel;  
6 -import io.swagger.annotations.ApiModelProperty;  
7 -import com.ruoyi.common.tool.BaseEntity;  
8 -  
9 -/**  
10 - * 用户认证信息对象 user_auth_info  
11 - *  
12 - * @author zhonglai  
13 - * @date 2025-10-18  
14 - */  
15 -@ApiModel("用户认证信息")  
16 -public class UserAuthInfo extends BaseEntity  
17 -{  
18 - private static final long serialVersionUID = 1L;  
19 -  
20 - /** 用户ID,主键关联 */  
21 - @ApiModelProperty(value="主键id")  
22 - private Integer id;  
23 -  
24 - /** 是否实名认证(0否,1是) */  
25 - @ApiModelProperty(value="是否实名认证(0否,1是)")  
26 - private Integer nameAuthentication;  
27 -  
28 - /** 个人审核状态 */  
29 - @ApiModelProperty(value="个人审核状态")  
30 - private Integer personalAuthenticationState;  
31 -  
32 - /** 企业审核状态 */  
33 - @ApiModelProperty(value="企业审核状态")  
34 - private Integer enterpriseAuthenticationState;  
35 -  
36 - /** 个人审核描述 */  
37 - @ApiModelProperty(value="个人审核描述")  
38 - private String personalAuthenticationDescribe;  
39 -  
40 - /** 企业审核描述 */  
41 - @ApiModelProperty(value="企业审核描述")  
42 - private String enterpriseAuthenticationDescribe;  
43 -  
44 - /** 个人审核更新时间 */  
45 - @ApiModelProperty(value="个人审核更新时间")  
46 - private Integer personalAuthenticationTime;  
47 -  
48 - /** 企业审核更新时间 */  
49 - @ApiModelProperty(value="企业审核更新时间")  
50 - private Integer enterpriseAuthenticationTime;  
51 -  
52 - /** 身份证号 */  
53 - @ApiModelProperty(value="身份证号")  
54 - private String identificationCard;  
55 -  
56 - /** 营业执照号 */  
57 - @ApiModelProperty(value="营业执照号")  
58 - private String businessLicenseNo;  
59 -  
60 - /** 企业名称 */  
61 - @ApiModelProperty(value="企业名称")  
62 - private String enterpriseName;  
63 -  
64 - /** 企业营业执照 */  
65 - @ApiModelProperty(value="企业营业执照")  
66 - private String businessLicenseUrl;  
67 -  
68 - public void setId(Integer id)  
69 - {  
70 - this.id = id;  
71 - }  
72 -  
73 - public Integer getId()  
74 - {  
75 - return id;  
76 - }  
77 - public void setNameAuthentication(Integer nameAuthentication)  
78 - {  
79 - this.nameAuthentication = nameAuthentication;  
80 - }  
81 -  
82 - public Integer getNameAuthentication()  
83 - {  
84 - return nameAuthentication;  
85 - }  
86 - public void setPersonalAuthenticationState(Integer personalAuthenticationState)  
87 - {  
88 - this.personalAuthenticationState = personalAuthenticationState;  
89 - }  
90 -  
91 - public Integer getPersonalAuthenticationState()  
92 - {  
93 - return personalAuthenticationState;  
94 - }  
95 - public void setEnterpriseAuthenticationState(Integer enterpriseAuthenticationState)  
96 - {  
97 - this.enterpriseAuthenticationState = enterpriseAuthenticationState;  
98 - }  
99 -  
100 - public Integer getEnterpriseAuthenticationState()  
101 - {  
102 - return enterpriseAuthenticationState;  
103 - }  
104 - public void setPersonalAuthenticationDescribe(String personalAuthenticationDescribe)  
105 - {  
106 - this.personalAuthenticationDescribe = personalAuthenticationDescribe;  
107 - }  
108 -  
109 - public String getPersonalAuthenticationDescribe()  
110 - {  
111 - return personalAuthenticationDescribe;  
112 - }  
113 - public void setEnterpriseAuthenticationDescribe(String enterpriseAuthenticationDescribe)  
114 - {  
115 - this.enterpriseAuthenticationDescribe = enterpriseAuthenticationDescribe;  
116 - }  
117 -  
118 - public String getEnterpriseAuthenticationDescribe()  
119 - {  
120 - return enterpriseAuthenticationDescribe;  
121 - }  
122 - public void setPersonalAuthenticationTime(Integer personalAuthenticationTime)  
123 - {  
124 - this.personalAuthenticationTime = personalAuthenticationTime;  
125 - }  
126 -  
127 - public Integer getPersonalAuthenticationTime()  
128 - {  
129 - return personalAuthenticationTime;  
130 - }  
131 - public void setEnterpriseAuthenticationTime(Integer enterpriseAuthenticationTime)  
132 - {  
133 - this.enterpriseAuthenticationTime = enterpriseAuthenticationTime;  
134 - }  
135 -  
136 - public Integer getEnterpriseAuthenticationTime()  
137 - {  
138 - return enterpriseAuthenticationTime;  
139 - }  
140 - public void setIdentificationCard(String identificationCard)  
141 - {  
142 - this.identificationCard = identificationCard;  
143 - }  
144 -  
145 - public String getIdentificationCard()  
146 - {  
147 - return identificationCard;  
148 - }  
149 - public void setBusinessLicenseNo(String businessLicenseNo)  
150 - {  
151 - this.businessLicenseNo = businessLicenseNo;  
152 - }  
153 -  
154 - public String getBusinessLicenseNo()  
155 - {  
156 - return businessLicenseNo;  
157 - }  
158 - public void setEnterpriseName(String enterpriseName)  
159 - {  
160 - this.enterpriseName = enterpriseName;  
161 - }  
162 -  
163 - public String getEnterpriseName()  
164 - {  
165 - return enterpriseName;  
166 - }  
167 - public void setBusinessLicenseUrl(String businessLicenseUrl)  
168 - {  
169 - this.businessLicenseUrl = businessLicenseUrl;  
170 - }  
171 -  
172 - public String getBusinessLicenseUrl()  
173 - {  
174 - return businessLicenseUrl;  
175 - }  
176 -  
177 - @Override  
178 - public String toString() {  
179 - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)  
180 - .append("id", getId())  
181 - .append("nameAuthentication", getNameAuthentication())  
182 - .append("personalAuthenticationState", getPersonalAuthenticationState())  
183 - .append("enterpriseAuthenticationState", getEnterpriseAuthenticationState())  
184 - .append("personalAuthenticationDescribe", getPersonalAuthenticationDescribe())  
185 - .append("enterpriseAuthenticationDescribe", getEnterpriseAuthenticationDescribe())  
186 - .append("personalAuthenticationTime", getPersonalAuthenticationTime())  
187 - .append("enterpriseAuthenticationTime", getEnterpriseAuthenticationTime())  
188 - .append("identificationCard", getIdentificationCard())  
189 - .append("businessLicenseNo", getBusinessLicenseNo())  
190 - .append("enterpriseName", getEnterpriseName())  
191 - .append("businessLicenseUrl", getBusinessLicenseUrl())  
192 - .toString();  
193 - }  
194 -}  
1 -package com.zhonglai.luhui.domain.user;  
2 -  
3 -import org.apache.commons.lang3.builder.ToStringBuilder;  
4 -import org.apache.commons.lang3.builder.ToStringStyle;  
5 -import io.swagger.annotations.ApiModel;  
6 -import io.swagger.annotations.ApiModelProperty;  
7 -import com.ruoyi.common.tool.BaseEntity;  
8 -  
9 -/**  
10 - * 基础用户信息对象 user_base_info  
11 - *  
12 - * @author zhonglai  
13 - * @date 2025-10-18  
14 - */  
15 -@ApiModel("基础用户信息")  
16 -public class UserBaseInfo extends BaseEntity  
17 -{  
18 - private static final long serialVersionUID = 1L;  
19 -  
20 - /** 用户ID,主键关联 */  
21 - @ApiModelProperty(value="主键id")  
22 - private Integer id;  
23 -  
24 - /** 登录名 */  
25 - @ApiModelProperty(value="登录名")  
26 - private String loginName;  
27 -  
28 - /** 真实姓名 */  
29 - @ApiModelProperty(value="真实姓名")  
30 - private String name;  
31 -  
32 - /** 昵称 */  
33 - @ApiModelProperty(value="昵称")  
34 - private String nickname;  
35 -  
36 - /** 性别(0男,1女) */  
37 - @ApiModelProperty(value="性别(0男,1女)")  
38 - private Integer gender;  
39 -  
40 - /** 手机号 */  
41 - @ApiModelProperty(value="手机号")  
42 - private String phone;  
43 -  
44 - /** 电子邮箱 */  
45 - @ApiModelProperty(value="电子邮箱")  
46 - private String email;  
47 -  
48 - /** 头像地址 */  
49 - @ApiModelProperty(value="头像地址")  
50 - private String imgUrl;  
51 -  
52 - public void setId(Integer id)  
53 - {  
54 - this.id = id;  
55 - }  
56 -  
57 - public Integer getId()  
58 - {  
59 - return id;  
60 - }  
61 - public void setLoginName(String loginName)  
62 - {  
63 - this.loginName = loginName;  
64 - }  
65 -  
66 - public String getLoginName()  
67 - {  
68 - return loginName;  
69 - }  
70 - public void setName(String name)  
71 - {  
72 - this.name = name;  
73 - }  
74 -  
75 - public String getName()  
76 - {  
77 - return name;  
78 - }  
79 - public void setNickname(String nickname)  
80 - {  
81 - this.nickname = nickname;  
82 - }  
83 -  
84 - public String getNickname()  
85 - {  
86 - return nickname;  
87 - }  
88 - public void setGender(Integer gender)  
89 - {  
90 - this.gender = gender;  
91 - }  
92 -  
93 - public Integer getGender()  
94 - {  
95 - return gender;  
96 - }  
97 - public void setPhone(String phone)  
98 - {  
99 - this.phone = phone;  
100 - }  
101 -  
102 - public String getPhone()  
103 - {  
104 - return phone;  
105 - }  
106 - public void setEmail(String email)  
107 - {  
108 - this.email = email;  
109 - }  
110 -  
111 - public String getEmail()  
112 - {  
113 - return email;  
114 - }  
115 - public void setImgUrl(String imgUrl)  
116 - {  
117 - this.imgUrl = imgUrl;  
118 - }  
119 -  
120 - public String getImgUrl()  
121 - {  
122 - return imgUrl;  
123 - }  
124 -  
125 - @Override  
126 - public String toString() {  
127 - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)  
128 - .append("id", getId())  
129 - .append("loginName", getLoginName())  
130 - .append("name", getName())  
131 - .append("nickname", getNickname())  
132 - .append("gender", getGender())  
133 - .append("phone", getPhone())  
134 - .append("email", getEmail())  
135 - .append("imgUrl", getImgUrl())  
136 - .append("createTime", getCreateTime())  
137 - .toString();  
138 - }  
139 -}  
1 -package com.zhonglai.luhui.domain.user;  
2 -  
3 -import org.apache.commons.lang3.builder.ToStringBuilder;  
4 -import org.apache.commons.lang3.builder.ToStringStyle;  
5 -import io.swagger.annotations.ApiModel;  
6 -import io.swagger.annotations.ApiModelProperty;  
7 -import com.ruoyi.common.tool.BaseEntity;  
8 -  
9 -/**  
10 - * 用户其他信息对象 user_extra_info  
11 - *  
12 - * @author zhonglai  
13 - * @date 2025-10-18  
14 - */  
15 -@ApiModel("用户其他信息")  
16 -public class UserExtraInfo extends BaseEntity  
17 -{  
18 - private static final long serialVersionUID = 1L;  
19 -  
20 - /** 用户ID,主键关联 */  
21 - @ApiModelProperty(value="主键id")  
22 - private Integer id;  
23 -  
24 - /** 描述图片地址 */  
25 - @ApiModelProperty(value="描述图片地址")  
26 - private String describeImgUrl;  
27 -  
28 - /** 描述 */  
29 - @ApiModelProperty(value="描述")  
30 - private String describe;  
31 -  
32 - /** 用户类型(0普通用户,1管理员,2客服) */  
33 - @ApiModelProperty(value="用户类型",allowableValues="0=普通用户,1管理员,2客服")  
34 - private Integer userType;  
35 -  
36 - /** 是否失效 */  
37 - @ApiModelProperty(value="是否失效")  
38 - private Integer isInvalid;  
39 -  
40 - /** 是否参与活动 */  
41 - @ApiModelProperty(value="是否参与活动")  
42 - private Integer isParticipateIn;  
43 -  
44 - /** 公司ID */  
45 - @ApiModelProperty(value="公司ID")  
46 - private Integer companyId;  
47 -  
48 - /** 分享次数 */  
49 - @ApiModelProperty(value="分享次数")  
50 - private Integer shareNumber;  
51 -  
52 - public void setId(Integer id)  
53 - {  
54 - this.id = id;  
55 - }  
56 -  
57 - public Integer getId()  
58 - {  
59 - return id;  
60 - }  
61 - public void setDescribeImgUrl(String describeImgUrl)  
62 - {  
63 - this.describeImgUrl = describeImgUrl;  
64 - }  
65 -  
66 - public String getDescribeImgUrl()  
67 - {  
68 - return describeImgUrl;  
69 - }  
70 - public void setDescribe(String describe)  
71 - {  
72 - this.describe = describe;  
73 - }  
74 -  
75 - public String getDescribe()  
76 - {  
77 - return describe;  
78 - }  
79 - public void setUserType(Integer userType)  
80 - {  
81 - this.userType = userType;  
82 - }  
83 -  
84 - public Integer getUserType()  
85 - {  
86 - return userType;  
87 - }  
88 - public void setIsInvalid(Integer isInvalid)  
89 - {  
90 - this.isInvalid = isInvalid;  
91 - }  
92 -  
93 - public Integer getIsInvalid()  
94 - {  
95 - return isInvalid;  
96 - }  
97 - public void setIsParticipateIn(Integer isParticipateIn)  
98 - {  
99 - this.isParticipateIn = isParticipateIn;  
100 - }  
101 -  
102 - public Integer getIsParticipateIn()  
103 - {  
104 - return isParticipateIn;  
105 - }  
106 - public void setCompanyId(Integer companyId)  
107 - {  
108 - this.companyId = companyId;  
109 - }  
110 -  
111 - public Integer getCompanyId()  
112 - {  
113 - return companyId;  
114 - }  
115 - public void setShareNumber(Integer shareNumber)  
116 - {  
117 - this.shareNumber = shareNumber;  
118 - }  
119 -  
120 - public Integer getShareNumber()  
121 - {  
122 - return shareNumber;  
123 - }  
124 -  
125 - @Override  
126 - public String toString() {  
127 - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)  
128 - .append("id", getId())  
129 - .append("describeImgUrl", getDescribeImgUrl())  
130 - .append("describe", getDescribe())  
131 - .append("userType", getUserType())  
132 - .append("isInvalid", getIsInvalid())  
133 - .append("isParticipateIn", getIsParticipateIn())  
134 - .append("companyId", getCompanyId())  
135 - .append("shareNumber", getShareNumber())  
136 - .toString();  
137 - }  
138 -}  
1 -package com.zhonglai.luhui.domain.user;  
2 -  
3 -import org.apache.commons.lang3.builder.ToStringBuilder;  
4 -import org.apache.commons.lang3.builder.ToStringStyle;  
5 -import io.swagger.annotations.ApiModel;  
6 -import io.swagger.annotations.ApiModelProperty;  
7 -import com.ruoyi.common.tool.BaseEntity;  
8 -  
9 -/**  
10 - * 用户登录对象 user_login  
11 - *  
12 - * @author zhonglai  
13 - * @date 2025-10-18  
14 - */  
15 -@ApiModel("用户登录")  
16 -public class UserLogin extends BaseEntity  
17 -{  
18 - private static final long serialVersionUID = 1L;  
19 -  
20 - /** 用户登录主键主键 */  
21 - @ApiModelProperty(value="主键id")  
22 - private Integer id;  
23 -  
24 - /** 用户主键id */  
25 - @ApiModelProperty(value="用户主键id")  
26 - private Integer userId;  
27 -  
28 - /** 用户登录名 */  
29 - @ApiModelProperty(value="用户登录名")  
30 - private String loginName;  
31 -  
32 - /** 用户密码 */  
33 - @ApiModelProperty(value="用户密码")  
34 - private String loginPass;  
35 -  
36 - /** 用户登录密码key */  
37 - @ApiModelProperty(value="用户登录密码key")  
38 - private String userLoginPassKey;  
39 -  
40 - public void setId(Integer id)  
41 - {  
42 - this.id = id;  
43 - }  
44 -  
45 - public Integer getId()  
46 - {  
47 - return id;  
48 - }  
49 - public void setUserId(Integer userId)  
50 - {  
51 - this.userId = userId;  
52 - }  
53 -  
54 - public Integer getUserId()  
55 - {  
56 - return userId;  
57 - }  
58 - public void setLoginName(String loginName)  
59 - {  
60 - this.loginName = loginName;  
61 - }  
62 -  
63 - public String getLoginName()  
64 - {  
65 - return loginName;  
66 - }  
67 - public void setLoginPass(String loginPass)  
68 - {  
69 - this.loginPass = loginPass;  
70 - }  
71 -  
72 - public String getLoginPass()  
73 - {  
74 - return loginPass;  
75 - }  
76 - public void setUserLoginPassKey(String userLoginPassKey)  
77 - {  
78 - this.userLoginPassKey = userLoginPassKey;  
79 - }  
80 -  
81 - public String getUserLoginPassKey()  
82 - {  
83 - return userLoginPassKey;  
84 - }  
85 -  
86 - @Override  
87 - public String toString() {  
88 - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)  
89 - .append("id", getId())  
90 - .append("userId", getUserId())  
91 - .append("loginName", getLoginName())  
92 - .append("loginPass", getLoginPass())  
93 - .append("userLoginPassKey", getUserLoginPassKey())  
94 - .toString();  
95 - }  
96 -}  
1 -package com.zhonglai.luhui.domain.user;  
2 -  
3 -import org.apache.commons.lang3.builder.ToStringBuilder;  
4 -import org.apache.commons.lang3.builder.ToStringStyle;  
5 -import io.swagger.annotations.ApiModel;  
6 -import io.swagger.annotations.ApiModelProperty;  
7 -import com.ruoyi.common.tool.BaseEntity;  
8 -  
9 -/**  
10 - * 用户登录信息对象 user_login_info  
11 - *  
12 - * @author zhonglai  
13 - * @date 2025-10-18  
14 - */  
15 -@ApiModel("用户登录信息")  
16 -public class UserLoginInfo extends BaseEntity  
17 -{  
18 - private static final long serialVersionUID = 1L;  
19 -  
20 - /** 用户ID,主键关联 */  
21 - @ApiModelProperty(value="主键id")  
22 - private Integer id;  
23 -  
24 - /** 在线状态(0离线,1在线) */  
25 - @ApiModelProperty(value="在线状态(0离线,1在线)")  
26 - private Integer onlineState;  
27 -  
28 - /** 最后登陆时间 */  
29 - @ApiModelProperty(value="最后登陆时间")  
30 - private Integer lastLoginTime;  
31 -  
32 - /** 最后登陆IP */  
33 - @ApiModelProperty(value="最后登陆IP")  
34 - private String lastLoginIp;  
35 -  
36 - /** 最后登陆地点 */  
37 - @ApiModelProperty(value="最后登陆地点")  
38 - private String lastAddress;  
39 -  
40 - /** 最后登陆经度 */  
41 - @ApiModelProperty(value="最后登陆经度")  
42 - private String lastLoginLongitude;  
43 -  
44 - /** 最后登陆纬度 */  
45 - @ApiModelProperty(value="最后登陆纬度")  
46 - private String lastLoginLatitude;  
47 -  
48 - public void setId(Integer id)  
49 - {  
50 - this.id = id;  
51 - }  
52 -  
53 - public Integer getId()  
54 - {  
55 - return id;  
56 - }  
57 - public void setOnlineState(Integer onlineState)  
58 - {  
59 - this.onlineState = onlineState;  
60 - }  
61 -  
62 - public Integer getOnlineState()  
63 - {  
64 - return onlineState;  
65 - }  
66 - public void setLastLoginTime(Integer lastLoginTime)  
67 - {  
68 - this.lastLoginTime = lastLoginTime;  
69 - }  
70 -  
71 - public Integer getLastLoginTime()  
72 - {  
73 - return lastLoginTime;  
74 - }  
75 - public void setLastLoginIp(String lastLoginIp)  
76 - {  
77 - this.lastLoginIp = lastLoginIp;  
78 - }  
79 -  
80 - public String getLastLoginIp()  
81 - {  
82 - return lastLoginIp;  
83 - }  
84 - public void setLastAddress(String lastAddress)  
85 - {  
86 - this.lastAddress = lastAddress;  
87 - }  
88 -  
89 - public String getLastAddress()  
90 - {  
91 - return lastAddress;  
92 - }  
93 - public void setLastLoginLongitude(String lastLoginLongitude)  
94 - {  
95 - this.lastLoginLongitude = lastLoginLongitude;  
96 - }  
97 -  
98 - public String getLastLoginLongitude()  
99 - {  
100 - return lastLoginLongitude;  
101 - }  
102 - public void setLastLoginLatitude(String lastLoginLatitude)  
103 - {  
104 - this.lastLoginLatitude = lastLoginLatitude;  
105 - }  
106 -  
107 - public String getLastLoginLatitude()  
108 - {  
109 - return lastLoginLatitude;  
110 - }  
111 -  
112 - @Override  
113 - public String toString() {  
114 - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)  
115 - .append("id", getId())  
116 - .append("onlineState", getOnlineState())  
117 - .append("lastLoginTime", getLastLoginTime())  
118 - .append("lastLoginIp", getLastLoginIp())  
119 - .append("lastAddress", getLastAddress())  
120 - .append("lastLoginLongitude", getLastLoginLongitude())  
121 - .append("lastLoginLatitude", getLastLoginLatitude())  
122 - .toString();  
123 - }  
124 -}  
1 -package com.zhonglai.luhui.domain.user;  
2 -  
3 -import org.apache.commons.lang3.builder.ToStringBuilder;  
4 -import org.apache.commons.lang3.builder.ToStringStyle;  
5 -import io.swagger.annotations.ApiModel;  
6 -import io.swagger.annotations.ApiModelProperty;  
7 -import com.ruoyi.common.tool.BaseEntity;  
8 -  
9 -/**  
10 - * 用户官方及告警信息对象 user_official_info  
11 - *  
12 - * @author zhonglai  
13 - * @date 2025-10-18  
14 - */  
15 -@ApiModel("用户官方及告警信息")  
16 -public class UserOfficialInfo extends BaseEntity  
17 -{  
18 - private static final long serialVersionUID = 1L;  
19 -  
20 - /** 用户ID,主键关联 */  
21 - @ApiModelProperty(value="主键id")  
22 - private Integer id;  
23 -  
24 - /** 官方担保状态 */  
25 - @ApiModelProperty(value="官方担保状态")  
26 - private Integer guarantee;  
27 -  
28 - /** 官方担保描述 */  
29 - @ApiModelProperty(value="官方担保描述")  
30 - private String guaranteeDescribe;  
31 -  
32 - /** 告警协议 */  
33 - @ApiModelProperty(value="告警协议")  
34 - private Integer alarmAgreement;  
35 -  
36 - /** 告警通知电话 */  
37 - @ApiModelProperty(value="告警通知电话")  
38 - private String alarmNoticePhone;  
39 -  
40 - /** 告警通知openid */  
41 - @ApiModelProperty(value="告警通知openid")  
42 - private String alarmNoticeOpenid;  
43 -  
44 - /** 告警通知开关 */  
45 - @ApiModelProperty(value="告警通知开关")  
46 - private Integer alarmNoticeWxopen;  
47 -  
48 - public void setId(Integer id)  
49 - {  
50 - this.id = id;  
51 - }  
52 -  
53 - public Integer getId()  
54 - {  
55 - return id;  
56 - }  
57 - public void setGuarantee(Integer guarantee)  
58 - {  
59 - this.guarantee = guarantee;  
60 - }  
61 -  
62 - public Integer getGuarantee()  
63 - {  
64 - return guarantee;  
65 - }  
66 - public void setGuaranteeDescribe(String guaranteeDescribe)  
67 - {  
68 - this.guaranteeDescribe = guaranteeDescribe;  
69 - }  
70 -  
71 - public String getGuaranteeDescribe()  
72 - {  
73 - return guaranteeDescribe;  
74 - }  
75 - public void setAlarmAgreement(Integer alarmAgreement)  
76 - {  
77 - this.alarmAgreement = alarmAgreement;  
78 - }  
79 -  
80 - public Integer getAlarmAgreement()  
81 - {  
82 - return alarmAgreement;  
83 - }  
84 - public void setAlarmNoticePhone(String alarmNoticePhone)  
85 - {  
86 - this.alarmNoticePhone = alarmNoticePhone;  
87 - }  
88 -  
89 - public String getAlarmNoticePhone()  
90 - {  
91 - return alarmNoticePhone;  
92 - }  
93 - public void setAlarmNoticeOpenid(String alarmNoticeOpenid)  
94 - {  
95 - this.alarmNoticeOpenid = alarmNoticeOpenid;  
96 - }  
97 -  
98 - public String getAlarmNoticeOpenid()  
99 - {  
100 - return alarmNoticeOpenid;  
101 - }  
102 - public void setAlarmNoticeWxopen(Integer alarmNoticeWxopen)  
103 - {  
104 - this.alarmNoticeWxopen = alarmNoticeWxopen;  
105 - }  
106 -  
107 - public Integer getAlarmNoticeWxopen()  
108 - {  
109 - return alarmNoticeWxopen;  
110 - }  
111 -  
112 - @Override  
113 - public String toString() {  
114 - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)  
115 - .append("id", getId())  
116 - .append("guarantee", getGuarantee())  
117 - .append("guaranteeDescribe", getGuaranteeDescribe())  
118 - .append("alarmAgreement", getAlarmAgreement())  
119 - .append("alarmNoticePhone", getAlarmNoticePhone())  
120 - .append("alarmNoticeOpenid", getAlarmNoticeOpenid())  
121 - .append("alarmNoticeWxopen", getAlarmNoticeWxopen())  
122 - .toString();  
123 - }  
124 -}  
1 -package com.zhonglai.luhui.domain.user;  
2 -  
3 -import org.apache.commons.lang3.builder.ToStringBuilder;  
4 -import org.apache.commons.lang3.builder.ToStringStyle;  
5 -import io.swagger.annotations.ApiModel;  
6 -import io.swagger.annotations.ApiModelProperty;  
7 -import com.ruoyi.common.tool.BaseEntity;  
8 -  
9 -/**  
10 - * 用户社交信息对象 user_social_info  
11 - *  
12 - * @author zhonglai  
13 - * @date 2025-10-18  
14 - */  
15 -@ApiModel("用户社交信息")  
16 -public class UserSocialInfo extends BaseEntity  
17 -{  
18 - private static final long serialVersionUID = 1L;  
19 -  
20 - /** 用户ID,主键关联 */  
21 - @ApiModelProperty(value="主键id")  
22 - private Integer id;  
23 -  
24 - /** QQ账号 */  
25 - @ApiModelProperty(value="QQ账号")  
26 - private String qq;  
27 -  
28 - /** 微信账号 */  
29 - @ApiModelProperty(value="微信账号")  
30 - private String weixin;  
31 -  
32 - /** 开放平台ID */  
33 - @ApiModelProperty(value="开放平台ID")  
34 - private Integer openId;  
35 -  
36 - /** 萤石子账号ID */  
37 - @ApiModelProperty(value="萤石子账号ID")  
38 - private String ysChildrenId;  
39 -  
40 - /** 萤石子子账号密码 */  
41 - @ApiModelProperty(value="萤石子子账号密码")  
42 - private String ysChildrenPass;  
43 -  
44 - /** 极光消息密码 */  
45 - @ApiModelProperty(value="极光消息密码")  
46 - private String messagePassWord;  
47 -  
48 - /** 极光账号是否活跃 */  
49 - @ApiModelProperty(value="极光账号是否活跃")  
50 - private Integer isMessageAction;  
51 -  
52 - public void setId(Integer id)  
53 - {  
54 - this.id = id;  
55 - }  
56 -  
57 - public Integer getId()  
58 - {  
59 - return id;  
60 - }  
61 - public void setQq(String qq)  
62 - {  
63 - this.qq = qq;  
64 - }  
65 -  
66 - public String getQq()  
67 - {  
68 - return qq;  
69 - }  
70 - public void setWeixin(String weixin)  
71 - {  
72 - this.weixin = weixin;  
73 - }  
74 -  
75 - public String getWeixin()  
76 - {  
77 - return weixin;  
78 - }  
79 - public void setOpenId(Integer openId)  
80 - {  
81 - this.openId = openId;  
82 - }  
83 -  
84 - public Integer getOpenId()  
85 - {  
86 - return openId;  
87 - }  
88 - public void setYsChildrenId(String ysChildrenId)  
89 - {  
90 - this.ysChildrenId = ysChildrenId;  
91 - }  
92 -  
93 - public String getYsChildrenId()  
94 - {  
95 - return ysChildrenId;  
96 - }  
97 - public void setYsChildrenPass(String ysChildrenPass)  
98 - {  
99 - this.ysChildrenPass = ysChildrenPass;  
100 - }  
101 -  
102 - public String getYsChildrenPass()  
103 - {  
104 - return ysChildrenPass;  
105 - }  
106 - public void setMessagePassWord(String messagePassWord)  
107 - {  
108 - this.messagePassWord = messagePassWord;  
109 - }  
110 -  
111 - public String getMessagePassWord()  
112 - {  
113 - return messagePassWord;  
114 - }  
115 - public void setIsMessageAction(Integer isMessageAction)  
116 - {  
117 - this.isMessageAction = isMessageAction;  
118 - }  
119 -  
120 - public Integer getIsMessageAction()  
121 - {  
122 - return isMessageAction;  
123 - }  
124 -  
125 - @Override  
126 - public String toString() {  
127 - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)  
128 - .append("id", getId())  
129 - .append("qq", getQq())  
130 - .append("weixin", getWeixin())  
131 - .append("openId", getOpenId())  
132 - .append("ysChildrenId", getYsChildrenId())  
133 - .append("ysChildrenPass", getYsChildrenPass())  
134 - .append("messagePassWord", getMessagePassWord())  
135 - .append("isMessageAction", getIsMessageAction())  
136 - .toString();  
137 - }  
138 -}  
@@ -21,11 +21,15 @@ @@ -21,11 +21,15 @@
21 <!-- 通用工具--> 21 <!-- 通用工具-->
22 <dependency> 22 <dependency>
23 <groupId>com.zhonglai.luhui</groupId> 23 <groupId>com.zhonglai.luhui</groupId>
24 - <artifactId>ruoyi-common-security</artifactId> 24 + <artifactId>lh-jar-action</artifactId>
25 </dependency> 25 </dependency>
26 <dependency> 26 <dependency>
27 <groupId>com.zhonglai.luhui</groupId> 27 <groupId>com.zhonglai.luhui</groupId>
28 - <artifactId>lh-jar-action</artifactId> 28 + <artifactId>lh-common-swagger</artifactId>
  29 + </dependency>
  30 + <dependency>
  31 + <groupId>com.zhonglai.luhui</groupId>
  32 + <artifactId>lh-common-datasource</artifactId>
29 </dependency> 33 </dependency>
30 </dependencies> 34 </dependencies>
31 </project> 35 </project>
@@ -24,8 +24,7 @@ public class UserLogin extends BaseEntity @@ -24,8 +24,7 @@ public class UserLogin extends BaseEntity
24 @ApiModelProperty(value="用户主键id") 24 @ApiModelProperty(value="用户主键id")
25 private Integer userId; 25 private Integer userId;
26 26
27 - /** 用户登录名 */  
28 - @ApiModelProperty(value="用户登录名") 27 + @ApiModelProperty(value="用户主键id")
29 private String loginName; 28 private String loginName;
30 29
31 /** 用户密码 */ 30 /** 用户密码 */
@@ -54,16 +53,7 @@ public class UserLogin extends BaseEntity @@ -54,16 +53,7 @@ public class UserLogin extends BaseEntity
54 { 53 {
55 return userId; 54 return userId;
56 } 55 }
57 - public void setLoginName(String loginName)  
58 - {  
59 - this.loginName = loginName;  
60 - }  
61 -  
62 - public String getLoginName()  
63 - {  
64 - return loginName;  
65 - }  
66 - public void setLoginPass(String loginPass) 56 + public void setLoginPass(String loginPass)
67 { 57 {
68 this.loginPass = loginPass; 58 this.loginPass = loginPass;
69 } 59 }
@@ -82,12 +72,19 @@ public class UserLogin extends BaseEntity @@ -82,12 +72,19 @@ public class UserLogin extends BaseEntity
82 return userLoginPassKey; 72 return userLoginPassKey;
83 } 73 }
84 74
  75 + public String getLoginName() {
  76 + return loginName;
  77 + }
  78 +
  79 + public void setLoginName(String loginName) {
  80 + this.loginName = loginName;
  81 + }
  82 +
85 @Override 83 @Override
86 public String toString() { 84 public String toString() {
87 return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 85 return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
88 .append("id", getId()) 86 .append("id", getId())
89 .append("userId", getUserId()) 87 .append("userId", getUserId())
90 - .append("loginName", getLoginName())  
91 .append("loginPass", getLoginPass()) 88 .append("loginPass", getLoginPass())
92 .append("userLoginPassKey", getUserLoginPassKey()) 89 .append("userLoginPassKey", getUserLoginPassKey())
93 .toString(); 90 .toString();
@@ -58,4 +58,7 @@ public interface UserLoginMapper @@ -58,4 +58,7 @@ public interface UserLoginMapper
58 * @return 结果 58 * @return 结果
59 */ 59 */
60 public int deleteUserLoginByIds(Integer[] ids); 60 public int deleteUserLoginByIds(Integer[] ids);
  61 +
  62 + public UserLogin selectUserLoginByLoginName(String loginName);
  63 +
61 } 64 }
@@ -60,4 +60,5 @@ public interface IUserLoginService @@ -60,4 +60,5 @@ public interface IUserLoginService
60 public int deleteUserLoginById(Integer id); 60 public int deleteUserLoginById(Integer id);
61 61
62 String apiLoginByPass(String user, String pass); 62 String apiLoginByPass(String user, String pass);
  63 + UserLogin selectUserLoginByLoginName(String loginName);
63 } 64 }
1 package com.zhonglai.luhui.user.service.impl; 1 package com.zhonglai.luhui.user.service.impl;
2 2
3 import java.util.List; 3 import java.util.List;
  4 +
  5 +import com.zhonglai.luhui.datasource.enums.DataSource;
  6 +import com.zhonglai.luhui.datasource.enums.DataSourceType;
4 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
5 import org.springframework.stereotype.Service; 8 import org.springframework.stereotype.Service;
6 import com.zhonglai.luhui.user.mapper.UserAccountInfoMapper; 9 import com.zhonglai.luhui.user.mapper.UserAccountInfoMapper;
@@ -13,6 +16,7 @@ import com.zhonglai.luhui.user.service.IUserAccountInfoService; @@ -13,6 +16,7 @@ import com.zhonglai.luhui.user.service.IUserAccountInfoService;
13 * @author zhonglai 16 * @author zhonglai
14 * @date 2025-10-20 17 * @date 2025-10-20
15 */ 18 */
  19 +@DataSource(value = DataSourceType.SLAVE)
16 @Service 20 @Service
17 public class UserAccountInfoServiceImpl implements IUserAccountInfoService 21 public class UserAccountInfoServiceImpl implements IUserAccountInfoService
18 { 22 {
1 package com.zhonglai.luhui.user.service.impl; 1 package com.zhonglai.luhui.user.service.impl;
2 2
3 import java.util.List; 3 import java.util.List;
  4 +
  5 +import com.zhonglai.luhui.datasource.enums.DataSource;
  6 +import com.zhonglai.luhui.datasource.enums.DataSourceType;
4 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
5 import org.springframework.stereotype.Service; 8 import org.springframework.stereotype.Service;
6 import com.zhonglai.luhui.user.mapper.UserAddressInfoMapper; 9 import com.zhonglai.luhui.user.mapper.UserAddressInfoMapper;
@@ -13,6 +16,7 @@ import com.zhonglai.luhui.user.service.IUserAddressInfoService; @@ -13,6 +16,7 @@ import com.zhonglai.luhui.user.service.IUserAddressInfoService;
13 * @author zhonglai 16 * @author zhonglai
14 * @date 2025-10-20 17 * @date 2025-10-20
15 */ 18 */
  19 +@DataSource(value = DataSourceType.SLAVE)
16 @Service 20 @Service
17 public class UserAddressInfoServiceImpl implements IUserAddressInfoService 21 public class UserAddressInfoServiceImpl implements IUserAddressInfoService
18 { 22 {
1 package com.zhonglai.luhui.user.service.impl; 1 package com.zhonglai.luhui.user.service.impl;
2 2
3 import java.util.List; 3 import java.util.List;
  4 +
  5 +import com.zhonglai.luhui.datasource.enums.DataSource;
  6 +import com.zhonglai.luhui.datasource.enums.DataSourceType;
4 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
5 import org.springframework.stereotype.Service; 8 import org.springframework.stereotype.Service;
6 import com.zhonglai.luhui.user.mapper.UserAuthInfoMapper; 9 import com.zhonglai.luhui.user.mapper.UserAuthInfoMapper;
@@ -13,6 +16,7 @@ import com.zhonglai.luhui.user.service.IUserAuthInfoService; @@ -13,6 +16,7 @@ import com.zhonglai.luhui.user.service.IUserAuthInfoService;
13 * @author zhonglai 16 * @author zhonglai
14 * @date 2025-10-20 17 * @date 2025-10-20
15 */ 18 */
  19 +@DataSource(value = DataSourceType.SLAVE)
16 @Service 20 @Service
17 public class UserAuthInfoServiceImpl implements IUserAuthInfoService 21 public class UserAuthInfoServiceImpl implements IUserAuthInfoService
18 { 22 {
@@ -2,6 +2,8 @@ package com.zhonglai.luhui.user.service.impl; @@ -2,6 +2,8 @@ package com.zhonglai.luhui.user.service.impl;
2 2
3 import java.util.List; 3 import java.util.List;
4 import com.ruoyi.common.utils.DateUtils; 4 import com.ruoyi.common.utils.DateUtils;
  5 +import com.zhonglai.luhui.datasource.enums.DataSource;
  6 +import com.zhonglai.luhui.datasource.enums.DataSourceType;
5 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.stereotype.Service; 8 import org.springframework.stereotype.Service;
7 import com.zhonglai.luhui.user.mapper.UserBaseInfoMapper; 9 import com.zhonglai.luhui.user.mapper.UserBaseInfoMapper;
@@ -14,6 +16,7 @@ import com.zhonglai.luhui.user.service.IUserBaseInfoService; @@ -14,6 +16,7 @@ import com.zhonglai.luhui.user.service.IUserBaseInfoService;
14 * @author zhonglai 16 * @author zhonglai
15 * @date 2025-10-20 17 * @date 2025-10-20
16 */ 18 */
  19 +@DataSource(value = DataSourceType.SLAVE)
17 @Service 20 @Service
18 public class UserBaseInfoServiceImpl implements IUserBaseInfoService 21 public class UserBaseInfoServiceImpl implements IUserBaseInfoService
19 { 22 {
1 package com.zhonglai.luhui.user.service.impl; 1 package com.zhonglai.luhui.user.service.impl;
2 2
3 import java.util.List; 3 import java.util.List;
  4 +
  5 +import com.zhonglai.luhui.datasource.enums.DataSource;
  6 +import com.zhonglai.luhui.datasource.enums.DataSourceType;
4 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
5 import org.springframework.stereotype.Service; 8 import org.springframework.stereotype.Service;
6 import com.zhonglai.luhui.user.mapper.UserExtraInfoMapper; 9 import com.zhonglai.luhui.user.mapper.UserExtraInfoMapper;
@@ -13,6 +16,7 @@ import com.zhonglai.luhui.user.service.IUserExtraInfoService; @@ -13,6 +16,7 @@ import com.zhonglai.luhui.user.service.IUserExtraInfoService;
13 * @author zhonglai 16 * @author zhonglai
14 * @date 2025-10-20 17 * @date 2025-10-20
15 */ 18 */
  19 +@DataSource(value = DataSourceType.SLAVE)
16 @Service 20 @Service
17 public class UserExtraInfoServiceImpl implements IUserExtraInfoService 21 public class UserExtraInfoServiceImpl implements IUserExtraInfoService
18 { 22 {
1 package com.zhonglai.luhui.user.service.impl; 1 package com.zhonglai.luhui.user.service.impl;
2 2
3 import java.util.List; 3 import java.util.List;
  4 +
  5 +import com.zhonglai.luhui.datasource.enums.DataSource;
  6 +import com.zhonglai.luhui.datasource.enums.DataSourceType;
4 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
5 import org.springframework.stereotype.Service; 8 import org.springframework.stereotype.Service;
6 import com.zhonglai.luhui.user.mapper.UserLoginInfoMapper; 9 import com.zhonglai.luhui.user.mapper.UserLoginInfoMapper;
@@ -13,6 +16,7 @@ import com.zhonglai.luhui.user.service.IUserLoginInfoService; @@ -13,6 +16,7 @@ import com.zhonglai.luhui.user.service.IUserLoginInfoService;
13 * @author zhonglai 16 * @author zhonglai
14 * @date 2025-10-20 17 * @date 2025-10-20
15 */ 18 */
  19 +@DataSource(value = DataSourceType.SLAVE)
16 @Service 20 @Service
17 public class UserLoginInfoServiceImpl implements IUserLoginInfoService 21 public class UserLoginInfoServiceImpl implements IUserLoginInfoService
18 { 22 {
1 package com.zhonglai.luhui.user.service.impl; 1 package com.zhonglai.luhui.user.service.impl;
2 2
3 import java.util.List; 3 import java.util.List;
  4 +
  5 +import com.zhonglai.luhui.datasource.enums.DataSource;
  6 +import com.zhonglai.luhui.datasource.enums.DataSourceType;
4 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
5 import org.springframework.stereotype.Service; 8 import org.springframework.stereotype.Service;
6 import com.zhonglai.luhui.user.mapper.UserLoginMapper; 9 import com.zhonglai.luhui.user.mapper.UserLoginMapper;
@@ -13,6 +16,7 @@ import com.zhonglai.luhui.user.service.IUserLoginService; @@ -13,6 +16,7 @@ import com.zhonglai.luhui.user.service.IUserLoginService;
13 * @author zhonglai 16 * @author zhonglai
14 * @date 2025-10-20 17 * @date 2025-10-20
15 */ 18 */
  19 +@DataSource(value = DataSourceType.SLAVE)
16 @Service 20 @Service
17 public class UserLoginServiceImpl implements IUserLoginService 21 public class UserLoginServiceImpl implements IUserLoginService
18 { 22 {
@@ -31,6 +35,12 @@ public class UserLoginServiceImpl implements IUserLoginService @@ -31,6 +35,12 @@ public class UserLoginServiceImpl implements IUserLoginService
31 return userLoginMapper.selectUserLoginById(id); 35 return userLoginMapper.selectUserLoginById(id);
32 } 36 }
33 37
  38 +
  39 + @Override
  40 + public UserLogin selectUserLoginByLoginName(String loginName)
  41 + {
  42 + return userLoginMapper.selectUserLoginByLoginName(loginName);
  43 + }
34 /** 44 /**
35 * 查询用户登录列表 45 * 查询用户登录列表
36 * 46 *
1 package com.zhonglai.luhui.user.service.impl; 1 package com.zhonglai.luhui.user.service.impl;
2 2
3 import java.util.List; 3 import java.util.List;
  4 +
  5 +import com.zhonglai.luhui.datasource.enums.DataSource;
  6 +import com.zhonglai.luhui.datasource.enums.DataSourceType;
4 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
5 import org.springframework.stereotype.Service; 8 import org.springframework.stereotype.Service;
6 import com.zhonglai.luhui.user.mapper.UserOfficialInfoMapper; 9 import com.zhonglai.luhui.user.mapper.UserOfficialInfoMapper;
@@ -13,6 +16,7 @@ import com.zhonglai.luhui.user.service.IUserOfficialInfoService; @@ -13,6 +16,7 @@ import com.zhonglai.luhui.user.service.IUserOfficialInfoService;
13 * @author zhonglai 16 * @author zhonglai
14 * @date 2025-10-20 17 * @date 2025-10-20
15 */ 18 */
  19 +@DataSource(value = DataSourceType.SLAVE)
16 @Service 20 @Service
17 public class UserOfficialInfoServiceImpl implements IUserOfficialInfoService 21 public class UserOfficialInfoServiceImpl implements IUserOfficialInfoService
18 { 22 {
1 package com.zhonglai.luhui.user.service.impl; 1 package com.zhonglai.luhui.user.service.impl;
2 2
3 import java.util.List; 3 import java.util.List;
  4 +
  5 +import com.zhonglai.luhui.datasource.enums.DataSource;
  6 +import com.zhonglai.luhui.datasource.enums.DataSourceType;
4 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
5 import org.springframework.stereotype.Service; 8 import org.springframework.stereotype.Service;
6 import com.zhonglai.luhui.user.mapper.UserSocialInfoMapper; 9 import com.zhonglai.luhui.user.mapper.UserSocialInfoMapper;
@@ -13,6 +16,7 @@ import com.zhonglai.luhui.user.service.IUserSocialInfoService; @@ -13,6 +16,7 @@ import com.zhonglai.luhui.user.service.IUserSocialInfoService;
13 * @author zhonglai 16 * @author zhonglai
14 * @date 2025-10-20 17 * @date 2025-10-20
15 */ 18 */
  19 +@DataSource(value = DataSourceType.SLAVE)
16 @Service 20 @Service
17 public class UserSocialInfoServiceImpl implements IUserSocialInfoService 21 public class UserSocialInfoServiceImpl implements IUserSocialInfoService
18 { 22 {
@@ -6,7 +6,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -6,7 +6,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
6 6
7 <resultMap type="UserBaseInfo" id="UserBaseInfoResult"> 7 <resultMap type="UserBaseInfo" id="UserBaseInfoResult">
8 <result property="id" column="id" /> 8 <result property="id" column="id" />
9 - <result property="loginName" column="login_name" />  
10 <result property="name" column="name" /> 9 <result property="name" column="name" />
11 <result property="nickname" column="nickname" /> 10 <result property="nickname" column="nickname" />
12 <result property="gender" column="gender" /> 11 <result property="gender" column="gender" />
@@ -17,13 +16,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -17,13 +16,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
17 </resultMap> 16 </resultMap>
18 17
19 <sql id="selectUserBaseInfoVo"> 18 <sql id="selectUserBaseInfoVo">
20 - select id, login_name, name, nickname, gender, phone, email, img_url, create_time from user_base_info 19 + select id, name, nickname, gender, phone, email, img_url, create_time from user_base_info
21 </sql> 20 </sql>
22 21
23 <select id="selectUserBaseInfoList" parameterType="UserBaseInfo" resultMap="UserBaseInfoResult"> 22 <select id="selectUserBaseInfoList" parameterType="UserBaseInfo" resultMap="UserBaseInfoResult">
24 <include refid="selectUserBaseInfoVo"/> 23 <include refid="selectUserBaseInfoVo"/>
25 <where> 24 <where>
26 - <if test="loginName != null and loginName != ''"> and login_name like concat('%', #{loginName}, '%')</if>  
27 <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> 25 <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
28 <if test="nickname != null and nickname != ''"> and nickname like concat('%', #{nickname}, '%')</if> 26 <if test="nickname != null and nickname != ''"> and nickname like concat('%', #{nickname}, '%')</if>
29 <if test="gender != null "> and gender = #{gender}</if> 27 <if test="gender != null "> and gender = #{gender}</if>
@@ -41,7 +39,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -41,7 +39,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
41 <insert id="insertUserBaseInfo" parameterType="UserBaseInfo" useGeneratedKeys="true" keyProperty="id"> 39 <insert id="insertUserBaseInfo" parameterType="UserBaseInfo" useGeneratedKeys="true" keyProperty="id">
42 insert into user_base_info 40 insert into user_base_info
43 <trim prefix="(" suffix=")" suffixOverrides=","> 41 <trim prefix="(" suffix=")" suffixOverrides=",">
44 - <if test="loginName != null and loginName != ''">login_name,</if>  
45 <if test="name != null">name,</if> 42 <if test="name != null">name,</if>
46 <if test="nickname != null">nickname,</if> 43 <if test="nickname != null">nickname,</if>
47 <if test="gender != null">gender,</if> 44 <if test="gender != null">gender,</if>
@@ -51,7 +48,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -51,7 +48,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
51 <if test="createTime != null">create_time,</if> 48 <if test="createTime != null">create_time,</if>
52 </trim> 49 </trim>
53 <trim prefix="values (" suffix=")" suffixOverrides=","> 50 <trim prefix="values (" suffix=")" suffixOverrides=",">
54 - <if test="loginName != null and loginName != ''">#{loginName},</if>  
55 <if test="name != null">#{name},</if> 51 <if test="name != null">#{name},</if>
56 <if test="nickname != null">#{nickname},</if> 52 <if test="nickname != null">#{nickname},</if>
57 <if test="gender != null">#{gender},</if> 53 <if test="gender != null">#{gender},</if>
@@ -65,7 +61,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -65,7 +61,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
65 <update id="updateUserBaseInfo" parameterType="UserBaseInfo"> 61 <update id="updateUserBaseInfo" parameterType="UserBaseInfo">
66 update user_base_info 62 update user_base_info
67 <trim prefix="SET" suffixOverrides=","> 63 <trim prefix="SET" suffixOverrides=",">
68 - <if test="loginName != null and loginName != ''">login_name = #{loginName},</if>  
69 <if test="name != null">name = #{name},</if> 64 <if test="name != null">name = #{name},</if>
70 <if test="nickname != null">nickname = #{nickname},</if> 65 <if test="nickname != null">nickname = #{nickname},</if>
71 <if test="gender != null">gender = #{gender},</if> 66 <if test="gender != null">gender = #{gender},</if>
@@ -16,14 +16,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -16,14 +16,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
16 </resultMap> 16 </resultMap>
17 17
18 <sql id="selectUserExtraInfoVo"> 18 <sql id="selectUserExtraInfoVo">
19 - select id, describe_img_url, describe, user_type, is_invalid, is_participate_in, company_id, share_number from user_extra_info 19 + select id, describe_img_url, `describe`, user_type, is_invalid, is_participate_in, company_id, share_number from user_extra_info
20 </sql> 20 </sql>
21 21
22 <select id="selectUserExtraInfoList" parameterType="UserExtraInfo" resultMap="UserExtraInfoResult"> 22 <select id="selectUserExtraInfoList" parameterType="UserExtraInfo" resultMap="UserExtraInfoResult">
23 <include refid="selectUserExtraInfoVo"/> 23 <include refid="selectUserExtraInfoVo"/>
24 <where> 24 <where>
25 <if test="describeImgUrl != null and describeImgUrl != ''"> and describe_img_url = #{describeImgUrl}</if> 25 <if test="describeImgUrl != null and describeImgUrl != ''"> and describe_img_url = #{describeImgUrl}</if>
26 - <if test="describe != null and describe != ''"> and describe = #{describe}</if> 26 + <if test="describe != null and describe != ''"> and `describe` = #{describe}</if>
27 <if test="userType != null "> and user_type = #{userType}</if> 27 <if test="userType != null "> and user_type = #{userType}</if>
28 <if test="isInvalid != null "> and is_invalid = #{isInvalid}</if> 28 <if test="isInvalid != null "> and is_invalid = #{isInvalid}</if>
29 <if test="isParticipateIn != null "> and is_participate_in = #{isParticipateIn}</if> 29 <if test="isParticipateIn != null "> and is_participate_in = #{isParticipateIn}</if>
@@ -36,13 +36,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -36,13 +36,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
36 <include refid="selectUserExtraInfoVo"/> 36 <include refid="selectUserExtraInfoVo"/>
37 where id = #{id} 37 where id = #{id}
38 </select> 38 </select>
39 - 39 +
40 <insert id="insertUserExtraInfo" parameterType="UserExtraInfo"> 40 <insert id="insertUserExtraInfo" parameterType="UserExtraInfo">
41 insert into user_extra_info 41 insert into user_extra_info
42 <trim prefix="(" suffix=")" suffixOverrides=","> 42 <trim prefix="(" suffix=")" suffixOverrides=",">
43 <if test="id != null">id,</if> 43 <if test="id != null">id,</if>
44 <if test="describeImgUrl != null">describe_img_url,</if> 44 <if test="describeImgUrl != null">describe_img_url,</if>
45 - <if test="describe != null">describe,</if> 45 + <if test="describe != null">`describe`,</if>
46 <if test="userType != null">user_type,</if> 46 <if test="userType != null">user_type,</if>
47 <if test="isInvalid != null">is_invalid,</if> 47 <if test="isInvalid != null">is_invalid,</if>
48 <if test="isParticipateIn != null">is_participate_in,</if> 48 <if test="isParticipateIn != null">is_participate_in,</if>
@@ -25,7 +25,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -25,7 +25,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
25 <if test="userLoginPassKey != null and userLoginPassKey != ''"> and user_login_pass_key = #{userLoginPassKey}</if> 25 <if test="userLoginPassKey != null and userLoginPassKey != ''"> and user_login_pass_key = #{userLoginPassKey}</if>
26 </where> 26 </where>
27 </select> 27 </select>
28 - 28 +
  29 + <select id="selectUserLoginByLoginName" parameterType="UserLogin" resultMap="UserLoginResult">
  30 + SELECT
  31 + a.id ,
  32 + a.user_id ,
  33 + a.login_name,
  34 + a.login_pass,
  35 + a.user_login_pass_key
  36 +
  37 + FROM user_login a
  38 + LEFT JOIN user_base_info b ON a.user_id = b.id
  39 + <where>
  40 + b.phone = #{loginName}
  41 + OR a.login_name = #{loginName}
  42 + OR b.email = #{loginName}
  43 + </where>
  44 + LIMIT 1
  45 + </select>
  46 +
29 <select id="selectUserLoginById" parameterType="Integer" resultMap="UserLoginResult"> 47 <select id="selectUserLoginById" parameterType="Integer" resultMap="UserLoginResult">
30 <include refid="selectUserLoginVo"/> 48 <include refid="selectUserLoginVo"/>
31 where id = #{id} 49 where id = #{id}
@@ -7,6 +7,7 @@ import com.ruoyi.common.utils.GsonConstructor; @@ -7,6 +7,7 @@ import com.ruoyi.common.utils.GsonConstructor;
7 import lombok.Data; 7 import lombok.Data;
8 8
9 import java.io.Serializable; 9 import java.io.Serializable;
  10 +import java.util.HashMap;
10 11
11 /** 12 /**
12 * 登录令牌 13 * 登录令牌
@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
36 where id = #{id} 36 where id = #{id}
37 </select> 37 </select>
38 38
39 - <insert id="insertContentGtroupManagement" parameterType="ContentGroupManagement" useGeneratedKeys="true" keyProperty="id"> 39 + <insert id="insertContentGroupManagement" parameterType="ContentGroupManagement" useGeneratedKeys="true" keyProperty="id">
40 insert into content_group_management 40 insert into content_group_management
41 <trim prefix="(" suffix=")" suffixOverrides=","> 41 <trim prefix="(" suffix=")" suffixOverrides=",">
42 <if test="content != null and content != ''">content,</if> 42 <if test="content != null and content != ''">content,</if>
@@ -87,12 +87,11 @@ public class SensorData { @@ -87,12 +87,11 @@ public class SensorData {
87 87
88 88
89 89
90 - public static StringBuffer deviceSensorDataListToInterval(List<DeviceSensorData> deviceSensorDataList,int lastTime,int interval) 90 + public static StringBuffer deviceSensorDataListToIntervalNearest(List<DeviceSensorData> deviceSensorDataList,int lastTime,int interval)
91 { 91 {
92 int abs = interval; 92 int abs = interval;
93 String lastData = null; 93 String lastData = null;
94 - StringBuffer stringBuffer = new StringBuffer(); //间隔时间  
95 - 94 + StringBuffer stringBuffer10 = new StringBuffer(); //间隔时间补全
96 for(DeviceSensorData deviceSensorData:deviceSensorDataList) 95 for(DeviceSensorData deviceSensorData:deviceSensorDataList)
97 { 96 {
98 97
@@ -102,7 +101,13 @@ public class SensorData { @@ -102,7 +101,13 @@ public class SensorData {
102 { 101 {
103 while (Math.abs(lc)>interval) 102 while (Math.abs(lc)>interval)
104 { 103 {
105 - setStringBuffer(lastData,lastTime,stringBuffer); 104 + if(null != lastData)
  105 + {
  106 + stringBuffer10.append(lastTime);
  107 + stringBuffer10.append(",");
  108 + stringBuffer10.append(lastData);
  109 + stringBuffer10.append("\r\n");
  110 + }
106 111
107 lastTime = lastTime+interval; 112 lastTime = lastTime+interval;
108 abs = interval; 113 abs = interval;
@@ -119,7 +124,10 @@ public class SensorData { @@ -119,7 +124,10 @@ public class SensorData {
119 124
120 }else if(lc==0){ 125 }else if(lc==0){
121 126
122 - setStringBuffer(deviceSensorData.getDataValue(),lastTime,stringBuffer); 127 + stringBuffer10.append(lastTime);
  128 + stringBuffer10.append(",");
  129 + stringBuffer10.append(deviceSensorData.getDataValue());
  130 + stringBuffer10.append("\r\n");
123 131
124 lastTime = lastTime+interval; 132 lastTime = lastTime+interval;
125 abs = interval; 133 abs = interval;
@@ -135,9 +143,9 @@ public class SensorData { @@ -135,9 +143,9 @@ public class SensorData {
135 } 143 }
136 144
137 //设置最后一个 145 //设置最后一个
138 - setStringBuffer(lastData,lastTime,stringBuffer); 146 + setStringBuffer(lastData,lastTime,stringBuffer10);
139 147
140 - return stringBuffer; 148 + return stringBuffer10;
141 } 149 }
142 150
143 private static void setStringBuffer(String lastData,Integer lastTime,StringBuffer stringBuffer) 151 private static void setStringBuffer(String lastData,Integer lastTime,StringBuffer stringBuffer)
@@ -53,4 +53,5 @@ public class ApiLoginController extends BaseController { @@ -53,4 +53,5 @@ public class ApiLoginController extends BaseController {
53 ajax.put(Constants.TOKEN, token); 53 ajax.put(Constants.TOKEN, token);
54 return ajax; 54 return ajax;
55 } 55 }
  56 +
56 } 57 }
1 -package com.zhonglai.luhui.api.controller.login.v2;  
2 -  
3 -import com.ruoyi.common.constant.Constants;  
4 -import com.ruoyi.common.core.domain.AjaxResult;  
5 -import com.zhonglai.luhui.action.BaseController;  
6 -import com.zhonglai.luhui.login.service.LoginService;  
7 -import com.zhonglai.luhui.user.service.IUserLoginService;  
8 -import io.swagger.annotations.Api;  
9 -import io.swagger.annotations.ApiImplicitParam;  
10 -import io.swagger.annotations.ApiImplicitParams;  
11 -import io.swagger.annotations.ApiOperation;  
12 -import org.springframework.beans.factory.annotation.Autowired;  
13 -import org.springframework.web.bind.annotation.PostMapping;  
14 -import org.springframework.web.bind.annotation.RequestMapping;  
15 -import org.springframework.web.bind.annotation.RestController;  
16 -  
17 -@Api(tags = "api登陆-v2")  
18 -@RestController  
19 -@RequestMapping("/v2/login/ApiLogin")  
20 -public class V2ApiLoginController extends BaseController {  
21 - @Autowired  
22 - private IUserLoginService userLoginService;  
23 - @ApiOperation("账号密码登陆")  
24 - @ApiImplicitParams({  
25 - @ApiImplicitParam(value = "账号",name = "user"),  
26 - @ApiImplicitParam(value = "密码",name = "pass"),  
27 - })  
28 - @PostMapping("/userpassLogin")  
29 - public AjaxResult userpassLogin(String user, String pass)  
30 - {  
31 - AjaxResult ajax = AjaxResult.success();  
32 - //生成令牌  
33 - String token = userLoginService.apiLoginByPass(user,pass);  
34 - ajax.put(Constants.TOKEN, token);  
35 - return ajax;  
36 - }  
37 -}  
@@ -365,7 +365,7 @@ public class DataService { @@ -365,7 +365,7 @@ public class DataService {
365 //间隔时间补全 365 //间隔时间补全
366 Date sdate = new Date(startTime*1000l); 366 Date sdate = new Date(startTime*1000l);
367 String day = DateUtils.parseDateToStr("yyyyMMdd",sdate); 367 String day = DateUtils.parseDateToStr("yyyyMMdd",sdate);
368 - stringBuffer10 = SensorData.deviceSensorDataListToIntervalCompletion(deviceSensorDataList, Integer.parseInt(sdate.getTime() / 1000 + ""), interval, day); 368 + stringBuffer10 = SensorData.deviceSensorDataListToIntervalNearest(deviceSensorDataList, Integer.parseInt(sdate.getTime() / 1000 + ""), interval);
369 369
370 }else { 370 }else {
371 stringBuffer10 = new StringBuffer(); 371 stringBuffer10 = new StringBuffer();
1 -# 项目相关配置 jhlt: # 名称 name: zhonglai # 版本 version: 3.8.2 # 版权年份 copyrightYear: 2022 # 实例演示开关 demoEnabled: true # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) profile: D:/ruoyi/uploadPath # 获取ip地址开关 addressEnabled: false # 验证码类型 math 数组计算 char 字符验证 captchaType: math # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 port: 18080 servlet: # 应用的访问路径 context-path: / tomcat: # tomcat的URI编码 uri-encoding: UTF-8 # 连接数满后的排队数,默认为100 accept-count: 1000 threads: # tomcat最大线程数,默认为200 max: 800 # Tomcat启动初始化的线程数,默认值10 min-spare: 100 # 日志配置 logging: level: com.ruoyi: debug org.springframework: warn com.zhonglai.luhui: debug # Spring配置 spring: # 资源信息 messages: # 国际化资源文件路径 basename: i18n/messages profiles: active: druid # 文件上传 servlet: multipart: # 单个文件大小 max-file-size: 10MB # 设置总上传的文件大小 max-request-size: 20MB # 服务模块 devtools: restart: # 热部署开关 enabled: true # redis 配置 redis: # 地址 host: 119.23.218.181 # 端口,默认为6379 port: 6379 # 数据库索引 database: 1 # 密码 password: # 连接超时时间 timeout: 10s lettuce: pool: # 连接池中的最小空闲连接 min-idle: 0 # 连接池中的最大空闲连接 max-idle: 8 # 连接池的最大数据库连接数 max-active: 8 # #连接池最大阻塞等待时间(使用负值表示没有限制) max-wait: -1ms # token配置 token: # 令牌自定义标识 header: Authorization # 令牌密钥 secret: abcdefghijklmnopqrstuvwxyz # 令牌有效期(默认30分钟) expireTime: 1440 rediskey: lh-api # MyBatis配置 mybatis: # 搜索指定包别名 typeAliasesPackage: com.ruoyi.**.domain,com.zhonglai.**.domain # 配置mapper的扫描,找到所有的mapper.xml映射文件 mapperLocations: classpath*:mapper/**/*Mapper.xml # 加载全局的配置文件 configLocation: classpath:mybatis/mybatis-config.xml # PageHelper分页插件 pagehelper: helperDialect: mysql supportMethodsArguments: true params: count=countSql # Swagger配置 swagger: # 是否开启swagger enabled: true # 请求前缀 pathMapping: /dev-api # 防止XSS攻击 xss: # 过滤开关 enabled: true # 排除链接(多个用逗号分隔) excludes: /system/notice # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/* mqtt: client: device_life: 180 sys: ## // 对于登录login 注册register 验证码captchaImage 允许匿名访问 antMatchers: /login/ApiLogin/*,/content/**,/test/**,/fish/FishPriceCollection/*,/iot/IotTerminal/listByDeviceId/* # NameServer地址 rocketmq: name-server: 8.129.224.117:9876 # 默认的消息组 producer: group: deviceCommand send-message-timeout: 30000 send-topic: lh-mqtt-service-deviceCommand-test send-tags: 1 ssh: isEnabled: true host: 119.23.218.181 port: 22 user: root password: Luhui586 portForwardingList: - localPort: 6379 remotePort: 6379 remoteHost: 127.0.0.1 - localPort: 3306 remotePort: 3306 remoteHost: 127.0.0.1  
  1 +# 项目相关配置 jhlt: # 名称 name: zhonglai # 版本 version: 3.8.2 # 版权年份 copyrightYear: 2022 # 实例演示开关 demoEnabled: true # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) profile: D:/ruoyi/uploadPath # 获取ip地址开关 addressEnabled: false # 验证码类型 math 数组计算 char 字符验证 captchaType: math # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 port: 18080 servlet: # 应用的访问路径 context-path: / tomcat: # tomcat的URI编码 uri-encoding: UTF-8 # 连接数满后的排队数,默认为100 accept-count: 1000 threads: # tomcat最大线程数,默认为200 max: 800 # Tomcat启动初始化的线程数,默认值10 min-spare: 100 # 日志配置 logging: level: com.ruoyi: debug org.springframework: warn com.zhonglai.luhui: debug # Spring配置 spring: # 资源信息 messages: # 国际化资源文件路径 basename: i18n/messages profiles: active: druid # 文件上传 servlet: multipart: # 单个文件大小 max-file-size: 10MB # 设置总上传的文件大小 max-request-size: 20MB # 服务模块 devtools: restart: # 热部署开关 enabled: true # redis 配置 redis: # 地址 host: 127.0.0.1 # 端口,默认为6379 port: 6379 # 数据库索引 database: 1 # 密码 password: # 连接超时时间 timeout: 10s lettuce: pool: # 连接池中的最小空闲连接 min-idle: 0 # 连接池中的最大空闲连接 max-idle: 8 # 连接池的最大数据库连接数 max-active: 8 # #连接池最大阻塞等待时间(使用负值表示没有限制) max-wait: -1ms # token配置 token: # 令牌自定义标识 header: Authorization # 令牌密钥 secret: abcdefghijklmnopqrstuvwxyz # 令牌有效期(默认30分钟) expireTime: 1440 rediskey: lh-api # MyBatis配置 mybatis: # 搜索指定包别名 typeAliasesPackage: com.ruoyi.**.domain,com.zhonglai.**.domain # 配置mapper的扫描,找到所有的mapper.xml映射文件 mapperLocations: classpath*:mapper/**/*Mapper.xml # 加载全局的配置文件 configLocation: classpath:mybatis/mybatis-config.xml # PageHelper分页插件 pagehelper: helperDialect: mysql supportMethodsArguments: true params: count=countSql # Swagger配置 swagger: # 是否开启swagger enabled: true # 请求前缀 pathMapping: /dev-api # 防止XSS攻击 xss: # 过滤开关 enabled: true # 排除链接(多个用逗号分隔) excludes: /system/notice # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/* mqtt: client: device_life: 180 sys: ## // 对于登录login 注册register 验证码captchaImage 允许匿名访问 antMatchers: /login/ApiLogin/*,/content/**,/test/**,/fish/FishPriceCollection/*,/iot/IotTerminal/listByDeviceId/* # NameServer地址 rocketmq: name-server: 8.129.224.117:9876 # 默认的消息组 producer: group: deviceCommand send-message-timeout: 30000 send-topic: lh-mqtt-service-deviceCommand-test send-tags: 1 ssh: isEnabled: true host: 119.23.218.181 port: 22 user: root password: Luhui586 portForwardingList: - localPort: 6379 remotePort: 6379 remoteHost: 127.0.0.1 - localPort: 3306 remotePort: 3306 remoteHost: 127.0.0.1
@@ -59,6 +59,11 @@ @@ -59,6 +59,11 @@
59 <groupId>com.zhonglai.luhui</groupId> 59 <groupId>com.zhonglai.luhui</groupId>
60 <artifactId>lh-common-firewall</artifactId> 60 <artifactId>lh-common-firewall</artifactId>
61 </dependency> 61 </dependency>
  62 +
  63 + <dependency>
  64 + <groupId>com.zhonglai.luhui</groupId>
  65 + <artifactId>lh-user</artifactId>
  66 + </dependency>
62 </dependencies> 67 </dependencies>
63 68
64 <build> 69 <build>
  1 +package com.zhonglai.luhui.login.controller.v2;
  2 +
  3 +import com.ruoyi.common.core.domain.AjaxResult;
  4 +import com.zhonglai.luhui.action.BaseController;
  5 +import com.zhonglai.luhui.dao.service.PublicService;
  6 +import com.zhonglai.luhui.login.service.LoginService;
  7 +import io.swagger.annotations.Api;
  8 +import io.swagger.annotations.ApiOperation;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.web.bind.annotation.*;
  11 +
  12 +import java.util.List;
  13 +import java.util.Map;
  14 +
  15 +@Api(tags = "api登陆V2")
  16 +@RestController
  17 +@RequestMapping("/v2/apiLogin")
  18 +public class ApiLoginV2Controller extends BaseController {
  19 +
  20 + @Autowired
  21 + private PublicService publicService;
  22 +
  23 + @Autowired
  24 + private LoginService loginService;
  25 +
  26 +
  27 + @ApiOperation("用户转移")
  28 + @PostMapping("/userTransfer")
  29 + public AjaxResult userTransfer()
  30 + {
  31 + List<Map<String,Object>> list =loginService.getRuningFishUserList();
  32 + for (Map<String,Object> runingFishuser : list)
  33 + {
  34 + List<Map<String,Object>> yu2leUserList = publicService.getObjectListBySQL("SELECT * FROM `liu_yu_le`.`user_info` where login_name='"+runingFishuser.get("login_name")+"'");
  35 + if (null == yu2leUserList || yu2leUserList.size() == 0)
  36 + {
  37 + publicService.updateBySql("INSERT INTO liu_yu_le.user_info(" +
  38 + "login_name,name,gender,phone,last_login_time,last_login_ip,create_time,last_address," +
  39 + "nickname,province_id,city_id,county_id,province_name,city_name,county_name,address" +
  40 + ") VALUES (" +
  41 + "'" + runingFishuser.get("login_name") + "'," +
  42 + "'" + runingFishuser.get("name") + "'," +
  43 + "'" + runingFishuser.get("gender") + "'," +
  44 + "'" + runingFishuser.get("phone") + "'," +
  45 + (runingFishuser.get("last_login_time") == null ? "NULL" : "'" + runingFishuser.get("last_login_time") + "'") + "," +
  46 + (runingFishuser.get("last_login_ip") == null ? "NULL" : "'" + runingFishuser.get("last_login_ip") + "'") + "," +
  47 + "'" + runingFishuser.get("create_time") + "'," +
  48 + (runingFishuser.get("last_address") == null ? "NULL" : "'" + runingFishuser.get("last_address") + "'") + "," +
  49 + (runingFishuser.get("nickname") == null ? "NULL" : "'" + runingFishuser.get("nickname") + "'") + "," +
  50 + (runingFishuser.get("province_id") == null ? "NULL" : "'" + runingFishuser.get("province_id") + "'") + "," +
  51 + (runingFishuser.get("city_id") == null ? "NULL" : "'" + runingFishuser.get("city_id") + "'") + "," +
  52 + (runingFishuser.get("county_id") == null ? "NULL" : "'" + runingFishuser.get("county_id") + "'") + "," +
  53 + (runingFishuser.get("province_name") == null ? "NULL" : "'" + runingFishuser.get("province_name") + "'") + "," +
  54 + (runingFishuser.get("city_name") == null ? "NULL" : "'" + runingFishuser.get("city_name") + "'") + "," +
  55 + (runingFishuser.get("county_name") == null ? "NULL" : "'" + runingFishuser.get("county_name") + "'") + "," +
  56 + (runingFishuser.get("address") == null ? "NULL" : "'" + runingFishuser.get("address") + "'") +
  57 + ")");
  58 +
  59 +
  60 + yu2leUserList = publicService.getObjectListBySQL("SELECT * FROM `liu_yu_le`.`user_info` where login_name='"+runingFishuser.get("login_name")+"'");
  61 + Map<String,Object> runingFishUserLoginMap =loginService.getRuningFishUserLogin((Integer) runingFishuser.get("id"));
  62 + try
  63 + {
  64 + publicService.updateBySql("INSERT INTO `liu_yu_le`.user_login(" +
  65 + "`user_id`,`login_name`,`login_pass`,`user_login_pass_key`) VALUES ("+
  66 + "'"+yu2leUserList.get(0).get("id")+"'," +
  67 + "'"+runingFishUserLoginMap.get("login_name")+"'," +
  68 + "'"+runingFishUserLoginMap.get("login_pass")+"'," +
  69 + "'"+runingFishUserLoginMap.get("user_login_pass_key")+"'" +
  70 + ")");
  71 + }
  72 + catch (Exception e)
  73 + {
  74 + logger.error("更新异常",e);
  75 + }
  76 +
  77 +
  78 + }
  79 + Map<String,Object> yu2leUser = yu2leUserList.get(0);
  80 + if(!(runingFishuser.get("id").toString()).equals(yu2leUser.get("id")+""))
  81 + {
  82 + //查看是否有相同用户id的用户存在
  83 + Map<String,Object> sameRuningFishUser = loginService.getRuningFishUser((Integer) yu2leUser.get("id"));
  84 + if (null != sameRuningFishUser) //如果有就先把旧用户id的runing_fish_user_id改为新的
  85 + {
  86 + loginService.updateRuningFishUserId("500"+yu2leUser.get("id"),yu2leUser.get("id")+"");
  87 + }
  88 +
  89 + loginService.updateRuningFishUserId(yu2leUser.get("id")+"",runingFishuser.get("id")+"");
  90 + }
  91 + }
  92 + return success();
  93 + }
  94 +
  95 +}
  1 +package com.zhonglai.luhui.login.model;
  2 +
  3 +public enum UserLoginCode {
  4 + USER_NOT_EXIST("用户不存在"),
  5 + USER_PASSWORD_ERROR("用户密码错误"),
  6 + USER_NOT_ACTIVE("用户未激活"),
  7 + USER_NOT_LOGIN("用户未登录"),
  8 + USER_NOT_LOGOUT("用户未登出"),
  9 + //用户失效
  10 + USER_INVALID("用户失效"),
  11 + //token失效
  12 + TOKEN_INVALID("token失效"),
  13 + //token超时
  14 + TOKEN_TIMEOUT("token超时"),
  15 + //token错误
  16 + TOKEN_ERROR("token错误");
  17 +
  18 + private String message;
  19 + UserLoginCode(String message) {
  20 + this.message = message;
  21 + }
  22 +
  23 + public String getMessage() {
  24 + return message;
  25 + }
  26 +}
@@ -11,6 +11,8 @@ import com.ruoyi.common.utils.spring.SpringUtils; @@ -11,6 +11,8 @@ import com.ruoyi.common.utils.spring.SpringUtils;
11 import com.ruoyi.system.domain.entity.SysUser; 11 import com.ruoyi.system.domain.entity.SysUser;
12 import com.ruoyi.common.tool.SysLogininforType; 12 import com.ruoyi.common.tool.SysLogininforType;
13 import com.zhonglai.luhui.dao.service.PublicService; 13 import com.zhonglai.luhui.dao.service.PublicService;
  14 +import com.zhonglai.luhui.datasource.enums.DataSource;
  15 +import com.zhonglai.luhui.datasource.enums.DataSourceType;
14 import com.zhonglai.luhui.redis.service.RedisCache; 16 import com.zhonglai.luhui.redis.service.RedisCache;
15 import com.zhonglai.luhui.security.config.DefaultSecurityConfig; 17 import com.zhonglai.luhui.security.config.DefaultSecurityConfig;
16 import com.zhonglai.luhui.security.dto.*; 18 import com.zhonglai.luhui.security.dto.*;
@@ -24,6 +26,9 @@ import org.springframework.security.authentication.UsernamePasswordAuthenticatio @@ -24,6 +26,9 @@ import org.springframework.security.authentication.UsernamePasswordAuthenticatio
24 import org.springframework.security.core.Authentication; 26 import org.springframework.security.core.Authentication;
25 import org.springframework.stereotype.Service; 27 import org.springframework.stereotype.Service;
26 28
  29 +import java.util.List;
  30 +import java.util.Map;
  31 +
27 /** 32 /**
28 * 登陆业务 33 * 登陆业务
29 */ 34 */
@@ -175,4 +180,55 @@ public class LoginService { @@ -175,4 +180,55 @@ public class LoginService {
175 } 180 }
176 return authentication; 181 return authentication;
177 } 182 }
  183 +
  184 +
  185 + @DataSource(DataSourceType.SLAVE)
  186 + public List<Map<String,Object>> getRuningFishUserList()
  187 + {
  188 + return publicService.getObjectListBySQL("SELECT * FROM `user_info`");
  189 + }
  190 +
  191 + @DataSource(DataSourceType.SLAVE)
  192 + public Map<String,Object> getRuningFishUserLogin(Integer userId)
  193 + {
  194 + List<Map<String,Object>> list = publicService.getObjectListBySQL("SELECT * FROM `user_login` where user_id="+userId);
  195 + if(null == list || list.size() == 0)
  196 + {
  197 + return null;
  198 + }
  199 + return list.get(0);
  200 + }
  201 +
  202 + @DataSource(DataSourceType.SLAVE)
  203 + public Map<String,Object> getRuningFishUser(Integer userId)
  204 + {
  205 + List<Map<String,Object>> list = publicService.getObjectListBySQL("SELECT * FROM `user_info` where id="+userId);
  206 + if(null == list || list.size() == 0)
  207 + {
  208 + return null;
  209 + }
  210 + return list.get(0);
  211 + }
  212 +
  213 + @DataSource(DataSourceType.SLAVE)
  214 + public void updateRuningFishUserId(String yu2leUserId,String runingFishUserId)
  215 + {
  216 + publicService.updateBySql("update device_info set user_id="+yu2leUserId+" where user_id="+runingFishUserId);
  217 + publicService.updateBySql("update device_parameter_config set user_id="+yu2leUserId+" where user_id="+runingFishUserId);
  218 + publicService.updateBySql("update device_timer set user_id="+yu2leUserId+" where user_id="+runingFishUserId);
  219 + publicService.updateBySql("update farming_daily set user_id="+yu2leUserId+" where user_id="+runingFishUserId);
  220 + publicService.updateBySql("update farming_disease_report set user_id="+yu2leUserId+" where user_id="+runingFishUserId);
  221 + publicService.updateBySql("update farming_harvest set user_id="+yu2leUserId+" where user_id="+runingFishUserId);
  222 + publicService.updateBySql("update farming_medication set user_id="+yu2leUserId+" where user_id="+runingFishUserId);
  223 + publicService.updateBySql("update farming_water set user_id="+yu2leUserId+" where user_id="+runingFishUserId);
  224 + publicService.updateBySql("update runingfish_base set user_id="+yu2leUserId+" where user_id="+runingFishUserId);
  225 + publicService.updateBySql("update runingfish_pond set user_id="+yu2leUserId+" where user_id="+runingFishUserId);
  226 + publicService.updateBySql("update runingfish_sink set user_id="+yu2leUserId+" where user_id="+runingFishUserId);
  227 + publicService.updateBySql("update sink_maintain_info set user_id="+yu2leUserId+" where user_id="+runingFishUserId);
  228 + publicService.updateBySql("update sys_file_upload set user_id="+yu2leUserId+" where user_id="+runingFishUserId);
  229 + publicService.updateBySql("update user_camera_device set user_id="+yu2leUserId+" where user_id="+runingFishUserId);
  230 + publicService.updateBySql("update user_camera_recharge set user_id="+yu2leUserId+" where user_id="+runingFishUserId);
  231 + publicService.updateBySql("update user_login set user_id="+yu2leUserId+" where user_id="+runingFishUserId);
  232 + publicService.updateBySql("update user_info set id="+yu2leUserId+" where id="+runingFishUserId);
  233 + }
178 } 234 }
  1 +package com.zhonglai.luhui.login.util;
  2 +
  3 +import io.jsonwebtoken.*;
  4 +import io.jsonwebtoken.SignatureException;
  5 +
  6 +import java.io.IOException;
  7 +import java.nio.file.Files;
  8 +import java.nio.file.Paths;
  9 +import java.security.*;
  10 +import java.security.spec.*;
  11 +import java.util.Date;
  12 +import java.util.HashMap;
  13 +import java.util.Map;
  14 +import java.util.function.Function;
  15 +
  16 +/**
  17 + * JJWT 0.9.1 工具类
  18 + * 功能:生成 token、解析 token、校验 token
  19 + *
  20 + * 说明:
  21 + * - SECRET 应妥善保管,不要硬编码到源码(可从配置文件/env读取)
  22 + * - expirationSeconds 单位为秒
  23 + */
  24 +public class JwtUtils {
  25 +
  26 + private static final String PRIVATE_KEY_PATH = "keys/rsa_private_key.pem";
  27 + private static final String PUBLIC_KEY_PATH = "keys/rsa_public_key.pem";
  28 +
  29 + // Token 有效期:24 小时
  30 + private static final long EXPIRATION_SECONDS = 60 * 60 * 24;
  31 +
  32 + private static PrivateKey privateKey;
  33 + private static PublicKey publicKey;
  34 +
  35 + static {
  36 + try {
  37 + privateKey = loadPrivateKey(PRIVATE_KEY_PATH);
  38 + publicKey = loadPublicKey(PUBLIC_KEY_PATH);
  39 + } catch (Exception e) {
  40 + throw new RuntimeException("加载 RSA 公私钥失败", e);
  41 + }
  42 + }
  43 +
  44 + // -------------------- 生成 Token --------------------
  45 +
  46 + public static String generateToken(Map<String, Object> claims, String subject) {
  47 +
  48 + return generateToken(claims,subject,EXPIRATION_SECONDS);
  49 + }
  50 +
  51 + public static String generateToken(Map<String, Object> claims, String subject,long EXPIRATION_SECONDS) {
  52 + Date now = new Date();
  53 + Date expiryDate = new Date(now.getTime() + EXPIRATION_SECONDS * 1000L);
  54 +
  55 + return Jwts.builder()
  56 + .setClaims(claims)
  57 + .setSubject(subject)
  58 + .setIssuedAt(now)
  59 + .setExpiration(expiryDate)
  60 + .signWith(SignatureAlgorithm.RS256, privateKey)
  61 + .compact();
  62 + }
  63 +
  64 + public static String generateToken(String subject) {
  65 + return generateToken(null, subject);
  66 + }
  67 +
  68 + // -------------------- 解析 Token --------------------
  69 +
  70 + private static Claims getAllClaimsFromToken(String token) throws JwtException {
  71 + return Jwts.parser()
  72 + .setSigningKey(publicKey)
  73 + .parseClaimsJws(token)
  74 + .getBody();
  75 + }
  76 +
  77 + public static <T> T getClaimFromToken(String token, Function<Claims, T> claimsResolver) {
  78 + Claims claims = getAllClaimsFromToken(token);
  79 + return claimsResolver.apply(claims);
  80 + }
  81 +
  82 + public static String getSubjectFromToken(String token) {
  83 + try {
  84 + return getClaimFromToken(token, Claims::getSubject);
  85 + } catch (ExpiredJwtException e) {
  86 + return e.getClaims().getSubject();
  87 + } catch (JwtException e) {
  88 + return null;
  89 + }
  90 + }
  91 +
  92 + public static Object getCustomClaim(String token, String key) {
  93 + try {
  94 + Claims claims = getAllClaimsFromToken(token);
  95 + return claims.get(key);
  96 + } catch (JwtException e) {
  97 + return null;
  98 + }
  99 + }
  100 +
  101 + // -------------------- 验证 Token --------------------
  102 +
  103 + public static boolean isTokenExpired(String token) {
  104 + try {
  105 + Date expiration = getClaimFromToken(token, Claims::getExpiration);
  106 + return expiration.before(new Date());
  107 + } catch (ExpiredJwtException e) {
  108 + return true;
  109 + } catch (JwtException e) {
  110 + return true;
  111 + }
  112 + }
  113 +
  114 + public static boolean validateToken(String token, String expectedSubject) {
  115 + try {
  116 + Claims claims = getAllClaimsFromToken(token);
  117 + String subject = claims.getSubject();
  118 + Date expiration = claims.getExpiration();
  119 + return subject.equals(expectedSubject) && expiration.after(new Date());
  120 + } catch (SignatureException e) {
  121 + System.err.println("签名验证失败: " + e.getMessage());
  122 + return false;
  123 + } catch (JwtException e) {
  124 + return false;
  125 + }
  126 + }
  127 +
  128 + public static boolean validateTokenSignatureAndExpiry(String token) {
  129 + try {
  130 + Claims claims = getAllClaimsFromToken(token);
  131 + return claims.getExpiration().after(new Date());
  132 + } catch (JwtException e) {
  133 + return false;
  134 + }
  135 + }
  136 +
  137 + // -------------------- 其他方法 --------------------
  138 +
  139 + public static String getUserIdFromToken(String token) {
  140 + Object userId = getCustomClaim(token, "userId");
  141 + return userId != null ? userId.toString() : null;
  142 + }
  143 +
  144 + public static String refreshToken(String token) {
  145 + try {
  146 + Claims claims = getAllClaimsFromToken(token);
  147 + return generateToken(claims, claims.getSubject());
  148 + } catch (JwtException e) {
  149 + return null;
  150 + }
  151 + }
  152 +
  153 + // -------------------- RSA 密钥加载 --------------------
  154 +
  155 + private static PrivateKey loadPrivateKey(String filePath) throws IOException, GeneralSecurityException {
  156 + String key = new String(Files.readAllBytes(Paths.get(filePath)))
  157 + .replaceAll("-----BEGIN (.*)-----", "")
  158 + .replaceAll("-----END (.*)----", "")
  159 + .replaceAll("\\s+", "");
  160 + byte[] keyBytes = java.util.Base64.getDecoder().decode(key);
  161 + PKCS8EncodedKeySpec spec = new PKCS8EncodedKeySpec(keyBytes);
  162 + KeyFactory kf = KeyFactory.getInstance("RSA");
  163 + return kf.generatePrivate(spec);
  164 + }
  165 +
  166 + private static PublicKey loadPublicKey(String filePath) throws IOException, GeneralSecurityException {
  167 + String key = new String(Files.readAllBytes(Paths.get(filePath)))
  168 + .replaceAll("-----BEGIN (.*)-----", "")
  169 + .replaceAll("-----END (.*)----", "")
  170 + .replaceAll("\\s+", "");
  171 + byte[] keyBytes = java.util.Base64.getDecoder().decode(key);
  172 + X509EncodedKeySpec spec = new X509EncodedKeySpec(keyBytes);
  173 + KeyFactory kf = KeyFactory.getInstance("RSA");
  174 + return kf.generatePublic(spec);
  175 + }
  176 +
  177 + public static void main(String[] args) {
  178 + Map<String, Object> claims = new HashMap<>();
  179 + claims.put("userId", 1001);
  180 + claims.put("role", "admin");
  181 +
  182 + String token = generateToken(null, "alice");
  183 + System.out.println("Token: " + token);
  184 +
  185 + String subject = getSubjectFromToken(token);
  186 + System.out.println("Subject: " + subject);
  187 +
  188 + String role = (String) getCustomClaim(token, "role");
  189 + System.out.println("Role: " + role);
  190 +
  191 + boolean valid = validateToken(token, "alice");
  192 + System.out.println("Token 有效: " + valid);
  193 + }
  194 +}
@@ -12,10 +12,10 @@ spring: @@ -12,10 +12,10 @@ spring:
12 # 从库数据源 12 # 从库数据源
13 slave: 13 slave:
14 # 从数据源开关/默认关闭 14 # 从数据源开关/默认关闭
15 - enabled: false  
16 - url:  
17 - username:  
18 - password: 15 + enabled: true
  16 + url: jdbc:mysql://rm-wz9446bn79p0r80ew0o.mysql.rds.aliyuncs.com:3306/runing_fish?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
  17 + username: luhui
  18 + password: Luhui586
19 # 初始连接数 19 # 初始连接数
20 initialSize: 5 20 initialSize: 5
21 # 最小连接池数量 21 # 最小连接池数量
1 -# 项目相关配置 jhlt: # 名称 name: zhonglai # 版本 version: 3.8.2 # 版权年份 copyrightYear: 2022 # 实例演示开关 demoEnabled: true # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) profile: D:/ruoyi/uploadPath # 获取ip地址开关 addressEnabled: false # 验证码类型 math 数组计算 char 字符验证 captchaType: math # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 port: 8061 servlet: # 应用的访问路径 context-path: / tomcat: # tomcat的URI编码 uri-encoding: UTF-8 # 连接数满后的排队数,默认为100 accept-count: 1000 threads: # tomcat最大线程数,默认为200 max: 800 # Tomcat启动初始化的线程数,默认值10 min-spare: 100 # 日志配置 logging: level: com.ruoyi: debug org.springframework: warn # Spring配置 spring: # 资源信息 messages: # 国际化资源文件路径 basename: i18n/messages profiles: active: druid # 文件上传 servlet: multipart: # 单个文件大小 max-file-size: 10MB # 设置总上传的文件大小 max-request-size: 20MB # 服务模块 devtools: restart: # 热部署开关 enabled: true # redis 配置 redis: # 地址 host: 47.112.163.61 # 端口,默认为6379 port: 9527 # 数据库索引 database: 1 # 密码 password: Luhui586 # 连接超时时间 timeout: 10s lettuce: pool: # 连接池中的最小空闲连接 min-idle: 0 # 连接池中的最大空闲连接 max-idle: 8 # 连接池的最大数据库连接数 max-active: 8 # #连接池最大阻塞等待时间(使用负值表示没有限制) max-wait: -1ms # token配置 token: # 令牌自定义标识 header: Authorization # 令牌密钥 secret: abcdefghijklmnopqrstuvwxyz # 令牌有效期(默认30分钟) expireTime: 1440 rediskey: lh-admin # MyBatis配置 mybatis: # 搜索指定包别名 typeAliasesPackage: com.ruoyi.**.domain, # 配置mapper的扫描,找到所有的mapper.xml映射文件 mapperLocations: classpath*:mapper/**/*Mapper.xml # 加载全局的配置文件 configLocation: classpath:mybatis/mybatis-config.xml # PageHelper分页插件 pagehelper: helperDialect: mysql supportMethodsArguments: true params: count=countSql # Swagger配置 swagger: # 是否开启swagger enabled: true # 请求前缀 pathMapping: /dev-api # 防止XSS攻击 xss: # 过滤开关 enabled: true # 排除链接(多个用逗号分隔) excludes: /system/notice # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/* mqtt: client: device_life: 180 sys: ## // 对于登录login 注册register 验证码captchaImage 允许匿名访问 antMatchers: /** # NameServer地址 rocketmq: name-server: 47.115.144.179:9876 # 默认的消息组 producer: group: deviceCommand send-message-timeout: 30000 send-topic: lh-mqtt-service-deviceCommand-test send-tags: 1  
  1 +# 项目相关配置
  2 +jhlt:
  3 + # 名称
  4 + name: zhonglai
  5 + # 版本
  6 + version: 3.8.2
  7 + # 版权年份
  8 + copyrightYear: 2022
  9 + # 实例演示开关
  10 + demoEnabled: true
  11 + # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
  12 + profile: D:/ruoyi/uploadPath
  13 + # 获取ip地址开关
  14 + addressEnabled: false
  15 + # 验证码类型 math 数组计算 char 字符验证
  16 + captchaType: math
  17 +
  18 +# 开发环境配置
  19 +server:
  20 + # 服务器的HTTP端口,默认为8080
  21 + port: 8061
  22 + servlet:
  23 + # 应用的访问路径
  24 + context-path: /
  25 + tomcat:
  26 + # tomcat的URI编码
  27 + uri-encoding: UTF-8
  28 + # 连接数满后的排队数,默认为100
  29 + accept-count: 1000
  30 + threads:
  31 + # tomcat最大线程数,默认为200
  32 + max: 800
  33 + # Tomcat启动初始化的线程数,默认值10
  34 + min-spare: 100
  35 +
  36 +# 日志配置
  37 +logging:
  38 + level:
  39 + com.ruoyi: debug
  40 + com.zhonglai.luhui: debug
  41 + org.springframework: warn
  42 +
  43 +# Spring配置
  44 +spring:
  45 + # 资源信息
  46 + messages:
  47 + # 国际化资源文件路径
  48 + basename: i18n/messages
  49 + profiles:
  50 + active: druid
  51 + # 文件上传
  52 + servlet:
  53 + multipart:
  54 + # 单个文件大小
  55 + max-file-size: 10MB
  56 + # 设置总上传的文件大小
  57 + max-request-size: 20MB
  58 + # 服务模块
  59 + devtools:
  60 + restart:
  61 + # 热部署开关
  62 + enabled: true
  63 + # redis 配置
  64 + redis:
  65 + # 地址
  66 + host: 47.112.163.61
  67 + # 端口,默认为6379
  68 + port: 9527
  69 + # 数据库索引
  70 + database: 1
  71 + # 密码
  72 + password: Luhui586
  73 + # 连接超时时间
  74 + timeout: 10s
  75 + lettuce:
  76 + pool:
  77 + # 连接池中的最小空闲连接
  78 + min-idle: 0
  79 + # 连接池中的最大空闲连接
  80 + max-idle: 8
  81 + # 连接池的最大数据库连接数
  82 + max-active: 8
  83 + # #连接池最大阻塞等待时间(使用负值表示没有限制)
  84 + max-wait: -1ms
  85 +
  86 +# token配置
  87 +token:
  88 + # 令牌自定义标识
  89 + header: Authorization
  90 + # 令牌密钥
  91 + secret: abcdefghijklmnopqrstuvwxyz
  92 + # 令牌有效期(默认30分钟)
  93 + expireTime: 1440
  94 + rediskey: lh-admin
  95 +
  96 +
  97 +# MyBatis配置
  98 +mybatis:
  99 + # 搜索指定包别名
  100 + typeAliasesPackage: com.ruoyi.**.domain,com.zhonglai.luhui.**.domain
  101 + # 配置mapper的扫描,找到所有的mapper.xml映射文件
  102 + mapperLocations: classpath*:mapper/**/*Mapper.xml
  103 + # 加载全局的配置文件
  104 + configLocation: classpath:mybatis/mybatis-config.xml
  105 +
  106 +# PageHelper分页插件
  107 +pagehelper:
  108 + helperDialect: mysql
  109 + supportMethodsArguments: true
  110 + params: count=countSql
  111 +
  112 +# Swagger配置
  113 +swagger:
  114 + # 是否开启swagger
  115 + enabled: true
  116 + # 请求前缀
  117 + pathMapping: /dev-api
  118 +
  119 +# 防止XSS攻击
  120 +xss:
  121 + # 过滤开关
  122 + enabled: true
  123 + # 排除链接(多个用逗号分隔)
  124 + excludes: /system/notice
  125 + # 匹配链接
  126 + urlPatterns: /system/*,/monitor/*,/tool/*
  127 +
  128 +mqtt:
  129 + client:
  130 + device_life: 180
  131 +
  132 +sys:
  133 + ## // 对于登录login 注册register 验证码captchaImage 允许匿名访问
  134 + antMatchers: /**
  135 +
  136 +# NameServer地址
  137 +rocketmq:
  138 + name-server: 47.115.144.179:9876
  139 + # 默认的消息组
  140 + producer:
  141 + group: deviceCommand
  142 + send-message-timeout: 30000
  143 + send-topic: lh-mqtt-service-deviceCommand-test
  144 + send-tags: 1
  145 +
  146 +ssh:
  147 + isEnabled: true
  148 + host: 47.112.163.61
  149 + port: 22
  150 + user: root
  151 + password: Luhui586
  152 + portForwardingList:
  153 + - localPort: 3306
  154 + remotePort: 3306
  155 + remoteHost: rm-wz9446bn79p0r80ew.mysql.rds.aliyuncs.com