| | |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.sys.ArgsEntity; |
| | | import com.lf.server.entity.sys.MenusEntity; |
| | | import com.lf.server.entity.sys.UsersEntity; |
| | | import com.lf.server.service.sys.ArgsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询所有") |
| | | @GetMapping(value = "/selectArgsAll") |
| | | public ResponseMsg<List<ArgsEntity>> selectArgsAll() { |
| | | @GetMapping(value = "/selectAll") |
| | | public ResponseMsg<List<ArgsEntity>> selectAll() { |
| | | try { |
| | | List<ArgsEntity> list = argsService.selectArgsAll(); |
| | | List<ArgsEntity> list = argsService.selectAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "根据ID查询") |
| | | @ApiOperation(value = "查询单条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectArgs") |
| | | public ResponseMsg<ArgsEntity> selectArgs(int id) { |
| | | @GetMapping(value = "/selectOne") |
| | | public ResponseMsg<ArgsEntity> selectOne(int id) { |
| | | try { |
| | | ArgsEntity argsEntity = argsService.selectArgs(id); |
| | | ArgsEntity argsEntity = argsService.selectOne(id); |
| | | |
| | | return success(argsEntity); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "插入一条数据") |
| | | @ApiOperation(value = "添加数据") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "实体类", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insertArg", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertArg(@RequestBody ArgsEntity entity) { |
| | | @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insert(@RequestBody ArgsEntity entity) { |
| | | try { |
| | | int count = argsService.insertArg(entity); |
| | | int count = argsService.insert(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "插入多条数据") |
| | | @ApiOperation(value = "批量添加") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "实体类集合", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insertArgs", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertArgs(@RequestBody List<ArgsEntity> list) { |
| | | @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> inserts(@RequestBody List<ArgsEntity> list) { |
| | | try { |
| | | int count = argsService.insertArgs(list); |
| | | int count = argsService.inserts(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "删除一条数据") |
| | | @ApiOperation(value = "刪除数据") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/deleteArg") |
| | | public ResponseMsg<Integer> deleteArg(int id) { |
| | | @GetMapping(value = "/delete") |
| | | public ResponseMsg<Integer> delete(int id) { |
| | | try { |
| | | int count = argsService.deleteArg(id); |
| | | int count = argsService.delete(id); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "删除多条数据") |
| | | @ApiOperation(value = "批量删除") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "ID数组", dataType = "Integer", paramType = "query", example = "{1,2}") |
| | | }) |
| | | @GetMapping(value = "/deleteArgs") |
| | | public ResponseMsg<Integer> deleteArgs(@RequestParam List<Integer> ids) { |
| | | @GetMapping(value = "/deletes") |
| | | public ResponseMsg<Integer> deletes(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("id数组不能为空", -1); |
| | | } |
| | | |
| | | int count = argsService.deleteArgs(ids); |
| | | int count = argsService.deletes(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "更新一条数据") |
| | | @ApiOperation(value = "修改数据") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "实体类", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateArg", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateArg(@RequestBody ArgsEntity entity) { |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> update(@RequestBody ArgsEntity entity) { |
| | | try { |
| | | int count = argsService.updateArg(entity); |
| | | int count = argsService.update(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "更新多条数据") |
| | | @ApiOperation(value = "批量修改") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "实体类集合", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateArgs", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateArgs(@RequestBody List<ArgsEntity> list) { |
| | | @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updates(@RequestBody List<ArgsEntity> list) { |
| | | try { |
| | | int count = argsService.updateArgs(list); |
| | | int count = argsService.updates(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |