| | |
| | | package com.lf.server.controller.data; |
| | | |
| | | import com.lf.server.aspect.SysLog; |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.WebHelper; |
| | | import com.lf.server.service.data.MetaService; |
| | | import com.lf.server.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | * 元数据 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "数据管理\\元数据管理") |
| | | @Api(tags = "数据管理\\元数据") |
| | | @RestController |
| | | @RequestMapping("/meta") |
| | | public class MetaController extends BaseController { |
| | |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("每页页数或分页数小于1", null); |
| | | } |
| | | |
| | | int count = metaService.selectCount(name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<MetaEntity> rs = metaService.selectByPage(name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "添加数据") |
| | | @ApiOperation(value = "插入一条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "实体类", dataType = "MetaEntity", paramType = "body") |
| | | }) |
| | |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | entity.setCreateTime(WebHelper.getCurrentTimestamp()); |
| | | int count = metaService.insert(entity); |
| | | |
| | | return success(count); |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "批量添加") |
| | | @ApiOperation(value = "插入多条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "实体类集合", dataType = "MetaEntity", paramType = "body") |
| | | }) |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "刪除数据") |
| | | @ApiOperation(value = "删除一条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "批量删除") |
| | | @ApiOperation(value = "删除多条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "ID数组", dataType = "Integer", paramType = "query", example = "1,2") |
| | | }) |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "修改数据") |
| | | @ApiOperation(value = "更新一条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "实体类", dataType = "MetaEntity", paramType = "body") |
| | | }) |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "批量修改") |
| | | @ApiOperation(value = "更新多条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "实体类集合", dataType = "MetaEntity", paramType = "body") |
| | | }) |