You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
77 lines
2.2 KiB
77 lines
2.2 KiB
package com.zilber.boot.intelligencesite.controller;
|
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.zilber.boot.intelligencesite.entity.ISafe;
|
|
import com.zilber.boot.intelligencesite.entity.IUser;
|
|
import com.zilber.boot.intelligencesite.service.IISafeService;
|
|
import com.zilber.boot.intelligencesite.service.IIUserService;
|
|
import com.zilber.boot.utils.AjaxResult;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import javax.annotation.Resource;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* <p>
|
|
* 实名制与信息管理 前端控制器
|
|
* </p>
|
|
*
|
|
* @author lsc
|
|
* @since 2025-05-06
|
|
*/
|
|
@RestController
|
|
@RequestMapping("/iuser")
|
|
@Api(tags = "实名制与信息管理")
|
|
public class IUserController {
|
|
|
|
@Resource
|
|
private IIUserService iiUserService;
|
|
|
|
|
|
@GetMapping("/list")
|
|
@ApiOperation(value="分页查询",notes="分页查询")
|
|
@ResponseBody
|
|
public AjaxResult queryList(IUser iUser, @RequestParam(defaultValue = "1") Integer pageNo,
|
|
@RequestParam(defaultValue = "10") Integer pageSize) {
|
|
PageHelper.startPage(pageNo, pageSize);
|
|
List<IUser> iUsers = iiUserService.queryList(iUser);
|
|
PageInfo<IUser> page = new PageInfo<>(iUsers);
|
|
return AjaxResult.success(page);
|
|
}
|
|
|
|
/***
|
|
* 查询单个
|
|
*/
|
|
@GetMapping("/getById")
|
|
@ApiOperation("查询单个")
|
|
public AjaxResult getById(Integer id) {
|
|
return AjaxResult.success(iiUserService.getById(id));
|
|
}
|
|
|
|
|
|
@PostMapping("/add")
|
|
@ApiOperation("增加")
|
|
public AjaxResult add(@RequestBody IUser iUser) {
|
|
return AjaxResult.success(iiUserService.save(iUser));
|
|
}
|
|
|
|
|
|
@PutMapping("/update")
|
|
@ApiOperation("修改")
|
|
public AjaxResult update(@RequestBody @Validated IUser iUser) {
|
|
iiUserService.updateById(iUser);
|
|
return AjaxResult.success();
|
|
}
|
|
|
|
@DeleteMapping("/delete")
|
|
@ApiOperation("删除")
|
|
public AjaxResult delete(Integer id) {
|
|
return AjaxResult.success(iiUserService.removeById(id));
|
|
}
|
|
|
|
}
|
|
|