|
|
@@ -0,0 +1,76 @@
|
|
|
+package com.mokamrp.privates.controller.pangu;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.mokamrp.privates.constant.HttpMsg;
|
|
|
+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 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 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;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 盘古微信养号手机账号微信好友 前端控制器
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author leon
|
|
|
+ * @since 2021-07-23
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/pangu/fosterwxMobileWxfriend")
|
|
|
+public class FosterwxMobileWxfriendController extends BaseController<FosterwxMobileWxfriend> {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ public FosterwxMobileWxfriendService fosterwxMobileWxfriendService;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * @fast
|
|
|
+ * 默认生成的控制器所继承的父类中有index/add/edit/del四个基础方法,均为post json请求
|
|
|
+ * 如果需要定制化,需要将BaseController中对应的方法复制到当前控制器,然后进行修改
|
|
|
+ */
|
|
|
+
|
|
|
+ @PostMapping("/list")
|
|
|
+ public Object list(@Valid @RequestBody PostBasePageHandle postBasePageHandle, BindingResult bindingResult){
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
|
|
|
+ }
|
|
|
+ Map<String,Object> res = fosterwxMobileWxfriendService.getList(postBasePageHandle);
|
|
|
+ return AjaxResult.success(res);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增好友,会加入seq
|
|
|
+ * @param addFosterwxMobileHandle
|
|
|
+ * @param bindingResult
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/addPro")
|
|
|
+ public Object addPro(@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);
|
|
|
+ }
|
|
|
+ fosterwxMobileWxfriendService.removeAndAdd(addFosterwxMobileHandle);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|