|
|
@@ -0,0 +1,63 @@
|
|
|
+package com.zksy.web.controller.base;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.zksy.base.domain.BasicInfo;
|
|
|
+import com.zksy.base.service.BasicInfoService;
|
|
|
+import com.zksy.common.core.domain.AjaxResult;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.util.Arrays;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author Administrator
|
|
|
+ * @version 1.0
|
|
|
+ * @project zksy-website-service
|
|
|
+ * @description 首页信息
|
|
|
+ * @date 2025/9/8 09:24:07
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/basicInfo")
|
|
|
+@Api(tags = "首页信息",description = "首页信息desc")
|
|
|
+public class BasicInfoController {
|
|
|
+ @Autowired
|
|
|
+ private BasicInfoService service;
|
|
|
+
|
|
|
+ @GetMapping("/findByPage")
|
|
|
+ @ApiOperation(value = "首页信息查询分页")
|
|
|
+ public AjaxResult findByPage(@ApiParam(value = "页码", required = true)long pageNum,
|
|
|
+ @ApiParam(value = "页数", required = true)long pageSize){
|
|
|
+ Page<BasicInfo> page = new Page<>(pageNum, pageSize);
|
|
|
+ return AjaxResult.success(service.page(page));
|
|
|
+ }
|
|
|
+ @GetMapping("/getBasicInfoList")
|
|
|
+ @ApiOperation(value = "首页信息查询")
|
|
|
+ public AjaxResult getBasicInfoList(){
|
|
|
+ return AjaxResult.success(service.list());
|
|
|
+ }
|
|
|
+ @GetMapping("/getById/{id}")
|
|
|
+ @ApiOperation(value = "根据Id查询首页信息")
|
|
|
+ public AjaxResult getById(@PathVariable String id){
|
|
|
+ return AjaxResult.success(service.getById(id));
|
|
|
+ }
|
|
|
+ @PostMapping("/save")
|
|
|
+ @ApiOperation(value = "首页信息保存")
|
|
|
+ public AjaxResult save(@RequestBody BasicInfo entity) {
|
|
|
+ return service.save(entity) ? AjaxResult.success(entity): AjaxResult.error("保存失败");
|
|
|
+ }
|
|
|
+ @PostMapping("/update")
|
|
|
+ @ApiOperation(value = "首页信息修改")
|
|
|
+ public AjaxResult update(@RequestBody BasicInfo entity) {
|
|
|
+ entity.setUpdateTime(LocalDateTime.now());
|
|
|
+ return service.updateById(entity) ? AjaxResult.success(entity): AjaxResult.error("修改失败");
|
|
|
+ }
|
|
|
+ @PostMapping("/deleteBatch")
|
|
|
+ @ApiOperation(value = "首页信息删除")
|
|
|
+ public AjaxResult delete(@RequestBody String[] ids) {
|
|
|
+ return service.removeByIds(Arrays.asList(ids)) ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
|
|
|
+ }
|
|
|
+}
|