|
|
@ -1,9 +1,17 @@ |
|
|
|
package com.cloud.kicc.system.devtools.controller; |
|
|
|
package com.cloud.kicc.system.devtools.controller; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
|
|
|
import com.cloud.kicc.common.core.api.R; |
|
|
|
|
|
|
|
import com.cloud.kicc.common.core.constant.AppConstants; |
|
|
|
|
|
|
|
import com.cloud.kicc.system.api.devtools.entity.GencodeCustomObj; |
|
|
|
|
|
|
|
import com.cloud.kicc.system.devtools.service.IGencodeCustomObjService; |
|
|
|
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import java.util.Arrays; |
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Controller; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
@ -13,9 +21,46 @@ import org.springframework.stereotype.Controller; |
|
|
|
* @author wangxiang4 |
|
|
|
* @author wangxiang4 |
|
|
|
* @since 2023-12-09 |
|
|
|
* @since 2023-12-09 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Controller |
|
|
|
@RestController |
|
|
|
@RequestMapping("/gencodeCustomObj") |
|
|
|
@RequestMapping(AppConstants.APP_SYSTEM + "/gencode/gencodeCustomObj") |
|
|
|
|
|
|
|
@RequiredArgsConstructor |
|
|
|
public class GencodeCustomObjController { |
|
|
|
public class GencodeCustomObjController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final IGencodeCustomObjService iGencodeCustomObjService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private LambdaQueryWrapper<GencodeCustomObj> getQueryWrapper(GencodeCustomObj gencodeCustomObj) { |
|
|
|
|
|
|
|
return new LambdaQueryWrapper<GencodeCustomObj>() |
|
|
|
|
|
|
|
.like(StrUtil.isNotBlank(gencodeCustomObj.getLabel()), GencodeCustomObj::getLabel, gencodeCustomObj.getLabel()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/list") |
|
|
|
|
|
|
|
public R list(Page page, GencodeCustomObj gencodeCustomObj) { |
|
|
|
|
|
|
|
IPage<GencodeCustomObj> result = iGencodeCustomObjService.page(page, getQueryWrapper(gencodeCustomObj)); |
|
|
|
|
|
|
|
return R.ok(result.getRecords(), result.getTotal()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/{id:\\w+}") |
|
|
|
|
|
|
|
public R getById(@PathVariable("id") String id) { |
|
|
|
|
|
|
|
return R.ok(iGencodeCustomObjService.getById(id)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/save") |
|
|
|
|
|
|
|
public R save(@RequestBody GencodeCustomObj gencodeCustomObj) { |
|
|
|
|
|
|
|
iGencodeCustomObjService.save(gencodeCustomObj); |
|
|
|
|
|
|
|
return R.ok(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PutMapping("/update") |
|
|
|
|
|
|
|
public R update(@RequestBody GencodeCustomObj gencodeCustomObj) { |
|
|
|
|
|
|
|
iGencodeCustomObjService.updateById(gencodeCustomObj); |
|
|
|
|
|
|
|
return R.ok(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@DeleteMapping("/remove/{id:[\\w,]+}") |
|
|
|
|
|
|
|
public R remove(@PathVariable String[] id) { |
|
|
|
|
|
|
|
iGencodeCustomObjService.removeByIds(Arrays.asList(id)); |
|
|
|
|
|
|
|
return R.ok(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|