Files
my-bigScreen/src/main/java/com/mini/mybigscreen/biz/controller/IndexInfoController.java
2026-03-05 22:32:39 +08:00

49 lines
1.3 KiB
Java

package com.mini.mybigscreen.biz.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mini.mybigscreen.Model.Message;
import com.mini.mybigscreen.Model.Result;
import com.mini.mybigscreen.biz.domain.IndexInfo;
import com.mini.mybigscreen.biz.service.IndexInfoService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 首页指标数据表 前端控制器
* </p>
*
* @author gaoxq
* @since 2026-03-02
*/
@RestController
@RequestMapping("/biz/indexInfo")
public class IndexInfoController {
@Resource
private IndexInfoService infoService;
@GetMapping("list")
public Result<?> getList(String indexCode) {
QueryWrapper<IndexInfo> query = new QueryWrapper<>();
query.eq(StrUtil.isNotBlank(indexCode), "index_code", indexCode)
.orderByAsc("sort");
return Result.success(infoService.list(query));
}
public Result<Message> save() {
return Result.success(new Message("数据新增成功", "200"));
}
public Result<Message> delete() {
return Result.success(new Message("数据删除成功", "200"));
}
}