无关风月
2025-02-08 bbc55de9bb0f6e5d3d8267c628d25780c19ebf36
xinquan-modules/xinquan-system/src/main/java/com/xinquan/system/controller/PageController.java
@@ -2,10 +2,12 @@
import com.xinquan.common.core.domain.R;
import com.xinquan.system.domain.CommissionRule;
import com.xinquan.common.log.annotation.Log;
import com.xinquan.common.log.enums.BusinessType;
import com.xinquan.system.domain.Page;
import com.xinquan.system.service.CommissionRuleService;
import com.xinquan.system.domain.Turn;
import com.xinquan.system.service.PageService;
import com.xinquan.system.service.TurnService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
@@ -24,6 +26,8 @@
public class PageController {
    @Resource
    private PageService pageService;
    @Resource
    private TurnService turnService;
    @PostMapping("/getPage")
    @ApiOperation(value = "获取启动页",tags = "获取启动页")
    public R<String> getPage() {
@@ -35,21 +39,37 @@
    }
    @GetMapping("/saveOrUpdate")
    @ApiOperation(value = "保存/修改启动页",tags = "管理后台-启动页")
    @Log(title = "【启动页】修改", businessType = BusinessType.UPDATE)
    public R saveOrUpdate(String img) {
        Page one = pageService.lambdaQuery().eq(Page::getType,1).one();
        if(one == null){
            Page page = new Page();
            page.setImg(img);
            page.setType(1);
            pageService.save(page);
        }else{
            one.setType(1);
            one.setImg(img);
            pageService.updateById(one);
        }
        return R.ok();
    }
    @PostMapping("/saveOrUpdatePlan")
    @GetMapping("/updateTurn")
    @ApiOperation(value = "修改IOS获取是否跳转三方支付", tags = "管理后台-启动页")
    public R updateTurn() {
        Turn one = turnService.getOne(null);
        if (one.getIsTurn()==1){
            one.setIsTurn(2);
        }else {
            one.setIsTurn(1);
        }
        turnService.updateById(one);
        return R.ok();
    }
    @PostMapping("/getPlan")
    @ApiOperation(value = "获取计划引导设置",tags = "计划引导设置")
    public R<String> saveOrUpdatePlan() {
    public R<String> getPlan() {
        Page one = pageService.lambdaQuery().eq(Page::getType,2).one();
        if (one!=null){
            return R.ok(one.getImg());
@@ -58,14 +78,18 @@
    }
    @GetMapping("/saveOrUpdatePlan")
    @ApiOperation(value = "保存/修改计划引导设置",tags = "计划引导设置")
    @Log(title = "【计划引导设置】修改", businessType = BusinessType.UPDATE)
    public R saveOrUpdatePlan(String img) {
        Page one = pageService.lambdaQuery().eq(Page::getType,2).one();
        if(one == null){
            Page page = new Page();
            page.setImg(img);
            page.setType(2);
            pageService.save(page);
        }else{
            one.setImg(img);
            one.setType(2);
            pageService.updateById(one);
        }
        return R.ok();