邀请可邀请多人
This commit is contained in:
+15
-4
@@ -8,6 +8,7 @@ import com.adc.da.slrs.StandardQA.service.Impl.AskUserServiceImpl;
|
|||||||
import com.adc.da.util.http.ResponseMessage;
|
import com.adc.da.util.http.ResponseMessage;
|
||||||
import com.adc.da.util.http.Result;
|
import com.adc.da.util.http.Result;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -15,6 +16,9 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: qk
|
* @Author: qk
|
||||||
* @Date: 2022/6/2 0002 8:44
|
* @Date: 2022/6/2 0002 8:44
|
||||||
@@ -28,10 +32,17 @@ public class AskUserController extends BaseController<AskUser> {
|
|||||||
private AskUserServiceImpl askUserService;
|
private AskUserServiceImpl askUserService;
|
||||||
@PostMapping("/insertAskUser")
|
@PostMapping("/insertAskUser")
|
||||||
public ResponseMessage insertAskUser(@RequestBody AskUser askUser){
|
public ResponseMessage insertAskUser(@RequestBody AskUser askUser){
|
||||||
if(askUserService.save(askUser)){
|
if(StringUtils.isBlank(askUser.getUsid())){
|
||||||
return Result.success("200","邀请成功",null);
|
return Result.error();
|
||||||
}else {
|
|
||||||
return Result.error("-1","添加失败",null);
|
|
||||||
}
|
}
|
||||||
|
String[] split = askUser.getUsid().split(",");
|
||||||
|
final List<String> asList = Arrays.asList(split);
|
||||||
|
for (String uid: asList){
|
||||||
|
AskUser askUserInfo = new AskUser();
|
||||||
|
askUserInfo.setAsdId(askUser.getAsdId());
|
||||||
|
askUserInfo.setUsid(uid);
|
||||||
|
askUserService.save(askUserInfo);
|
||||||
|
}
|
||||||
|
return Result.success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user