增加任务分类
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package com.zsw.erp.controller;
|
||||
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import static com.zsw.erp.utils.ResponseJsonUtil.returnJson;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/user")
|
||||
@Api(tags = {"系统用户信息"})
|
||||
public class ErpUserController{
|
||||
|
||||
@Resource
|
||||
private AdminUserService userService;
|
||||
|
||||
@GetMapping(value = "/getUserList")
|
||||
public JSONArray getUserList(){
|
||||
JSONArray dataArray = new JSONArray();
|
||||
try {
|
||||
List<AdminUserDO> dataList = userService.getUsersByStatus(0);
|
||||
if (null != dataList) {
|
||||
for (AdminUserDO user : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", user.getId());
|
||||
item.put("userName", user.getNickname());
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return dataArray;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user