fix (farm): 用户同步
- 绕过token验证
This commit is contained in:
@@ -29,83 +29,83 @@ import cn.iocoder.yudao.module.farm.controller.admin.indicatorname.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.indicatorname.IndicatorNameDO;
|
||||
import cn.iocoder.yudao.module.farm.service.indicatorname.IndicatorNameService;
|
||||
|
||||
@Tag(name = "管理后台 - 指标名称")
|
||||
@RestController
|
||||
@RequestMapping("/farm/indicator-name")
|
||||
@Validated
|
||||
//@Tag(name = "管理后台 - 指标名称")
|
||||
//@RestController
|
||||
//@RequestMapping("/farm/indicator-name")
|
||||
//@Validated
|
||||
public class IndicatorNameController {
|
||||
|
||||
@Resource
|
||||
private IndicatorNameService indicatorNameService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建指标名称")
|
||||
@PreAuthorize("@ss.hasPermission('farm:indicator-name:create')")
|
||||
public CommonResult<Long> createIndicatorName(@Valid @RequestBody IndicatorNameSaveReqVO createReqVO) {
|
||||
return success(indicatorNameService.createIndicatorName(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新指标名称")
|
||||
@PreAuthorize("@ss.hasPermission('farm:indicator-name:update')")
|
||||
public CommonResult<Boolean> updateIndicatorName(@Valid @RequestBody IndicatorNameSaveReqVO updateReqVO) {
|
||||
indicatorNameService.updateIndicatorName(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除指标名称")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:indicator-name:delete')")
|
||||
public CommonResult<Boolean> deleteIndicatorName(@RequestParam("id") Long id) {
|
||||
indicatorNameService.deleteIndicatorName(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除指标名称")
|
||||
@PreAuthorize("@ss.hasPermission('farm:indicator-name:delete')")
|
||||
public CommonResult<Boolean> deleteIndicatorNameList(@RequestParam("ids") List<Long> ids) {
|
||||
indicatorNameService.deleteIndicatorNameListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得指标名称")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:indicator-name:query')")
|
||||
public CommonResult<IndicatorNameRespVO> getIndicatorName(@RequestParam("id") Long id) {
|
||||
IndicatorNameDO indicatorName = indicatorNameService.getIndicatorName(id);
|
||||
return success(BeanUtils.toBean(indicatorName, IndicatorNameRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得指标名称分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:indicator-name:query')")
|
||||
public CommonResult<PageResult<IndicatorNameRespVO>> getIndicatorNamePage(@Valid IndicatorNamePageReqVO pageReqVO) {
|
||||
PageResult<IndicatorNameDO> pageResult = indicatorNameService.getIndicatorNamePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, IndicatorNameRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得指标名称全量")
|
||||
@PreAuthorize("@ss.hasPermission('farm:indicator-name:query')")
|
||||
public CommonResult<List<IndicatorNameRespVO>> getIndicatorNameList(@Valid IndicatorNamePageReqVO pageReqVO) {
|
||||
List<IndicatorNameDO> pageResult = indicatorNameService.getIndicatorNameList(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, IndicatorNameRespVO.class));
|
||||
}
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出指标名称 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:indicator-name:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportIndicatorNameExcel(@Valid IndicatorNamePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<IndicatorNameDO> list = indicatorNameService.getIndicatorNamePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "指标名称.xls", "数据", IndicatorNameRespVO.class,
|
||||
BeanUtils.toBean(list, IndicatorNameRespVO.class));
|
||||
}
|
||||
//
|
||||
// @Resource
|
||||
// private IndicatorNameService indicatorNameService;
|
||||
//
|
||||
// @PostMapping("/create")
|
||||
// @Operation(summary = "创建指标名称")
|
||||
// @PreAuthorize("@ss.hasPermission('farm:indicator-name:create')")
|
||||
// public CommonResult<Long> createIndicatorName(@Valid @RequestBody IndicatorNameSaveReqVO createReqVO) {
|
||||
// return success(indicatorNameService.createIndicatorName(createReqVO));
|
||||
// }
|
||||
//
|
||||
// @PutMapping("/update")
|
||||
// @Operation(summary = "更新指标名称")
|
||||
// @PreAuthorize("@ss.hasPermission('farm:indicator-name:update')")
|
||||
// public CommonResult<Boolean> updateIndicatorName(@Valid @RequestBody IndicatorNameSaveReqVO updateReqVO) {
|
||||
// indicatorNameService.updateIndicatorName(updateReqVO);
|
||||
// return success(true);
|
||||
// }
|
||||
//
|
||||
// @DeleteMapping("/delete")
|
||||
// @Operation(summary = "删除指标名称")
|
||||
// @Parameter(name = "id", description = "编号", required = true)
|
||||
// @PreAuthorize("@ss.hasPermission('farm:indicator-name:delete')")
|
||||
// public CommonResult<Boolean> deleteIndicatorName(@RequestParam("id") Long id) {
|
||||
// indicatorNameService.deleteIndicatorName(id);
|
||||
// return success(true);
|
||||
// }
|
||||
//
|
||||
// @DeleteMapping("/delete-list")
|
||||
// @Parameter(name = "ids", description = "编号", required = true)
|
||||
// @Operation(summary = "批量删除指标名称")
|
||||
// @PreAuthorize("@ss.hasPermission('farm:indicator-name:delete')")
|
||||
// public CommonResult<Boolean> deleteIndicatorNameList(@RequestParam("ids") List<Long> ids) {
|
||||
// indicatorNameService.deleteIndicatorNameListByIds(ids);
|
||||
// return success(true);
|
||||
// }
|
||||
//
|
||||
// @GetMapping("/get")
|
||||
// @Operation(summary = "获得指标名称")
|
||||
// @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
// @PreAuthorize("@ss.hasPermission('farm:indicator-name:query')")
|
||||
// public CommonResult<IndicatorNameRespVO> getIndicatorName(@RequestParam("id") Long id) {
|
||||
// IndicatorNameDO indicatorName = indicatorNameService.getIndicatorName(id);
|
||||
// return success(BeanUtils.toBean(indicatorName, IndicatorNameRespVO.class));
|
||||
// }
|
||||
//
|
||||
// @GetMapping("/page")
|
||||
// @Operation(summary = "获得指标名称分页")
|
||||
// @PreAuthorize("@ss.hasPermission('farm:indicator-name:query')")
|
||||
// public CommonResult<PageResult<IndicatorNameRespVO>> getIndicatorNamePage(@Valid IndicatorNamePageReqVO pageReqVO) {
|
||||
// PageResult<IndicatorNameDO> pageResult = indicatorNameService.getIndicatorNamePage(pageReqVO);
|
||||
// return success(BeanUtils.toBean(pageResult, IndicatorNameRespVO.class));
|
||||
// }
|
||||
//
|
||||
// @GetMapping("/list")
|
||||
// @Operation(summary = "获得指标名称全量")
|
||||
// @PreAuthorize("@ss.hasPermission('farm:indicator-name:query')")
|
||||
// public CommonResult<List<IndicatorNameRespVO>> getIndicatorNameList(@Valid IndicatorNamePageReqVO pageReqVO) {
|
||||
// List<IndicatorNameDO> pageResult = indicatorNameService.getIndicatorNameList(pageReqVO);
|
||||
// return success(BeanUtils.toBean(pageResult, IndicatorNameRespVO.class));
|
||||
// }
|
||||
// @GetMapping("/export-excel")
|
||||
// @Operation(summary = "导出指标名称 Excel")
|
||||
// @PreAuthorize("@ss.hasPermission('farm:indicator-name:export')")
|
||||
// @ApiAccessLog(operateType = EXPORT)
|
||||
// public void exportIndicatorNameExcel(@Valid IndicatorNamePageReqVO pageReqVO,
|
||||
// HttpServletResponse response) throws IOException {
|
||||
// pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
// List<IndicatorNameDO> list = indicatorNameService.getIndicatorNamePage(pageReqVO).getList();
|
||||
// // 导出 Excel
|
||||
// ExcelUtils.write(response, "指标名称.xls", "数据", IndicatorNameRespVO.class,
|
||||
// BeanUtils.toBean(list, IndicatorNameRespVO.class));
|
||||
// }
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user