1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
package com.yeshi.fanli.service.inter.user;
 
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
 
import org.springframework.web.multipart.MultipartFile;
 
import com.yeshi.fanli.entity.bus.user.InviteUser;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.exception.user.UserInfoException;
import com.yeshi.fanli.vo.user.UserInfoVO;
 
public interface UserInfoService {
    /**
     * 通过openid和loginType,获取用户
     * 
     * @param loginType
     *            1:阿里系列(淘宝)账户
     * @param openid
     *            :登录淘宝后得到的openid
     * @param appid
     * @return 用户,如果不存在返回null
     */
    public UserInfo getUserByLoginTypeAndOpenId(int loginType, String openid, String appid);
 
    /**
     * 添加用户
     * 
     * @param form
     *            用户信息
     * @return 用户,添加失败返回null
     */
    public UserInfo addUser(UserInfo form, String appid);
 
    /**
     * 通过用户id获取用户
     * 
     * @param uid
     *            用户id
     * @return 用户
     */
    public UserInfo getUserById(long uid);
 
    /**
     * Mybatis通过用户ID获取用户信息
     * 
     * @param uid
     * @return
     */
    public UserInfo getUserByIdWithMybatis(long uid);
 
    public void update(UserInfo user);
 
    public long getUserCount();
 
    public List<UserInfo> getUserList(int index, String key);
 
    public int getUserCount(String key);
 
    public Map<String, Integer> getnewUserByDate(int days, Date date);
 
    public Map<String, Integer> getnewUserByMonth(int months, Date date);
 
    public Map<String, Integer> getUserTotalByDate(int days, Date date);
 
    public Map<String, Integer> getUserTotalByMonth(int months, Date date);
 
    public List<UserInfo> getUserListByUid(long uid);
 
    public double getFreezeAssets(double min);
 
    public double getCanAssets(double min);
 
    public long getRandomShamUser();
 
    public boolean inviteWXUserInfo(String code, UserInfo inviter);
 
    public void unBindUserInfo(UserInfo find, int type);
 
    public void addMoney(UserInfo userInfo, BigDecimal money);
 
    public List<UserInfo> findFriends(long id, int type);
 
    public List<InviteUser> getFriendsList(long id, int type, int page, int pageSize);
 
    public long getFriendsListCount(long id, int type);
 
    public int findFriendsCount(long id, int type);
 
    public boolean createUser(UserInfo form, String appid);
 
    public void updateLoginInfo(UserInfo user);
 
    public void cleanPassword(long id);
 
    public BigDecimal getNewPeopleHB(Long id);
 
    /**
     * 查询用户信息 -- 用户管理列表
     * 
     * @param start
     * @param count
     * @param key
     * @param userType
     * @param days
     * @param startTime
     * @param endTime
     * @param orderMode
     * @return
     */
    public List<UserInfoVO> query(long start, int count, Integer userState, String key, Integer keyType,
            String userRank, Integer days, String startTime, String endTime, Integer orderField, Integer orderMode);
 
    public long queryCount(Integer userState, String key, Integer keyType, String userRank, Integer days,
            String startTime, String endTime);
 
    public double querySumMoney(String key, Integer userType, Integer days, String startTime, String endTime);
 
    /**
     * 选择性更新
     * 
     * @param record
     * @return
     */
    public int updateByPrimaryKeySelective(UserInfo record);
 
    /**
     * 其强制删除绑定信息
     * 
     * @param user
     * @param type
     */
    public void deleteBindInfo(UserInfo user, int type);
 
    /**
     * 根据id查询用户信息
     * 
     * @param id
     * @return
     */
    public UserInfo selectByPKey(Long id);
 
    /**
     * 超过 daysNum 天未登陆的用户
     * 
     * @param daysNum
     * @param list
     * @return
     */
    public List<Long> longTimeNoLogin(int daysNum, List<Long> list);
 
    /**
     * 根据电话号码、邀请码获取邀请用户
     * 
     * @param phone
     * @param inviteCode
     * @return
     */
    public UserInfo getInfoByPhoneOrInviteCode(String phone, String inviteCode);
 
    /**
     * 根据电话号码 获取有效用户
     * 
     * @param phone
     * @return
     */
    public UserInfo getEffectiveUserInfoByPhone(String phone);
 
    /**
     * 获取用户信息
     * 
     * @param uid
     * @return
     * @throws UserInfoException
     */
    public UserInfo getUserInfo(Long uid) throws UserInfoException;
 
    /**
     * 根据微信获取有效用户
     * 
     * @param unionId
     * @return
     */
    public UserInfo getEffectiveUserInfoByWXUnionId(String unionId);
 
    /**
     * 获取用户余额
     * 
     * @param uid
     * @return
     */
    public BigDecimal getBalance(Long uid);
 
    /**
     * 更换头像
     * 
     * @param file
     * @param uid
     * @throws UserInfoException
     * @throws IOException
     */
    public void uploadPortrait(MultipartFile file, Long uid) throws UserInfoException, IOException;
 
    /**
     * 保存头像
     * 
     * @param nickName
     * @param uid
     * @throws UserInfoException
     */
    public void saveUserInfo(String nickName, Long uid) throws UserInfoException;
 
    /**
     * 封禁用户
     * 
     * @param uid
     */
    public void forbiddenUser(Long uid,String reason);
 
}