|
|
@@ -69,8 +69,8 @@ public class AppUserController extends CertifyApiController {
|
|
|
private UserService userServiceImpl;
|
|
|
@Resource
|
|
|
private MessageService messageService;
|
|
|
- @Resource
|
|
|
- private EasemobUtils easemobUtils;
|
|
|
+// @Resource
|
|
|
+// private EasemobUtils easemobUtils;
|
|
|
@Resource
|
|
|
private BannersService bannersService;
|
|
|
@Resource
|
|
|
@@ -82,7 +82,7 @@ public class AppUserController extends CertifyApiController {
|
|
|
@Resource
|
|
|
private UserCareerService userCareerService;
|
|
|
@Resource
|
|
|
- private UserInterestService userInterestService;
|
|
|
+ private UserInterestService userInterestService;
|
|
|
@Resource
|
|
|
private UserIdentityService userIdentityService;
|
|
|
@Resource
|
|
|
@@ -97,7 +97,7 @@ public class AppUserController extends CertifyApiController {
|
|
|
private UserService userService;
|
|
|
@Resource(name = "passwordUtil")
|
|
|
private PasswordUtil passwordUtil;
|
|
|
-
|
|
|
+
|
|
|
@RequestMapping(value = "/uploadImg",method = RequestMethod.POST)
|
|
|
public Result uploadAvatar(HttpServletRequest req){
|
|
|
Result res = new Result();
|
|
|
@@ -117,8 +117,8 @@ public class AppUserController extends CertifyApiController {
|
|
|
Result res = new Result();
|
|
|
if(u!=null&&StringUtils.isNotEmpty(u.getMobile())){
|
|
|
//验证手机号码格式是否正确
|
|
|
- Pattern p = Pattern.compile("^(1[1-9][0-9])\\d{8}$"); // 验证手机号
|
|
|
- Matcher m = p.matcher(u.getMobile());
|
|
|
+ Pattern p = Pattern.compile("^(1[1-9][0-9])\\d{8}$"); // 验证手机号
|
|
|
+ Matcher m = p.matcher(u.getMobile());
|
|
|
if(!m.matches()){
|
|
|
res.getError().add(buildError("电话号码格式不对","电话号码格式不对"));
|
|
|
}else{
|
|
|
@@ -133,28 +133,28 @@ public class AppUserController extends CertifyApiController {
|
|
|
userServiceImpl.updateByPrimaryKeySelective(u);
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@RequestMapping(value = "/logout",method = RequestMethod.GET)
|
|
|
public Result logout(HttpServletRequest request){
|
|
|
Result res = new Result();
|
|
|
TokenManager.logout();
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@RequestMapping(value = "/userInfo",method = RequestMethod.GET)
|
|
|
public Result userInfo(HttpServletRequest request){
|
|
|
Result res = new Result();
|
|
|
res.setData(userServiceImpl.selectBaseInfo());
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
|
|
public Result index(){
|
|
|
Result res = new Result();
|
|
|
res.setData(messageService.selectMessageWithGroup());
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@RequestMapping(value = "/listMessage", method = RequestMethod.POST)
|
|
|
public Result listMessage(Integer subject,Integer sourceType,Integer pageNo,Integer pageSize){
|
|
|
Result res = new Result();
|
|
|
@@ -164,7 +164,7 @@ public class AppUserController extends CertifyApiController {
|
|
|
}*/
|
|
|
User u = TokenManager.getUserToken();
|
|
|
if(u != null){
|
|
|
- List<MessageBo> boList = messageService.selectSyncMessage(u.getId());
|
|
|
+ List<MessageBo> boList = messageService.selectSyncMessage(u.getId());
|
|
|
if(boList != null && boList.size()>0){
|
|
|
List<MessageProducer> producers = new ArrayList<MessageProducer>();
|
|
|
List<MessageConsumer> consumers = new ArrayList<MessageConsumer>();
|
|
|
@@ -190,14 +190,13 @@ public class AppUserController extends CertifyApiController {
|
|
|
res.setData(messageService.listPersonalMessage(subject,sourceType,pageNo,pageSize));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 同步绑定账号
|
|
|
* @param uuid
|
|
|
* @param registrationId
|
|
|
- * @param userName
|
|
|
*/
|
|
|
@RequestMapping(value = "/synBindingAccount",method = RequestMethod.POST)
|
|
|
private Result synBindingAccount(String uuid,String registrationId,String easemobName,String easemobPass){
|
|
|
@@ -206,12 +205,12 @@ public class AppUserController extends CertifyApiController {
|
|
|
messageService.updateJpushEasemobAccount(uuid, registrationId, easemobName,easemobPass);
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/*
|
|
|
* 更新极光推送
|
|
|
- *
|
|
|
+ *
|
|
|
* */
|
|
|
-
|
|
|
+
|
|
|
@RequestMapping(value = "/updateJpushAccount",method = RequestMethod.POST)
|
|
|
private Result updateJpush(String uuid,String registrationId,String easemobName,String easemobPass,String uid){
|
|
|
Result res = new Result();
|
|
|
@@ -223,12 +222,12 @@ public class AppUserController extends CertifyApiController {
|
|
|
messageService.updateJpushEasemobAccount(uuid, registrationId, easemobName,easemobPass);
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 读取消息
|
|
|
* @param messageId
|
|
|
- * @throws IllegalAccessException
|
|
|
- * @throws InvocationTargetException
|
|
|
+ * @throws IllegalAccessException
|
|
|
+ * @throws InvocationTargetException
|
|
|
*/
|
|
|
@RequestMapping(value = "/readMessage",method = RequestMethod.GET)
|
|
|
private Result readMessage(String messageId){
|
|
|
@@ -255,8 +254,8 @@ public class AppUserController extends CertifyApiController {
|
|
|
/**
|
|
|
* 读取推送消息
|
|
|
* @param messageId
|
|
|
- * @throws IllegalAccessException
|
|
|
- * @throws InvocationTargetException
|
|
|
+ * @throws IllegalAccessException
|
|
|
+ * @throws InvocationTargetException
|
|
|
*/
|
|
|
@RequestMapping(value = "/readJpushMessage",method = RequestMethod.GET)
|
|
|
private Result readJpushMessage(String messageId){
|
|
|
@@ -280,8 +279,8 @@ public class AppUserController extends CertifyApiController {
|
|
|
res.setData(jsonObject);
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 关注功能
|
|
|
*/
|
|
|
@@ -301,11 +300,11 @@ public class AppUserController extends CertifyApiController {
|
|
|
}else {
|
|
|
res.setData(achievementInterestService.deleteInterest( uid, type, objectId,interest));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -350,7 +349,7 @@ public class AppUserController extends CertifyApiController {
|
|
|
res.setData(demandService.selectinterest(type, pNo, pSize));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 成果详情
|
|
|
* @param id
|
|
|
@@ -379,7 +378,7 @@ public class AppUserController extends CertifyApiController {
|
|
|
res.setData(demandService.selectAppDemandDetail( id));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 新增成果
|
|
|
*/
|
|
|
@@ -404,7 +403,7 @@ public class AppUserController extends CertifyApiController {
|
|
|
AchievementFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
res = disposeInputAchievement(res, ia, keywords);
|
|
|
if (!res.getError().isEmpty()) {
|
|
|
return res;
|
|
|
@@ -414,7 +413,7 @@ public class AppUserController extends CertifyApiController {
|
|
|
res.setData(achievementService.saveAppAchievement(a, keywords));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private Result disposeInputAchievement(Result res, InputAchievement ia, String[] keywords) {
|
|
|
if (StringUtils.isBlank(ia.getName())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果名称", "成果名称"));
|
|
|
@@ -444,7 +443,7 @@ public class AppUserController extends CertifyApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 新增需求
|
|
|
*/
|
|
|
@@ -482,7 +481,7 @@ public class AppUserController extends CertifyApiController {
|
|
|
res.setData(demandService.saveAppUserDemand(d, validityPeriodFormattedDate, keywords));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private Result disposeDemand(Result res, InputDemand demand, String[] keywords) {
|
|
|
if (StringUtils.isBlank(demand.getName())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求名称", "需求名称"));
|
|
|
@@ -513,7 +512,7 @@ public class AppUserController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到问题说明", "问题说明"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
/*for (int i = 0; i < keywords.length; i++) {
|
|
|
if (AFTConstants.KEYWORDLENTH < keywords[i].length()) {
|
|
|
@@ -524,8 +523,8 @@ public class AppUserController extends CertifyApiController {
|
|
|
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 成果、需求图片上传
|
|
|
*/
|
|
|
@@ -554,7 +553,7 @@ public class AppUserController extends CertifyApiController {
|
|
|
res.setData(fieldGlossoryService.getField(pid, level));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 获取环信登录账号,如果未注册则先注册
|
|
|
@@ -563,15 +562,15 @@ public class AppUserController extends CertifyApiController {
|
|
|
public Result getEasemob() {
|
|
|
User u = TokenManager.getUserToken();
|
|
|
if (u != null) {
|
|
|
- JSONObject res = easemobUtils.send(new EasemobInfo().uri("/users/" + u.getNumber()).method(HttpMethod.GET));
|
|
|
+// JSONObject res = easemobUtils.send(new EasemobInfo().uri("/users/" + u.getNumber()).method(HttpMethod.GET));
|
|
|
JSONObject resultObj = new JSONObject();
|
|
|
resultObj.put("easemobPass", new SimpleHash("md5", u.getId(), null, 1).toHex());
|
|
|
resultObj.put("easemobName", String.valueOf(u.getNumber()));
|
|
|
resultObj.put("nickname", StringUtils.isBlank(u.getNickname()) ? "技淘用户" + u.getNumber() : u.getNickname());
|
|
|
- if (res == null || StringUtils.equals("service_resource_not_found", (CharSequence) res.get("error"))) {
|
|
|
- easemobUtils.sendLater(
|
|
|
- new EasemobInfo().uri("/users/").data(resultObj.toJSONString()).method(HttpMethod.POST));
|
|
|
- }
|
|
|
+// if (res == null || StringUtils.equals("service_resource_not_found", (CharSequence) res.get("error"))) {
|
|
|
+// easemobUtils.sendLater(
|
|
|
+// new EasemobInfo().uri("/users/").data(resultObj.toJSONString()).method(HttpMethod.POST));
|
|
|
+// }
|
|
|
return res().data(resultObj);
|
|
|
} else {
|
|
|
return res().error(buildError("user only", "必须是登录会员才能访问。"));
|
|
|
@@ -605,26 +604,26 @@ public class AppUserController extends CertifyApiController {
|
|
|
}
|
|
|
}
|
|
|
return res;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
/*APP我的订单列表
|
|
|
* userType-----0-购买者 1-出售者 2-管理员
|
|
|
- *
|
|
|
+ *
|
|
|
* */
|
|
|
@RequestMapping(value="/orderList",method = RequestMethod.GET)
|
|
|
public Result getMyJtOrderList(Integer orderType,Integer userType,Integer pageNo,Integer pageSize) {
|
|
|
Result result=new Result();
|
|
|
- if(userType==null || userType>1 || userType<0) {
|
|
|
+ if(userType==null || userType>1 || userType<0) {
|
|
|
result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"","用户类型错误"));
|
|
|
return result;
|
|
|
}
|
|
|
result.setData(jtOrderService.appSearchOrderList(orderType, userType, pageNo, pageSize));
|
|
|
-
|
|
|
+
|
|
|
return result;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/*
|
|
|
* APP我的成果列表
|
|
|
**/
|
|
|
@@ -639,7 +638,7 @@ public class AppUserController extends CertifyApiController {
|
|
|
}
|
|
|
Pagination<AchievementObject> p=achievementService.listMyAchievement(auditStatus, name, dataCategory,
|
|
|
startDate, endDate,cStartDate, cEndDate, pageNo, pageSize);
|
|
|
- result.data(p);
|
|
|
+ result.data(p);
|
|
|
return result;
|
|
|
}
|
|
|
/**
|
|
|
@@ -707,8 +706,8 @@ public class AppUserController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
for (int i = 0; i < keywords.length; i++) {
|
|
|
if (AFTConstants.KEYWORDLENTH < keywords[i].length()) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "关键词长度"));
|
|
|
@@ -805,7 +804,7 @@ public class AppUserController extends CertifyApiController {
|
|
|
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/*
|
|
|
* 收藏列表 0 成果 1需求 2项目
|
|
|
* */
|
|
|
@@ -868,7 +867,7 @@ public class AppUserController extends CertifyApiController {
|
|
|
result.setData(messageService.updateAppReadMessage(id));
|
|
|
return result;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/** 图片上传 **/
|
|
|
@RequestMapping(value = "/uploadHeadPortrait", method = RequestMethod.POST)
|
|
|
public Result uploadCustomerImg(HttpServletRequest req,String sign){
|
|
|
@@ -876,5 +875,5 @@ public class AppUserController extends CertifyApiController {
|
|
|
res.setData(handleFile(res, "/customer_head_portrait/", false, req, sign));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|