com.ape9527.core.controller.BaseObjFieldController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ape-core Show documentation
Show all versions of ape-core Show documentation
Ape low code platform core module
The newest version!
package com.ape9527.core.controller;
import com.ape9527.auth.annotation.LoginAuth;
import com.ape9527.core.entity.BaseObjField;
import com.ape9527.core.model.AjaxResult;
import com.ape9527.core.service.BaseObjFieldService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
/**
* 基础对象属性 控制层
*
* @author YuanShuai[[email protected]]
*/
@Api(tags = "BaseObjFieldController", description = "基础对象属性控制层")
@RestController
@RequestMapping("/api/base/obj/field")
public class BaseObjFieldController {
private final BaseObjFieldService baseObjFieldService;
public BaseObjFieldController(BaseObjFieldService baseObjFieldService) {
this.baseObjFieldService = baseObjFieldService;
}
@LoginAuth
@ApiOperation("查询数据对象属性列表")
@GetMapping("/{objCode}")
public AjaxResult list(@PathVariable String objCode,
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
@RequestParam(name = "fieldName", defaultValue = "") String fieldName) {
BaseObjField baseObjField = new BaseObjField();
baseObjField.setObjCode(objCode);
baseObjField.setFieldName(fieldName);
return AjaxResult.success(baseObjFieldService.queryListByPage(baseObjField, pageNum, pageSize));
}
@LoginAuth
@ApiOperation("查询数据对象属性对象")
@GetMapping("/{objCode}/{uuid}")
public AjaxResult getOne(@PathVariable String objCode, @PathVariable String uuid) {
return AjaxResult.success(baseObjFieldService.queryById(uuid));
}
@LoginAuth
@ApiOperation("保存数据对象属性")
@PostMapping("")
public AjaxResult save(@RequestBody BaseObjField field) {
return baseObjFieldService.save(field);
}
@LoginAuth
@ApiOperation("删除数据对象属性")
@PostMapping("/del")
public AjaxResult del(@RequestBody BaseObjField field) {
return baseObjFieldService.delById(field.getUuid()) ? AjaxResult.success() : AjaxResult.error("删除数据对象属性失败!");
}
}