FsUserAdminController.java 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package com.fs.user;
  2. import com.fs.common.core.controller.BaseController;
  3. import com.fs.common.core.domain.R;
  4. import com.fs.common.core.domain.R;
  5. import com.fs.common.core.page.TableDataInfo;
  6. import com.fs.his.vo.OptionsVO;
  7. import com.fs.store.param.h5.FsUserPageListParam;
  8. import com.fs.store.service.IFsUserService;
  9. import com.fs.store.vo.h5.*;
  10. import com.github.pagehelper.PageHelper;
  11. import com.github.pagehelper.PageInfo;
  12. import com.fs.store.vo.h5.FsUserPageListVO;
  13. import com.github.pagehelper.PageHelper;
  14. import com.github.pagehelper.PageInfo;
  15. import io.swagger.annotations.Api;
  16. import io.swagger.annotations.ApiOperation;
  17. import lombok.AllArgsConstructor;
  18. import org.springframework.beans.factory.annotation.Autowired;
  19. import org.springframework.security.access.prepost.PreAuthorize;
  20. import org.springframework.web.bind.annotation.*;
  21. import java.util.HashMap;
  22. import java.util.List;
  23. import java.util.Map;
  24. @Api(tags = "会员管理接口")
  25. @RestController
  26. @RequestMapping("/user/fsUser")
  27. @AllArgsConstructor
  28. public class FsUserAdminController extends BaseController {
  29. @Autowired
  30. private IFsUserService fsUserService;
  31. @PreAuthorize("@ss.hasPermi('user:fsUser:list')")
  32. @PostMapping("/list")
  33. @ApiOperation("会员列表(与移动端使用的相同查询)")
  34. public R pageList(@RequestBody FsUserPageListParam param) {
  35. // PageHelper.startPage(param.getPageNum(), param.getPageSize());
  36. TableDataInfo tableDataInfo = fsUserService.selectFsUserPageListNew(param);
  37. // PageInfo<FsUserPageListVO> pageInfo = new PageInfo<>(list);
  38. Map<String, Object> result = new HashMap<>();
  39. result.put("rows", tableDataInfo.getRows());
  40. result.put("total", tableDataInfo.getTotal());
  41. return R.ok(result);
  42. }
  43. /**
  44. * 根据会员名称模糊查询
  45. * @param name 名称
  46. * @return list
  47. */
  48. @GetMapping("/getUserListLikeName")
  49. public R getUserListLikeName(@RequestParam(required = false) String name,
  50. @RequestParam(required = false, defaultValue = "1") Integer pageNum,
  51. @RequestParam(required = false, defaultValue = "10") Integer pageSize) {
  52. Map<String,Object> params = new HashMap<>();
  53. params.put("nickName", name);
  54. PageHelper.startPage(pageNum, pageSize);
  55. List<OptionsVO> userList = fsUserService.selectUserListByMap(params);
  56. return R.ok().put("data", new PageInfo<>(userList));
  57. }
  58. }