xuhy
2024-03-01 8c47a796880249d2b081d70e306c998cd3caf4b2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TVipConfigController.java
@@ -1,8 +1,14 @@
package com.ruoyi.web.controller.api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.TUser;
import com.ruoyi.system.domain.TVipConfig;
import com.ruoyi.system.service.TVipConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * <p>
@@ -12,9 +18,35 @@
 * @author xiaochen
 * @since 2024-02-29
 */
@Api(tags = "会员设置")
@RestController
@RequestMapping("/tVipConfig")
public class TVipConfigController {
    private final TVipConfigService vipConfigService;
    @Autowired
    public TVipConfigController(TVipConfigService vipConfigService) {
        this.vipConfigService = vipConfigService;
    }
    /**
     * 获取会员配置
     */
    @ApiOperation(value = "获取会员配置")
    @GetMapping(value = "/getById")
    public AjaxResult<TVipConfig> getById(@RequestParam Long id) {
        return AjaxResult.success(vipConfigService.getById(1));
    }
    /**
     * 编辑会员配置
     */
    @ApiOperation(value = "编辑会员配置")
    @PostMapping(value = "/updateById")
    public AjaxResult updateById(@RequestBody TVipConfig vipConfig) {
        return AjaxResult.success(vipConfigService.updateById(vipConfig));
    }
}