sys param 删除 id
This commit is contained in:
@@ -3,11 +3,13 @@ package com.czg;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
|
||||
/**
|
||||
* @author ww
|
||||
*/
|
||||
@EnableCaching
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
@MapperScan("com.czg.service.system.mapper")
|
||||
|
||||
@@ -9,6 +9,8 @@ import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author GYJoker
|
||||
*/
|
||||
@@ -26,18 +28,48 @@ public class SysParamController {
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public CzgResult<Long> insertParams(@RequestBody @Validated({InsertGroup.class}) SysParamsDTO paramsDTO) {
|
||||
public CzgResult<String> insertParams(@RequestBody @Validated({InsertGroup.class}) SysParamsDTO paramsDTO) {
|
||||
return sysParamsService.insertParams(paramsDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改参数
|
||||
* @param paramsDTO 参数
|
||||
* @return 修改结果
|
||||
* @return 修改结果
|
||||
*/
|
||||
@PutMapping
|
||||
public CzgResult<Long> updateParams(@RequestBody @Validated({UpdateGroup.class}) SysParamsDTO paramsDTO) {
|
||||
public CzgResult<String> updateParams(@RequestBody @Validated({UpdateGroup.class}) SysParamsDTO paramsDTO) {
|
||||
return sysParamsService.updateParams(paramsDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除参数
|
||||
* @param code 参数code
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping("/{code}")
|
||||
public CzgResult<Boolean> deleteParams(@PathVariable String code) {
|
||||
return sysParamsService.deleteParams(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据参数编码获取参数
|
||||
* @param code 参数编码
|
||||
* @return 参数
|
||||
*/
|
||||
@GetMapping("/code/{code}")
|
||||
public CzgResult<SysParamsDTO> deleteCode(@PathVariable String code) {
|
||||
return sysParamsService.getParamsByCode(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据参数类型获取参数
|
||||
* @param type 参数类型
|
||||
* @return 参数列表
|
||||
*/
|
||||
@GetMapping("/type/{type}")
|
||||
public CzgResult<List<SysParamsDTO>> deleteType(@PathVariable String type) {
|
||||
return sysParamsService.getParamsByType(Integer.valueOf(type));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user