用户功能的用户查询快递

grs
yjxx 2 weeks ago
parent 3b1fb1aa13
commit d3382cda09

@ -37,7 +37,7 @@ public class AdminController {
@Resource @Resource
private AddressService addressService; private AddressService addressService;
// 管理员查看用户或者快递员信息 // 管理员查看用户或者快递员信息(finish)
@GetMapping("/infoList") @GetMapping("/infoList")
public Result<Page<User>> getUserList(@RequestParam int page, @RequestParam int pageSize, @RequestParam int mark) { public Result<Page<User>> getUserList(@RequestParam int page, @RequestParam int pageSize, @RequestParam int mark) {
if (page <= 0 || pageSize <= 0) { if (page <= 0 || pageSize <= 0) {
@ -55,7 +55,7 @@ public class AdminController {
return new Result<>(200, "", pageInfo); return new Result<>(200, "", pageInfo);
} }
// 拉黑删除快递员或者用户 // 拉黑删除快递员或者用户(finish)
@DeleteMapping("/delete/{id}") @DeleteMapping("/delete/{id}")
public Result<String> delete(@PathVariable Long id, @RequestParam @NotNull String operation) { public Result<String> delete(@PathVariable Long id, @RequestParam @NotNull String operation) {
User user = userService.getById(id); User user = userService.getById(id);
@ -77,7 +77,7 @@ public class AdminController {
return new Result<>(200, "操作成功", ""); return new Result<>(200, "操作成功", "");
} }
// 管理员发送消息 // 管理员发送消息(finish)
@PostMapping("/sendMessage") @PostMapping("/sendMessage")
public Result<String> sendMessage(@RequestBody @Validated SendMessageDTO sendMessageDTO) { public Result<String> sendMessage(@RequestBody @Validated SendMessageDTO sendMessageDTO) {
Message message = SendMessageUtil.sendMessage(sendMessageDTO); Message message = SendMessageUtil.sendMessage(sendMessageDTO);
@ -85,7 +85,7 @@ public class AdminController {
return new Result<>(200, "发送成功", ""); return new Result<>(200, "发送成功", "");
} }
// 获取正在留言的人的所有聊天记录 // 获取正在留言的人的所有聊天记录(finish)
@GetMapping("/allMessage") @GetMapping("/allMessage")
public Result<List<List<Message>>> getAllMessage(@RequestParam Long toId) { public Result<List<List<Message>>> getAllMessage(@RequestParam Long toId) {
Long meId = GetIdUtil.getId(); Long meId = GetIdUtil.getId();
@ -103,7 +103,7 @@ public class AdminController {
return new Result<>(200, "", list); return new Result<>(200, "", list);
} }
// 管理员获取所有快递信息 // 管理员获取所有快递信息(finish)
@GetMapping("/express") @GetMapping("/express")
public Result<Page<ExpressListDTO>> getAllExpress(@RequestParam int page, @RequestParam int pageSize) { public Result<Page<ExpressListDTO>> getAllExpress(@RequestParam int page, @RequestParam int pageSize) {
Page<Records> recordsPage = new Page<>(page, pageSize); Page<Records> recordsPage = new Page<>(page, pageSize);

@ -37,7 +37,7 @@ public class CommonController {
@Resource @Resource
private StringRedisTemplate stringRedisTemplate; private StringRedisTemplate stringRedisTemplate;
// 注册 // 注册(finish)
@PostMapping("/register") @PostMapping("/register")
public Result<String> register(@RequestBody @Validated @NotNull User user) { public Result<String> register(@RequestBody @Validated @NotNull User user) {
// 查找用户是否存在 // 查找用户是否存在
@ -58,7 +58,7 @@ public class CommonController {
return new Result<>(200, "注册成功", ""); return new Result<>(200, "注册成功", "");
} }
// 通过账号登录 // 通过账号登录(finish)
@PostMapping("/loginByAccount") @PostMapping("/loginByAccount")
public Result<String> login(@RequestBody @Validated @NotNull UserLoginByAccountDTO userLoginByAccountDTO) { public Result<String> login(@RequestBody @Validated @NotNull UserLoginByAccountDTO userLoginByAccountDTO) {
// 查询用户是否存在 // 查询用户是否存在
@ -147,7 +147,7 @@ public class CommonController {
return new Result<>(200, "密码修改成功, 请重新登陆", ""); return new Result<>(200, "密码修改成功, 请重新登陆", "");
} }
// 获取个人信息 // 获取个人信息(finish)
@GetMapping("/info") @GetMapping("/info")
public Result<User> getInfo() { public Result<User> getInfo() {
Long id = GetIdUtil.getId(); Long id = GetIdUtil.getId();

@ -19,6 +19,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
import java.util.Objects;
@RestController @RestController
@RequestMapping("/user") @RequestMapping("/user")
@ -240,4 +241,25 @@ public class UserController {
recordsService.updateById(records); recordsService.updateById(records);
return new Result<>(200, "代取成功", ""); return new Result<>(200, "代取成功", "");
} }
// 用户查询快递
@GetMapping("/query")
public Result<Goods> queryGoods(@RequestParam Long queryCode, @RequestParam Long queryId) {
Long id = GetIdUtil.getId();
LambdaQueryWrapper<Goods> goodsLambdaQueryWrapper = new LambdaQueryWrapper<>();
if (Objects.equals(id, queryId)) {
goodsLambdaQueryWrapper.eq(Goods::getExpressCode, queryCode);
Goods goods = goodsService.getOne(goodsLambdaQueryWrapper);
return new Result<>(200, "查询成功", goods);
} else {
goodsLambdaQueryWrapper.eq(Goods::getExpressCode, queryCode)
.eq(Goods::getGetUserId, queryId);
Goods goods = goodsService.getOne(goodsLambdaQueryWrapper);
if (goods == null) {
return new Result<>(404, "请输入正确的快递单号, 或您不是快递的收件人或者邮寄人", null);
} else {
return new Result<>(200, "查询成功", goods);
}
}
}
} }

Loading…
Cancel
Save