|
|
@@ -6,14 +6,14 @@ import com.mokamrp.privates.constant.HttpStatus;
|
|
|
import com.mokamrp.privates.entity.PostBasePageHandle;
|
|
|
import com.mokamrp.privates.entity.pangu.AddFosterwxMobileHandle;
|
|
|
import com.mokamrp.privates.help.AjaxResult;
|
|
|
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxStation;
|
|
|
+import com.mokamrp.privates.service.pangu.FosterwxStationService;
|
|
|
import org.aspectj.weaver.loadtime.Aj;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
import com.mokamrp.privates.service.pangu.FosterwxMobileWxfriendService;
|
|
|
import com.mokamrp.privates.mapper.pangu.pojo.FosterwxMobileWxfriend;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import com.mokamrp.privates.controller.BaseController;
|
|
|
import javax.validation.Valid;
|
|
|
@@ -22,8 +22,6 @@ import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
|
@@ -40,6 +38,8 @@ public class FosterwxMobileWxfriendController extends BaseController<FosterwxMob
|
|
|
@Autowired
|
|
|
public FosterwxMobileWxfriendService fosterwxMobileWxfriendService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ public FosterwxStationService fosterwxStationService;
|
|
|
/*
|
|
|
* @fast
|
|
|
* 默认生成的控制器所继承的父类中有index/add/edit/del四个基础方法,均为post json请求
|
|
|
@@ -72,5 +72,33 @@ public class FosterwxMobileWxfriendController extends BaseController<FosterwxMob
|
|
|
fosterwxMobileWxfriendService.removeAndAdd(addFosterwxMobileHandle);
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
+
|
|
|
+ /*
|
|
|
+ *@Leon 以下接口为站点负责人后台页面接口,需要独立登陆才可访问
|
|
|
+ */
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增好友,会加入seq
|
|
|
+ * @param addFosterwxMobileHandle
|
|
|
+ * @param bindingResult
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/wxfriendAddPro")
|
|
|
+ public Object wxfriendAddPro(@RequestParam(name = "token") String token,
|
|
|
+ @RequestBody AddFosterwxMobileHandle addFosterwxMobileHandle, BindingResult bindingResult){
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
|
|
|
+ }
|
|
|
+ if (addFosterwxMobileHandle.getFriends() == null || addFosterwxMobileHandle.getFriends().size() <= 0){
|
|
|
+ return AjaxResult.error(HttpMsg.error);
|
|
|
+ }
|
|
|
+ //.登录验证
|
|
|
+ FosterwxStation fosterwxStation = fosterwxStationService.getAuthInfo(token);
|
|
|
+ if (fosterwxStation == null){
|
|
|
+ return AjaxResult.error(HttpStatus.LOGIN_ERROR, HttpMsg.needLogin);
|
|
|
+ }
|
|
|
+ fosterwxMobileWxfriendService.removeAndAdd(addFosterwxMobileHandle);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
}
|
|
|
|