3 changed files with 41 additions and 1 deletions
@ -1,22 +1,43 @@ |
|||
package cn.chjyj.szwh.controller.admin; |
|||
|
|||
import cn.chjyj.szwh.bean.User; |
|||
import cn.chjyj.szwh.controller.BaseController; |
|||
import cn.chjyj.szwh.service.UserService; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
@RestController |
|||
@RequestMapping("/admin/user.User") |
|||
public class AdminUserController extends BaseController { |
|||
@Autowired |
|||
private UserService userService; |
|||
|
|||
@PostMapping("/getUserFind") |
|||
public JSONObject getUserFind(){ |
|||
return jsonObject; |
|||
} |
|||
|
|||
/** |
|||
* 用户列表 |
|||
* @param spage |
|||
* @param limit |
|||
* @return |
|||
*/ |
|||
@PostMapping("/list") |
|||
public JSONObject list(){ |
|||
public JSONObject list(@RequestParam(value = "page",defaultValue = "1") String spage, |
|||
@RequestParam(value = "limit",defaultValue = "20")String limit){ |
|||
int page=Integer.valueOf(spage); |
|||
int pagesize=Integer.valueOf(limit); |
|||
List<User> userList = userService.getUserList(page,pagesize); |
|||
jsonObject.put("data",userList); |
|||
jsonObject.put("code",200); |
|||
jsonObject.put("msg","操作成功"); |
|||
return jsonObject; |
|||
} |
|||
} |
|||
|
|||
Loading…
Reference in new issue