52 lines
1.6 KiB
Java
52 lines
1.6 KiB
Java
package net.srt.controller;
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import lombok.AllArgsConstructor;
|
|
import net.srt.convert.MetadataPropertyConvert;
|
|
import net.srt.entity.MetadataPropertyEntity;
|
|
import net.srt.framework.common.utils.Result;
|
|
import net.srt.service.MetadataPropertyService;
|
|
import net.srt.vo.MetadataPropertyVo;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import javax.validation.Valid;
|
|
import java.util.List;
|
|
|
|
@RestController
|
|
@RequestMapping("metadata-property")
|
|
@Tag(name = "数据治理-元数据属性值")
|
|
@AllArgsConstructor
|
|
public class MetadataPropertyController {
|
|
private final MetadataPropertyService metadataPropertyService;
|
|
|
|
@GetMapping("{id}")
|
|
@Operation(summary = "信息")
|
|
public Result<MetadataPropertyVo> get(@PathVariable("id") Long id) {
|
|
MetadataPropertyEntity entity = metadataPropertyService.getById(id);
|
|
return Result.ok(MetadataPropertyConvert.INSTANCE.convert(entity));
|
|
}
|
|
|
|
@PostMapping
|
|
@Operation(summary = "保存")
|
|
public Result<String> save(@RequestBody MetadataPropertyVo vo){
|
|
metadataPropertyService.save(vo);
|
|
return Result.ok();
|
|
}
|
|
|
|
@PutMapping
|
|
@Operation(summary = "修改")
|
|
public Result<String> update(@RequestBody @Valid MetadataPropertyVo vo){
|
|
metadataPropertyService.update(vo);
|
|
return Result.ok();
|
|
}
|
|
|
|
@DeleteMapping
|
|
@Operation(summary = "删除")
|
|
public Result<String> delete(@RequestBody List<Long> idList){
|
|
metadataPropertyService.delete(idList);
|
|
return Result.ok();
|
|
}
|
|
|
|
}
|