Commit eaa6722d authored by 徐小光's avatar 徐小光

Merge branch 'feature/firstSlaveDBuse' into 'master'

swagger



See merge request !17
parents e73393dd 20f2f3a1
......@@ -45,7 +45,7 @@ public class ImageCaptchaController {
* 默认匹配 GET /captcha, 提供4位数字和字母混合图片验证码
*/
@RequestMapping(value = "/captcha")
@ApiOperation(value = "/captcha", notes = "获取图形验证码接口, 会返回一个base64的图形验证码")
@ApiOperation(value = "获取验证码", notes = "获取图形验证码接口, 会返回一个base64的图形验证码", httpMethod = "GET")
public JsonResult fetchCaptcha(HttpServletRequest request) {
String imageId = UUID.randomUUID().toString();
BufferedImage challenge = imageCaptchaService.getImageChallengeForID(Constants.IMAGE_CAPTCHA_KEY + imageId, request.getLocale());
......@@ -71,6 +71,7 @@ public class ImageCaptchaController {
*/
@CaptchaValidator
@RequestMapping("/verification_image_code")
@ApiOperation(value = "验证图形验证码", notes = "验证图形验证码", httpMethod = "POST")
public JsonResult verificationImageCode() {
return JsonResult.buildSuccessResult("", null);
}
......
......@@ -8,6 +8,7 @@ import cn.quantgroup.xyqb.service.captcha.IQuantgroupCaptchaService;
import cn.quantgroup.xyqb.util.IPUtil;
import cn.quantgroup.xyqb.util.PasswordUtil;
import cn.quantgroup.xyqb.util.ValidationUtil;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Value;
......@@ -38,6 +39,7 @@ public class NewCaptchaController {
@RequestMapping(value = "/captcha/new")
@ApiOperation(value = "获取新图形验证码", notes = "获取新图形验证码", httpMethod = "POST")
public JsonResult getCaptcha(String phoneNo, String clientType, HttpServletRequest request) {
String remoteIp = IPUtil.getRemoteIP(request);
log.info("获取验证码, phoneNo:{}, clientType:{}, ip:{}, verifyType-qg:{}", phoneNo, clientType, remoteIp, geetestClose);
......
......@@ -16,6 +16,7 @@ import cn.quantgroup.xyqb.util.ValidationUtil;
import cn.quantgroup.xyqb.util.encrypt.MD5Util;
import cn.quantgroup.xyqb.util.encrypt.RSA;
import com.google.gson.*;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.hssf.usermodel.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -65,6 +66,7 @@ public class UserQueryLogController {
private static final String PRIVATE_KEY = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJiLDU8pacJuQrLMcr5uUekpNH+q07c6rue+NJ1yikJKY4mqOLcH6okyt/TfbjaZgkhB4XdhJNBlN+uLkSQ2CiqfRj8piksAq6rz2M90iQHeW+Ku97D22l9sBPgHXhaChZ0wfmiioG3SXLd/4mOgEzl0oVM6uFySEUOhoHdQBpqJAgMBAAECgYA3DfCWwoaWEr9l0p4TFrPfZ+y3qwrQVZCsuRw6Ow2lUT3NgK8JeATw0WpNKZqYgBziQUzDjj8AK5fcHjobDJnsKGqC2VQ+j05hQZztoHTrYxOx6xrGxIzqmbt/dPsw779xXSRJu3DuUeCm6CrGZpVpPX/NtXBxIhXRY2KRNa1SZQJBAPMboc+M6/OeGPQqFvXg9jgEWcosBpy6HtukfjONQAVuM5e0pZa8SQCLhcoHgbbqcEhbDAJEqr9x9eZjjFPSt08CQQCgoe/hOVf0s5oo1IM1TVEUkGOIzVVlyTMwu0p4jwt3987D7BKZe7mCl41quWDwL4JIQ0GcivVMpJzYsDBZHRqnAkBMgCKAHHlXdSWnF+OXxg3U/NGAhDAke5EgTvgDouxFiTMlBwygjWlviXg1Zf1UoRtqOXRi9lbA3cyijirnacSTAkBmve0ug30MmOvbfcHGkANyQcBIOf2LMxu46bKCVgwh2bC4hACJhydqrgDX6GZmehy8l7gZpo+rTAa+WkMyXHk1AkEArt6ElkyNI7TDu0By59Zin05tuZJr6QoMXs9bVH+xP3OBG1KfPYTBc9yb5MOjXIxAjyGGeDpUfhuUDBe56GTOBA==";
@RequestMapping("/queryLog")
@ApiOperation(value = "给运营系统提供的查询查询记录的", notes = "给运营系统提供的查询查询记录的", httpMethod = "POST")
public JsonResult queryLog(HttpServletRequest request, @RequestParam(required = false) String beginDate, @RequestParam(required = false) String endDate, Integer pageId, Integer pageSize) {
LOGGER.info("查询日期:beginDate{},endDate{}", beginDate, endDate);
String token = request.getHeader(Constants.X_AUTH_TOKEN);
......@@ -124,6 +126,7 @@ public class UserQueryLogController {
}
@RequestMapping("/queryUserInfo")
@ApiOperation(value = "给运营系统提供的查询用户信息的接口", notes = "给运营系统提供的查询用户信息的接口", httpMethod = "POST")
public JsonResult queryForResult(HttpServletRequest request, String key, String keyValues, String columns, Integer pageId, Integer pageSize) {
LOGGER.info("查询条件:key{},columns{}", key, columns);
String token = request.getHeader(Constants.X_AUTH_TOKEN);
......@@ -331,6 +334,7 @@ public class UserQueryLogController {
}
@RequestMapping("/exportUserInfo")
@ApiOperation(value = "给运营系统提供的导出用户信息的接口", notes = "给运营系统提供的导出用户信息的接口", httpMethod = "POST")
public JsonResult exportExcel(final HttpServletResponse response, HttpServletRequest request, String key, String keyValues, String columns) {
......
......@@ -61,10 +61,9 @@ public class AppController implements IBaseController {
* @param request
* @return Token和phoneNo
*/
@IpValidator
@RequestMapping("/login")
@ApiOperation(value = "/login", notes = "App登陆")
@ApiOperation(value = "App登陆", notes = "App登陆", httpMethod = "POST")
public JsonResult login(
String phoneNo,
String idNo, String name, String key,
......@@ -76,7 +75,6 @@ public class AppController implements IBaseController {
if (!ValidationUtil.validatePhoneNo(phoneNo)) {
return JsonResult.buildErrorStateResult(USER_ERROR_OR_PASSWORD_ERROR, null);
}
// Todo -- 截止2017-12-08 13:44:00只有52次调用记录,来自222(白条),最近一次:2017-11-11 12:15:53
LOGGER.info("第三方用户登录 [AppController] login --> loginFrom:{},channelId:{},btRegisterChannelId:{} requestIp:{},idNo:{},name:{}", registerFrom, channelId, btRegisterChannelId, IPUtil.getRemoteIP(request), idNo, name);
User user = userService.findByPhoneInDb(phoneNo);
if (user == null) {
......@@ -123,6 +121,7 @@ public class AppController implements IBaseController {
@IpValidator
@RequestMapping("/login_super")
@ApiOperation(value = "免密登陆, 新手机号还自动注册", notes = "免密登陆, 新手机号还自动注册", httpMethod = "POST")
public JsonResult loginSuper(
String phoneNo,
String idNo, String name, String key,
......@@ -190,6 +189,7 @@ public class AppController implements IBaseController {
@IpValidator
@RequestMapping("/login2")
@ApiOperation(value = "免密登陆, 新手机号不自动注册", notes = "免密登陆, 新手机号不自动注册", httpMethod = "POST")
public JsonResult login2(
String phoneNo,
@RequestParam(required = false, defaultValue = "1") Long registerFrom,
......
......@@ -12,6 +12,7 @@ import cn.quantgroup.xyqb.service.user.*;
import cn.quantgroup.xyqb.util.EmojiUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
......@@ -56,6 +57,7 @@ public class UserCenterController {
*/
@PasswordFreeAccessValidator
@RequestMapping("/index")
@ApiOperation(value = "用户中心首页", notes = "用户中心首页显示头像, 昵称, 姓名", httpMethod = "POST")
public JsonResult userCenterIndex(String phoneNo) {
Long userId = queryUserId(phoneNo);
if (null == userId || userId == 0L) {
......@@ -84,6 +86,7 @@ public class UserCenterController {
* @return
*/
@RequestMapping("/save/avatar")
@ApiOperation(value = "保存头像", notes = "保存用户头像", httpMethod = "POST")
public JsonResult SaveUserAvatarAddr(String phoneNo, String avatarUrl) {
if (StringUtils.isBlank(avatarUrl) || StringUtils.isBlank(phoneNo)) {
LOGGER.error("参数不合法:avatarUrl:{}, phoneNo:{}", avatarUrl, phoneNo);
......@@ -119,6 +122,7 @@ public class UserCenterController {
* @return
*/
@RequestMapping("/queryNick")
@ApiOperation(value = "查询昵称", notes = "查询用户昵称", httpMethod = "POST")
public JsonResult queryUserNick(String phoneNo) {
if (StringUtils.isEmpty(phoneNo)) {
LOGGER.error("手机号为空,phoneNo:{}", phoneNo);
......@@ -144,6 +148,7 @@ public class UserCenterController {
* @return
*/
@RequestMapping("/saveNick")
@ApiOperation(value = "保存昵称", notes = "保存用户昵称", httpMethod = "POST")
public JsonResult saveUserNick(String phoneNo, String nick) {
if (StringUtils.isEmpty(phoneNo)) {
LOGGER.error("手机号为空,phoneNo:{}", phoneNo);
......@@ -175,6 +180,7 @@ public class UserCenterController {
* @return
*/
@RequestMapping("/query/verified")
@ApiOperation(value = "查询用户是否实名认证", notes = "查询用户是否实名认证", httpMethod = "POST")
public JsonResult queryVerified(String phoneNo) {
if (StringUtils.isEmpty(phoneNo)) {
LOGGER.error("手机号为空,phoneNo:{}", phoneNo);
......@@ -200,6 +206,7 @@ public class UserCenterController {
*/
@PasswordFreeAccessValidator
@RequestMapping("/personalData")
@ApiOperation(value = "查询个人资料信息", notes = "查询个人资料信息", httpMethod = "POST")
public JsonResult personalData(String phoneNo) {
if (StringUtils.isBlank(phoneNo)) {
LOGGER.error("手机号为空,phoneNo:{}", phoneNo);
......@@ -241,6 +248,7 @@ public class UserCenterController {
* @return
*/
@RequestMapping("/contacts/save")
@ApiOperation(value = "保存用户联系人", notes = "保存用户联系人", httpMethod = "POST")
public JsonResult saveUserContact(String phoneNo, String contactJson) {
if (StringUtils.isEmpty(phoneNo)) {
LOGGER.error("保存联系人,参数错误. phoneNo:{}", phoneNo);
......@@ -282,6 +290,7 @@ public class UserCenterController {
* @return
*/
@RequestMapping("/address/save")
@ApiOperation(value = "保存用户地址", notes = "保存用户地址", httpMethod = "POST")
public JsonResult saveUserAddress(String phoneNo, String province, Long provinceCode, String city, Long cityCode, String address,
Long districtCode, String district) {
LOGGER.info("保存用户地址信息, phoneNo:{}, province:{}, provinceCode:{}, city:{}, cityCode:{},district:{}, address:{}", phoneNo, province, provinceCode, city, cityCode, district, address);
......@@ -326,6 +335,7 @@ public class UserCenterController {
* @return
*/
@RequestMapping("/searchAddress/phoneNo")
@ApiOperation(value = "查询用户地址", notes = "查询用户地址", httpMethod = "POST")
public JsonResult searchUserAddress(String phoneNo) {
if (StringUtils.isEmpty(phoneNo)) {
return JsonResult.buildErrorStateResult(null, null);
......@@ -346,6 +356,7 @@ public class UserCenterController {
* @return
*/
@RequestMapping("/searchContacts/phoneNo")
@ApiOperation(value = "查询用户联系人", notes = "查询用户联系人", httpMethod = "POST")
public JsonResult searchUserContacts(String phoneNo) {
if (StringUtils.isEmpty(phoneNo)) {
return JsonResult.buildErrorStateResult(null, null);
......@@ -369,6 +380,7 @@ public class UserCenterController {
* @return
*/
@RequestMapping("/save/userExtInfo")
@ApiOperation(value = "保存用户经济学历等信息", notes = "保存用户经济学历等信息", httpMethod = "POST")
public JsonResult saveUserExtInfo(String phoneNo, EducationEnum educationEnum, MaritalStatus maritalStatus, IncomeRangeEnum incomeRangeEnum, OccupationEnum occupationEnum) {
if (StringUtils.isEmpty(phoneNo)) {
return JsonResult.buildErrorStateResult(null, null);
......
......@@ -78,13 +78,6 @@ public class UserController implements IBaseController {
@Autowired
private IUserRegisterService userRegisterService;
@RequestMapping("/test")
public JsonResult test() {
HttpServletRequest request = getRequest();
IPUtil.logIp(log, request);
return JsonResult.buildSuccessResult("", getCurrentUserFromRedis());
}
/**
* 登录(账号 + 密码)
* 密码错误达到限定次数时执行图形验证码校验
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment