package com.fdkankan.ucenter.controller.api;


import com.fdkankan.ucenter.common.BaseController;
import com.fdkankan.ucenter.common.ResultData;
import com.fdkankan.ucenter.entity.UcenterSystem;
import com.fdkankan.ucenter.service.IUcenterSystemService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 
 * @since 2024-07-09
 */
@RestController
@RequestMapping("/ucenter/system")
public class UcenterSystemController extends BaseController {

    @Autowired
    IUcenterSystemService ucenterSystemService;


    @GetMapping("/getInfo")
    public ResultData getInfo(@RequestParam(required = false,defaultValue = "zh") String lang){
        return ResultData.ok(ucenterSystemService.getByLang(lang));
    }

    @PostMapping("/saveOrUpdate")
    public ResultData saveOrUpdate(@RequestBody UcenterSystem param){
        ucenterSystemService.saveByLang(param);
        return ResultData.ok();
    }
}

